* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
    
    html, body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      height: 100dvh;
      background: #000;
      color: #fff;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      overflow: hidden;
      display: flex;
    }

    /* Video Pane */
    .video-pane {
      flex: 1;
      width: 100%;
      height: 100%;
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
      background: #000;
      overflow: hidden;
      cursor: pointer;
    }

    video {
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: #000;
    }

    /* Master HUD Overlay Wrapper */
    .hud-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 20;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .hud-overlay.visible {
      opacity: 1;
    }

    /* Top Station & Audio Banner (Game Mode) */
    .top-bar-overlay {
      position: absolute;
      top: 16px;
      left: 16px;
      display: flex;
      align-items: center;
      gap: 10px;
      pointer-events: none;
    }

    .hud-overlay.visible .top-bar-overlay {
      pointer-events: auto;
    }

    .channel-badge {
      background: rgba(0, 0, 0, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.25);
      padding: 6px 14px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 8px;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }
    .channel-badge-num {
      font-weight: 800;
      color: #4CAF50;
      font-size: 15px;
    }
    .channel-badge-name {
      font-size: 12px;
      color: #ccc;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .audio-indicator-pill {
      background: rgba(0, 0, 0, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.25);
      padding: 6px 14px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 600;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s;
    }
    .audio-indicator-pill:hover {
      background: rgba(255, 255, 255, 0.15);
    }
    .audio-indicator-pill.astc {
      border-color: rgba(76, 175, 80, 0.5);
      color: #81c784;
    }
    .audio-indicator-pill.sdr {
      border-color: rgba(33, 150, 243, 0.5);
      color: #64b5f6;
    }

    /* Center Floating DVR Controls */
    .center-controls {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0.95);
      display: flex;
      align-items: center;
      gap: clamp(12px, 3vw, 20px);
      padding: clamp(8px, 2vw, 12px) clamp(14px, 3vw, 20px);
      background: rgba(0, 0, 0, 0.55);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 50px;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      pointer-events: none;
      transition: transform 0.25s ease;
    }

    .hud-overlay.visible .center-controls {
      pointer-events: auto;
      transform: translate(-50%, -50%) scale(1);
    }

    .seek-btn {
      background: rgba(255, 255, 255, 0.15);
      border: 1px solid rgba(255, 255, 255, 0.25);
      color: #fff;
      width: clamp(42px, 8vw, 54px);
      height: clamp(42px, 8vw, 54px);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.15s, transform 0.1s;
    }
    .seek-btn svg {
      width: clamp(20px, 4vw, 26px);
      height: clamp(20px, 4vw, 26px);
    }
    .seek-btn:active:not(:disabled) {
      background: rgba(255, 255, 255, 0.35);
      transform: scale(0.92);
    }
    .seek-btn:disabled {
      opacity: 0.2;
      cursor: not-allowed;
    }

    .play-pause-btn {
      background: rgba(255, 255, 255, 0.25);
      border: 1px solid rgba(255, 255, 255, 0.4);
      color: #fff;
      width: clamp(50px, 10vw, 64px);
      height: clamp(50px, 10vw, 64px);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.15s, transform 0.1s;
    }
    .play-pause-btn svg {
      width: clamp(22px, 5vw, 28px);
      height: clamp(22px, 5vw, 28px);
    }
    .play-pause-btn:active {
      background: rgba(255, 255, 255, 0.4);
      transform: scale(0.92);
    }

    .live-status {
      position: absolute;
      bottom: -28px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 11px;
      font-weight: bold;
      letter-spacing: 0.5px;
      color: rgba(255, 255, 255, 0.5);
      background: rgba(0, 0, 0, 0.6);
      padding: 3px 10px;
      border-radius: 14px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 5px;
      border: 1px solid rgba(255, 255, 255, 0.15);
      white-space: nowrap;
      user-select: none;
    }
    .live-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.4);
    }
    .live-status.is-live {
      color: #ff3333;
      border-color: rgba(255, 51, 51, 0.5);
    }
    .live-status.is-live .live-dot {
      background: #ff3333;
      box-shadow: 0 0 6px #ff3333;
    }

    /* Right-Side Bottom Controls */
    .bottom-bar {
      position: absolute;
      bottom: 16px;
      right: 16px;
      display: flex;
      align-items: center;
      gap: 8px;
      pointer-events: none;
    }

    .hud-overlay.visible .bottom-bar {
      pointer-events: auto;
    }

    .ctrl-pill {
      display: flex;
      align-items: center;
      gap: 8px;
      background: rgba(0, 0, 0, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 30px;
      padding: 6px 12px;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    .ctrl-btn {
      background: none;
      border: none;
      color: #fff;
      cursor: pointer;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .vol-slider {
      -webkit-appearance: none;
      appearance: none;
      width: clamp(55px, 12vw, 80px);
      height: 4px;
      border-radius: 2px;
      background: rgba(255, 255, 255, 0.25);
      outline: none;
      cursor: pointer;
    }
    .vol-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #fff;
      cursor: pointer;
      box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    }
    .vol-slider::-moz-range-thumb {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #fff;
      cursor: pointer;
      border: none;
    }

    .action-btn {
      background: rgba(0, 0, 0, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #fff;
      border-radius: 50%;
      width: 34px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      transition: background 0.15s;
    }
    .action-btn:hover { background: rgba(255, 255, 255, 0.2); }

    /* Fixed Toggle Tab */
    .toggle-tab {
      position: fixed;
      top: 50%;
      right: 270px;
      transform: translateY(-50%);
      width: 28px;
      height: 52px;
      background: #181818;
      border: 1px solid #333;
      border-right: none;
      border-radius: 8px 0 0 8px;
      color: #aaa;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 12px;
      user-select: none;
      z-index: 60;
      transition: right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .toggle-tab:hover { background: #252525; color: #fff; }
    .toggle-tab.collapsed { right: 0; border-left: 1px solid #444; }

    /* Sidebar Drawer Architecture */
    .sidebar {
      width: 270px;
      height: 100%;
      height: 100dvh;
      background: #181818;
      padding: 16px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      border-left: 1px solid #282828;
      transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), margin-right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
      position: relative;
      z-index: 40;
      flex-shrink: 0;
      overflow-y: auto;
    }

    .sidebar.collapsed {
      transform: translateX(100%);
      margin-right: -270px;
    }

    .sidebar.locked .channel-btn,
    .sidebar.locked .nav-buttons button {
      opacity: 0.35;
      cursor: not-allowed;
      pointer-events: none;
    }

    .status-box { 
      background: #242424; 
      padding: 10px 12px; 
      border-radius: 8px; 
      border: 1px solid #333;
    }
    .status-active { 
      font-size: 22px; 
      font-weight: 800; 
      color: #4CAF50; 
      margin-top: 2px; 
    }
    .section-label { 
      font-size: 11px; 
      font-weight: 700; 
      color: #888; 
      text-transform: uppercase; 
      letter-spacing: 0.5px;
      margin-bottom: 6px; 
    }
    
    /* Normal Channel Presets Grid */
    .btn-grid { 
      display: grid; 
      grid-template-columns: repeat(2, 1fr); 
      gap: 8px; 
    }
    button.channel-btn, .nav-buttons button {
      background: #2b2b2b;
      border: 1px solid #3d3d3d;
      color: #fff;
      font-size: clamp(14px, 2vh, 16px);
      font-weight: 600;
      padding: clamp(8px, 1.5vh, 12px);
      border-radius: 6px;
      cursor: pointer;
    }
    button.channel-btn:active, .nav-buttons button:active { background: #0078d7; }
    
    .nav-buttons { display: flex; gap: 6px; margin-bottom: 8px; }
    .nav-buttons button { flex: 1; font-size: 13px; }

    /* Audio Switcher Component (Game Mode) */
    .audio-card {
      background: #202020;
      border: 1px solid #333;
      border-radius: 8px;
      padding: 12px;
      margin-top: 14px;
    }

    .audio-toggle-group {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      background: #151515;
      padding: 4px;
      border-radius: 8px;
      border: 1px solid #2d2d2d;
    }

    .audio-toggle-btn {
      background: transparent;
      border: none;
      color: #888;
      padding: 9px 6px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      transition: all 0.2s ease;
    }
    .audio-toggle-btn .icon {
      font-size: 18px;
    }
    .audio-toggle-btn.active.astc {
      background: #1b4725;
      color: #69f0ae;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
    .audio-toggle-btn.active.sdr {
      background: #0d386b;
      color: #64b5f6;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    /* Audio Delay & Sync Controls */
    .sync-panel {
      margin-top: 12px;
      background: #191919;
      border: 1px solid #2a2a2a;
      border-radius: 6px;
      padding: 10px;
    }

    .sync-slider-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 6px 0;
    }

    .step-btn {
      background: #2b2b2b;
      border: 1px solid #3d3d3d;
      color: #fff;
      font-size: 11px;
      font-weight: bold;
      padding: 4px 8px;
      border-radius: 4px;
      cursor: pointer;
    }
    .step-btn:hover { background: #383838; }

    .sync-slider {
      flex: 1;
      -webkit-appearance: none;
      appearance: none;
      height: 4px;
      border-radius: 2px;
      background: #333;
      outline: none;
    }
    .sync-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #64b5f6;
      cursor: pointer;
    }

    a.guide-link {
      text-align: center;
      background: #222;
      color: #58a6ff;
      text-decoration: none;
      padding: 8px;
      border-radius: 6px;
      border: 1px solid #333;
      font-size: 12px;
      display: block;
    }

    .info-pill {
      display: none;
      position: absolute;
      top: 16px;
      left: 50%;
      transform: translateX(-50%);
      background: #0078d7;
      color: white;
      padding: 8px 18px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: bold;
      z-index: 80;
      box-shadow: 0 4px 15px rgba(0,0,0,0.6);
      animation: fadeIn 0.3s ease;
    }

    .spectator-modal {
      display: none;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.85);
      z-index: 100;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 20px;
      text-align: center;
    }
    .spectator-card {
      background: #1e1e1e;
      border: 1px solid #333;
      border-radius: 12px;
      padding: 24px;
      max-width: 380px;
      width: 100%;
      box-shadow: 0 8px 30px rgba(0,0,0,0.7);
    }
    .spectator-card h3 {
      margin-top: 0;
      font-size: 18px;
      color: #ff9800;
    }
    .spectator-card p {
      font-size: 13px;
      color: #bbb;
      margin-bottom: 18px;
      line-height: 1.4;
    }
    .tuner-choice-btn {
      width: 100%;
      background: #2b2b2b;
      border: 1px solid #444;
      color: #fff;
      padding: 12px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 10px;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: background 0.15s, border-color 0.15s;
    }
    .tuner-choice-btn:hover {
      background: #0078d7;
      border-color: #58a6ff;
    }

    @media (max-width: 768px) {
      .sidebar {
        position: fixed;
        right: 0;
        top: 0;
        width: 250px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.8);
      }
      .sidebar.collapsed { transform: translateX(100%); margin-right: 0; }
      .toggle-tab { right: 250px; }
      .toggle-tab.collapsed { right: 0; }
    }

    @media (orientation: portrait) and (max-width: 768px) {
      body { flex-direction: column; }
      .video-pane { width: 100%; height: 40vh; flex: none; }
      .sidebar {
        position: static;
        width: 100%;
        height: 60vh;
        border-left: none;
        border-top: 1px solid #282828;
        transform: none !important;
        margin-right: 0 !important;
        padding: 12px;
        box-shadow: none;
      }
      .toggle-tab { display: none; }
      .bottom-bar { bottom: 8px; right: 8px; }
    }
