/* ==========================
   配信者詳細ページ
   ネオン・ダークテーマ版
   ========================== */

: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;
}

.streamer-hero__check-since {
    margin: 0;
    font-size: 12px;
    color: #5f5e6a;
}

/* ==========================
   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);
}

/* LIVE NOW のサムネイル：タップ（クリック）でプレビューを開く */
.streamer-live__thumb-btn {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    line-height: 0;
    border-radius: 12px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.streamer-live__thumb-btn .streamer-live__thumb {
    display: block;
    margin: 0;
    transition: transform .18s ease, filter .18s ease;
}

.streamer-live__thumb-btn:hover .streamer-live__thumb,
.streamer-live__thumb-btn:focus-visible .streamer-live__thumb {
    transform: scale(1.02);
    filter: brightness(1.06);
}

.streamer-live__thumb-btn:focus-visible {
    outline: 2px solid var(--pachi-cyan, #00e5ff);
    outline-offset: 2px;
}

/* 「▶ タップで再生」の案内（PCは中央寄りの大きめ、スマホは左下に小さく） */
.streamer-live__thumb-btn::after {
    content: "▶ タップで再生";
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .streamer-live__thumb-btn::after {
        left: 8px;
        bottom: 8px;
        padding: 5px 10px;
        font-size: 12px;
    }
}

.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;
}

/* ==========================
   STREAM PULSE（配信の盛り上がり：同接・コメント・スパチャのグラフ。履歴カードの中に表示）
   ========================== */

.stream-pulse__summary {
    margin: 12px 0 6px;
    font-size: 12px;
    color: var(--pachi-text-sub);
}

.stream-pulse__svg {
    display: block;
    width: 100%;
    height: auto;
}

.stream-pulse__svg .pulse-grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.stream-pulse__svg .pulse-axis { fill: var(--pachi-text-sub); font-size: 10px; }
.stream-pulse__svg .pulse-bar { fill: rgba(79, 195, 247, .45); }
.stream-pulse__svg .pulse-area { fill: rgba(34, 197, 94, .14); }
.stream-pulse__svg .pulse-line { fill: none; stroke: var(--pachi-green); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stream-pulse__svg .pulse-sc { fill: #f6a05a; }
.stream-pulse__svg .pulse-peak { fill: #fff; stroke: var(--pachi-green); stroke-width: 2; }
.stream-pulse__svg .pulse-peak-label { fill: #fff; font-size: 11px; font-weight: 700; }

.stream-pulse__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--pachi-text-sub);
}

.stream-pulse__legend-item::before {
    content: "";
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

.stream-highlights {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--pachi-border);
}

.stream-highlights__title {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pachi-text-sub);
}

.stream-highlights__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stream-highlights__list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border: 1px solid var(--pachi-border);
    border-radius: 999px;
    font-size: 12px;
    text-decoration: none;
    color: var(--pachi-text-sub);
}

.stream-highlights__time {
    font-weight: 700;
    color: var(--pachi-green);
}

.stream-pulse__legend-item--line::before { width: 14px; height: 2px; background: var(--pachi-green); }
.stream-pulse__legend-item--bar::before { width: 10px; height: 10px; background: rgba(79, 195, 247, .6); }
.stream-pulse__legend-item--sc::before {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 7px solid #f6a05a;
}

@media screen and (max-width: 767px) {
}

.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__sc-detail {
    margin-top: 10px;
    border-top: 1px dashed var(--pachi-border);
    padding-top: 8px;
}

.streamer-chat-analysis__sc-detail summary {
    cursor: pointer;
    font-size: 12px;
    color: #ffc83d;
    font-weight: 700;
}

.streamer-chat-analysis__sc-foreign {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 400;
    color: var(--pachi-muted, #9aa3b2);
}

.streamer-chat-analysis__sc-title {
    margin: 12px 0 4px;
    font-size: 12px;
    color: var(--pachi-text-sub);
}

.streamer-chat-analysis__sc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.streamer-chat-analysis__sc-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 2px;
    border-bottom: 1px solid var(--pachi-border);
    font-size: 12px;
    color: #fff;
}

.streamer-chat-analysis__sc-list li:last-child {
    border-bottom: none;
}

.streamer-chat-analysis__sc-no {
    flex: 0 0 20px;
    color: var(--pachi-text-sub);
    font-weight: 700;
}

.streamer-chat-analysis__sc-time {
    flex: 0 0 74px;
    color: var(--pachi-text-sub);
}

.streamer-chat-analysis__sc-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.streamer-chat-analysis__sc-amount {
    flex: 0 0 auto;
    color: #ffc83d;
    font-weight: 700;
}

.streamer-chat-analysis__sc-count {
    flex: 0 0 auto;
    color: var(--pachi-text-sub);
}

.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);
}

a.machine-tag--link {
    text-decoration: none;
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
}

a.machine-tag--link:hover {
    background: rgba(0, 229, 255, .22);
    border-color: var(--pachi-cyan);
    color: var(--pachi-cyan);
}

/* ==========================
   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 {
    scroll-margin-top: 80px;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.streamer-history h2 {
    margin-top: 0;
    color: #fff;
}

.streamer-history__note {
    margin: -8px 0 6px;
    font-size: 12px;
    color: var(--pachi-text-sub);
}

.history-card {
    display: flex;
    flex-wrap: wrap;
    padding: 16px 0;
    border-bottom: 1px solid var(--pachi-border);
    gap: 14px;
    align-items: flex-start;
}

.history-card:last-child {
    border-bottom: none;
}

/* 履歴カードの下に付ける「盛り上がり・スパチャ」の開閉部分（カードの横幅いっぱいに出す） */
.history-detail {
    flex: 1 0 100%;
    margin-top: 2px;
    border: 1px solid var(--pachi-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
}

.history-detail__summary {
    cursor: pointer;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--pachi-green, #22c55e);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-detail__summary::-webkit-details-marker {
    display: none;
}

.history-detail__summary::after {
    content: "▼";
    font-size: 10px;
    transition: transform .18s ease;
}

.history-detail[open] > .history-detail__summary::after {
    transform: rotate(180deg);
}

.history-detail__body {
    padding: 0 14px 14px;
}

.history-detail__title {
    margin: 14px 0 4px;
    font-size: 13px;
    color: #fff;
    border: none;
    padding: 0;
}

.history-card__chat-item--jewel .history-card__chat-label i { color: #7dd3fc; }
.history-card__chat-item--membership .history-card__chat-label i { color: #86efac; }

/* 配信者に伝える用の文章（コピーボタン付き） */
.history-detail__share {
    margin-top: 14px;
}

.history-detail__share-note {
    margin: 2px 0 6px;
    font-size: 12px;
    color: var(--pachi-text-sub);
}

.history-detail__sharetext {
    margin: 0 0 8px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.7;
    color: #e8e8ee;
    white-space: pre-wrap;
    word-break: break-all;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--pachi-border);
    border-radius: 8px;
    user-select: all;
}

.history-detail__copy {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    cursor: pointer;
}

.history-detail__copy.is-done {
    color: #111;
    background: var(--pachi-green, #22c55e);
    border-color: var(--pachi-green, #22c55e);
}

.history-detail__commenters-line {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--pachi-text-sub);
}

.history-detail__commenters-line strong {
    color: #fff;
}

/* 応援のまとめ（スパチャ・ジュエル・メンバーシップギフト） */
.history-detail__summary-text {
    margin: 4px 0 6px;
    font-size: 14px;
    line-height: 1.8;
    color: #fff;
}

.support__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.support-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--pachi-border);
    border-left-width: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
}

.support-card--sc { border-left-color: #f6a05a; }
.support-card--jewel { border-left-color: #7dd3fc; }
.support-card--gift { border-left-color: #86efac; }

.support-card__label {
    font-size: 11px;
    color: var(--pachi-text-sub);
}

.support-card--sc .support-card__label i { color: #f6a05a; }
.support-card--jewel .support-card__label i { color: #7dd3fc; }
.support-card--gift .support-card__label i { color: #86efac; }

.support-card__value {
    font-size: 20px;
    color: #fff;
    line-height: 1.3;
}

.support-card__sub {
    font-size: 11px;
    color: var(--pachi-text-sub);
}

.support__note {
    margin: 4px 0 8px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--pachi-text-sub);
}

.support__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 4px 0 8px;
}

.support__controls .sc-history__sort {
    margin: 0;
}

.support__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.support__chip {
    padding: 5px 12px;
    font-size: 12px;
    color: var(--pachi-text-sub);
    background: transparent;
    border: 1px solid var(--pachi-border);
    border-radius: 999px;
    cursor: pointer;
}

.support__chip.is-active {
    color: #fff;
    border-color: rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .08);
}

.support__tag {
    display: inline-block;
    margin: 0 6px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    color: #111;
}

.support__tag--sc { background: #f6a05a; }
.support__tag--jewel { background: #7dd3fc; }
.support__tag--gift { background: #86efac; }

.sc-history__sort {
    display: flex;
    gap: 6px;
    margin: 4px 0 8px;
}

.sc-history__sort-btn {
    padding: 5px 12px;
    font-size: 12px;
    color: var(--pachi-text-sub);
    background: transparent;
    border: 1px solid var(--pachi-border);
    border-radius: 999px;
    cursor: pointer;
}

.sc-history__sort-btn.is-active {
    color: #ffc83d;
    border-color: rgba(255, 200, 61, .6);
    background: rgba(255, 200, 61, .08);
}

.sc-history__list li[hidden] {
    display: none;
}

.sc-history__list li.is-extra {
    display: none;
}

.sc-history__more[hidden] {
    display: none;
}

.sc-history__more {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 9px;
    font-size: 13px;
    color: var(--pachi-text-sub);
    background: transparent;
    border: 1px solid var(--pachi-border);
    border-radius: 10px;
    cursor: pointer;
}

.sc-history__more:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
}

.history-detail__sc {
    margin-top: 6px;
}

.streamer-chat-analysis__sc-detail--card {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.streamer-chat-analysis__sc-headline {
    margin: 4px 0;
    font-size: 13px;
    color: #ffc83d;
}

.streamer-chat-analysis__sc-summary {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--pachi-text-sub);
}

.streamer-chat-analysis__sc-summary strong {
    color: #ffc83d;
}

.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: 220px;
    min-width: 220px;
    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;
}

/* PC：サムネは16:9のまま全体を見せ、横幅を広げて、右側のテキスト（約180〜210px）の
   高さに近づける。高さを合わせるために切り抜くことはしない。 */
@media (min-width: 769px) {
    .history-card__thumb {
        width: 320px;
        min-width: 320px;
    }
}

.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__time {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 6px 0 2px;
    font-size: 12px;
    color: var(--pachi-text-sub);
}

.history-card__time i {
    margin-right: 4px;
    color: #4fc3f7;
}

.history-card__time-range {
    white-space: nowrap;
}

.history-card__time-total {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.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);
}

/* ライブチャットの集計（コメント数・参加人数・スパチャ合計）。
   PC：同接のチップの下に、ラベル＋値を1行に収めたチップを並べる。 */
.history-card__chat {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.history-card__chat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.28);
    color: #b9d9ea;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
}

.history-card__chat-label i {
    margin-right: 3px;
    color: #4fc3f7;
}

.history-card__chat-item strong {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.history-card__chat-item--superchat {
    background: rgba(255, 200, 61, 0.1);
    border-color: rgba(255, 200, 61, 0.38);
    color: #f6dfa0;
}

.history-card__chat-item--superchat .history-card__chat-label i,
.history-card__chat-item--superchat strong {
    color: #ffc83d;
}

.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-hero__check-since {
        text-align: 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;
    }

    /* スマホ：ラベルを上、値を下に積んだ「タイル」を横に等分して並べる。
       タップしやすい高さにし、数字が目に入りやすいよう値を大きくする。 */
    /* 項目が増えた（コメント・参加・スパチャ・ジュエル・ギフトの最大5つ）ので、
       1行に詰め込まず、1つあたり96px以上を確保して折り返す（3つ＋2つなど） */
    .history-card__chat {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
        gap: 6px;
        margin-top: 10px;
    }

    .history-card__chat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 7px 9px;
        border-radius: 10px;
        white-space: normal;
    }

    .history-card__chat-label {
        font-size: 10px;
        white-space: nowrap;
    }

    .history-card__chat-item strong {
        font-size: 15px;
        line-height: 1.2;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    .streamer-live-layout {
        grid-template-columns: 1fr;
    }
}

/* ==========================
   関連チャンネル（同じ配信者のほかのチャンネル・動画用サブチャンネル）
   ========================== */

.streamer-related {
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid var(--pachi-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .02);
}

.streamer-related h2 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #fff;
    border: none;
    padding: 0;
}

.streamer-related__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.streamer-related__list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
}

.streamer-related__tag {
    padding: 2px 8px;
    font-size: 11px;
    color: #111;
    background: var(--pachi-green, #22c55e);
    border-radius: 999px;
}

.streamer-related__tag--sub {
    background: #b388ff;
}

.streamer-related__note {
    font-size: 11px;
    color: var(--pachi-text-sub);
}

/* コメントで多かった言葉（配信ごと／配信者ページ上部） */
.history-words {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 4px;
    padding: 0;
    list-style: none;
}

.history-words li {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

.history-words__n {
    font-size: 11px;
    color: var(--pachi-text-sub);
}

.history-words__stamps,
.history-words__peak {
    margin: 6px 0 0;
    font-size: 13px;
}

.history-words__note {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--pachi-text-sub);
}

.streamer-words {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.streamer-words__title {
    margin: 0 0 6px;
    font-size: 15px;
    border: none;
    padding: 0;
}

.streamer-words__text {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.7;
}
