
  :root {
    --midnight: #0d0f14;
    --ink: #161820;
    --charcoal: #1e2028;
    --slate: #2a2d38;
    --steel: #3d4152;
    --red-string: #c23b3b;
    --red-glow: #d94f4f;
    --red-deep: #8b2020;
    --parchment: #f2e8d5;
    --cream: #ebe0cc;
    --cork: #b8a88e;
    --text-primary: #e8e4de;
    --text-secondary: #9a9690;
    --text-muted: #6b6862;
    --pin-brass: #c9a84c;
    --evidence-blue: #4a7fb5;
    --solved-green: #4a8b6e;
    --cold-case: #7b6fa3;
    --live-red: #e53e3e;

    --nav-h: 48px;
    --chat-w: 340px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
  }

  /* ── Light Theme ── */
  [data-theme="light"] {
    --midnight: #f5f2ee;
    --ink: #ffffff;
    --charcoal: #f0ede8;
    --slate: #d8d3ca;
    --steel: #b8b3aa;
    --parchment: #1a1814;
    --cream: #2a2520;
    --cork: #6b6560;
    --text-primary: #1a1814;
    --text-secondary: #4a4744;
    --text-muted: #8a8784;
  }

  /* Nav: semi-transparent bg uses rgba so we need an explicit light override */
  [data-theme="light"] .nav { background: rgba(240,237,232,0.98); }
  /* Logo swap (player doesn't load global.css) */
  .logo-light { display: none; }
  .logo-dark  { display: inline-block; }
  [data-theme="light"] .logo-light { display: inline-block; }
  [data-theme="light"] .logo-dark  { display: none; }

  /* Pins shop: light theme */
  [data-theme="light"] .pins-shop { background: #f5f2ee; border-color: rgba(0,0,0,0.1); }

  /* Super chat modal: hardcoded dark bg */
  [data-theme="light"] .sc-modal { background: #f5f2ee; }

  /* Login modal: hardcoded dark bg */
  [data-theme="light"] .login-modal-card { background: #fff; }

  /* Splash overlay is positioned over the dark video — keep its text light */
  [data-theme="light"] .splash-title { color: #f2e8d5; }
  [data-theme="light"] .splash-meta  { color: #9a9690; }
  [data-theme="light"] .splash-viewers-row { color: #9a9690; }
  [data-theme="light"] .splash-bottom-hint { color: #9a9690; }

  /* White-alpha hover/border states → dark-alpha in light mode */
  [data-theme="light"] .msg:hover { background: rgba(0,0,0,0.04); }
  [data-theme="light"] .msg-mod-btn { background: rgba(0,0,0,0.05); }
  [data-theme="light"] .msg-mod-btn:hover { background: rgba(194,59,59,0.12); }
  [data-theme="light"] .ci-mod-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }
  [data-theme="light"] .ci-mod-btn:hover { background: rgba(0,0,0,0.08); }
  [data-theme="light"] .chat-filter-btn { border-color: rgba(0,0,0,0.15); }
  [data-theme="light"] .chat-filter-btn:hover:not(.active) { border-color: rgba(0,0,0,0.25); }
  [data-theme="light"] .ai-context-footer { border-top-color: rgba(0,0,0,0.08); }
  [data-theme="light"] .board-header { border-bottom-color: rgba(0,0,0,0.08); }
  [data-theme="light"] .lb-row { background: rgba(0,0,0,0.03); }
  [data-theme="light"] .lb-row:hover { background: rgba(0,0,0,0.06); }
  [data-theme="light"] .msg-system { border-color: rgba(0,0,0,0.1); }

  /* Darken accent colors that are too light on a white background */
  [data-theme="light"] { --pin-brass: #92750f; }
  [data-theme="light"] .lb-pins,
  [data-theme="light"] .msg-gift { color: #6d28d9; }
  [data-theme="light"] .points-hud-earn,
  [data-theme="light"] .pred-result-win { color: #15803d; }
  [data-theme="light"] .login-modal-sent { color: #047857; }

  /* Theme toggle button */
  .player-theme-toggle {
    background: none;
    border: 1px solid var(--slate);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
  }
  .player-theme-toggle:hover { color: var(--text-secondary); border-color: var(--steel); }
  .player-theme-toggle svg { pointer-events: none; }
  .theme-icon-moon { display: none; }
  .theme-icon-sun  { display: block; }
  [data-theme="light"] .theme-icon-moon { display: block; }
  [data-theme="light"] .theme-icon-sun  { display: none; }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html, body {
    height: 100%;
    overflow: hidden;
    background: var(--midnight);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent; /* no blue flash on tap */
  }

  /* ============================================================
     LAYOUT — Full viewport, no scroll
     Desktop: [Video + Controls + Info] [Chat Sidebar]
     Mobile:  [Video] [Tabs: Chat / AI / Case] stacked
  ============================================================ */
  .app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding-top: var(--safe-t); /* standalone mode: push below status bar */
  }

  /* ============= TOP NAV ============= */
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    padding: 0 16px;
    background: var(--ink);
    border-bottom: 1px solid var(--slate);
    flex-shrink: 0;
    z-index: 100;
  }

  .nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .nav-logo-link {
    display: flex; align-items: center;
    text-decoration: none;
  }
  .nav-logo-img {
    height: 34px; width: auto;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .nav-case-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    background: none;
    border: 1px solid var(--slate);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
  }

  .nav-case-btn:hover {
    border-color: var(--red-string);
    color: var(--text-secondary);
  }

  .nav-share-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--slate);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
  }

  .nav-share-btn:hover {
    border-color: var(--red-string);
    color: var(--text-secondary);
  }

  /* ============= MAIN CONTENT ============= */
  .main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
  }

  /* ============= VIDEO COLUMN ============= */
  .video-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  /* VIDEO WRAPPER — maintains 16:9 with click shield */
  .video-wrapper {
    position: relative;
    flex: 1;
    background: #000;
    min-height: 0;
    overflow: hidden;
  }

  .video-wrapper iframe,
  .video-wrapper #ytPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1;
  }

  /* CLICK SHIELD — captures all pointer events on the video area
     Prevents clicks from reaching YouTube iframe */
  .click-shield {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
  }

  /* Top gradient overlay for our badges */
  .video-overlay-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
    z-index: 20;
    pointer-events: none;
  }

  .overlay-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: auto;
  }

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

  .badge-live-dot {
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
  }

  .badge-live-text {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
  }

  .badge-viewers {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .badge-viewers-dot {
    width: 5px; height: 5px;
    background: var(--live-red);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
  }

  .badge-viewers-text {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #fff;
    font-weight: 600;
  }

  /* ============= CONTROL BAR — unified controls + case context ============= */
  .control-bar {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 10px 0 6px;
    background: var(--ink);
    border-top: 1px solid var(--slate);
    flex-shrink: 0;
  }

  /* Play button */
  .cb-play {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border: none;
    background: transparent;
    color: var(--parchment);
    font-size: 15px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
  }

  .cb-play:hover {
    background: var(--charcoal);
  }

  /* Separator dot */
  .cb-dot {
    color: var(--steel);
    font-size: 5px;
    margin: 0 8px;
    flex-shrink: 0;
    line-height: 1;
  }

  /* Case title */
  .cb-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--parchment);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  /* Source name — visible, not muted */
  .cb-source {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .cb-verified {
    width: 13px; height: 13px;
    background: var(--evidence-blue);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    color: #fff;
    flex-shrink: 0;
  }

  /* Elapsed time */
  .cb-time {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Right side */
  .cb-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 10px;
  }

  /* Case tag — red accent like the old overlay */
  .cb-case-tag {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--red-string);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .cb-case-name {
    font-family: 'Libre Baskerville', serif;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--parchment);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
  }

  .cb-case-name:hover {
    color: var(--red-string);
  }

  /* ============= VOLUME — YouTube-style inline horizontal ============= */
  .cb-vol-wrap {
    display: flex;
    align-items: center;
  }

  .cb-mute {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
  }

  .cb-mute:hover {
    background: var(--charcoal);
    color: var(--parchment);
  }

  .cb-vol-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease, margin 0.2s ease;
    display: flex;
    align-items: center;
    margin-left: 0;
  }

  .cb-vol-wrap:hover .cb-vol-slider,
  .cb-vol-slider.dragging {
    width: 64px;
    margin-left: 4px;
  }

  .cb-vol-track {
    width: 64px;
    height: 4px;
    background: var(--steel);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
  }

  .cb-vol-fill {
    height: 100%;
    width: 0%;
    background: var(--text-secondary);
    border-radius: 2px;
    pointer-events: none;
    transition: background 0.15s;
  }

  .cb-vol-track:hover .cb-vol-fill,
  .cb-vol-slider.dragging .cb-vol-fill {
    background: var(--red-string);
  }

  .cb-vol-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--parchment);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
  }

  .cb-vol-track:hover .cb-vol-thumb,
  .cb-vol-slider.dragging .cb-vol-thumb {
    opacity: 1;
  }

  /* ============= CHAT SIDEBAR ============= */
  .chat-sidebar {
    width: var(--chat-w);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--slate);
    background: var(--ink);
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
  }

  /* Chat header — tabs only */
  .chat-header {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    border-bottom: 1px solid var(--slate);
    flex-shrink: 0;
  }

  .ch-tabs {
    display: flex;
    gap: 2px;
    background: var(--charcoal);
    padding: 2px;
    border-radius: 6px;
    width: 100%;
  }

  .ch-tab {
    flex: 1;
    padding: 5px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: transparent;
    white-space: nowrap;
    text-align: center;
    position: relative;
  }

  .ch-tab.active {
    color: var(--parchment);
    background: var(--slate);
  }

  .ch-tab:hover:not(.active) {
    color: var(--text-secondary);
  }

  /* Badge inside Chat tab (online count — desktop only) */
  .ch-tab-badge {
    font-size: 9px;
    font-weight: 700;
    color: var(--evidence-blue);
    margin-left: 2px;
  }

  /* ── Chat Info Bar (stream filter + count + points/pins) ── */
  .chat-info-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.015);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
    font-size: 10px;
  }
  .cib-dot {
    width: 5px; height: 5px;
    background: var(--evidence-blue);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
  }
  .cib-count {
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 600;
  }
  .cib-spacer { flex: 1; }
  .cib-hud {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    padding: 1px 6px;
    border-radius: 4px;
  }
  .cib-hud-pts {
    color: var(--evidence-blue);
    background: rgba(74,127,181,0.08);
  }
  .cib-hud-pins {
    color: var(--pin-brass);
    background: rgba(201,168,76,0.08);
    cursor: pointer;
    transition: background 0.15s;
  }
  .cib-hud-pins:hover { background: rgba(201,168,76,0.15); }
  .cib-hud-plus {
    font-size: 10px;
    font-weight: 800;
    opacity: 0.5;
    margin-left: 1px;
  }
  /* Stream filter buttons inside info bar */
  .cib-filter {
    display: flex;
    gap: 2px;
    margin-right: 2px;
  }
  .cib-filter-btn {
    font-size: 9px;
    padding: 1px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
  }
  .cib-filter-btn.active {
    background: var(--evidence-blue);
    color: #fff;
    border-color: var(--evidence-blue);
  }
  .cib-filter-btn:hover:not(.active) {
    border-color: rgba(255,255,255,0.2);
  }

  /* ── Highlights strip (pinned + superchat pills + prediction toggle) ── */
  .chat-highlights {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }

  /* Super chat pills — horizontal scroll */
  .sc-pills {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
  }
  .sc-pills::-webkit-scrollbar { display: none; }
  .sc-pill {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.15s;
  }
  .sc-pill:hover { opacity: 0.8; }
  .sc-pill-name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
  .sc-pill-amt { font-size: 9px; opacity: 0.8; }
  .sc-pill-1 { background: rgba(246,224,94,0.15); color: #f6e05e; border: 1px solid rgba(246,224,94,0.3); }
  .sc-pill-2 { background: rgba(237,137,54,0.15); color: #ed8936; border: 1px solid rgba(237,137,54,0.3); }
  .sc-pill-3 { background: rgba(229,62,62,0.15); color: #e53e3e; border: 1px solid rgba(229,62,62,0.3); }
  .sc-pill-4 { background: rgba(159,122,234,0.15); color: #9f7aea; border: 1px solid rgba(159,122,234,0.3); }
  .sc-pill-5 { background: rgba(229,62,62,0.2); color: #fff; border: 1px solid rgba(229,62,62,0.5); }

  /* Pinned message — single line in highlights */
  .hl-pinned {
    padding: 3px 10px;
    flex-shrink: 0;
  }
  .hl-pinned .msg-pinned {
    padding: 4px 8px;
    background: rgba(194,59,59,0.06);
    border: 1px solid rgba(194,59,59,0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }
  .hl-pinned .msg-pinned-label {
    font-family: 'Space Mono', monospace;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--red-string);
    font-weight: 700;
    flex-shrink: 0;
  }
  .hl-pinned .msg-pinned-text {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }
  .hl-pinned .msg-pinned-dismiss {
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    padding: 0 2px;
  }
  .hl-pinned .msg-pinned-dismiss:hover { color: var(--text-primary); }

  /* Prediction toggle — in highlights strip */
  .hl-pred-toggle {
    display: flex; align-items: center; gap: 6px; padding: 4px 10px;
    cursor: pointer; user-select: none;
  }
  .hl-pred-toggle:hover { background: rgba(255,255,255,0.02); }
  .hl-pred-icon { font-size: 10px; transition: transform 0.2s; flex-shrink: 0; color: var(--evidence-blue); }
  .hl-pred-toggle.collapsed .hl-pred-icon { transform: rotate(-90deg); }
  .hl-pred-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); font-family: 'Space Mono', monospace; flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .hl-pred-summary {
    font-size: 9px; color: var(--text-secondary); font-family: 'Space Mono', monospace;
    white-space: nowrap; flex-shrink: 0;
  }

  /* Stream filter — compact pill toggle */
  .chat-filter-pill {
    display: flex;
    gap: 3px;
    padding: 3px 10px;
    flex-shrink: 0;
  }
  .cfp-btn {
    font-size: 9px;
    padding: 1px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }
  .cfp-btn.active {
    background: var(--evidence-blue);
    color: #fff;
    border-color: var(--evidence-blue);
  }
  .cfp-btn:hover:not(.active) {
    border-color: rgba(255,255,255,0.2);
  }

  /* Legacy status bar — hidden (replaced by header HUD) */
  .chat-status-bar { display: none; }
  .chat-status-dot, .chat-status-text, .chat-status-count { display: none; }
  .chat-filter-bar { display: none; }
  .chat-filter-label { display: none; }
  .chat-filter-btn { display: none; }

  /* Chat messages area */
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    scroll-behavior: smooth;
  }

  /* Scrollbar styling */
  .chat-messages::-webkit-scrollbar {
    width: 4px;
  }

  .chat-messages::-webkit-scrollbar-track {
    background: transparent;
  }

  .chat-messages::-webkit-scrollbar-thumb {
    background: var(--steel);
    border-radius: 2px;
  }

  /* Pinned message bar — now inside highlights strip */
  #pinnedBar { flex-shrink: 0; }

  /* Legacy pinned message (still used in some contexts) */
  .msg-pinned {
    padding: 4px 8px;
    background: rgba(194,59,59,0.06);
    border: 1px solid rgba(194,59,59,0.15);
    border-radius: 6px;
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .msg-pinned-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--red-string);
    margin-bottom: 4px;
  }

  .msg-pinned-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
  }

  /* AI insight block */
  .msg-ai {
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(194,59,59,0.05), rgba(74,127,181,0.05));
    border: 1px solid rgba(194,59,59,0.12);
    border-radius: 8px;
    margin-bottom: 4px;
    flex-shrink: 0;
  }

  .msg-ai-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--red-string);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .msg-ai-dot {
    width: 5px; height: 5px;
    background: var(--red-string);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
  }

  .msg-ai-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-style: italic;
  }

  /* Chat message */
  .msg {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.45;
    transition: background 0.15s;
  }

  .msg:hover {
    background: rgba(255,255,255,0.02);
  }

  .msg-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 4px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 3px;
    line-height: 1.4;
  }

  .badge-m { background: rgba(201,168,76,0.12); color: var(--pin-brass); border: 1px solid rgba(201,168,76,0.2); }
  .badge-mod { background: rgba(74,139,110,0.12); color: var(--solved-green); border: 1px solid rgba(74,139,110,0.2); }
  .badge-c { background: rgba(194,59,59,0.12); color: var(--red-string); border: 1px solid rgba(194,59,59,0.2); }

  .msg-name {
    font-weight: 600;
    margin-right: 5px;
    cursor: pointer;
  }

  .msg-name:hover { text-decoration: underline; }

  .name-member { color: var(--pin-brass); }
  .name-mod { color: var(--solved-green); }
  .name-creator { color: var(--red-string); }
  .name-regular { color: var(--evidence-blue); }

  .msg-text { color: var(--text-secondary); }

  /* System message */
  .msg-system {
    text-align: center;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--text-muted);
    border: 1px dashed rgba(255,255,255,0.06);
    border-radius: 6px;
  }

  .msg-system strong { color: var(--red-string); }
  .msg-system.msg-error { color: var(--red-string); border-color: rgba(194,59,59,0.2); }

  /* Avatars in chat */
  .msg-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
  }
  .msg-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #e8e4de;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* Message with avatar: flex row */
  .msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }
  .msg-body {
    min-width: 0;
    flex: 1;
  }

  /* Mod controls on hover */
  .msg-mod {
    display: none;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
  }
  .msg:hover .msg-mod {
    display: flex;
  }
  .msg-mod-btn {
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    width: 18px; height: 18px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
  }
  .msg-mod-btn:hover {
    background: rgba(194,59,59,0.2);
    color: var(--red-string);
  }
  .msg-unpin-btn {
    position: absolute;
    top: 6px; right: 6px;
  }
  .msg-pinned {
    position: relative;
  }

  /* Mod toggle icon */
  .ci-mod-toggle {
    position: absolute;
    top: -20px;
    right: 6px;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.15s;
    border-radius: 3px;
  }
  .ci-mod-toggle:hover { opacity: 0.7; }
  .ci-mod-toggle.active { opacity: 1; background: rgba(255,255,255,0.05); }

  /* Mod bar above chat input (hidden by default) */
  .ci-mod-bar {
    display: flex;
    gap: 4px;
    padding: 2px 0 4px;
  }
  .ci-mod-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
  }
  .ci-mod-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
  }

  /* Chat input */
  .chat-input {
    padding: 6px 8px;
    border-top: 1px solid var(--slate);
    flex-shrink: 0;
    position: relative;
  }

  .ci-box {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 20px;
    transition: border-color 0.15s;
  }

  .ci-box:focus-within {
    border-color: var(--red-string);
  }

  /* Plus button (replaces separate gift + super buttons) */
  .ci-plus {
    width: 26px; height: 26px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    line-height: 1;
  }
  .ci-plus:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
  .ci-plus.active { background: var(--red-string); color: #fff; border-color: var(--red-string); transform: rotate(45deg); }

  /* Extras popup (gift + super) */
  .ci-extras {
    position: absolute;
    bottom: 100%;
    right: 8px;
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 8px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
    margin-bottom: 4px;
    z-index: 10;
  }
  .ci-extra-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
  }
  .ci-extra-btn:hover { background: rgba(255,255,255,0.08); color: var(--parchment); }
  .ci-extra-gift:hover { border-color: rgba(168,85,247,0.4); color: #a855f7; }
  .ci-extra-super:hover { border-color: rgba(201,168,76,0.4); color: var(--pin-brass); }

  .ci-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
  }

  .ci-field::placeholder {
    color: var(--text-muted);
  }

  .ci-send {
    width: 28px; height: 28px;
    background: var(--red-string);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
  }

  .ci-send:hover { background: var(--red-glow); }

  /* ── Pins HUD (legacy — hidden, replaced by ch-hud) ── */
  .pins-hud { display: none; }
  .pins-hud-icon { font-size: 10px; }
  .pins-hud-bal { font-weight: 700; font-family: 'Space Mono', monospace; font-size: 10px; }
  .pins-hud-buy {
    background: rgba(201,168,76,0.2);
    border: none;
    color: var(--pin-brass);
    width: 16px; height: 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-left: 2px;
  }
  .pins-hud-buy:hover { background: rgba(201,168,76,0.35); }

  /* ── Points HUD (legacy — hidden, replaced by ch-hud) ── */
  .points-hud { display: none; }
  .points-hud-icon { font-size: 10px; }
  .points-hud-bal { font-weight: 700; font-family: 'Space Mono', monospace; font-size: 10px; }
  .points-hud-earn {
    color: #4ade80;
    font-size: 9px;
    font-weight: 700;
    animation: ptsFade 2s ease-out forwards;
    position: absolute;
    top: -12px;
    right: 0;
    pointer-events: none;
  }
  @keyframes ptsFade {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
  }

  /* ── Prediction Toggle Bar (legacy class compat) ── */
  .pred-toggle {
    display: flex; align-items: center; gap: 6px; padding: 4px 10px;
    cursor: pointer; flex-shrink: 0; user-select: none;
  }
  .pred-toggle:hover { background: rgba(255,255,255,0.02); }
  .pred-toggle-icon { font-size: 10px; transition: transform 0.2s; flex-shrink: 0; color: var(--evidence-blue); }
  .pred-toggle.collapsed .pred-toggle-icon { transform: rotate(-90deg); }
  .pred-toggle-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); font-family: 'Space Mono', monospace; flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .pred-toggle-summary {
    font-size: 9px; color: var(--text-secondary); font-family: 'Space Mono', monospace;
    white-space: nowrap; flex-shrink: 0;
  }

  /* ── Prediction Banner ── */
  .pred-banner {
    flex-shrink: 0;
    margin: 0 8px 2px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 6px;
    overflow: hidden;
  }
  .pred-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(74,127,181,0.08);
    border-bottom: 1px solid var(--slate);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--evidence-blue);
  }
  .pred-timer {
    margin-left: auto;
    color: #22c55e;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
  }
  .pred-timer.pred-urgent { color: #ef4444; }
  .pred-title {
    padding: 8px 10px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
  }
  .pred-options {
    display: flex;
    gap: 6px;
    padding: 0 10px;
  }
  .pred-opt {
    flex: 1;
    text-align: center;
    padding: 10px 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid var(--slate);
    transition: all 0.2s;
    background: var(--ink);
  }
  .pred-opt:hover:not(.pred-locked) {
    border-color: var(--evidence-blue);
    background: rgba(74,127,181,0.06);
  }
  .pred-opt.pred-opt-a.pred-selected {
    border-color: var(--evidence-blue);
    background: rgba(74,127,181,0.12);
    box-shadow: 0 0 8px rgba(74,127,181,0.2);
  }
  .pred-opt.pred-opt-b.pred-selected {
    border-color: var(--pin-brass);
    background: rgba(201,168,76,0.1);
    box-shadow: 0 0 8px rgba(201,168,76,0.2);
  }
  .pred-opt.pred-locked { cursor: default; opacity: 0.6; }
  .pred-opt-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
  }
  .pred-opt-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 2px;
  }
  .pred-opt-pool {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
  }
  .pred-opt-return {
    font-size: 10px;
    color: var(--evidence-blue);
    font-weight: 700;
  }
  .pred-opt.pred-opt-b .pred-opt-return { color: var(--pin-brass); }
  .pred-opt-voters {
    font-size: 9px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
  }
  .pred-bar {
    display: flex;
    height: 4px;
    margin: 8px 10px 0;
    border-radius: 2px;
    overflow: hidden;
    background: var(--slate);
  }
  .pred-bar-a {
    background: var(--evidence-blue);
    transition: width 0.3s;
  }
  .pred-bar-b {
    background: var(--pin-brass);
    transition: width 0.3s;
  }
  .pred-bet-row {
    padding: 8px 10px 10px;
  }
  .pred-bet-presets {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
  }
  .pred-preset {
    flex: 1;
    padding: 4px 0;
    background: var(--ink);
    border: 1px solid var(--slate);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    cursor: pointer;
    transition: all 0.15s;
  }
  .pred-preset:hover {
    border-color: var(--evidence-blue);
    color: var(--text-primary);
    background: rgba(74,127,181,0.06);
  }
  .pred-bet-controls {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .pred-bet-input {
    flex: 1;
    background: var(--ink);
    border: 1px solid var(--slate);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 7px 10px;
    font-size: 13px;
    font-family: 'Space Mono', monospace;
    outline: none;
    min-width: 0;
  }
  .pred-bet-input:focus { border-color: var(--evidence-blue); }
  .pred-bet-input::-webkit-outer-spin-button,
  .pred-bet-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .pred-bet-input { -moz-appearance: textfield; }
  .pred-bet-input::placeholder { color: var(--text-muted); font-size: 11px; }
  .pred-bet-btn {
    padding: 7px 18px;
    background: var(--evidence-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .pred-bet-btn:hover { filter: brightness(1.15); }
  .pred-bet-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .pred-my-bet {
    padding: 4px 10px 8px;
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
  }
  .pred-my-bet strong { color: var(--evidence-blue); }

  /* Prediction result overlay */
  .pred-result {
    padding: 10px;
    text-align: center;
  }
  .pred-result-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }
  .pred-result-win { color: #4ade80; }
  .pred-result-lose { color: #ef4444; }
  .pred-result-refund { color: var(--pin-brass); }
  .pred-result-detail {
    font-size: 11px;
    color: var(--text-secondary);
  }

  /* ── Pins Shop (overlays entire sidebar) ── */
  .pins-shop-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 199;
    display: none;
  }
  .pins-shop {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 420px;
    background: var(--midnight);
    border: 1px solid var(--slate);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    z-index: 200;
    padding: 24px 20px;
    overflow-y: auto;
    max-height: 90vh;
  }
  .pins-shop-inner {
    width: 100%;
  }
  .pins-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }
  .pins-shop-header span {
    font-size: 16px;
    font-weight: 800;
    color: var(--pin-brass);
    letter-spacing: 0.5px;
  }
  .pins-shop-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
  }
  .pins-shop-close:hover {
    background: var(--slate);
    color: var(--text-primary);
  }
  .pins-shop-packages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pins-pkg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 10px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-align: center;
    color: var(--text-primary);
    font-family: inherit;
  }
  .pins-pkg:hover {
    border-color: var(--pin-brass);
    background: rgba(201,168,76,0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  .pins-pkg:active {
    transform: translateY(0);
  }
  .pins-pkg-amount {
    font-size: 18px;
    font-weight: 800;
    color: var(--pin-brass);
    font-family: 'Space Mono', monospace;
  }
  .pins-pkg-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
  }
  .pins-pkg-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .pins-pkg-badge {
    position: absolute;
    top: -8px; left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--pin-brass);
    color: var(--midnight);
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(201,168,76,0.3);
    white-space: nowrap;
  }
  .pins-pkg-best { grid-column: 1 / -1; border-color: rgba(201,168,76,0.3); }
  .pins-pkg-popular { border-color: rgba(74,127,181,0.3); }
  .pins-shop-footer {
    text-align: center;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 14px;
    letter-spacing: 0.5px;
    opacity: 0.7;
  }

  /* ── Tier Selector ── */
  /* ── Super Chat Modal (YouTube-style bottom sheet) ── */
  .sc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
  }
  .sc-modal {
    position: fixed;
    bottom: 0;
    right: 0;
    width: var(--chat-w);
    background: #1a1c25;
    border-radius: 16px 16px 0 0;
    padding: 20px 18px 28px;
    z-index: 191;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    animation: scSlideUp 0.22s ease;
  }
  @keyframes scSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .sc-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .sc-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .sc-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
  }
  .sc-modal-close:hover { background: var(--slate); color: var(--text-primary); }
  .sc-modal-headline {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: -4px;
  }
  .sc-modal-sub {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
  }
  /* Preview card */
  .sc-preview-card {
    border-radius: 12px;
    border: 2px solid #f6e05e;
    padding: 12px 14px;
    background: rgba(246,224,94,0.06);
    transition: border-color 0.2s, background 0.2s;
  }
  .sc-preview-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  .sc-preview-av {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--slate);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
    overflow: hidden;
  }
  .sc-preview-av img { width: 100%; height: 100%; object-fit: cover; }
  .sc-preview-name {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sc-preview-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f6e05e;
    color: #1a1c25;
    font-family: 'Space Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
  }
  .sc-preview-msg {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    resize: none;
    height: 52px;
  }
  .sc-preview-msg::placeholder { color: rgba(154,150,144,0.6); }
  /* Stats row */
  .sc-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    padding: 4px 0;
  }
  .sc-stat-item strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
  }
  .sc-stat-item span {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  /* Slider */
  .sc-slider-wrap { padding: 0 2px; }
  .sc-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, #f6e05e 0%, #ed8936 25%, #e53e3e 50%, #9f7aea 75%, #c23b3b 100%);
    outline: none;
    cursor: pointer;
  }
  .sc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #f6e05e;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  }
  .sc-slider::-moz-range-thumb {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #f6e05e;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  }
  .sc-tier-names {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
  }
  .sc-tier-names span {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    flex: 1;
  }
  .sc-balance-row {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
  }
  .sc-send-btn {
    width: 100%;
    padding: 14px;
    background: #2d5ff5;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    margin-top: 2px;
  }
  .sc-send-btn:hover { background: #3d6ff5; }
  .sc-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  @media (max-width: 768px) {
    .sc-modal { width: 100%; right: 0; left: 0; }
  }

  /* ── Super Chat Carousel ── */
  .sc-carousel {
    display: none; /* Replaced by sc-pills in highlights strip */
  }
  .sc-carousel::-webkit-scrollbar { display: none; }

  .sc-card {
    min-width: 120px;
    max-width: 160px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 8px;
    padding: 8px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }
  .sc-card-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
  }
  .sc-card-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }
  .sc-card-amount {
    font-size: 8px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    color: #fff;
    flex-shrink: 0;
  }
  .sc-card-text {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .sc-card-timer {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: 'Space Mono', monospace;
  }

  /* ── Super Chat Messages (inline) ── */
  .msg-super {
    flex-direction: column;
    padding: 8px 10px;
    margin: 4px 0;
    border-radius: 8px;
    animation: superChatGlow 0.5s ease;
  }
  .msg-super-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
  }
  .msg-super-info {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
  }
  .msg-super-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    margin-left: auto;
  }
  .msg-super-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    padding: 0 8px 4px;
  }

  .msg-super-1 { background: rgba(246,224,94,0.08); border-left: 3px solid #f6e05e; }
  .msg-super-1 .msg-super-badge { background: #f6e05e; color: #1a1a1a; }
  .msg-super-2 { background: rgba(237,137,54,0.10); border-left: 3px solid #ed8936; }
  .msg-super-2 .msg-super-badge { background: #ed8936; color: #1a1a1a; }
  .msg-super-3 { background: rgba(229,62,62,0.10); border-left: 3px solid #e53e3e; }
  .msg-super-3 .msg-super-badge { background: #e53e3e; color: #fff; }
  .msg-super-4 { background: rgba(159,122,234,0.10); border-left: 3px solid #9f7aea; }
  .msg-super-4 .msg-super-badge { background: #9f7aea; color: #fff; }
  .msg-super-5 { background: rgba(229,62,62,0.12); border-left: 3px solid #e53e3e; border-width: 3px; }
  .msg-super-5 .msg-super-badge { background: #e53e3e; color: #fff; }

  @keyframes superChatGlow {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
  }

  .mobile-tab-bar {
    display: none;
  }

  /* ============= SPLASH OVERLAY ============= */
  .splash-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.5s ease, visibility 0.5s ease;
  }

  .splash-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .splash-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(13,15,20,0.75) 0%, rgba(13,15,20,0.92) 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .splash-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
  }

  .splash-case-tag {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--red-string);
    margin-bottom: 12px;
  }

  .splash-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--parchment);
    line-height: 1.2;
    margin-bottom: 12px;
    max-width: 500px;
  }

  .splash-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    font-size: 13px;
    color: var(--text-secondary);
  }

  .splash-source {
    padding: 2px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
  }

  .splash-sep { opacity: 0.3; }

  .splash-live-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--live-red);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
  }

  .splash-live-dot {
    width: 7px; height: 7px;
    background: var(--live-red);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
  }

  .splash-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 36px;
    background: var(--red-string);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 0 rgba(194,59,59,0.4);
    animation: pulse-btn 2s ease-in-out infinite;
  }

  @keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(194,59,59,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(194,59,59,0); }
  }

  .splash-play-btn:hover {
    background: var(--red-glow);
    transform: scale(1.04);
    animation: none;
    box-shadow: 0 8px 32px rgba(194,59,59,0.35);
  }

  .splash-play-icon {
    font-size: 20px;
    color: #fff;
  }

  .splash-play-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
  }

  .splash-viewers-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
  }

  .splash-viewers-dot {
    width: 6px; height: 6px;
    background: var(--live-red);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
  }

  .splash-bottom-hint {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    z-index: 2;
    opacity: 0.7;
  }

  /* ============================================================
     RESPONSIVE — MOBILE
  ============================================================ */
  @media (max-width: 768px) {
    :root {
      --nav-h: 44px;
    }

    .nav-logo-img { height: 30px; }
    .nav-case-btn span.desktop-text { display: none; }
    .user-pill-name { display: none; }
    .user-pill-chevron { display: none; }
    .user-pill { padding: 3px; gap: 0; }

    /* Stack layout */
    .main {
      flex-direction: column;
    }

    /* Video takes fixed 16:9 ratio on mobile */
    .video-col {
      flex: none;
    }

    .video-wrapper {
      flex: none;
      aspect-ratio: 16/9;
      min-height: unset;
    }

    /* Control bar + stream info hidden on mobile */
    .control-bar { display: none; }

    /* Chat takes remaining space */
    .chat-sidebar {
      flex: 1;
      width: 100%;
      border-left: none;
      border-top: 1px solid var(--slate);
      min-height: 0;
    }

    /* Mobile tab bar — compact with HUD */
    .mobile-tab-bar {
      display: flex;
      align-items: center;
      height: 36px;
      background: var(--ink);
      border-bottom: 1px solid var(--slate);
      flex-shrink: 0;
      order: -1; /* Put tabs ABOVE panels */
    }

    .mt-tab {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      height: 100%;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: all 0.15s;
    }

    .mt-tab.active {
      color: var(--parchment);
      border-bottom-color: var(--red-string);
    }

    .mt-tab-icon { font-size: 12px; }
    .mt-tab-label { font-size: 10px; }
    .mt-tab-count {
      font-size: 8px;
      font-weight: 700;
      color: var(--evidence-blue);
    }

    /* Mobile HUD hidden — info bar handles it now */
    .mt-hud { display: none; }

    /* Info bar tighter on mobile */
    .chat-info-bar { padding: 3px 8px; gap: 5px; }

    /* Hide desktop chat header on mobile — tab bar handles navigation */
    .chat-header { display: none; }

    /* Pins shop full width on mobile */
    .pins-shop {
      top: auto; bottom: 0; left: 50%;
      transform: translateX(-50%);
      width: 100%; max-width: 100%;
      border-radius: 14px 14px 0 0;
      border-bottom: none;
    }

    .video-overlay-top { padding: 8px 10px; }

    /* ---- SPLASH OVERLAY — Must fit ~220px tall video on iPhone ---- */
    .splash-content {
      padding: 8px 16px;
    }

    .splash-case-tag {
      font-size: 8px;
      letter-spacing: 1.2px;
      margin-bottom: 4px;
    }

    .splash-title {
      font-size: 15px;
      margin-bottom: 6px;
      line-height: 1.2;
      max-width: 300px;
      /* Clamp to 1 line on very small screens */
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .splash-meta {
      margin-bottom: 10px;
      gap: 8px;
      font-size: 11px;
    }

    .splash-source {
      font-size: 10px;
      padding: 1px 6px;
    }

    .splash-live-badge { font-size: 9px; }
    .splash-live-dot { width: 5px; height: 5px; }

    .splash-play-btn {
      padding: 9px 22px;
      gap: 8px;
      border-radius: 10px;
    }

    .splash-play-icon { font-size: 14px; }
    .splash-play-text { font-size: 13px; }

    .splash-viewers-row {
      margin-top: 6px;
      font-size: 10px;
    }

    .splash-viewers-dot { width: 5px; height: 5px; }

    .splash-bottom-hint {
      bottom: 4px;
      font-size: 10px;
    }

    /* Nav compact */
    .nav { padding: 0 10px; gap: 6px; }
    .nav-case-btn { height: 28px; padding: 0 8px; font-size: 11px; }

    /* Chat compact */
    .msg { padding: 4px 8px; font-size: 12px; }
    .msg-pinned { padding: 4px 8px; }
    .msg-ai { padding: 6px 8px; }
    .chat-input { padding: 4px 6px; }
    .ci-box { padding: 5px 8px; }
    .ci-field { font-size: 16px; } /* 16px prevents iOS zoom on focus */
    .chat-highlights { border-bottom: none; }
    .hl-pred-toggle { padding: 3px 8px; }
    .sc-pills { padding: 3px 6px; }
    .hl-pinned { padding: 2px 6px; }

    /* AI panel compact — safe bottom */
    .ai-panel { padding: 10px; gap: 8px; }
    .ai-context-card { padding: 12px; }
    .ai-context-text { font-size: 12px; line-height: 1.55; }
    .ai-context-label { font-size: 8px; letter-spacing: 1.2px; }
    .ai-status-bar { padding: 6px 10px; }
    .ai-input-area { padding: 8px 10px; }
    .ai-context-footer { margin-top: 8px; padding-top: 6px; }
    .ai-context-action { font-size: 10px; }
    .ai-welcome { padding: 16px 12px 12px; }
    .ai-welcome-icon { font-size: 28px; }
    .ai-welcome-title { font-size: 13px; }
    .ai-welcome-desc { font-size: 11px; }
    .ai-suggestion { padding: 8px 12px; font-size: 12px; }
    .ai-ask-input { font-size: 16px; } /* 16px prevents iOS zoom */

    /* Case panel compact — safe bottom */
    .case-panel { padding: 10px; gap: 8px; }
    .cp-hero { padding: 12px; }
    .cp-hero-name { font-size: 14px; }
    .cp-stat-num { font-size: 15px; }
    .cp-stat-label { font-size: 8px; }
    .cp-stat { padding: 8px 4px; }
    .cp-summary { padding: 10px; }
    .cp-timeline { padding: 10px; }
    .cp-section-label { font-size: 8px; letter-spacing: 1.2px; }
    .cp-cta { padding: 12px 16px; }
    .cp-cta-text { font-size: 13px; }
    .cmt-date { font-size: 10px; }
    .cmt-text { font-size: 12px; }

    /* Prediction compact on mobile */
    .pred-opt { padding: 6px 4px; }
    .pred-title { padding: 6px 10px 4px; font-size: 11px; }
    .pred-bet-presets { display: none; }
    .pred-bet-row { padding: 6px 10px 8px; }

    /* Live panel compact */
    .live-status-bar { margin: 8px 8px 0; padding: 6px 10px; }
    .live-filters { padding: 6px 8px 2px; }
    .live-channels-list { padding: 4px 8px 8px; }
    .live-ch-thumb { width: 80px; height: 45px; }
    .live-ch-title { font-size: 11px; }
    .live-ch-source { font-size: 10px; }
  }

  /* Extra small — iPhone SE / iPhone Mini */
  @media (max-width: 380px) {
    .splash-case-tag { display: none; }
    .splash-title { font-size: 13px; -webkit-line-clamp: 1; }
    .splash-meta { margin-bottom: 8px; }
    .splash-play-btn { padding: 8px 18px; }
    .splash-play-text { font-size: 12px; }
    .splash-viewers-row { display: none; }
    .splash-bottom-hint { display: none; }
  }

  /* Standard iPhone (390-414px) — hide bottom hint, keep rest compact */
  @media (max-width: 430px) and (min-width: 381px) {
    .splash-bottom-hint { display: none; }
    .splash-title { -webkit-line-clamp: 1; }
  }

  /* Landscape phones */
  @media (max-width: 768px) and (max-height: 500px) {
    .splash-case-tag { display: none; }
    .splash-title { font-size: 14px; margin-bottom: 4px; -webkit-line-clamp: 1; }
    .splash-meta { margin-bottom: 8px; }
    .splash-play-btn { padding: 8px 18px; }
    .splash-viewers-row { display: none; }
    .splash-bottom-hint { display: none; }
  }

  /* ============= SIDEBAR PANELS — Desktop + Mobile ============= */
  .sidebar-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
  }

  .sidebar-panel.active {
    display: flex;
  }

  /* ============= AI PANEL ============= */
  .ai-panel {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }

  .ai-panel::-webkit-scrollbar { width: 4px; }
  .ai-panel::-webkit-scrollbar-track { background: transparent; }
  .ai-panel::-webkit-scrollbar-thumb { background: var(--steel); border-radius: 2px; }

  .ai-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(194,59,59,0.06);
    border: 1px solid rgba(194,59,59,0.12);
    border-radius: 8px;
    flex-shrink: 0;
  }

  .ai-status-dot {
    width: 7px; height: 7px;
    background: var(--red-string);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
  }

  .ai-status-text {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--red-string);
    font-weight: 700;
  }

  .ai-status-detail {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
  }

  .ai-context-card {
    padding: 14px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 10px;
    transition: border-color 0.2s;
    min-width: 0;
    overflow: hidden;
  }

  .ai-context-card:hover {
    border-color: rgba(194,59,59,0.25);
  }

  .ai-context-card.highlight {
    border-color: rgba(194,59,59,0.3);
    background: linear-gradient(135deg, rgba(194,59,59,0.04), var(--charcoal));
  }

  .ai-context-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--red-string);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .ai-context-label .dot {
    width: 5px; height: 5px;
    background: var(--red-string);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
  }

  .ai-context-label .label-icon {
    font-size: 12px;
    flex-shrink: 0;
  }

  .ai-context-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .ai-context-text strong {
    color: var(--parchment);
    font-weight: 600;
  }

  .ai-context-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.04);
  }

  .ai-context-action {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ai-context-action:hover { color: var(--text-secondary); }

  a.ai-source-link {
    text-decoration: none;
    color: var(--text-muted);
    cursor: pointer;
  }
  a.ai-source-link:hover {
    color: var(--accent);
    text-decoration: underline;
  }

  .ai-thinking {
    animation: pulse 1.5s ease-in-out infinite;
  }

  .ai-answer-card {
    margin-top: 2px;
    margin-bottom: 14px;
  }

  .ai-input-area {
    padding: 10px 14px;
    border-top: 1px solid var(--slate);
    flex-shrink: 0;
    background: var(--ink);
  }

  .ai-ask-box {
    padding: 10px 14px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.15s;
  }

  .ai-ask-box:focus-within {
    border-color: var(--red-string);
  }

  .ai-ask-dot {
    width: 8px; height: 8px;
    background: var(--red-string);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
  }

  .ai-ask-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
  }

  .ai-ask-input::placeholder {
    color: var(--text-muted);
  }

  .ai-ask-send {
    width: 28px; height: 28px;
    background: var(--red-string);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
  }

  .ai-ask-send:hover { background: var(--red-glow); }

  .ai-powered-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
  }

  /* ── AI Welcome + Suggestions ── */
  .ai-welcome {
    text-align: center;
    padding: 24px 16px 16px;
  }

  .ai-welcome-icon {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.8;
  }

  .ai-welcome-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--parchment);
    margin-bottom: 8px;
  }

  .ai-welcome-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 260px;
    margin: 0 auto;
  }

  .ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .ai-suggestion {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12.5px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
  }

  .ai-suggestion:hover {
    border-color: rgba(194,59,59,0.3);
    color: var(--parchment);
    background: rgba(194,59,59,0.04);
  }

  /* ============= CASE PANEL ============= */
  .case-panel {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .case-panel::-webkit-scrollbar { width: 4px; }
  .case-panel::-webkit-scrollbar-track { background: transparent; }
  .case-panel::-webkit-scrollbar-thumb { background: var(--steel); border-radius: 2px; }

  /* ── Case Panel — Hero Header ── */
  .cp-hero {
    padding: 16px;
    background: linear-gradient(135deg, rgba(194,59,59,0.08), rgba(194,59,59,0.02));
    border: 1px solid rgba(194,59,59,0.18);
    border-radius: 12px;
    text-align: center;
  }

  .cp-hero-status {
    display: inline-block;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 3px 10px;
    border-radius: 100px;
    margin-bottom: 8px;
  }

  .cp-status--active { background: rgba(229,62,62,0.15); color: var(--live-red); border: 1px solid rgba(229,62,62,0.3); }
  .cp-status--developing { background: rgba(201,168,76,0.12); color: var(--pin-brass); border: 1px solid rgba(201,168,76,0.25); }
  .cp-status--cold { background: rgba(123,111,163,0.12); color: var(--cold-case); border: 1px solid rgba(123,111,163,0.25); }
  .cp-status--closed { background: rgba(74,139,110,0.12); color: var(--solved-green); border: 1px solid rgba(74,139,110,0.25); }

  .cp-hero-name {
    font-family: 'Libre Baskerville', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--parchment);
    line-height: 1.25;
    margin-bottom: 8px;
  }

  .cp-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .cp-hero-tag {
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
  }

  /* ── Case Panel — Stats Grid ── */
  .cp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .cp-grid-3 { grid-template-columns: repeat(3, 1fr); }

  .cp-stat {
    text-align: center;
    padding: 10px 4px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 8px;
  }

  .cp-stat-num {
    font-family: 'Space Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--parchment);
    line-height: 1;
    margin-bottom: 4px;
  }

  .cp-stat-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
  }

  .cp-stat--victim .cp-stat-num { color: var(--live-red); }
  .cp-stat--victim { border-color: rgba(229,62,62,0.2); }
  .cp-stat--suspect .cp-stat-num { color: var(--pin-brass); }
  .cp-stat--suspect { border-color: rgba(201,168,76,0.18); }

  /* ── Case Panel — Key People ── */
  .cp-people {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .cp-person {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 8px;
    font-size: 12px;
  }

  .cp-person-role {
    font-family: 'Space Mono', monospace;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
  }

  .cp-role-victim { background: rgba(229,62,62,0.12); color: var(--live-red); }
  .cp-role-suspect { background: rgba(201,168,76,0.12); color: var(--pin-brass); }

  .cp-person-name {
    color: var(--parchment);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ── Case Panel — Summary ── */
  .cp-summary {
    padding: 12px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 10px;
  }

  .cp-section-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--red-string);
    margin-bottom: 8px;
  }

  .cp-summary-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
  }

  /* ── Case Panel — Timeline ── */
  .cp-timeline {
    padding: 12px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 10px;
  }

  .case-mini-timeline {
    padding-left: 16px;
    position: relative;
  }

  .case-mini-timeline::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--slate);
  }

  .cmt-item {
    position: relative;
    padding: 4px 0 4px 12px;
  }

  .cmt-item::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 10px;
    width: 7px; height: 7px;
    border-radius: 50%;
    border: 1.5px solid var(--red-string);
    background: var(--charcoal);
  }

  .cmt-item.cmt-latest::before {
    background: var(--red-string);
    box-shadow: 0 0 6px rgba(194,59,59,0.5);
  }

  .cmt-date {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--red-string);
  }

  .cmt-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
  }

  /* ── Case Panel — Records Row ── */
  .cp-records {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 0;
  }

  .cp-records-sep {
    width: 3px; height: 3px;
    background: var(--steel);
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* ── Case Panel — CTA Button ── */
  .cp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--red-string);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 0 rgba(194,59,59,0.4);
    animation: pulse-btn 2.5s ease-in-out infinite;
    flex-shrink: 0;
  }

  .cp-cta:hover {
    background: var(--red-glow);
    transform: translateY(-1px);
    animation: none;
    box-shadow: 0 6px 24px rgba(194,59,59,0.35);
  }

  .cp-cta-text {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
  }

  .cp-cta-arrow {
    font-size: 16px;
    color: #fff;
    transition: transform 0.2s;
  }

  .cp-cta:hover .cp-cta-arrow {
    transform: translateX(3px);
  }

  .cp-cta-sub {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    flex-shrink: 0;
  }

  /* ============= LIVE CHANNELS PANEL ============= */
  .live-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .live-panel::-webkit-scrollbar { width: 4px; }
  .live-panel::-webkit-scrollbar-track { background: transparent; }
  .live-panel::-webkit-scrollbar-thumb { background: var(--steel); border-radius: 2px; }

  .live-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 10px 10px 0;
    background: rgba(229,62,62,0.06);
    border: 1px solid rgba(229,62,62,0.12);
    border-radius: 8px;
    flex-shrink: 0;
  }

  .live-status-dot {
    width: 7px; height: 7px;
    background: var(--live-red);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
  }

  .live-status-text {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--live-red);
    font-weight: 700;
  }

  .live-status-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
  }

  .live-filters {
    display: flex;
    gap: 4px;
    padding: 8px 10px 4px;
    flex-shrink: 0;
    flex-wrap: wrap;
  }

  .live-filter {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border-radius: 100px;
    background: var(--charcoal);
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }

  .live-filter:hover {
    color: var(--text-secondary);
  }

  .live-filter.active {
    color: var(--parchment);
    border-color: var(--red-string);
    background: rgba(194,59,59,0.1);
  }

  .live-channels-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .live-channels-list::-webkit-scrollbar { width: 4px; }
  .live-channels-list::-webkit-scrollbar-track { background: transparent; }
  .live-channels-list::-webkit-scrollbar-thumb { background: var(--steel); border-radius: 2px; }

  .live-ch-card {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
  }

  .live-ch-card:hover {
    background: var(--charcoal);
  }

  .live-ch-card.now-playing {
    background: rgba(194,59,59,0.06);
    border-color: rgba(194,59,59,0.18);
  }

  .live-ch-thumb {
    width: 96px;
    height: 54px;
    background: var(--charcoal);
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
  }

  .live-ch-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .live-ch-thumb-live {
    position: absolute;
    top: 3px;
    left: 3px;
    padding: 1px 5px;
    background: var(--live-red);
    border-radius: 3px;
    font-family: 'Space Mono', monospace;
    font-size: 7px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
  }

  .live-ch-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }

  .live-ch-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--parchment);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
  }

  .live-ch-source {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .live-ch-verified {
    width: 11px; height: 11px;
    background: var(--evidence-blue);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 6px;
    color: #fff;
    flex-shrink: 0;
  }

  .live-ch-meta {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .live-ch-viewers {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--live-red);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .live-ch-viewers-dot {
    width: 4px; height: 4px;
    background: var(--live-red);
    border-radius: 50%;
  }

  .live-ch-playing {
    font-family: 'Space Mono', monospace;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--red-string);
  }

  .live-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
  }

  .live-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
  }

  .live-loading {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 12px;
  }

  .live-loading-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--slate);
    border-top-color: var(--red-string);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  /* ============================================================
     LOGIN MODAL
     ============================================================ */

  .login-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
  }
  .login-modal.active { display: flex; }

  .login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
  }

  .login-modal-card {
    position: relative;
    background: var(--ink);
    border: 1px solid var(--slate);
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    z-index: 1;
    animation: modalIn 0.2s ease;
  }

  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  .login-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
  }
  .login-modal-close:hover { color: var(--text-primary); }

  .login-modal-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
  }
  .login-modal-logo img { height: 40px; width: auto; }

  .login-modal-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
  }

  .login-modal-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    background: #fff;
    color: #1f2937;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
  }
  .login-modal-google:hover { background: #f3f4f6; }
  [data-theme="light"] .login-modal-google { background: #f3f4f6; border: 1px solid #d1d5db; }
  [data-theme="light"] .login-modal-google:hover { background: #e5e7eb; }

  .login-modal-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 12px;
  }
  .login-modal-divider::before, .login-modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--slate);
  }

  .login-modal-email { display: flex; flex-direction: column; gap: 10px; }

  .login-modal-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--midnight);
    border: 1px solid var(--slate);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
  }
  .login-modal-input:focus { border-color: var(--red-string); }
  .login-modal-input::placeholder { color: var(--text-muted); }

  .login-modal-submit {
    width: 100%;
    padding: 11px;
    background: var(--red-string);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
  }
  .login-modal-submit:hover { background: var(--red-glow); }
  .login-modal-submit:disabled { opacity: 0.6; cursor: not-allowed; }

  .login-modal-sent {
    text-align: center;
    color: #6ee7b7;
    background: rgba(74,139,110,0.15);
    border: 1px solid rgba(74,139,110,0.3);
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
  }

  .login-modal-error {
    text-align: center;
    color: #f87171;
    background: rgba(194,59,59,0.15);
    border: 1px solid rgba(194,59,59,0.3);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 10px;
  }

  .login-modal-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
  }
  .login-modal-footer a { color: var(--text-secondary); text-decoration: none; }
  .login-modal-footer a:hover { color: var(--text-primary); }

  /* Sign In trigger button (used in player header, sidebar, etc.) */
  .btn-sign-in {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--red-string);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
  }
  .btn-sign-in:hover { background: var(--red-glow); }

  /* User avatar pill (shown when logged in) */
  .user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: border-color 0.15s;
  }
  .user-pill:hover { border-color: var(--text-muted); }
  .user-pill-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--slate);
  }
  .user-pill-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-pill-chevron { color: var(--text-muted); transition: transform 0.15s; }

  .user-pill-wrap { position: relative; }
  .user-pill-wrap .user-pill { cursor: pointer; }

  .user-pill-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: var(--ink);
    border: 1px solid var(--slate);
    border-radius: 8px;
    padding: 4px 0;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .user-pill-dropdown::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 14px;
    width: 8px;
    height: 8px;
    background: var(--ink);
    border-left: 1px solid var(--slate);
    border-top: 1px solid var(--slate);
    transform: rotate(45deg);
  }
  .user-pill-dropdown.active { display: block; }

  .user-pill-dropdown-item {
    display: block;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.12s;
  }
  .user-pill-dropdown-item:hover {
    background: var(--charcoal);
    color: var(--text-primary);
  }
  .user-pill-dropdown-logout:hover { color: #f87171; }

  /* ── Pins Celebration Overlay ── */
  .pins-celebration {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    transition: opacity 0.4s ease;
    cursor: pointer;
  }
  .pins-celeb-content {
    text-align: center;
    animation: celebBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .pins-celeb-icon {
    font-size: 56px;
    margin-bottom: 8px;
  }
  .pins-celeb-title {
    font-size: 28px;
    font-weight: 700;
    color: #c9a84c;
    text-shadow: 0 2px 12px rgba(201,168,76,0.4);
    margin-bottom: 4px;
  }
  .pins-celeb-amount {
    font-size: 20px;
    font-weight: 600;
    color: #e8e4de;
  }
  .pins-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .confetti-particle {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
  }
  .confetti-particle:nth-child(odd) {
    width: 6px;
    height: 12px;
    border-radius: 1px;
  }
  @keyframes celebBounce {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
  }
  @keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
  }

  /* ══════════════════════════════════════════════════════════════════
     CRIME GIFTS
     ══════════════════════════════════════════════════════════════════ */

  /* Gift button in chat input */
  .ci-gift {
    width: 28px; height: 28px;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
  }
  .ci-gift:hover {
    background: rgba(168,85,247,0.3);
    border-color: #a855f7;
  }

  /* ── Gift Selector Popup ── */
  .gift-selector {
    padding: 8px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
  }
  .gift-sel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a855f7;
  }
  .gift-sel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
  }
  .gift-sel-close:hover { color: var(--text-primary); }

  .gift-sel-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .gift-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
  }
  .gift-card:hover {
    border-color: #a855f7;
    background: rgba(168,85,247,0.1);
    transform: translateY(-1px);
  }
  .gift-card:active {
    transform: translateY(0);
  }

  /* Tier glow on hover */
  .gift-tier-1:hover { border-color: #94a3b8; box-shadow: 0 0 8px rgba(148,163,184,0.3); }
  .gift-tier-2:hover { border-color: #3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.3); }
  .gift-tier-3:hover { border-color: #a855f7; box-shadow: 0 0 8px rgba(168,85,247,0.3); }
  .gift-tier-4:hover { border-color: #fbbf24; box-shadow: 0 0 10px rgba(251,191,36,0.4); }

  .gift-card-icon {
    width: 32px;
    height: 32px;
  }
  .gift-card-name {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .gift-card-cost {
    font-size: 9px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1px;
  }
  .gift-pin-icon {
    font-size: 8px;
  }

  /* ── Gift Animation Overlay ── */
  .gift-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9998;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gift-anim-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 30px;
    border-radius: 20px;
    opacity: 0;
    transform: scale(0.2) rotate(-10deg);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .gift-anim-container.gift-anim-active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  .gift-anim-container.gift-anim-exit {
    opacity: 0;
    transform: scale(1.3) rotate(5deg);
    transition: all 0.5s ease-out;
  }

  /* Tier 1 — subtle silver */
  .gift-anim-container.gift-tier-anim-1 {
    background: radial-gradient(ellipse at center, rgba(148,163,184,0.25) 0%, rgba(15,23,42,0.9) 70%);
    box-shadow: 0 0 60px rgba(148,163,184,0.2), inset 0 0 40px rgba(148,163,184,0.05);
  }
  /* Tier 2 — blue glow */
  .gift-anim-container.gift-tier-anim-2 {
    background: radial-gradient(ellipse at center, rgba(59,130,246,0.3) 0%, rgba(15,23,42,0.92) 70%);
    box-shadow: 0 0 80px rgba(59,130,246,0.3), inset 0 0 50px rgba(59,130,246,0.08);
  }
  /* Tier 3 — purple energy */
  .gift-anim-container.gift-tier-anim-3 {
    background: radial-gradient(ellipse at center, rgba(168,85,247,0.35) 0%, rgba(15,23,42,0.92) 65%);
    box-shadow: 0 0 100px rgba(168,85,247,0.4), 0 0 200px rgba(168,85,247,0.1), inset 0 0 60px rgba(168,85,247,0.1);
  }
  /* Tier 4 — legendary gold */
  .gift-anim-container.gift-tier-anim-4 {
    background: radial-gradient(ellipse at center, rgba(251,191,36,0.35) 0%, rgba(180,83,9,0.15) 40%, rgba(15,23,42,0.95) 70%);
    box-shadow: 0 0 120px rgba(251,191,36,0.5), 0 0 250px rgba(251,191,36,0.15), inset 0 0 80px rgba(251,191,36,0.1);
    animation: giftGoldPulse 1.5s ease-in-out infinite;
  }

  @keyframes giftGoldPulse {
    0%, 100% { box-shadow: 0 0 120px rgba(251,191,36,0.5), 0 0 250px rgba(251,191,36,0.15); }
    50% { box-shadow: 0 0 150px rgba(251,191,36,0.7), 0 0 300px rgba(251,191,36,0.25); }
  }

  /* Glow ring behind icon */
  .gift-anim-ring {
    position: absolute;
    width: 160px; height: 160px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.06);
    animation: giftRingSpin 3s linear infinite;
  }
  .gift-anim-ring::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px;
    width: 164px; height: 164px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: currentColor;
    animation: giftRingSpin 2s linear infinite reverse;
  }
  @keyframes giftRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  .gift-anim-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gift-anim-icon {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 30px rgba(168,85,247,0.6));
    animation: giftIconFloat 1.2s ease-in-out infinite alternate;
    position: relative;
    z-index: 1;
  }

  /* Tier-scaled icon sizes */
  .gift-tier-anim-1 .gift-anim-icon { width: 100px; height: 100px; }
  .gift-tier-anim-2 .gift-anim-icon { width: 110px; height: 110px; }
  .gift-tier-anim-3 .gift-anim-icon { width: 120px; height: 120px; }
  .gift-tier-anim-4 .gift-anim-icon { width: 140px; height: 140px; }

  /* Tier-specific icon glow */
  .gift-tier-anim-1 .gift-anim-icon { filter: drop-shadow(0 0 20px rgba(148,163,184,0.5)); }
  .gift-tier-anim-2 .gift-anim-icon { filter: drop-shadow(0 0 30px rgba(59,130,246,0.6)) drop-shadow(0 0 60px rgba(59,130,246,0.2)); }
  .gift-tier-anim-3 .gift-anim-icon { filter: drop-shadow(0 0 35px rgba(168,85,247,0.7)) drop-shadow(0 0 80px rgba(168,85,247,0.25)); }
  .gift-tier-anim-4 .gift-anim-icon {
    filter: drop-shadow(0 0 40px rgba(251,191,36,0.8)) drop-shadow(0 0 100px rgba(251,191,36,0.3));
    animation: giftIconGold 0.8s ease-in-out infinite alternate;
  }

  @keyframes giftIconFloat {
    0% { transform: translateY(2px) scale(1); }
    100% { transform: translateY(-4px) scale(1.05); }
  }
  @keyframes giftIconGold {
    0% { transform: translateY(2px) scale(1) rotate(-3deg); }
    100% { transform: translateY(-6px) scale(1.1) rotate(3deg); }
  }

  /* Tier-specific ring colors */
  .gift-tier-anim-1 .gift-anim-ring { color: #94a3b8; width: 130px; height: 130px; }
  .gift-tier-anim-1 .gift-anim-ring::before { width: 134px; height: 134px; }
  .gift-tier-anim-2 .gift-anim-ring { color: #3b82f6; width: 140px; height: 140px; }
  .gift-tier-anim-2 .gift-anim-ring::before { width: 144px; height: 144px; }
  .gift-tier-anim-3 .gift-anim-ring { color: #a855f7; width: 150px; height: 150px; }
  .gift-tier-anim-3 .gift-anim-ring::before { width: 154px; height: 154px; }
  .gift-tier-anim-4 .gift-anim-ring { color: #fbbf24; width: 170px; height: 170px; border-width: 3px; }
  .gift-tier-anim-4 .gift-anim-ring::before { width: 176px; height: 176px; }

  .gift-anim-name {
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
  }

  .gift-anim-sender {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    font-weight: 600;
    letter-spacing: 0.5px;
  }

  /* Cost flash */
  .gift-anim-cost {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    font-weight: 500;
    margin-top: -4px;
  }

  /* ── Gift Chat Messages ── */
  .msg-gift {
    background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(168,85,247,0.02));
    border-left: 2px solid #a855f7;
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 12px;
    color: #c4b5fd;
  }

  /* ═══════════════════════════════════════════════════════
     BOARD PANEL — Leaderboard widget in sidebar
  ═══════════════════════════════════════════════════════ */

  .board-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 12px;
    gap: 16px;
  }

  .board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .board-header-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .board-full-link {
    font-size: 11px;
    color: var(--pin-brass);
    text-decoration: none;
    opacity: 0.8;
  }
  .board-full-link:hover { opacity: 1; }

  .board-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .board-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
  }

  /* ── Leaderboard rows (shared widget + page) ── */

  .lb-list { display: flex; flex-direction: column; gap: 4px; }

  .lb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    transition: background 0.15s;
  }
  .lb-row:hover { background: rgba(255,255,255,0.06); }

  .lb-num {
    font-size: 10px;
    color: var(--text-muted);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
  }

  .lb-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
  }

  .lb-avatar-init {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
  }

  .lb-name {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .lb-score {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--pin-brass);
    flex-shrink: 0;
    font-weight: 600;
  }

  .lb-pins { color: #c4b5fd; }

  .lb-loading, .lb-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 6px;
    text-align: center;
  }

  /* ── Rank badges (widget size) ── */

  .lb-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .lb-badge-board_master   { background: rgba(245,158,11,0.18); color: #f59e0b; }
  .lb-badge-analyst        { background: rgba(224,122,47,0.18); color: #e07a2f; }
  .lb-badge-lead_detective { background: rgba(155,93,229,0.18); color: #9b5de5; }
  .lb-badge-detective      { background: rgba(74,139,110,0.18); color: #4a8b6e; }
  .lb-badge-investigator   { background: rgba(56,139,253,0.18); color: #388bfd; }
  .lb-badge-observer       { background: rgba(107,114,128,0.18); color: #9ca3af; }
  .lb-badge-civilian       { display: none; }
