/* --- style_modern.css (Holometer V3 - Cyber-Minimal) --- */

:root {
    --bg-dark: #050505;
    --bg-card: #0a0a0a;
    --bg-card-hover: #111;

    /* Brand red (softer, less "financial" harsh) */
    --primary: #ff6b61;
    --primary-soft: rgba(255, 107, 97, 0.18);
    --secondary: #3b82f6;
    /* Blue */
    --tertiary: #a855f7;
    /* Purple */
    --gold: #fbbf24;

    --text-main: #f3f4f6;
    --text-dim: #9ca3af;
    --text-muted: #4b5563;

    --border-color: #262626;
    --border-highlight: #404040;

    --gradient-bg: linear-gradient(135deg, #0a0a0a 0%, #050505 100%);
    --gradient-card: linear-gradient(180deg, rgba(20, 20, 20, 0.8) 0%, rgba(10, 10, 10, 0.9) 100%);

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(0, 0, 0, 0.5);

    --font-heading: 'Orbitron', 'Inter', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Layout spacing tokens */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --content-max: 1200px;
    --layout-gap: 20px;
    --side-sticky-top: 96px;
    --section-gap: var(--space-5);
    --section-gap-tight: var(--space-3);
    --card-radius-md: 12px;
    --card-radius-lg: 14px;
    --card-pad-md: var(--space-4);
    --card-pad-sm: var(--space-3);
}



/* Header / Brand */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.share-x-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.22s ease;
}

.share-x-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.share-x-btn i {
    font-size: 1.05rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
}

.brand-logo .brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-logo .brand-needle {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    filter: drop-shadow(0 0 14px var(--primary-soft));
}

.brand-logo .brand-textblock {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.0;
}

.brand-logo .brand-title {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 700;
    text-transform: none;
    font-size: 1.26rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.brand-logo .bt-holo {
    /* Keep HOLO a touch wider, but avoid pushing away "Meter". */
    letter-spacing: 0.04em;
    margin-right: 0;
}

.brand-logo .bt-meter {
    letter-spacing: 0.02em;
}

.brand-logo .bt-gap {
    width: 0.16em;
    display: inline-block;
}

.brand-logo .brand-subtitle {
    margin-top: 0;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    opacity: 0.9;
    white-space: nowrap;
}

.header-search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
    margin-left: 20px;
}

.header-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.9rem;
}

.header-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 15px 8px 35px;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: 0.3s;
}

.search-mobile-btn {
    color: #888;
    font-size: 1.2rem;
    display: none;
}

.separator {
    border-left: 1px solid #333;
}

@media (max-width: 600px) {
    .header-search-box {
        display: none;
    }

    .search-mobile-btn {
        display: block;
    }
}

/* Mobile menu search */
.mm-title--top {
    margin-top: 0;
}

.mm-grid--primary {
    margin-bottom: 30px;
}

.mm-section--search {
    margin-bottom: 20px;
}

.mm-search-form {
    display: flex;
    gap: 10px;
}

.mm-search-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    outline: none;
}

.mm-search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
}


/* 1. Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Accessibility utility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 2. Header */
.header-container {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.header-top-row {
    padding: 15px 20px 10px;
    width: min(var(--content-max), 100%);
    margin: 0 auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.scroll-nav {
    padding: 5px 20px 15px;
    width: min(var(--content-max), 100%);
    margin: 0 auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: 0.1em;
    background: linear-gradient(90deg, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.header-title .meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* Scroll Nav */
.scroll-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}

.scroll-nav::-webkit-scrollbar {
    display: none;
}

.pill {
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    background: #111;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.pill:hover {
    color: #fff;
    border-color: var(--border-highlight);
    background: #1a1a1a;
}

.pill.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* 3. Main Container & Layout */
.main-container {
    max-width: var(--content-max);
    margin: var(--space-5) auto;
    padding: 0 var(--space-4);
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .main-container {
        padding: 0 var(--space-3);
        margin: var(--space-3) auto;
    }

    .header-top-row {
        width: 100%;
        margin: 0;
        padding: 10px 10px 8px !important;
    }

    .scroll-nav {
        width: 100%;
        margin: 0;
        padding: 5px 10px 12px !important;
    }

    /* Move logo and items closer to the left edge */
    .header-title {
        gap: 8px !important;
    }

    .brand-logo {
        gap: 4px !important;
        font-size: 0.9rem !important;
    }

    .scroll-nav {
        gap: 6px;
    }

    .scroll-nav .pill {
        padding: 5px 12px;
        font-size: 0.74rem;
    }
}

/* 4. Section Titles */
.hero-section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 30px 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title {
    margin: 0 0 var(--section-gap-tight);
    line-height: 1.35;
}

.hero-section-title i {
    color: var(--text-muted);
}

.hero-section-title.live i {
    color: var(--primary);
}

.hero-section-title.next i {
    color: var(--secondary);
}

/* 5. Hero Cards (Live/Next) */
.stream-scroll-box {
    overflow-x: auto;
    padding-bottom: 15px;
    margin: 0 -20px;
    /* Bleed on mobile */
    padding: 0 20px 15px;
}

.hero-grid {
    display: flex;
    gap: 15px;
}

.hero-grid li {
    flex: 0 0 280px;
}

.hero-card {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    height: 100%;
    align-items: center;
}

.hero-card:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #eee;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.pill-live {
    background: rgba(239, 68, 68, 0.2);
    color: var(--primary);
}

.pill-next {
    background: rgba(59, 130, 246, 0.2);
    color: var(--secondary);
}

/* 6. Ranking Cards */
.ranking-card-detailed {
    background: var(--bg-card);
    border: 1px solid var(--accent-color, var(--border-color));
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.ranking-card-detailed:hover {
    border-color: var(--accent-color, var(--border-highlight));
    box-shadow: var(--shadow-card);
}

/* Rank Number */
.rc-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.rc-rank {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    margin-right: 20px;
    min-width: 40px;
    text-align: center;
    color: var(--border-highlight);
}

.rk-1 .rc-rank {
    color: var(--gold);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.rk-2 .rc-rank {
    color: #e5e5e5;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.rk-3 .rc-rank {
    color: #d97706;
    text-shadow: 0 0 20px rgba(217, 119, 6, 0.2);
}

.rc-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    margin-right: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.rc-info {
    flex: 1;
    min-width: 0;
}

.rc-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.rc-name span {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 400;
    opacity: 0.7;
}

.rc-name .rc-oshi {
    color: var(--accent-color, var(--text-dim));
    font-weight: 600;
    opacity: 0.95;
}

.rc-diff {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-color, var(--text-dim));
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border: 1px solid var(--accent-color, rgba(255, 255, 255, 0.12));
    border-radius: 4px;
    display: inline-block;
}

.rc-stream-title {
    font-size: 0.8rem;
    margin-top: 4px;
    opacity: 0.8;
}

.rc-stream-title a {
    color: #fff;
    text-decoration: none;
}

.rc-stream-title a:hover {
    text-decoration: underline;
}

.rc-love-area {
    text-align: right;
}

.rc-love-val {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.rc-love-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}

/* Stats Grid in Card */
.rc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .rc-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.rc-box {
    background: #111;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rc-box-label {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.rc-box-val {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: #ddd;
}

.rc-unit-small {
    font-size: 0.7em;
    color: #555;
    margin-left: 2px;
}

/* 6.5. Dashboard & Navigation */
.dashboard-desc {
    text-align: center;
    margin-bottom: var(--section-gap);
    padding: var(--card-pad-md) var(--space-5);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--card-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-desc h1,
.dashboard-desc .dashboard-desc-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 var(--space-2);
    letter-spacing: 0.3px;
}

.dashboard-desc h1 i,
.dashboard-desc .dashboard-desc-title i {
    color: var(--secondary);
    margin-right: 6px;
    font-size: 1.2rem;
}

.dashboard-desc p,
.dashboard-desc .dashboard-desc-copy {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    max-width: 650px;
    margin: 0 auto;
}

.dashboard-desc--hero {
    text-align: left;
    border-left: 4px solid var(--primary);
    background: linear-gradient(90deg, rgba(255, 107, 97, 0.08) 0%, transparent 100%);
}

.dashboard-desc--hero .dashboard-desc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--space-2);
}

.dashboard-desc--hero .dashboard-desc-subtitle {
    font-size: 0.6em;
    font-weight: 500;
    color: var(--text-dim);
    margin-left: 10px;
    letter-spacing: 0.01em;
}

.dashboard-desc--hero .dashboard-desc-copy {
    margin: 0;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .dashboard-desc {
        display: none;
    }
}

.date-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    font-size: 1.2rem;
    font-weight: bold;
}

.date-nav a {
    color: #fff;
    padding: 0 20px;
    transition: transform 0.2s;
}

.date-nav a:hover {
    transform: scale(1.2);
}

.date-nav-bottom {
    margin-top: 18px;
}

.date-nav span {
    min-width: 80px;
    text-align: center;
}

.date-nav .nav-disabled {
    color: #444;
    padding: 0 20px;
    cursor: default;
}

/* 7. Parts Stream Card (Shared) */
.stream-card {
    display: flex;
    flex-direction: row;
    background: #0f0f0f;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
    text-decoration: none;
}

.stream-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    background:
        radial-gradient(900px 240px at 12% 18%, color-mix(in srgb, var(--card-accent, var(--oshi-color)) 26%, transparent) 0%, transparent 60%),
        radial-gradient(700px 220px at 88% 82%, color-mix(in srgb, var(--card-accent, var(--oshi-color)) 18%, transparent) 0%, transparent 62%);
}

.stream-card>* {
    position: relative;
    z-index: 1;
}

.rank-card {
    margin-bottom: 10px;
}

.rank-card .stream-thumb {
    width: 180px;
    aspect-ratio: 16/9;
}

.rank-card .stream-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: auto;
}

.rank-card .thumb-owner-wrap {
    display: none;
}

.rank-card .thumb-owner-overlay {
    display: none;
}

@media (max-width: 640px) {
    .rank-card {
        flex-direction: column;
    }

    .rank-card .stream-thumb {
        width: 100%;
        aspect-ratio: 16/9;
    }

    .rank-card .stream-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        aspect-ratio: auto;
    }

    .rank-card .stream-info {
        justify-content: flex-start;
        width: 100%;
        padding-top: 6px;
    }

    .rank-card .stream-title {
        margin-top: 0;
    }

    .rank-card .stream-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 10px;
        margin-top: 8px;
        font-size: 0.72rem;
    }

    .rank-card .stream-stats .stat-item {
        min-width: 0;
        white-space: nowrap;
    }

    .rank-card .stream-owner-line {
        display: flex;
        margin-bottom: 4px;
    }

    .rank-card .stream-owner-line .owner-icon {
        display: inline-block;
        width: 16px;
        height: 16px;
    }

    .rank-card .thumb-owner-wrap {
        display: none;
    }

    .rank-card .thumb-owner-overlay {
        display: none !important;
    }

    .rank-card.is-owner-under-thumb {
        display: grid;
        grid-template-columns: 180px minmax(0, 1fr);
        grid-template-areas: "thumb info";
        align-items: stretch;
        column-gap: 9px;
    }

    .rank-card.is-owner-under-thumb .stream-thumb {
        grid-area: thumb;
        width: 100%;
    }

    .rank-card.is-owner-under-thumb .thumb-owner-below {
        display: none;
    }

    .rank-card.is-owner-under-thumb .stream-info {
        grid-area: info;
        width: 100%;
        padding-top: 0;
        min-height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 4px;
    }

    .rank-card.is-owner-under-thumb .stream-owner-line {
        display: flex;
        margin-bottom: 2px;
        gap: 6px;
    }

    .rank-card.is-owner-under-thumb .stream-owner-line .owner-icon {
        width: 14px;
        height: 14px;
    }

    .rank-card.is-owner-under-thumb .stream-owner-line .owner-name {
        font-size: 0.78rem;
        line-height: 1.1;
    }

    .rank-card.is-owner-under-thumb .stream-title {
        margin-bottom: 4px;
        line-height: 1.32;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .rank-card.is-owner-under-thumb .stream-stats {
        margin-top: 0;
        gap: 2px 10px;
        font-size: 0.7rem;
        line-height: 1.05;
    }
}

.stream-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--card-accent, var(--oshi-color));
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.38),
        0 0 0 1px color-mix(in srgb, var(--card-accent, var(--oshi-color)) 38%, transparent);
}

.stream-card:hover::before {
    opacity: 1;
}

.stream-thumb {
    width: 160px;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.stream-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
    display: block;
}

/* Badges within Stream Thumb */
.thumb-badge {
    position: absolute;
    z-index: 5;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
}

.thumb-badge.badge-seen {
    bottom: 8px;
    right: 8px;
    background: rgba(16, 185, 129, 0.9);
}

.stream-card.is-seen .stream-title::after {
    content: "（見た）";
    font-size: 0.75em;
    color: #10b981;
    margin-left: 6px;
}

.seen-filter-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.seen-filter-toolbar .pill {
    cursor: pointer;
}

.seen-filter-toolbar .seen-reset {
    opacity: 0.9;
}

body.seen-filter-enabled.hm-hide-seen .stream-card.is-seen {
    display: none !important;
}

.stream-thumb img.thumb-fallback {
    opacity: 0.4;
}

.badge-time {
    bottom: 4px;
    left: 4px;
}

.badge-total-duration {
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.9);
    font-size: 1rem;
    padding: 4px 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-status {
    top: 4px;
    right: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.badge-live {
    background: var(--primary);
}

.badge-next {
    background: var(--secondary);
}

.badge-mem {
    bottom: 4px;
    left: 4px;
    background: #10b981;
}

.stream-info {
    padding: 10px 12px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
}

@media (max-width: 480px) {
    .stream-thumb {
        width: 130px;
    }

    .stream-title {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .stream-stats {
        gap: 8px;
        font-size: 0.7rem;
    }

    .badge-total-duration {
        font-size: 0.8rem;
        padding: 2px 4px;
    }
}

.stream-owner-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.thumb-owner-below {
    display: none;
}

.owner-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.owner-name {
    font-size: 0.75rem;
    color: #cbd5e1;
    /* Brighter than #999 */
}

.stream-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    /* Max brightness */
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stream-stats {
    display: flex;
    gap: 15px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #cbd5e1;
    /* Brighter than text-dim */
    list-style: none;
    padding: 0;
    margin: 0;
}

.stream-card .stream-stats {
    margin-top: 6px;
}

.stream-card.card-16x9-row {
    flex-direction: row;
    align-items: flex-start;
}

.stream-card.card-16x9-row .stream-thumb {
    width: 180px;
    flex: 0 0 180px;
}

.stream-card.card-16x9-row .stream-thumb img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    aspect-ratio: 16/9;
}

.stream-card.card-top-thumb {
    flex-direction: column;
}

.stream-card.card-top-thumb .stream-thumb {
    width: 100%;
}

.stream-card.card-top-thumb .stream-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

.stream-card.is-owner-hidden .stream-title {
    margin-top: 0;
}

.stream-card.is-stats-compact .stream-stats {
    margin-top: 4px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-item i {
    font-size: 0.7rem;
    opacity: 0.7;
}

.unit {
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 1px;
}

.inline-time {
    margin-left: 8px;
    color: var(--secondary);
    font-weight: 700;
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.stat-item.c-sc {
    color: var(--gold);
}

.stat-item.c-gift {
    color: var(--secondary);
}

.stat-item.c-member {
    color: #10b981;
}

/* Summary Stat Cards (Global) */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 18px 0 24px;
}

.s-card {
    background: rgba(12, 12, 12, 0.9);
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.s-card-label {
    color: #777;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.s-card-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-mono);
}

.s-card .unit-small {
    font-size: 0.7em;
    opacity: 0.6;
}

/* Rank Badge in Stream Card */
.rank-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    padding: 2px 8px;
    border-bottom-right-radius: 6px;
    font-weight: 800;
    font-family: var(--font-heading);
    font-style: italic;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.rank-badge.rank-1 {
    background: var(--gold);
    color: #000;
    text-shadow: none;
}

.rank-badge.rank-2 {
    background: #e5e5e5;
    color: #000;
    text-shadow: none;
}

.rank-badge.rank-3 {
    background: #d97706;
    color: #000;
    text-shadow: none;
}

.rank-badge.rank-other {
    background: rgba(0, 0, 0, 0.7);
    font-size: 0.8rem;
}

/* 7.5. Timeline */
.timeline-section {
    margin-bottom: var(--space-7);
}

.timeline-title {
    font-size: 1.3rem;
    color: #e2e8f0;
    margin: 0 0 var(--section-gap);
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-title i {
    color: var(--secondary);
}

.page-title {
    color: #e5e7eb;
    font-weight: 700;
    margin: 0 0 var(--space-4);
}

/* ============================
   Members Page (members.php)
   ============================ */
.members-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 10px 0 22px;
    flex-wrap: wrap;
}

.members-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
    min-width: min(520px, 92vw);
}

.members-search i {
    color: rgba(255, 255, 255, 0.55);
}

.members-search input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-size: 0.95rem;
}

.members-chips {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.members-chips .chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.members-chips .chip:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

.members-chips .chip.active {
    background: rgba(255, 0, 85, 0.18);
    border-color: rgba(255, 0, 85, 0.35);
    color: #fff;
}

.members-section {
    margin: 28px 0 38px;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (min-width: 720px) {
    .member-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .member-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 16px;
    }
}

.member-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    transform: translateZ(0);
    position: relative;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.member-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
    background:
        radial-gradient(260px 200px at 28% 20%, color-mix(in srgb, var(--card-accent, var(--oshi-color)) 28%, transparent) 0%, transparent 60%),
        radial-gradient(260px 200px at 72% 80%, color-mix(in srgb, var(--card-accent, var(--oshi-color)) 22%, transparent) 0%, transparent 62%);
    filter: blur(0.2px);
}

.member-card:hover {
    border-color: var(--card-accent, var(--oshi-color));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px color-mix(in srgb, var(--card-accent, var(--oshi-color)) 55%, transparent), 0 0 26px color-mix(in srgb, var(--card-accent, var(--oshi-color)) 18%, transparent);
    background: rgba(255, 255, 255, 0.04);
}

.member-card:hover::before {
    opacity: 1;
}

.member-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #0b0b0b;
}

.member-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(0);
}

.member-card__bg {
    position: absolute;
    inset: -18% -18% auto -18%;
    height: 70%;
    background-size: cover;
    background-position: center;
    transform: scaleY(-1);
    filter: blur(18px) saturate(0.95);
    opacity: 0.55;
}

.member-card__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 55%, rgba(0, 0, 0, 0.92) 100%);
}

.member-card__name {
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 1.02rem;
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.member-card__sub {
    margin-top: 4px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* New stacked layout for members page */
.member-grid.member-grid--all {
    margin-top: 4px;
}

.member-card.member-card--stack {
    display: flex;
    flex-direction: column;
}

.member-card.member-card--stack .member-card__media {
    aspect-ratio: 1 / 1;
}

.member-card.member-card--stack .member-card__meta {
    padding: 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-card.member-card--stack .member-card__name {
    font-size: 1.02rem;
    text-shadow: none;
}

.member-card__group {
    align-self: flex-start;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    padding: 5px 10px;
    border-radius: 999px;
}

.timeline-count {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 400;
    margin-left: auto;
}

/* Live page */
.page-title.page-title--live {
    font-size: 1.4rem;
    margin-bottom: 14px;
}

.no-data-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.live-badge.scheduled {
    background: #555;
}

.live-ccv-badge.scheduled {
    background: rgba(0, 0, 0, 0.7);
    font-size: 0.85rem;
}

.live-badge.ended {
    background: #333;
}

.live-ccv-badge.ended {
    background: rgba(0, 0, 0, 0.6);
    font-size: 0.85rem;
    color: #ddd;
}

.update-time {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
    text-align: right;
}

.live-ccv-badge i {
    margin-right: 4px;
}

.live-stats-row {
    display: flex;
    justify-content: flex-end;
}

.live-icon {
    border-color: var(--accent, #ccc);
}

.timeline-hour-group {
    margin-top: 25px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--secondary);
    border-radius: 4px;
}

/* Ratio Ranking Card */
.ranking-card-ratio {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

/* Ratio ranking card refresh */
.ratio-card {
    background: var(--gradient-card);
    /* Use per-card oshi color when available (index.php sets --oshi-color inline). */
    border: 1px solid color-mix(in srgb, var(--oshi-color) 85%, var(--border-color));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.ratio-card__header-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 9px;
    border-bottom: 1px solid var(--border-color);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.ratio-card__header-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--oshi-color) 55%, transparent);
    outline-offset: 2px;
    border-radius: 12px;
}

.ratio-card:hover {
    border-color: var(--oshi-color);
    box-shadow:
        var(--shadow-card),
        0 0 0 1px color-mix(in srgb, var(--oshi-color) 38%, transparent),
        0 0 22px color-mix(in srgb, var(--oshi-color) 14%, transparent);
}

.ranking-card-detailed.is-hero,
.ratio-card.is-hero {
    border-width: 2px;
    border-color: var(--oshi-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.ranking-card-detailed.is-hero .rc-thumb,
.ratio-card.is-hero .ratio-card__avatar {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.ratio-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 10px;
}

.ca-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.75rem;
}

.ca-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.rank-more-wrap {
    display: flex;
    justify-content: center;
    margin: 18px 0 30px;
}

.rank-more-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 10px 24px;
    font-weight: 700;
    cursor: pointer;
}

.rank-hidden {
    display: none;
}

@media (max-width: 768px) {
    .stream-card {
        padding: 10px;
    }

    .stream-card .stream-title {
        font-size: 0.9rem;
    }

    .stream-card .stream-stats {
        gap: 8px;
        flex-wrap: wrap;
    }

    .stream-card .stat-item {
        font-size: 0.75rem;
    }
}

/* Quick Actions */
.quick-actions {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 22px;
}

.qa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s ease;
}

.qa-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1100px) {
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ratio-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 9px;
    border-bottom: 1px solid var(--border-color);
}

.ratio-card__rank {
    font-size: 1.35rem;
    font-weight: 900;
    font-family: var(--font-heading);
    color: rgba(255, 255, 255, 0.12);
    font-style: italic;
    min-width: 24px;
    text-align: left;
}


.ratio-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--oshi-color);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.35);
    object-fit: cover;
}

.ratio-card__name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.98rem;
    line-height: 1.2;
}

.ratio-card__grow {
    flex: 1;
    min-width: 0;
}

.ratio-card__oshi {
    font-size: 0.95rem;
    color: var(--oshi-color);
    font-weight: 600;
}

.ratio-unit {
    font-size: 0.55em;
    margin-left: 2px;
}

.ratio-card__meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.ratio-card__metric {
    margin-left: auto;
    text-align: right;
}

.ratio-card__metric-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-weight: 700;
}

.ratio-card__metric-val {
    font-size: 1.22rem;
    font-weight: 900;
    color: var(--secondary);
    font-family: var(--font-mono);
    line-height: 1;
}

.ratio-card-compact .ratio-card__header {
    border-bottom: 0;
    padding-left: 10px;
    padding-right: 10px;
    gap: 9px;
}

.ratio-card-compact .ratio-card__name {
    flex-wrap: nowrap;
    min-width: 0;
    margin-left: -1px;
}

.ratio-card-compact .ratio-card__name a {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ratio-card__body {
    padding: 16px;
}

.ratio-card__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.ratio-card__panel {
    flex: 1;
    min-width: 170px;
}

.ratio-card__panel-title {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.ratio-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.ratio-bar__fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 4px;
}

.ratio-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.02rem;
}

.ratio-card__stats span {
    white-space: nowrap;
}

.ratio-card__total {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-weight: 900;
    font-family: var(--font-mono);
}

.ratio-card__streams {
    border-top: 1px dashed var(--border-color);
    margin-top: 16px;
    padding-top: 12px;
}

@media (max-width: 720px) {
    .ratio-card__header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .ratio-card__metric {
        width: 100%;
        text-align: left;
    }

    .ratio-card__grid {
        gap: 12px;
    }

    .ratio-card-compact .ratio-card__header {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .ratio-card-compact .ratio-card__metric {
        width: auto;
        text-align: right;
    }

    .ratio-card-compact .ratio-card__name {
        font-size: 0.9rem;
    }
}

.ratio-header {
    display: flex;
    padding: 15px 20px;
}

.ratio-main-info {
    flex: 2;
    padding-right: 15px;
}

.ratio-val-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ratio-label {
    font-size: 0.7rem;
    color: #666;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ratio-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
}

.ratio-inc-stats {
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    gap: 15px;
}

.ratio-side-info {
    flex: 1;
    min-width: 120px;
    border-left: 1px solid var(--border-color);
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ratio-total-label {
    font-size: 0.7rem;
    color: #aaa;
    margin-bottom: 2px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.ratio-total-label span {
    font-size: 0.6rem;
    opacity: 0.7;
}

.ratio-total-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 2px;
}

/* Archive List in Rankings */
.archive-section {
    padding: 10px 15px;
    border-top: 1px solid #222;
}

.archive-section-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-hour-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #60a5fa;
}

.timeline-hour-count {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-left: 8px;
}

.timeline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.timeline-grid .rank-hidden {
    display: flex !important;
    opacity: 1 !important;
}

@media (min-width: 1280px) {
    .timeline-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .timeline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ranking-section-title {
    text-align: center;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Ranking title with built-in date navigation (daily mode) */
.ranking-title-nav {
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 800;
    color: #fff;
}

.ranking-title-nav .rt-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    user-select: none;
    font-weight: 900;
}

.ranking-title-nav .rt-nav:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.16);
}

.ranking-title-nav .rt-disabled {
    opacity: 0.35;
}

.ranking-title-nav .rt-text {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.ranking-title-nav .rt-date {
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0.85;
}

.ranking-title-nav .rt-desc {
    font-size: 1.55rem;
    font-weight: 900;
}

@media (max-width: 600px) {
    .ranking-title-nav .rt-desc {
        font-size: 1.25rem;
    }

    .ranking-title-nav .rt-date {
        font-size: 0.9rem;
    }

    .ranking-title-nav .rt-nav {
        width: 34px;
        height: 32px;
    }
}

/* 8. Utility & Footer */
.no-data-msg {
    text-align: center;
    color: #666;
    padding: 40px;
    margin: 40px 0;
    border: 1px dashed #333;
    border-radius: 8px;
}

.footer-copy {
    text-align: center;
    color: #444;
    font-size: 0.75rem;
    margin-top: 60px;
    padding-bottom: 40px;
    font-family: var(--font-mono);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
}

.footer-nav a:hover {
    color: var(--secondary);
}

.site-footer {
    margin-top: auto;
    padding: 30px 20px;
    text-align: center;
    color: #555;
    font-size: 0.8rem;
    border-top: 1px solid #1a1a1a;
}

.site-footer-links {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.site-footer-links a {
    color: #666;
    text-decoration: none;
}

.site-footer-copy {
    font-family: var(--font-mono);
}

/* 9. Mobile Tweaks */
@media (max-width: 480px) {
    .header-container {
        padding: 15px;
    }

    .main-container {
        padding: 0 15px;
    }

    .stream-thumb {
        width: 130px;
    }

    .rc-rank {
        font-size: 2rem;
        margin-right: 15px;
        min-width: 30px;
    }

    .rc-thumb {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }

    .rc-name {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .stream-thumb {
        width: 140px;
    }
}

.timeline-card {
    flex-direction: column;
}

.timeline-card .stream-thumb {
    width: 100%;
}

.timeline-card .stream-thumb img {
    height: auto;
    aspect-ratio: 16/9;
}

.timeline-card .stream-info {
    padding: 12px 14px;
}

@media (max-width: 640px) {
    .stream-graph-page .related-row .stream-card {
        flex-direction: column;
    }

    .stream-graph-page .related-row .stream-thumb {
        width: 100%;
    }

    .stream-graph-page .related-row .stream-thumb img {
        height: auto;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 640px) {
    .search-title .search-title-query {
        display: block;
        margin-top: 6px;
    }

    .search-form {
        flex-direction: column;
        gap: 10px;
    }

    .search-field {
        width: 100%;
    }

    .search-input,
    .search-select,
    .search-submit {
        width: 100%;
    }

    .search-submit {
        text-align: center;
    }
}

/* History Page Specifics (retained structure, updated style) */
.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

/* History Profile + Timeline (refactor) */
.history-page {
    padding: 20px 20px 8px;
}

.history-page+.main-container {
    margin-top: var(--space-2);
}

.history-header {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.history-avatar {
    width: 92px !important;
    height: 92px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.history-header img.history-avatar {
    width: 92px !important;
    height: 92px !important;
    border-radius: 50%;
    object-fit: cover;
}

.profile-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    gap: 26px;
    align-items: center;
}

.profile-card .stream-thumb.profile-thumb {
    width: 96px;
    height: 96px;
    max-width: 30vw;
    border-radius: 50%;
    overflow: hidden;
}

.stream-thumb.profile-thumb img.profile-thumb-img {
    width: 100%;
    height: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.profile-info {
    padding: 0;
}

.profile-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.profile-name {
    font-size: 2rem;
    margin: 0 0 6px;
    font-family: var(--font-heading);
}

.profile-affiliation {
    font-size: 0.95rem;
}

.history-header-body {
    flex: 1;
    min-width: 0;
}

.history-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.history-name {
    font-size: 2.1rem;
    margin: 0 0 6px;
    font-family: var(--font-heading);
}

.history-oshi-mark {
    font-size: 1.1rem;
    margin-left: 8px;
    opacity: 0.9;
}

.history-affiliation {
    color: var(--text-dim);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-unit-sep {
    opacity: 0.4;
}

.history-unit-tag {
    color: #cbd5f5;
    font-weight: 700;
}

.history-socials {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.history-social-btn.is-youtube {
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff8a80;
}

.history-social-btn.is-x {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
}

.history-meta {
    display: flex;
    gap: 18px;
    margin-top: 12px;
    color: #b8b8b8;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.history-meta-icon {
    color: #666;
    margin-right: 6px;
}

.history-hero .hero-live-box {
    border: 1px solid #1a1a1a;
    background: #0b0b0b;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hero-live-box.is-live {
    --hero-accent: #ef4444;
}

.hero-live-box.is-next {
    --hero-accent: #3b82f6;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--hero-accent);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.hero-content {
    display: flex;
    gap: 18px;
    align-items: center;
}

.hero-thumb {
    width: 200px;
    max-width: 45vw;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.hero-thumb-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.hero-live-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ef4444;
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 8px;
}

.hero-info {
    flex: 1;
    min-width: 0;
}

.hero-title {
    font-size: 1.15rem;
    margin: 0 0 8px;
    color: #fff;
}

.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--hero-accent);
    font-family: var(--font-mono);
}

.hero-meta.is-live {
    --hero-accent: #ff4d4d;
}

.hero-meta.is-next {
    --hero-accent: #4da3ff;
}

.hero-meta-unit {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: 2px;
}

.hero-meta i {
    font-size: 0.9rem;
}

.history-fans-box {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
}

.fans-scroll-box {
    max-height: 200px;
    overflow-y: auto;
}

.history-fans-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-fan-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #1a1a1a;
    overflow: hidden;
    transition: 0.2s;
}

.history-fan-item:hover {
    background: #151515;
}

.history-fan-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--fan-fill, 0%);
    background: rgba(251, 191, 36, 0.05);
    z-index: 0;
}

.history-fan-rank {
    width: 35px;
    font-family: var(--font-mono);
    font-weight: 800;
    color: #555;
    font-size: 0.9rem;
    z-index: 1;
}

.history-fan-rank.is-top {
    color: var(--gold);
    font-size: 1.1rem;
}

.history-fan-body {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.history-fan-name {
    color: #eee;
    font-weight: 600;
    font-size: 0.82rem;
}

.history-timeline-title {
    border-left: 4px solid #6366f1;
    padding-left: 10px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #6366f1;
}

.history-section {
    margin-bottom: var(--section-gap);
}

.history-timeline-item {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.history-pref-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 14px;
}

.ios-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #cbd5e1;
    user-select: none;
    position: relative;
}

.ios-toggle__label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.ios-toggle__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.ios-toggle__ui {
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.35);
    position: relative;
    transition: background 0.18s ease, border-color 0.18s ease;
    flex: 0 0 auto;
}

.ios-toggle__ui::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-50%);
    transition: left 0.18s ease, background 0.18s ease;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.ios-toggle:has(.ios-toggle__input:checked) .ios-toggle__ui {
    background: color-mix(in srgb, var(--oshi-color) 60%, rgba(16, 185, 129, 0.55));
    border-color: color-mix(in srgb, var(--oshi-color) 50%, rgba(16, 185, 129, 0.75));
}

.ios-toggle:has(.ios-toggle__input:checked) .ios-toggle__ui::after {
    left: 21px;
}

.ios-toggle:focus-within {
    outline: 2px solid rgba(255, 255, 255, 0.12);
    outline-offset: 2px;
}

/* Preference: Hide like ratio UI */
body.pref-hide-suki .history-timeline-daily,
body.pref-hide-suki .history-timeline-right {
    display: none !important;
}

/* Also hide "Stats (Gain)" area (including title) when preference is OFF */
body.pref-hide-suki .history-timeline-left {
    display: none !important;
}

/* Preference: Hide archive list in timeline */
body.pref-hide-archives .history-timeline-streams {
    display: none !important;
}

.timeline-item.hidden {
    display: none;
}

.history-timeline-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.history-timeline-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.history-pref-toggles.is-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
}

.history-pref-toggles.is-compact .ios-toggle__label {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 800;
    letter-spacing: 0.2px;
    min-width: auto;
}

/* Stream Graph preference toggles */
.sg-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0 10px;
    flex-wrap: wrap;
}

.sg-actions-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.sg-actions-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.sg-pref-toggles {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
}

@media (max-width: 520px) {
    .sg-pref-toggles {
        width: 100%;
        justify-content: space-between;
    }
}

/* Preferences: hide sections on stream_graph.php */
body.pref-hide-sg-graph .graph-container {
    display: none !important;
}

body.pref-hide-sg-cards .stat-cards-grid {
    display: none !important;
}

@media (max-width: 520px) {
    .history-timeline-titlebar {
        align-items: flex-start;
    }

    .history-pref-toggles.is-compact {
        width: 100%;
        justify-content: space-between;
    }
}

.history-timeline-date {
    font-weight: 700;
    color: #eee;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.history-timeline-date-icon {
    color: #666;
    font-size: 0.9em;
}

.history-timeline-date-text {
    font-family: 'JetBrains Mono', var(--font-mono);
    font-weight: 800;
    letter-spacing: 0.5px;
}

.history-timeline-daily {
    color: #888;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: right;
    flex-shrink: 0;
}

.history-timeline-daily-value {
    color: #3b82f6;
    font-size: 1rem;
    font-weight: 700;
    margin-left: 3px;
    font-family: 'JetBrains Mono', var(--font-mono);
}

.history-timeline-body {
    padding: 0 15px 15px;
}

.history-timeline-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    position: relative;
}

.history-timeline-left {
    padding-bottom: 5px;
}

.history-timeline-subtitle {
    font-size: 0.64rem;
    color: #666;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-timeline-stats {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', var(--font-mono);
    font-weight: 700;
    font-size: 0.86rem;
    line-height: 1.2;
}

.history-timeline-stat.is-like {
    color: #fbbf24;
    white-space: nowrap;
}

.history-timeline-stat.is-dislike {
    color: #888;
    white-space: nowrap;
}

.history-timeline-stat.is-comment {
    color: #555;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.history-archive-row-card {
    flex-direction: row;
}

.history-archive-row-card .stream-thumb {
    width: 180px;
}

.history-archive-row-card .stream-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

.history-timeline-right {
    border-left: 1px solid #1a1a1a;
    padding-left: 15px;
}

.history-timeline-ratio {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: 'JetBrains Mono', var(--font-mono);
}

.history-timeline-ratio-main {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.history-timeline-ratio-diff {
    font-size: 0.8rem;
    font-weight: 600;
}

.history-timeline-ratio-diff.is-up {
    color: #ef4444;
}

.history-timeline-ratio-diff.is-down {
    color: #3b82f6;
}

.history-timeline-ratio-diff.is-flat {
    color: #64748b;
}

.history-timeline-streams {
    border-top: 1px dashed #222;
    margin-top: 15px;
    padding-top: 15px;
}

.history-timeline-streams-title {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.history-timeline-streams-icon {
    font-size: 0.9rem;
}

.history-timeline-streams-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.history-timeline-more {
    text-align: center;
    margin: 30px 0;
}

.history-timeline-more-btn {
    padding: 14px 40px;
    font-size: 0.9rem;
    cursor: pointer;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    border: 1px solid #333;
    color: #eee;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.history-game-tags {
    margin: var(--space-1) 0 var(--space-2);
}

.history-game-tags.is-top {
    margin-top: var(--space-1);
    padding: var(--card-pad-sm) var(--card-pad-md);
    border-radius: var(--card-radius-lg);
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.history-game-tags .section-title {
    margin: 0 0 var(--section-gap-tight);
}

.history-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--section-gap);
    align-items: start;
    margin-top: var(--space-2);
}

.history-side-menu {
    position: static;
    top: auto;
    align-self: start;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid #1b1b1b;
    border-radius: var(--card-radius-lg);
    padding: var(--card-pad-md);
    max-height: none;
    overflow: visible;
}

.history-side-title {
    font-size: 0.9rem;
    color: #9ca3af;
    margin: 0 0 var(--space-3);
    letter-spacing: 0.08em;
}

.history-side-group {
    margin-bottom: var(--space-3);
}

.history-side-group-title {
    font-size: 0.85rem;
    color: #cbd5f5;
    font-weight: 700;
    margin-bottom: 6px;
    list-style: none;
    cursor: pointer;
}

.history-side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.history-side-group>summary {
    list-style: none;
}

.history-side-group>summary::-webkit-details-marker {
    display: none;
}

.history-side-group[open] .history-side-group-title::after {
    content: "−";
    float: right;
    color: #94a3b8;
}

.history-side-group:not([open]) .history-side-group-title::after {
    content: "+";
    float: right;
    color: #94a3b8;
}

.history-period-nav {
    display: flex;
    gap: 10px;
    margin: 6px 0 18px;
    flex-wrap: wrap;
}

.history-header-stats.stat-cards-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-width: none;
    margin: var(--space-2) 0 var(--space-4);
    gap: var(--space-3);
}

.history-header-stats .s-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 86px;
    padding: 12px 14px;
    background: #090b0e;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    box-shadow: none;
}

.history-header-stats .s-card-label,
.history-header-stats .s-card-val {
    width: 100%;
    text-align: center;
}

.history-header-stats .s-card-label {
    color: #7d8596;
    font-size: 0.72rem;
    margin-bottom: 10px;
    text-transform: none;
    letter-spacing: 0;
}

.history-header-stats .s-card-val {
    font-family: var(--font-body);
    font-size: 1.38rem;
    line-height: 1.05;
    font-weight: 800;
    white-space: nowrap;
}

.history-main-content .history-header.profile-card {
    max-width: 980px;
    margin: 0 auto var(--space-4);
}

.history-data-note {
    margin: var(--space-2) 0 var(--space-3);
    font-size: 0.8rem;
    color: #94a3b8;
    letter-spacing: 0.02em;
    text-align: right;
}

@media (max-width: 1200px) {
    .history-header-stats.stat-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .history-header-stats .s-card-val {
        font-size: 1.24rem;
    }
}

.history-side-link {
    display: block;
    padding: 6px 10px;
    border-radius: 10px;
    color: #e5e7eb;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
}

.history-side-link.is-active {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.32);
    color: #dbeafe;
}

.history-side-link:hover {
    background: rgba(255, 255, 255, 0.09);
}

.history-main-content {
    min-width: 0;
}

@media (max-width: 1100px) {
    .history-layout {
        grid-template-columns: 1fr;
    }

    .history-side-menu {
        display: none;
    }
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.tag-chip:hover {
    background: rgba(255, 255, 255, 0.12);
}

.tag-count {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

@media (max-width: 900px) {

    .history-header,
    .profile-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-socials {
        justify-content: flex-start;
    }

    .history-avatar {
        width: 68px;
        height: 68px;
    }

    .profile-card .stream-thumb.profile-thumb,
    .hero-thumb {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .history-header {
        padding: 14px;
    }

    .history-name {
        font-size: 1.6rem;
    }

    .history-socials {
        gap: 8px;
    }

    .history-social-btn {
        font-size: 0.76rem;
        padding: 4px 10px;
    }

    .history-social-btn.is-x {
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .history-timeline-content {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .history-timeline-right {
        border-left: 1px solid #1a1a1a;
        padding-left: 10px;
    }

    .history-timeline-subtitle {
        font-size: 0.58rem;
        letter-spacing: 0.6px;
    }

    .history-timeline-stats {
        font-size: 0.76rem;
        gap: 8px;
    }

    .history-timeline-ratio-main {
        font-size: 1rem;
    }

    .history-timeline-ratio-diff {
        font-size: 0.72rem;
    }
}

@media (max-width: 768px) {
    .history-timeline-content {
        grid-template-columns: 1fr 1fr !important;
    }
}

.h-header {
    background: #111;
    padding: 10px 15px;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.h-date {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #ccc;
}

.val-high {
    color: var(--primary);
}

.val-low {
    color: var(--secondary);
}

.h-body {
    padding: 15px;
}

.stat-split-container {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.h-bar-area {
    background: #222;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 5px 0;
}

.bg-high {
    background: var(--gold);
}

.bg-low {
    background: var(--secondary);
}

.val-pos {
    color: var(--gold);
    font-weight: bold;
}

.stream-sec-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #666;
    margin: 15px 0 10px;
    text-transform: uppercase;
}

.stream-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-wrap {
    margin: 0 auto;
    padding: 20px;
}

.search-heading {
    margin-bottom: 30px;
}

.search-title {
    font-size: 1.8rem;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
    margin-bottom: 10px;
}

.search-title-query {
    color: var(--primary);
}

.search-meta {
    color: #888;
}

.search-panel {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 18px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
}

.search-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.search-field {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 14px 20px 14px 45px;
    border-radius: 12px;
    outline: none;
    font-size: 1rem;
    transition: 0.3s;
}

.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111;
    border: 1px solid #222;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.search-autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #222;
}

.search-autocomplete-item.is-hover {
    background: #222;
}

.search-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 600;
    height: 50px;
    outline: none;
}

.search-submit {
    border: none;
    cursor: pointer;
    padding: 0 35px;
    font-weight: 800;
    border-radius: 12px;
    height: 50px;
    background: #fff;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.search-trending {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.search-trending-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-right: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: 0.2s;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-tag.is-active {
    background: var(--primary);
    color: #fff;
}

.search-filter-meta {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-filter-chip {
    background: rgba(255, 59, 48, 0.1);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 700;
}

.search-filter-clear {
    color: #fff;
    text-decoration: none;
    opacity: 0.6;
    font-size: 0.8rem;
    border-bottom: 1px solid #444;
    margin-left: 10px;
}

.search-empty {
    text-align: center;
    padding: 50px;
    color: #666;
}

.search-empty-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.search-card {
    border-color: rgba(59, 130, 246, 0.24);
}

.search-card .stream-thumb {
    width: 100%;
}

.search-card .stream-thumb img {
    height: auto;
    aspect-ratio: 16/9;
}

/* Search results: grid layout (max 4 columns on desktop) */
.search-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 640px) {
    .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .search-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .search-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.search-grid .stream-card {
    height: 100%;
}

/* Side Mini Nav (PC only) */
.layout-with-side {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: var(--section-gap);
    align-items: start;
}

.side-mini-nav {
    position: static;
    top: auto;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--card-pad-sm) var(--space-2);
    border-radius: var(--card-radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.side-mini-title {
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    text-align: center;
}

.side-mini-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 10px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid transparent;
}

.side-mini-link i {
    font-size: 1.1rem;
}

.side-mini-link.active,
.side-mini-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.side-content {
    min-width: 0;
}

.side-content>.page-title:first-child,
.side-content>.stats-hub-title:first-child,
.side-content>.dashboard-desc:first-child {
    margin-top: 0;
}

.side-content> :first-child {
    margin-top: 0 !important;
}

@media (max-width: 1100px) {
    .layout-with-side {
        grid-template-columns: 1fr;
    }

    .side-mini-nav {
        display: none;
    }

    .stats-hub-period-mobile {
        display: flex !important;
        gap: 8px;
        margin: 0 0 14px;
        flex-wrap: wrap;
    }
}

/* Stats Hub */
.stats-hub-title {
    margin: 0 0 var(--section-gap);
    font-size: 1.4rem;
}

.stats-hub-period-mobile {
    display: none;
}

.stats-hub-subheading {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    padding: 8px 10px;
    border-left: 3px solid rgba(251, 191, 36, 0.7);
    background: rgba(251, 191, 36, 0.06);
    font-size: 0.9rem;
    color: #fcd34d;
}

.stats-hub-period-nav {
    margin: 6px 0 16px;
}

.stats-hub-link {
    color: var(--primary);
    text-decoration: none;
}

.stats-hub-link.is-secondary {
    color: var(--secondary);
}

.stats-hub-link.is-gold {
    color: var(--gold);
}

.stats-hub-link.is-green {
    color: #10b981;
}

.stats-hub-link.is-pink {
    color: #f472b6;
}

.stats-hub-chevron {
    font-size: 0.8em;
    opacity: 0.5;
}

.stats-hub-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    max-height: 400px;
}

.stats-hub-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stats-row {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #1a1a1a;
    overflow: hidden;
}

.stats-row-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--bar-width, 0%);
    background: linear-gradient(90deg, var(--bar-color, rgba(255, 255, 255, 0.06)) 0%, rgba(255, 255, 255, 0.01) 100%);
    z-index: 0;
}

.stats-row-rank {
    position: static;
    margin-right: 15px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-style: normal;
    z-index: 1;
}

.stats-row-name {
    flex: 1;
    min-width: 0;
    z-index: 1;
}

.stats-row-link {
    color: #ddd;
    font-weight: 600;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-row-val {
    font-family: var(--font-mono);
    font-weight: bold;
    color: #fff;
    z-index: 1;
    text-align: right;
}

.unit-small {
    font-size: 0.7em;
    opacity: 0.5;
    margin-left: 2px;
    font-weight: normal;
}

.fans-scroll-box::-webkit-scrollbar {
    width: 4px;
}

.fans-scroll-box::-webkit-scrollbar-track {
    background: transparent;
}

.fans-scroll-box::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.timeline-page-title {
    margin-bottom: 14px;
    font-size: 1.4rem;
}

/* Simple Ranking */
.simple-ranking-wrap {
    max-width: 940px;
    margin: 0 auto;
    padding: 20px;
}

.simple-ranking-head {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.simple-ranking-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.simple-ranking-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.simple-ranking-hero {
    text-align: left;
    border-left: 4px solid var(--secondary);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    margin-bottom: 40px;
    padding-left: 12px;
}

.simple-ranking-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin: 0;
    letter-spacing: 1px;
    color: #fff;
}

.simple-ranking-sub {
    color: #888;
    margin: 8px 0 0;
    font-size: 0.95rem;
}

.simple-ranking-card {
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-height: none;
    overflow: visible;
}

.simple-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.simple-ranking-empty {
    padding: 60px;
    text-align: center;
    color: #444;
    font-style: italic;
}

.simple-ranking-row {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #1a1a1a;
    overflow: hidden;
}

.simple-ranking-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--bar-width, 0%);
    background: linear-gradient(90deg, var(--bar-color, rgba(255, 255, 255, 0.06)) 0%, rgba(255, 255, 255, 0.01) 100%);
    z-index: 0;
}

.simple-ranking-rank {
    position: static;
    margin-right: 15px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-style: normal;
    z-index: 1;
    font-weight: 900;
}

.simple-ranking-name {
    flex: 1;
    min-width: 0;
    z-index: 1;
}

.simple-ranking-link {
    color: #eee;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.simple-ranking-link-text {
    font-size: 1.1rem;
}

.simple-ranking-val {
    font-family: var(--font-mono);
    font-weight: bold;
    color: #fff;
    z-index: 1;
    text-align: right;
    font-size: 1.1rem;
}

.simple-ranking-footer {
    margin-top: 40px;
    text-align: center;
}

.simple-ranking-top {
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 30px;
    background: #111;
    border: 1px solid #333;
}

/* Stream Graph Page */
.stream-graph-page .main-thumb-wrapper {
    width: 100%;
    max-width: 720px;
    margin: 0 auto 30px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.stream-graph-page .sg-sticky-scope {
    position: relative;
}

.stream-graph-page .sg-tag-row {
    max-width: 720px;
    margin: -18px auto 18px;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
}

.stream-graph-page .sg-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.22s ease, transform 0.18s ease;
}

.stream-graph-page .sg-tag-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
}

/* Desktop: large "glass" player that sticks until related sections */
@media (min-width: 900px) {
    .stream-graph-page .main-thumb-wrapper.sg-player-pin {
        max-width: min(80vw, 1280px);
        border-radius: 18px;
        border: 1px solid rgba(255, 255, 255, 0.10);
        background: linear-gradient(180deg, rgba(20, 20, 20, 0.75) 0%, rgba(8, 8, 8, 0.55) 100%);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 18px 70px rgba(0, 0, 0, 0.55);
    }

    .stream-graph-page .main-thumb-wrapper.sg-player-pin {
        position: sticky;
        top: 18px;
        z-index: 30;
    }

    .stream-graph-page .main-thumb-wrapper.sg-player-pin::before {
        content: "";
        position: absolute;
        inset: -24px -18px;
        background: radial-gradient(closest-side, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.0));
        filter: blur(10px);
        pointer-events: none;
        z-index: -1;
    }

    .stream-graph-page .main-thumb-wrapper.sg-player-pin .main-embed {
        border-radius: 18px;
        overflow: hidden;
    }

    .stream-graph-page .graph-container {
        max-width: min(80vw, 1280px);
        margin-left: auto;
        margin-right: auto;
    }

    .stream-graph-page .stat-cards-grid {
        max-width: min(80vw, 1280px);
        margin-left: auto;
        margin-right: auto;
    }

    .stream-graph-page .sg-tag-row {
        max-width: min(80vw, 1280px);
        margin-left: auto;
        margin-right: auto;
    }
}

.stream-graph-page .main-thumb-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.stream-graph-page .main-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

.stream-graph-page .main-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Lightweight YouTube embed (loads iframe only after click) */
.yt-lite {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    cursor: pointer;
}

@supports not (aspect-ratio: 16/9) {
    .yt-lite {
        height: 0;
        padding-top: 56.25%;
    }

    .yt-lite>* {
        position: absolute;
        inset: 0;
    }
}

.yt-lite-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-lite-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .35));
    opacity: .9;
    transition: opacity .22s ease;
}

.yt-lite-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .25);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

.yt-lite-play::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-38%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent rgba(255, 255, 255, .92);
}

.yt-lite-open {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    text-decoration: none;
    color: #fff;
    background: rgba(0, 0, 0, .45);
    border: 1px solid rgba(255, 255, 255, .18);
}

.yt-lite:hover .yt-lite-shade {
    opacity: 1;
}

.yt-lite:focus-visible {
    outline: 2px solid rgba(0, 190, 255, .7);
    outline-offset: 2px;
}

.yt-lite.is-loaded {
    cursor: default;
    background: transparent;
    border: none;
}

.yt-lite iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* If someone passes "main-embed" class, undo the legacy padding-top trick */
.stream-graph-page .yt-lite.main-embed {
    padding-top: 0;
    background: transparent;
}

.stream-graph-page .stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stream-graph-page .s-card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #333;
    padding: 15px;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.stream-graph-page .s-card-label {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.stream-graph-page .s-card-val {
    font-size: 1.2rem;
    font-weight: bold;
    font-family: var(--font-mono);
    color: #fff;
}

.s-card-val-ccv {
    color: #ef4444;
}

.s-card-val-early-avg {
    color: #fbbf24;
}

.s-card-val-early-gain {
    color: #3b82f6;
}

.s-card-val-sc {
    color: #e11d48;
}

.s-card-val-gift {
    color: #ec4899;
}

.s-card-val-mem {
    color: #10b981;
}

.sg-early-pct {
    font-size: 0.75em;
    color: #94a3b8;
}

.stream-graph-page .graph-container {
    background: rgba(10, 10, 10, 0.6);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #333;
}

.graph-title {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: #475569;
    font-weight: 700;
}

.graph-warning,
.graph-missing {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 6px;
    text-align: center;
}

.graph-warning {
    padding: 10px;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.graph-warning-note {
    font-size: 0.75rem;
    opacity: 0.8;
}

.graph-missing {
    padding: 20px;
    margin: 20px;
}

.graph-missing-icon {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.graph-missing-note {
    font-size: 0.9rem;
}

.graph-scheduled,
.graph-empty {
    color: #94a3b8;
    text-align: center;
    padding: 40px;
}

.graph-scheduled-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: inline-block;
}

.graph-scheduled-note {
    font-size: 0.8rem;
}

.graph-canvas {
    position: relative;
    height: 400px;
    width: 100%;
}

.related-section {
    margin-top: 40px;
}

.sec-title {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

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

.related-list>li {
    margin-bottom: 12px;
}

.related-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 6px 0 14px;
    overflow-y: visible;
}

.related-row .stream-card {
    min-width: 280px;
    max-width: 320px;
    flex: 0 0 auto;
}

.related-row.is-stacked .stream-card {
    flex-direction: column;
}

.related-row.is-stacked .stream-thumb {
    width: 100%;
}

.related-row.is-stacked .stream-thumb img {
    height: auto;
    aspect-ratio: 16/9;
}

@media (max-width: 768px) {
    .related-row .stream-card {
        min-width: 220px;
        max-width: 260px;
    }
}

@media (max-width: 640px) {
    .related-row .stream-card {
        min-width: 180px;
        max-width: 220px;
    }
}

.same-day-list .stream-thumb {
    width: 180px;
}

.same-day-list .stream-thumb img {
    height: auto;
    aspect-ratio: 16/9;
}

.same-day-row {
    display: grid;
    gap: 12px;
    overflow: visible;
    padding: 0;
}

.same-day-row .stream-card {
    max-width: none;
    min-width: 0;
}

@media (max-width: 640px) {
    .same-day-row {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        padding: 6px 0 14px;
    }

    .same-day-row .stream-card {
        min-width: 180px;
        max-width: 220px;
        flex: 0 0 auto;
    }

    .same-day-list .stream-card {
        flex-direction: column;
    }

    .same-day-list .stream-thumb {
        width: 100%;
    }
}

.chart-legend-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
    font-size: 0.75rem;
    color: #cbd5e1;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    white-space: nowrap;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.legend-dot.ccv {
    background: var(--oshi-color);
}

.legend-dot.sc {
    background: #e11d48;
    border: 1px dashed rgba(225, 29, 72, 0.8);
}

.legend-dot.cmt {
    background: #f59e0b;
}

.legend-dot.rate {
    background: rgba(245, 158, 11, 0.35);
    border: 1px solid rgba(245, 158, 11, 0.6);
}

.legend-dot.other {
    background: #fff;
    border: 1px solid #0f0f0f;
}

.yt-link-wrap {
    text-align: center;
}

.yt-link-btn {
    display: inline-block;
    background: #c4302b;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    margin: 20px 0;
    transition: 0.2s;
}

.yt-link-btn:hover {
    background: #e62117;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(196, 48, 43, 0.4);
}

.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    text-decoration: none;
    color: #ccc;
    transition: 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-btn.is-disabled {
    opacity: 0.5;
    background: #f1f5f9;
}

.nav-label {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 4px;
}

.nav-title {
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sg-debug {
    background: #111;
    border: 1px solid #333;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.sg-debug-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.sg-debug-line {
    margin-top: 6px;
}

.sg-title {
    font-size: 1.3rem;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #f1f5f9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.sg-title-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

.sg-live-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 6px;
    animation: sg-pulse 2s infinite;
}

.sg-title-external {
    font-size: 0.8em;
    opacity: 0.6;
    margin-left: 4px;
}

.sg-meta {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.sg-sep {
    margin: 0 8px;
}

.sg-meta-link {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
}

.sg-meta-note {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 15px;
}

.sg-meta-arrow {
    margin: 0 6px;
}

.sg-thumb-wrapper {
    position: relative;
}

.sg-thumb-link {
    display: block;
}

.sg-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s;
}

.sg-thumb-yt-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

@keyframes sg-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* Daily Ratio Card Special */
.ranking-card-daily-ratio {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
}

.ratio-val-high {
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: 700;
}

.ratio-val-low {
    color: var(--secondary);
    font-family: var(--font-mono);
    font-weight: 700;
}

/* =========================================
   10. Hamburger Menu (Mobile/Global)
   ========================================= */
.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 200;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 150;
    display: none;
    /* JS toggle */
    flex-direction: column;
    overflow-y: auto;
    padding: 60px 20px 40px;
}

.mobile-menu-overlay.open {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mm-section {
    margin-bottom: 25px;
}

.mm-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--primary);
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.mm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mm-grid li {
    list-style: none;
}

.mm-link {
    display: block;
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ddd;
    font-size: 0.85rem;
    text-align: center;
    transition: 0.2s;
}

.mm-link:hover {
    background: #333;
    color: #fff;
    border-color: var(--secondary);
}

/* Mobile Bottom Nav */
.has-mobile-nav {
    padding-bottom: 86px;
}

.mobile-bottom-nav {
    display: none;
}

/* ----------------------------- */
/* Shorts Corner                  */
/* ----------------------------- */
.shorts-corner {
    margin: 18px 0 26px;
}

.shorts-corner .section-title {
    margin: 10px 0 12px;
}

.shorts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 900px) {
    .shorts-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.shorts-grid {
    margin-top: 10px;
}

.shorts-ck {
    margin-top: -10px;
    padding: 6px 10px 10px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stream-card.is-short .thumb-badge.badge-status {
    /* keep LIVE/NEXT visible if any, but soften on shorts */
    opacity: 0.95;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 50%;
        bottom: 10px;
        -webkit-transform: translateX(-50%);
        transform: translateX(-50%);
        width: calc(100% - 24px);
        max-width: 520px;
        background: rgba(12, 12, 12, 0.92);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        padding: 8px 6px;
        gap: 4px;
        z-index: 1200;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    .mb-nav-item {
        flex: 1;
        text-decoration: none;
        color: #d1d5db;
        font-size: 0.7rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 6px 4px;
        border-radius: 12px;
        transition: 0.2s ease;
    }

    .mb-nav-item i {
        font-size: 1rem;
        color: #f8fafc;
    }

    .mb-nav-item:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .footer-nav,
    .site-footer-links {
        display: none;
    }

    .footer-copy,
    .site-footer {
        margin-top: 20px;
        padding-bottom: 110px;
    }

    .timeline-section:last-child,
    .stats-hub-grid>.timeline-section:last-child,
    .history-main-content>section:last-child {
        margin-bottom: 18px;
    }
}

.close-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

/* Animations */
.stream-card,
.ranking-card-detailed,
.ranking-card-ratio {
    animation: fadeIn 0.4s ease-out forwards;
}

.stream-card:hover {
    transform: none;
}

/* Better Ratio Card V2 */
.ranking-card-ratio {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    margin-bottom: 14px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s ease-out forwards;
}

.ratio-main-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.ratio-rank-big {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    font-style: italic;
    color: #444;
    min-width: 40px;
    text-align: center;
}

.rk-1 .ratio-rank-big {
    color: var(--gold);
}

.rk-2 .ratio-rank-big {
    color: #aaa;
}

.rk-3 .ratio-rank-big {
    color: #cd7f32;
}

.ratio-streamer-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #333;
}

.ratio-streamer-info {
    flex: 1;
    min-width: 0;
}

.ratio-name-line {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ratio-name-line a:hover {
    color: var(--secondary);
}

.ratio-badge-daily {
    display: inline-block;
    font-size: 0.65rem;
    background: #222;
    color: #888;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ratio-sub-metrics {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

.ratio-sub-label {
    font-size: 0.7rem;
    color: #555;
    font-weight: bold;
    text-transform: uppercase;
}

.ratio-counts {
    display: flex;
    gap: 10px;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.9rem;
}

.ratio-percent-large {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 20px;
}

.ratio-total-stat {
    border-left: 1px solid #222;
    padding-left: 20px;
    min-width: 140px;
}

.stat-label-dim {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
}

.stat-val-love {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--gold);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.oshi-mark {
    font-size: 1rem;
    opacity: 0.8;
}

/* Statistics Hub Grid */
.stats-hub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    content-visibility: auto;
    contain-intrinsic-size: 800px;
}

@media (min-width: 900px) {
    .stats-hub-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stream-grid,
.history-timeline-list,
.timeline-section-group {
    content-visibility: auto;
    contain-intrinsic-size: 700px;
}

.sg-next-guide {
    margin: 10px 0 16px;
}

.sg-next-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: #dbeafe;
    background: rgba(29, 78, 216, 0.15);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.86rem;
}

.history-related-link-wrap {
    margin-bottom: 8px;
}

.history-related-link {
    color: #93c5fd;
    font-size: 0.78rem;
    text-decoration: none;
}

.history-related-link:hover {
    color: #bfdbfe;
}

@media (min-width: 1400px) {
    .stats-hub-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Fix mobile grid issues */
@media (max-width: 600px) {
    .ratio-main-row {
        flex-wrap: wrap;
    }

    .ratio-percent-large {
        width: 100%;
        margin: 10px 0;
        text-align: center;
        font-size: 2rem;
    }

    .ratio-total-stat {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #222;
        padding-top: 10px;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

.unit-small {
    font-size: 0.7em;
    font-weight: normal;
    color: #888;
    margin: 0 2px;
}

/* News Ticker */
.news-bar {
    background: #000;
    border-bottom: 1px solid #222;
    padding: 8px 15px;
    font-size: 0.8rem;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.news-label {
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    font-weight: 800;
    font-size: 0.7rem;
    border-radius: 3px;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
}

.news-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 30s linear infinite;
    color: #ccc;
}

.news-content span {
    margin-right: 50px;
}

.news-content a {
    color: var(--secondary);
    font-weight: 700;
}

.news-content a:hover {
    text-decoration: underline;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* Mobile Overlay Menu Polish */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 40px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-overlay.open {
    left: 0;
}

.close-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.mm-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.mm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.mm-link {
    background: #111;
    border: 1px solid #222;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    color: #ccc;
    display: block;
}

.mm-link:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #333;
}

/* === Daily Summary Card === */
.daily-summary-card {
    background: linear-gradient(135deg, rgba(255, 107, 97, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid var(--border-highlight);
    border-radius: var(--card-radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-card);
}

.daily-summary-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin: 0 0 var(--space-5) 0;
    letter-spacing: 0.05em;
}

.daily-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.daily-stat-item {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius-md);
    padding: var(--space-4);
    text-align: center;
    transition: all 0.2s ease;
}

.daily-stat-item:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
}

.daily-stat-label {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.daily-stat-label i {
    color: var(--primary);
}

.daily-stat-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: var(--space-1);
}

.daily-stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

@media (max-width: 768px) {
    .daily-summary-stats {
        grid-template-columns: 1fr;
    }

    .daily-summary-title {
        font-size: 1.25rem;
    }

    .daily-stat-value {
        font-size: 1.5rem;
    }
}

/* --- Today's News Bar (Breaking News Style) --- */
.daily-news-container {
    background: linear-gradient(90deg, #111 0%, #0a0a0a 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--section-gap);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    height: 40px;
}

.daily-news-label {
    background: var(--primary);
    color: #000;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
    padding-right: 25px;
}

.daily-news-label i {
    animation: flash 2s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.daily-news-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.daily-news-content::-webkit-scrollbar {
    display: none;
}

.news-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 0.85rem;
    color: #eee;
}

.news-item-label {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-item-label i {
    color: var(--primary);
    opacity: 0.8;
}

.news-item-value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.news-item-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-left: 4px;
    opacity: 0.8;
}

.news-item.revenue .news-item-label i {
    color: var(--gold);
}

.news-divider {
    width: 1px;
    height: 16px;
    background: #333;
}

@media (max-width: 600px) {
    .daily-news-container {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        padding: 5px 0;
    }

    .daily-news-label {
        width: 100%;
        clip-path: none;
        padding: 5px 15px;
        font-size: 0.75rem;
        background: transparent;
        color: var(--primary);
        border-bottom: 1px solid #222;
        margin-bottom: 5px;
    }

    .daily-news-content {
        width: 100%;
        padding: 5px 15px 10px;
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    .news-divider {
        display: none;
    }
}
/* --- Shorts Ranking Styles --- */
.shorts-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.shorts-ranking-item {
    display: flex;
    align-items: center;
    background: #161616;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    gap: 15px;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.shorts-ranking-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: #1a1a1a;
}

.shorts-rank-badge {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border-radius: 6px;
    font-size: 1.1rem;
    flex-shrink: 0;
    color: #888;
    background: #252525;
    font-family: var(--font-heading);
}

.shorts-rank-badge.rank-1 { background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%); color: #000; box-shadow: 0 0 15px rgba(253, 185, 49, 0.2); }
.shorts-rank-badge.rank-2 { background: linear-gradient(135deg, #E0E0E0 0%, #BDBDBD 100%); color: #000; }
.shorts-rank-badge.rank-3 { background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%); color: #000; }

.shorts-thumb-wrap {
    width: 54px;
    height: 96px; /* 9:16 aspect ratio */
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background: #000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.shorts-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shorts-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.shorts-title-link {
    text-decoration: none;
    color: inherit;
}

.shorts-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0 0 6px;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shorts-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #aaa;
    align-items: center;
    margin-bottom: 8px;
}

.shorts-author {
    color: var(--primary);
    font-weight: 600;
}

.shorts-stats-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.shorts-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ccc;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
}

.shorts-stat.highlight {
    color: #fff;
}

.shorts-stat i { color: #888; }
.shorts-stat.highlight i { color: var(--primary); }
.shorts-stat:nth-child(2).highlight i { color: #f91880; } /* Likes pink */

@media (max-width: 600px) {
    .shorts-ranking-item {
        padding: 10px;
        gap: 10px;
    }
    .shorts-thumb-wrap {
        width: 48px;
        height: 85px;
    }
    .shorts-title {
        font-size: 0.9rem;
    }
    .shorts-rank-badge {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}
