/* ==========================
   配信者詳細ページ
   ネオン・ダークテーマ版
   ========================== */

:root {
    --pachi-bg: #0a0a14;
    --pachi-bg-panel: #12121f;
    --pachi-border: #262640;
    --pachi-pink: #ff2e7e;
    --pachi-purple: #9333ea;
    --pachi-cyan: #00e5ff;
    --pachi-green: #22c55e;
    --pachi-red: #ff4d4f;
    --pachi-text: #f3f4f6;
    --pachi-text-sub: #9ca3af;
}

/* LIVE NOWの赤丸(絵文字の代わり) */
.live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pachi-red);
    vertical-align: middle;
    margin-right: 2px;
}

@keyframes live-badge-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ページ全体にうっすらネオンの気配を出す背景 */
.streamer-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 46, 126, .10), transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(0, 229, 255, .08), transparent 35%),
        var(--pachi-bg);
    color: var(--pachi-text);
}

/* ==========================
   共通パネル(カード)の土台
   ========================== */
.streamer-hero,
.streamer-live,
.streamer-stat-card,
.streamer-history,
.streamer-about,
.streamer-intro,
.streamer-subscriber-history,
.streamer-chat-analysis,
.streamer-machine-ranking {
    background: linear-gradient(180deg, var(--pachi-bg-panel), #0d0d18);
    border: 1px solid var(--pachi-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
}

/* ==========================
   INTRO（配信者紹介文）
   ========================== */

.streamer-intro {
    padding: 18px 22px;
    margin-bottom: 24px;
    border-radius: 16px;
}

.streamer-intro p {
    margin: 0;
    color: var(--pachi-text-sub);
    font-size: 14px;
    line-height: 1.85;
}

/* ==========================
   HERO
   ========================== */

.streamer-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 30px;
    margin-bottom: 24px;
    border-radius: 20px;
    position: relative;
    border-color: rgba(255, 46, 126, .35);
}

.streamer-hero__icon {
    flex-shrink: 0;
}

.streamer-hero__icon img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--pachi-pink);
    box-shadow:
        0 0 0 4px rgba(255, 46, 126, .12),
        0 0 24px rgba(255, 46, 126, .55);
}

.streamer-hero__title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 10px;
}

.streamer-hero__content h1 {
    margin: 0;
    color: #fff;
    font-size: 2rem;
    letter-spacing: .01em;
    text-wrap: balance;
    /* 折り返し時、最終行に1文字だけ残るような不格好な改行を防ぐ */
}


.streamer-hero__stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.streamer-hero__stats span {
    color: var(--pachi-text-sub);
    font-size: 15px;
}

/* ==========================
   BUTTON
   ========================== */

.streamer-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--pachi-red), #b3001b);
    color: #fff;
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(255, 0, 51, .35);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.streamer-btn:hover {
    opacity: .95;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(255, 0, 51, .5);
}

/* ==========================
   LIVE
   ========================== */

.streamer-promo-area {
    display: block;
}

.live-now-title {
    color: var(--pachi-red);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 77, 79, .12);
    animation: pachi-live-pulse 1.8s ease-in-out infinite;
}

@keyframes pachi-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, .35); }
    50% { box-shadow: 0 0 0 8px rgba(255, 77, 79, 0); }
}

.streamer-live {
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    border-color: rgba(255, 77, 79, .45);
    box-shadow: 0 0 30px rgba(255, 77, 79, .12), 0 4px 20px rgba(0, 0, 0, .35);
}

.streamer-live h2 {
    margin-top: 0;
    color: #fff;
}

.streamer-live h3 {
    color: #fff;
    font-size: 20px;
}

.streamer-live__thumb {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--pachi-border);
}

.streamer-live__stats {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.live-stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--pachi-border);
}

.live-stat__label {
    display: block;
    color: var(--pachi-text-sub);
    font-size: 12px;
    margin-bottom: 8px;
}

.live-stat strong {
    font-size: 24px;
    color: #fff;
}

.live-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.streamer-preview-btn {
    background: linear-gradient(135deg, var(--pachi-green), #16a34a);
    border: none;
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(34, 197, 94, .3);
    transition: transform .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.streamer-preview-btn:hover {
    transform: translateY(-1px);
}

.streamer-btn--app {
    display: none;
}

.streamer-live-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.streamer-live-highlight {
    height: 100%;
}

/* ==========================
   前回の配信ハイライト(配信中でない時)
   ========================== */

.streamer-highlight-standalone {
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    border-color: rgba(0, 229, 255, .25);
}

.streamer-highlight-standalone .pachi-highlight {
    max-width: 640px;
}

/* ==========================
   STATS(色分けアイコン付き)
   ========================== */

.streamer-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.streamer-stat-card {
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    position: relative;
    padding-top: 56px;
    min-width: 0;
    /* Gridアイテムのデフォルト(min-width:auto)による、長い数字でのはみ出しを防ぐ */
    transition: transform .15s ease, box-shadow .15s ease;
}

.streamer-stat-card:hover {
    transform: translateY(-3px);
}

/* アイコン(色付き丸背景 + Font Awesomeアイコン) */
.streamer-stat-card__icon {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.streamer-stat-card:nth-of-type(1) .streamer-stat-card__icon {
    background-color: rgba(255, 46, 126, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 46, 126, .4);
    color: var(--pachi-pink);
}
.streamer-stat-card:nth-of-type(1) strong { color: var(--pachi-pink); }

.streamer-stat-card:nth-of-type(2) .streamer-stat-card__icon {
    background-color: rgba(0, 229, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(0, 229, 255, .4);
    color: var(--pachi-cyan);
}
.streamer-stat-card:nth-of-type(2) strong { color: var(--pachi-cyan); }

.streamer-stat-card:nth-of-type(3) .streamer-stat-card__icon {
    background-color: rgba(147, 51, 234, .22);
    box-shadow: inset 0 0 0 1px rgba(147, 51, 234, .5);
    color: #c084fc;
}
.streamer-stat-card:nth-of-type(3) strong { color: #c084fc; }

.streamer-stat-card strong {
    display: block;
    font-size: 30px;
    margin-bottom: 10px;
    overflow-wrap: break-word;
    /* 万が一フォントサイズ調整でも収まらない桁数が来た時の保険 */
}

.streamer-stat-card--best {
    border-color: rgba(34, 197, 94, .5);
}

.streamer-stat-card--best .streamer-stat-card__icon {
    background-color: rgba(34, 197, 94, .18);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .4);
    color: var(--pachi-green);
}

.streamer-stat-card--best strong {
    color: var(--pachi-green);
}

.streamer-stat-card span {
    color: var(--pachi-text-sub);
    font-size: 13px;
}

/* ==========================
   SUBSCRIBER HISTORY（登録者数推移）
   ========================== */

.streamer-subscriber-history {
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.streamer-subscriber-history h2 {
    margin-top: 0;
    color: #fff;
}

.streamer-subscriber-history__empty {
    color: var(--pachi-text-sub);
    font-size: 14px;
    margin: 0;
}

.streamer-subscriber-history__chart {
    width: 100%;
}

.streamer-subscriber-history__chart svg {
    width: 100%;
    height: 160px;
    display: block;
}

.streamer-subscriber-history__labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: var(--pachi-text-sub);
}

.streamer-subscriber-history__diff {
    font-weight: 700;
    font-size: 14px;
}

.streamer-subscriber-history__diff.is-up { color: var(--pachi-green); }
.streamer-subscriber-history__diff.is-down { color: #ff6b6b; }

.streamer-subscriber-history__daily-list {
    margin-top: 16px;
    border-top: 1px solid var(--pachi-border);
}

.streamer-subscriber-history__daily-row {
    display: flex;
    align-items: center;
    padding: 8px 2px;
    border-bottom: 1px solid var(--pachi-border);
    font-size: 13px;
}

.streamer-subscriber-history__daily-row:last-child {
    border-bottom: none;
}

.streamer-subscriber-history__daily-date {
    flex: 0 0 44px;
    color: var(--pachi-text-sub);
}

.streamer-subscriber-history__daily-count {
    flex: 1;
    text-align: right;
    padding-right: 16px;
    color: #fff;
}

.streamer-subscriber-history__daily-diff {
    flex: 0 0 56px;
    text-align: right;
    font-weight: 700;
}

.streamer-subscriber-history__daily-diff.is-up { color: var(--pachi-green); }
.streamer-subscriber-history__daily-diff.is-down { color: #ff6b6b; }
.streamer-subscriber-history__daily-diff.is-flat { color: var(--pachi-text-sub); font-weight: 400; }

/* ==========================
   CHAT ANALYSIS（ライブチャット分析）
   ========================== */

.streamer-chat-analysis {
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.streamer-chat-analysis h2 {
    margin-top: 0;
    color: #fff;
}

.streamer-chat-analysis__note {
    color: var(--pachi-text-sub);
    font-size: 12px;
    margin: -8px 0 16px;
}

.streamer-chat-analysis__session-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.streamer-chat-analysis__session-item {
    padding: 10px 12px;
    border: 1px solid var(--pachi-border);
    border-radius: 10px;
}

.streamer-chat-analysis__session-title {
    font-size: 13px;
    color: #fff;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.streamer-chat-analysis__session-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12px;
    color: var(--pachi-text-sub);
}

.streamer-chat-analysis__session-stats i {
    margin-right: 4px;
}

.streamer-chat-analysis__superchat {
    color: #ffc83d;
    font-weight: 700;
}

.streamer-chat-analysis__rank-title {
    margin: 24px 0 8px;
    font-size: 15px;
    color: #fff;
}

.streamer-chat-analysis__rank-list {
    border-top: 1px solid var(--pachi-border);
}

.streamer-chat-analysis__rank-item {
    display: flex;
    align-items: center;
    padding: 8px 2px;
    border-bottom: 1px solid var(--pachi-border);
    font-size: 13px;
}

.streamer-chat-analysis__rank-item:last-child {
    border-bottom: none;
}

.streamer-chat-analysis__rank-no {
    flex: 0 0 28px;
    color: var(--pachi-text-sub);
    font-weight: 700;
}

.streamer-chat-analysis__rank-name {
    flex: 1;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.streamer-chat-analysis__rank-count {
    flex: 0 0 auto;
    color: var(--pachi-text-sub);
}

/* ==========================
   MACHINE RANKING
   ========================== */

.streamer-machine-ranking {
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    border-color: rgba(147, 51, 234, .35);
}

.streamer-machine-ranking h2 {
    margin-top: 0;
    color: #fff;
}

.machine-rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--pachi-border);
}

.machine-rank-item:last-child {
    border-bottom: none;
}

.machine-rank-no {
    width: 60px;
    color: #c084fc;
    font-weight: bold;
}

.machine-rank-name {
    flex: 1;
    color: #fff;
}

.machine-rank-count {
    color: var(--pachi-text-sub);
}

.machine-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 229, 255, .12);
    color: var(--pachi-cyan);
    border: 1px solid rgba(0, 229, 255, .35);
}

/* ==========================
   SIMILAR STREAMERS（同じ機種をよく打つ配信者）
   ========================== */

.streamer-similar {
    background: linear-gradient(180deg, var(--pachi-bg-panel), #0d0d18);
    border: 1px solid var(--pachi-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.streamer-similar h2 {
    margin-top: 0;
    color: #fff;
}

.similar-streamer-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.similar-streamer-scroll::-webkit-scrollbar {
    height: 4px;
}

.similar-streamer-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--pachi-border);
    text-decoration: none !important;
    border-bottom: 1px solid var(--pachi-border) !important;
    transition: border-color .2s ease, transform .2s ease;
}

.similar-streamer-card:hover {
    border-color: var(--pachi-cyan);
    transform: translateY(-3px);
}

.similar-streamer-card.is-live {
    border-color: rgba(255, 77, 79, .5);
    background: rgba(255, 77, 79, .06);
}

.similar-streamer-card__icon {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--pachi-bg);
    margin-bottom: 8px;
}

.similar-streamer-card__live-badge {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pachi-red);
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .03em;
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
    animation: live-badge-blink 1.8s ease-in-out infinite;
}

.similar-streamer-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-streamer-card__name {
    font-size: 12px;
    font-weight: 700;
    color: var(--pachi-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 2px;
}

.similar-streamer-card__machine {
    font-size: 10px;
    color: var(--pachi-cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 6px;
}

.similar-streamer-card__subs {
    font-size: 10px;
    color: var(--pachi-text-sub);
}

.similar-streamer-card__subs i {
    margin-right: 2px;
}

@media screen and (max-width: 480px) {
    .similar-streamer-card {
        width: 92px;
        padding: 12px 6px;
    }
    .similar-streamer-card__icon {
        width: 48px;
        height: 48px;
    }
}

/* ==========================
   HISTORY
   ========================== */

.streamer-history {
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.streamer-history h2 {
    margin-top: 0;
    color: #fff;
}

.history-card {
    display: flex;
    padding: 16px 0;
    border-bottom: 1px solid var(--pachi-border);
    gap: 14px;
    align-items: flex-start;
}

.history-card:last-child {
    border-bottom: none;
}

.history-card__date {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--pachi-text-sub, #a0a5b5);
    margin-bottom: 4px;
}

.history-card__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.5;
    max-height: 3em;
}

.history-card__thumb {
    position: relative;
    display: block;
    width: 120px;
    min-width: 120px;
    padding: 0;
    border: 1px solid var(--pachi-border);
    background: none;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0;
    overflow: hidden;
    border-radius: 10px;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.history-card__thumb:hover {
    box-shadow: 0 8px 22px rgba(0, 229, 255, .25);
    border-color: rgba(0, 229, 255, .5);
}

.history-card__thumb:hover img {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.history-card__thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 9px;
    object-fit: cover;
    transition: transform .18s ease, filter .18s ease;
}

.history-card__thumb::after {
    content: "▶ プレビュー";
    position: absolute;
    left: 10px;
    bottom: 8px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    white-space: nowrap;
}

.history-card__body {
    flex: 1;
    min-width: 0;
}

.history-card__body h3 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 16px;
}

.history-card__body p {
    margin: 0;
    color: var(--pachi-text-sub);
}

.history-card__peak {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.history-card__peak-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #c9d4ea;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid var(--pachi-border);
}

.history-card__actions {
    margin-top: 8px;
    margin-bottom: 6px;
}

.history-card__youtube-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--pachi-cyan);
    text-decoration: none;
    margin-bottom: 10px;
}

.history-card__youtube-link:hover {
    text-decoration: underline;
}

/* ==========================
   ABOUT
   ========================== */

.streamer-about {
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.streamer-about h2 {
    margin-top: 0;
    color: #fff;
}

.streamer-about__content {
    color: var(--pachi-text-sub);
    line-height: 1.8;
    white-space: pre-wrap;
    margin-top: 20px;
}

.streamer-about-details summary {
    cursor: pointer;
    list-style: none;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    padding: 8px 0;
}

.streamer-about-details summary::-webkit-details-marker {
    display: none;
}

.streamer-about-details summary::after {
    content: "＋";
    float: right;
    color: var(--pachi-cyan);
    font-size: 22px;
}

.streamer-about-details[open] summary::after {
    content: "－";
}

.live-preview-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}

/* ==========================
   MOBILE
   ========================== */

@media (max-width: 768px) {

    .streamer-page {
        padding: 12px;
    }

    .streamer-hero {
        flex-direction: column;
        text-align: center;
    }

    .streamer-hero__content h1 {
        font-size: 1.6rem;
    }

    .streamer-hero__stats {
        justify-content: center;
    }

    .streamer-intro {
        padding: 14px 16px;
    }

    .streamer-intro p {
        font-size: 13px;
        line-height: 1.8;
    }

    .streamer-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .streamer-stat-card {
        padding-left: 12px;
        padding-right: 12px;
    }

    .streamer-stat-card strong {
        font-size: 20px;
    }

    .streamer-btn--app {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .history-card {
        flex-direction: column;
    }

    .history-card img {
        width: 100%;
    }

    .history-card__thumb {
        width: 100%;
        min-width: 0;
    }

    .history-card__thumb::after {
        font-size: 10px;
        padding: 3px 7px;
        left: 6px;
        bottom: 6px;
    }

    .streamer-live-layout {
        grid-template-columns: 1fr;
    }
}