
    /* ═══════════════════════════════════════════════════════════════════════
       Design Tokens & CSS Variables
    ═══════════════════════════════════════════════════════════════════════ */
    /* ═══════════════════════════════════════════════════════════════════════
       Design Tokens & Modern Dark Theme
    ═══════════════════════════════════════════════════════════════════════ */
    :root {
      --bg-body: #06070a;
      --bg-card: #0c0e14;
      --bg-header: rgba(10, 12, 18, 0.7);
      
      --accent-gold: #eab308;
      --accent-gold-glow: rgba(234, 179, 8, 0.25);
      --accent-red: #ef4444;
      --accent-red-glow: rgba(239, 68, 68, 0.35);
      --accent-blue: #3b82f6;
      
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --text-dim: #64748b;
      
      --border-subtle: rgba(255, 255, 255, 0.08);
      --border-hover: rgba(255, 255, 255, 0.16);
      
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --radius-pill: 9999px;
    }

    *, *::before, *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    html, body {
      width: 100%;
      height: 100%;
      height: 100dvh;
      background-color: var(--bg-body);
      color: var(--text-main);
      font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      overflow: hidden; /* منع التمرير نهائياً */
      user-select: none;
    }

    body {
      display: flex;
      flex-direction: column;
      background: radial-gradient(ellipse at 50% 15%, #141828 0%, #08090e 55%, #040507 100%);
      position: relative;
      /* متغير ارتفاع الهيدر — يُحدَّث بـ JS عند تغيير الحجم */
      --header-h: 110px;
    }

    /* ═══════════════════════════════════════════════════════════════════════
       Floating Studio Header Bar
    ═══════════════════════════════════════════════════════════════════════ */
    .top-header {
      width: calc(100% - 32px);
      max-width: 1440px;
      margin: 8px auto 0 auto;
      padding: 6px 22px;
      min-height: 64px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      z-index: 50;
      direction: ltr;
      background: rgba(9, 12, 20, 0.82);
      backdrop-filter: blur(24px) saturate(170%);
      -webkit-backdrop-filter: blur(24px) saturate(170%);
      border: 1px solid rgba(56, 189, 248, 0.16);
      border-radius: 18px;
      box-shadow: 
        0 8px 28px -6px rgba(0, 0, 0, 0.8),
        0 0 18px rgba(14, 165, 233, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
      position: relative;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .top-header::before {
      content: '';
      position: absolute;
      top: 0;
      left: 8%;
      right: 8%;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.5), rgba(14, 165, 233, 0.85), rgba(56, 189, 248, 0.5), transparent);
      border-radius: 9999px;
      pointer-events: none;
    }

    .top-header:hover {
      border-color: rgba(56, 189, 248, 0.28);
      box-shadow: 
        0 10px 32px -6px rgba(0, 0, 0, 0.85),
        0 0 24px rgba(14, 165, 233, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }

    /* Left Group: Brand Logo */
    .header-left-cluster {
      display: inline-flex;
      align-items: center;
      gap: 14px;
    }

    /* Brand Logo: aboodfull2-live with animated glow */
    .brand-logo-wrap {
      display: inline-flex;
      align-items: center;
      position: relative;
      text-decoration: none;
      border-radius: 9999px;
      transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.28s ease;
    }

    .logo-aura-glow {
      position: absolute;
      inset: -4px;
      border-radius: 9999px;
      background: radial-gradient(ellipse at center, rgba(14, 165, 233, 0.3) 0%, rgba(56, 189, 248, 0.1) 60%, transparent 80%);
      filter: blur(7px);
      opacity: 0.6;
      animation: logo-aura-pulse 3.5s ease-in-out infinite alternate;
      pointer-events: none;
      z-index: 0;
    }

    @keyframes logo-aura-pulse {
      0% {
        opacity: 0.4;
        transform: scale(0.98);
        filter: blur(5px);
      }
      100% {
        opacity: 0.8;
        transform: scale(1.03);
        filter: blur(10px);
      }
    }

    .brand-logo-img {
      height: 50px;
      width: auto;
      max-width: 240px;
      object-fit: contain;
      display: block;
      position: relative;
      z-index: 1;
      filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 10px rgba(14, 165, 233, 0.3));
      transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .brand-logo-wrap:hover .brand-logo-img {
      transform: scale(1.04);
      filter: drop-shadow(0 5px 18px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 18px rgba(56, 189, 248, 0.7));
    }

    @media (max-width: 1024px) {
      .brand-logo-img {
        height: 44px;
        max-width: 200px;
      }
      .top-header {
        width: calc(100% - 24px);
        padding: 5px 16px;
        min-height: 56px;
        border-radius: 14px;
      }
    }

    @media (max-width: 640px) {
      .brand-logo-img {
        height: 36px;
        max-width: 150px;
      }
      .top-header {
        width: calc(100% - 14px);
        margin-top: 5px;
        padding: 5px 10px;
        min-height: 46px;
        border-radius: 11px;
      }
      .header-left-cluster {
        gap: 7px;
      }
      .header-right-cluster {
        gap: 6px;
      }
      .header-schedule-btn {
        padding: 5px 11px;
        font-size: 0.8rem;
        gap: 5px;
      }
      .header-schedule-btn .schedule-icon {
        width: 13px;
        height: 13px;
      }
      .viewer-count-badge {
        padding: 5px 10px;
        font-size: 0.8rem;
        gap: 6px;
      }
    }

    /* Header Schedule Link Button */
    .header-schedule-btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 7px 16px;
      background: rgba(234, 179, 8, 0.08);
      border: 1px solid rgba(234, 179, 8, 0.32);
      border-radius: var(--radius-pill);
      font-size: 0.86rem;
      font-weight: 700;
      color: #fef08a;
      text-decoration: none;
      user-select: none;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), 0 0 14px rgba(234, 179, 8, 0.08);
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header-schedule-btn:hover {
      background: rgba(234, 179, 8, 0.18);
      border-color: rgba(234, 179, 8, 0.65);
      color: #ffffff;
      transform: translateY(-1px);
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 0 20px rgba(234, 179, 8, 0.25);
    }

    .header-schedule-btn:active {
      transform: translateY(0);
    }

    .header-schedule-btn .schedule-icon {
      width: 15px;
      height: 15px;
      stroke: var(--accent-gold);
      flex-shrink: 0;
      transition: transform 0.2s ease;
    }

    .header-schedule-btn:hover .schedule-icon {
      transform: scale(1.1);
    }

    /* Live Viewer Count Badge */
    .viewer-count-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 15px;
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: var(--radius-pill);
      font-size: 0.86rem;
      font-weight: 700;
      color: #e2e8f0;
      user-select: none;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .viewer-dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: #ef4444;
      flex-shrink: 0;
      box-shadow: 0 0 12px #ef4444;
      animation: pulse-dot 1.5s infinite;
    }

    @keyframes pulse-dot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%      { opacity: 0.4; transform: scale(0.85); }
    }

    .viewer-count-badge.offline-badge .viewer-dot {
      background: #64748b;
      box-shadow: none;
      animation: none;
    }

    .viewer-count-badge.live-badge {
      border-color: rgba(239, 68, 68, 0.45);
      background: rgba(239, 68, 68, 0.1);
      box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
      color: #fecaca;
    }

    @keyframes count-bump {
      0%   { transform: scale(1); }
      40%  { transform: scale(1.2); }
      100% { transform: scale(1); }
    }

    .viewer-count-num.bump {
      animation: count-bump 0.3s ease-out;
    }

    /* Right Group: Minimal Quality & Protocol Badge */
    .header-right-cluster {
      display: inline-flex;
      align-items: center;
      gap: 10px;
    }

    .stream-status-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 15px;
      border-radius: var(--radius-pill);
      background: rgba(16, 185, 129, 0.07);
      border: 1px solid rgba(16, 185, 129, 0.25);
      font-size: 0.82rem;
      font-weight: 700;
      color: #a7f3d0;
      letter-spacing: 0.02em;
      box-shadow: 0 0 16px rgba(16, 185, 129, 0.12);
    }

    .status-tech-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #10b981;
      box-shadow: 0 0 10px #10b981;
      animation: tech-dot-pulse 2s infinite;
    }

    @keyframes tech-dot-pulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%      { opacity: 0.45; transform: scale(0.85); }
    }

    /* ═══════════════════════════════════════════════════════════════════════
       Center Stage / Cinema Canvas
    ═══════════════════════════════════════════════════════════════════════ */
    .stage-wrapper {
      /* يأخذ كل المساحة المتبقية بعد الهيدر */
      flex: 1;
      min-height: 0; /* مهم: يمنع overflow في flex */
      display: grid;
      grid-template-columns: minmax(0, 1fr) 0;
      gap: 12px;
      align-items: stretch;
      justify-content: stretch;
      padding: 10px 14px 12px;
      width: 100%;
      position: relative;
      overflow: hidden;
      direction: ltr;
      transition: grid-template-columns 0.32s cubic-bezier(0.4, 0, 0.2, 1), gap 0.32s ease;
    }

    body.remote-open .stage-wrapper {
      grid-template-columns: minmax(0, 1fr) minmax(285px, 340px);
    }

    /* Ambient Backlight Glow */
    .ambient-glow {
      position: absolute;
      width: 85%;
      height: 75%;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.12) 0%, rgba(234, 179, 8, 0.05) 45%, transparent 75%);
      filter: blur(60px);
      z-index: 1;
      pointer-events: none;
      opacity: 0.8;
      transition: opacity 0.5s ease;
    }

    /* Theater Mode */
    .stage-wrapper.theater-mode {
      padding: 0;
      grid-template-columns: minmax(0, 1fr) 0;
      gap: 0;
    }

    .stage-wrapper.theater-mode .remote-shell {
      display: none;
    }

    .stage-wrapper.theater-mode .ambient-glow {
      display: none;
    }

    /* ── Player Theater Card ─────────────────────────────────────────── */
    .player-theater-card {
      position: relative;
      z-index: 2;
      /* يملأ الارتفاع المتاح بالكامل — العرض يتحدد تلقائياً بـ aspect-ratio */
      height: 100%;
      width: auto;
      /* قيّد العرض بحيث لا يتجاوز 100% عرض الـ stage */
      max-width: 100%;
      aspect-ratio: 16 / 9;
      background: #000000;
      border-radius: var(--radius-lg);
      overflow: hidden;
      border: 1px solid var(--border-subtle);
      box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.95), 0 0 40px rgba(0, 0, 0, 0.5);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 0;
      align-self: center;
      justify-self: center;
      direction: rtl;
    }

    .stage-wrapper.theater-mode .player-theater-card {
      border-radius: 0;
      border: none;
      height: 100%;
      width: 100%;
      max-width: 100%;
      box-shadow: none;
    }

    /* OvenPlayer Mount Container & Native Fullscreen */
    #player,
    #player .op-wrapper,
    #player .op-player,
    #player .op-media-element-container {
      width: 100% !important;
      height: 100% !important;
      background: #000000 !important;
    }

    #player video {
      width: 100% !important;
      height: 100% !important;
      object-fit: contain !important;
      background: #000000 !important;
    }

    .player-theater-card:fullscreen,
    .player-theater-card:-webkit-full-screen {
      width: 100vw !important;
      height: 100vh !important;
      height: 100dvh !important;
      max-width: 100vw !important;
      max-height: 100vh !important;
      max-height: 100dvh !important;
      border-radius: 0 !important;
      border: none !important;
      margin: 0 !important;
      padding: 0 !important;
      background: #000000 !important;
    }

    .offline-overlay {
      position: absolute;
      inset: 0;
      z-index: 25;
      background: 
        radial-gradient(ellipse at 50% 38%, rgba(14, 165, 233, 0.14) 0%, rgba(15, 23, 42, 0.92) 52%, #05070c 100%),
        #05070c;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      text-align: center;
      padding: 24px 18px;
    }

    .offline-overlay.active {
      display: flex;
    }

    /* Standby Centerpiece Visual */
    .standby-stage {
      position: relative;
      width: 146px;
      height: 146px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 4px;
    }

    .standby-wave {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      border: 1.5px solid rgba(56, 189, 248, 0.45);
      background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
      animation: standby-wave-expand 3.2s cubic-bezier(0, 0.4, 0.8, 1) infinite;
      pointer-events: none;
    }

    .standby-wave.wave-2 {
      animation-delay: 1.6s;
    }

    @keyframes standby-wave-expand {
      0% {
        transform: scale(0.85);
        opacity: 0.9;
      }
      50% {
        opacity: 0.35;
      }
      100% {
        transform: scale(1.75);
        opacity: 0;
      }
    }

    .standby-avatar-card {
      position: relative;
      z-index: 2;
      width: 136px;
      height: 136px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      animation: standby-float 4.2s ease-in-out infinite alternate;
      box-shadow: 
        0 14px 34px -6px rgba(0, 0, 0, 0.95),
        0 0 28px rgba(14, 165, 233, 0.38);
    }

    @keyframes standby-float {
      0% {
        transform: translateY(0px) scale(1);
        filter: drop-shadow(0 6px 18px rgba(14, 165, 233, 0.3));
      }
      100% {
        transform: translateY(-6px) scale(1.025);
        filter: drop-shadow(0 12px 28px rgba(56, 189, 248, 0.6));
      }
    }

    .standby-avatar-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
      display: block;
    }

    .standby-status-tag {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 5px 15px;
      border-radius: var(--radius-pill);
      background: rgba(234, 179, 8, 0.08);
      border: 1px solid rgba(234, 179, 8, 0.28);
      color: #fef08a;
      font-size: 0.8rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      box-shadow: 0 0 16px rgba(234, 179, 8, 0.1);
    }

    .standby-dot-pulse {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #eab308;
      box-shadow: 0 0 8px #eab308;
      animation: standby-dot-blink 1.8s infinite;
    }

    @keyframes standby-dot-blink {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%      { opacity: 0.35; transform: scale(0.85); }
    }

    .offline-title {
      font-size: 1.25rem;
      font-weight: 800;
      color: #f8fafc;
    }

    .offline-sub {
      font-size: 0.9rem;
      color: #94a3b8;
      max-width: 380px;
      line-height: 1.5;
    }

    .scan-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 16px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: var(--radius-pill);
      font-size: 0.8rem;
      color: #cbd5e1;
    }

    .scan-spin {
      width: 13px;
      height: 13px;
      border: 2px solid rgba(255, 255, 255, 0.2);
      border-top-color: var(--accent-gold);
      border-radius: 50%;
      animation: rotate-spin 0.8s linear infinite;
    }

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

    /* ═══════════════════════════════════════════════════════════════════════
       Custom Control Bar
    ═══════════════════════════════════════════════════════════════════════ */
    .controls-overlay {
      position: absolute;
      inset: 0;
      z-index: 20;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 25%, transparent 60%);
      opacity: 1;
      transition: opacity 0.25s ease-out;
      pointer-events: none;
    }

    .player-theater-card.idle-hide .controls-overlay {
      opacity: 0;
      pointer-events: none;
    }

    .controls-overlay > * {
      pointer-events: auto;
    }

    /* Yellow/Gold Live Timeline Bar */
    .live-timeline-track {
      width: 100%;
      height: 3.5px;
      background: rgba(255, 255, 255, 0.2);
      position: relative;
      cursor: default;
    }

    .live-timeline-fill {
      width: 100%;
      height: 100%;
      background: var(--accent-gold);
      box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
    }

    /* Bottom Control Bar Row */
    .control-actions-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 18px 14px;
      direction: ltr;
    }

    .ctrl-group {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    /* Clean Minimalist Player Icon Buttons */
    .player-btn {
      background: transparent;
      border: none;
      color: #ffffff;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: var(--radius-sm);
      transition: all 0.15s ease;
      opacity: 0.9;
    }

    .player-btn:hover {
      opacity: 1;
      transform: scale(1.1);
      color: var(--accent-gold);
    }

    .player-btn:active {
      transform: scale(0.95);
    }

    .player-btn svg {
      width: 22px;
      height: 22px;
      stroke-width: 2.2;
    }

    /* Volume Slider Area */
    .volume-cluster {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .vol-slider-input {
      -webkit-appearance: none;
      appearance: none;
      width: 70px;
      height: 4px;
      border-radius: var(--radius-pill);
      background: rgba(255, 255, 255, 0.3);
      outline: none;
      cursor: pointer;
      transition: all 0.2s;
    }

    .vol-slider-input::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #ffffff;
      cursor: pointer;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    }

    /* Red Dot + مباشر (Live Tag on Bottom Left) */
    .bottom-live-indicator {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.85rem;
      font-weight: 700;
      color: #ffffff;
      user-select: none;
      padding-left: 4px;
    }

    .bottom-live-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--accent-red);
      box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    }

    /* ═══════════════════════════════════════════════════════════════════════
       Twitch-Style Video Stats Modal (HUD Overlay)
    ═══════════════════════════════════════════════════════════════════════ */
    .stats-twitch-modal {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 30;
      width: 300px;
      max-width: calc(100% - 20px);
      max-height: calc(100% - 20px);
      background: rgba(13, 17, 24, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 8px;
      box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(16px);
      direction: rtl;
      display: none;
      flex-direction: column;
      overflow: hidden;
      animation: modal-fade-in 0.2s ease-out;
    }

    .stats-twitch-modal.open {
      display: flex;
    }

    @keyframes modal-fade-in {
      from { opacity: 0; transform: translateY(-8px) scale(0.97); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .modal-header {
      display: flex;
      flex-shrink: 0;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px;
      background: rgba(255, 255, 255, 0.03);
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .modal-title {
      font-size: 0.85rem;
      font-weight: 800;
      color: #f8fafc;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .modal-close-btn {
      background: transparent;
      border: none;
      color: #94a3b8;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 4px;
      border-radius: 4px;
      transition: color 0.15s;
    }

    .modal-close-btn:hover {
      color: #ffffff;
    }

    .modal-body {
      padding: 10px 14px;
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-width: thin;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .stat-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
      gap: 10px;
      align-items: center;
      font-size: 0.8rem;
      padding: 3px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }

    .stat-row:last-child {
      border-bottom: none;
    }

    .stat-k {
      color: #94a3b8;
      overflow-wrap: anywhere;
    }

    .stat-v {
      color: #f1f5f9;
      font-family: 'Inter', monospace;
      font-weight: 700;
      direction: ltr;
      text-align: left;
      overflow-wrap: anywhere;
    }

    .stat-v.highlight {
      color: #34d399;
    }

    .site-loader {
      position: fixed;
      inset: 0;
      z-index: 500;
      display: grid;
      place-items: center;
      background: radial-gradient(circle at 50% 32%, rgba(14, 165, 233, 0.18), transparent 42%), #05070c;
      transition: opacity 0.36s ease, visibility 0.36s ease;
    }

    .site-loader.is-hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .loader-core {
      display: grid;
      justify-items: center;
      gap: 18px;
      width: min(300px, calc(100vw - 48px));
    }

    .loader-logo {
      width: min(210px, 72vw);
      height: auto;
      filter: drop-shadow(0 14px 34px rgba(14, 165, 233, 0.25));
    }

    .loader-track {
      width: 100%;
      height: 4px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
    }

    .loader-fill {
      width: 46%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #38bdf8, #22c55e);
      animation: loader-slide 1.05s ease-in-out infinite alternate;
    }

    @keyframes loader-slide {
      from { transform: translateX(-62%); }
      to { transform: translateX(126%); }
    }

    .remote-shell {
      position: relative;
      z-index: 3;
      min-width: 0;
      min-height: 0;
      direction: rtl;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(10, 13, 20, 0.78);
      backdrop-filter: blur(18px) saturate(150%);
      -webkit-backdrop-filter: blur(18px) saturate(150%);
      border-radius: 16px;
      box-shadow: 0 18px 44px -22px rgba(0, 0, 0, 0.9);
      overflow: hidden;
    }

    .side-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #e2e8f0;
      font-size: 0.88rem;
      font-weight: 900;
    }

    .side-kicker {
      color: #38bdf8;
      font-size: 0.68rem;
      font-weight: 800;
      letter-spacing: 0;
    }

    .remote-shell {
      display: flex;
      flex-direction: column;
      opacity: 0;
      visibility: hidden;
      transform: translateX(16px);
      pointer-events: none;
      transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s ease;
    }

    body.remote-open .remote-shell {
      opacity: 1;
      visibility: visible;
      transform: translateX(0);
      pointer-events: auto;
    }

    .remote-header {
      min-height: 54px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .remote-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: #94a3b8;
      font-size: 0.76rem;
      font-weight: 800;
      white-space: nowrap;
    }

    .remote-status-dot {
      width: 8px;
      height: 8px;
      border-radius: 99px;
      background: #64748b;
    }

    .remote-status.online .remote-status-dot {
      background: #22c55e;
      box-shadow: 0 0 12px rgba(34, 197, 94, 0.65);
    }

    .remote-status.offline .remote-status-dot {
      background: #ef4444;
      box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
    }

    .remote-close-btn,
    .remote-toggle-btn {
      min-width: 44px;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border: 1px solid rgba(56, 189, 248, 0.25);
      border-radius: 999px;
      background: rgba(14, 165, 233, 0.1);
      color: #bae6fd;
      font: inherit;
      font-weight: 900;
      cursor: pointer;
      transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    }

    .remote-toggle-btn {
      padding: 0 14px;
    }

    .remote-toggle-btn:hover,
    .remote-close-btn:hover {
      transform: translateY(-1px);
      background: rgba(14, 165, 233, 0.18);
      border-color: rgba(56, 189, 248, 0.46);
    }

    .remote-frame-wrap {
      position: relative;
      flex: 1;
      min-height: 0;
      background: #030712;
    }

    .remote-frame {
      width: 100%;
      height: 100%;
      border: 0;
      display: block;
      background: #030712;
    }

    body.remote-disabled #remote-toggle,
    body.remote-disabled #remote-panel {
      display: none;
    }

    /* ═══════════════════════════════════════════════════════════════════════
       Mobile & Tablet Responsive Tweaks
    ═══════════════════════════════════════════════════════════════════════ */
        /* Mobile Unmute Floating Pill Badge */
    .mobile-unmute-badge {
      position: absolute;
      top: 14px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 23;
      display: none;
      align-items: center;
      gap: 9px;
      padding: 9px 18px;
      background: rgba(15, 23, 42, 0.92);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 1px solid rgba(234, 179, 8, 0.5);
      border-radius: var(--radius-pill);
      color: #fef08a;
      font-size: 0.88rem;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(234, 179, 8, 0.25);
      animation: pulse-unmute 2s infinite ease-in-out;
      transition: opacity 0.25s ease, transform 0.25s ease;
      user-select: none;
      -webkit-user-select: none;
    }

    .mobile-unmute-badge.visible {
      display: flex;
    }

    .mobile-unmute-badge svg {
      width: 18px;
      height: 18px;
      stroke: var(--accent-gold);
      flex-shrink: 0;
    }

    @keyframes pulse-unmute {
      0%, 100% { transform: translateX(-50%) scale(1); }
      50%      { transform: translateX(-50%) scale(1.04); }
    }

    /* Fallback Manual Play Overlay for Mobile */
    .mobile-play-fallback {
      position: absolute;
      inset: 0;
      z-index: 24;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(4, 6, 12, 0.75);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .mobile-play-fallback.visible {
      display: flex;
    }

    .mobile-play-big-btn {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      padding: 14px 28px;
      background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%);
      color: #0d0f17;
      font-size: 1.05rem;
      font-weight: 900;
      font-family: inherit;
      border: none;
      border-radius: var(--radius-pill);
      box-shadow: 0 12px 32px rgba(234, 179, 8, 0.45), 0 0 20px rgba(234, 179, 8, 0.3);
      cursor: pointer;
      transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-play-big-btn:active {
      transform: scale(0.96);
    }

    .mobile-play-big-btn svg {
      width: 22px;
      height: 22px;
    }

    /* ═══════════════════════════════════════════════════════════════════════
       Mobile Auto-Fullscreen & Landscape Expansion
       (توسع المشغل تلقائياً لملء كامل الشاشة عند إمالة الجوال بالعرض)
    ═══════════════════════════════════════════════════════════════════════ */
    @media (orientation: landscape) and (max-height: 520px),
           (orientation: landscape) and (max-width: 950px) and (max-height: 600px),
           screen and (max-width: 950px) and (orientation: landscape) {
      body {
        --header-h: 0px !important;
        overflow: hidden !important;
      }

      .top-header {
        display: none !important;
      }

      .remote-shell {
        display: none !important;
      }

      .stage-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
      }

      .player-theater-card {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
      }

      .ambient-glow {
        display: none !important;
      }

      .controls-overlay {
        padding: 0 env(safe-area-inset-right, 16px) env(safe-area-inset-bottom, 8px) env(safe-area-inset-left, 16px) !important;
      }
    }

    body.is-mobile-landscape .top-header,
    body.fullscreen-active .top-header {
      display: none !important;
    }

    body.is-mobile-landscape .remote-shell,
    body.is-mobile-landscape #remote-toggle,
    body.fullscreen-active .remote-shell,
    body.fullscreen-active #remote-toggle {
      display: none !important;
    }

    body.is-mobile-landscape {
      --header-h: 0px !important;
    }

    body.is-mobile-landscape .stage-wrapper,
    body.fullscreen-active .stage-wrapper {
      padding: 0 !important;
      margin: 0 !important;
      width: 100vw !important;
      height: 100vh !important;
      height: 100dvh !important;
    }

    body.is-mobile-landscape .player-theater-card,
    body.fullscreen-active .player-theater-card {
      width: 100vw !important;
      max-width: 100vw !important;
      height: 100vh !important;
      height: 100dvh !important;
      max-height: 100vh !important;
      max-height: 100dvh !important;
      aspect-ratio: auto !important;
      border-radius: 0 !important;
      border: none !important;
      box-shadow: none !important;
    }

    body.is-mobile-landscape .ambient-glow,
    body.fullscreen-active .ambient-glow {
      display: none !important;
    }

    @media (min-width: 1600px) {
      .stage-wrapper {
        grid-template-columns: minmax(0, 1fr) 0;
        gap: 16px;
        padding: 14px 20px 18px;
      }

      body.remote-open .stage-wrapper {
        grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
      }
    }

    @media (max-width: 980px) {
      body {
        overflow: hidden;
      }

      .stage-wrapper,
      body.remote-open .stage-wrapper {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(80px, 1fr);
        gap: 10px;
        align-content: start;
        overflow-y: auto;
      }

      .player-theater-card {
        order: 1;
        width: 100% !important;
        height: auto !important;
      }

      .remote-shell {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        z-index: 120;
        height: min(72dvh, 620px);
        border-radius: 18px;
        opacity: 0;
        transform: translateY(105%);
      }

      body.remote-open .remote-shell {
        opacity: 1;
        transform: translateY(0);
      }

    }

@media (max-width: 768px) {
      .stage-wrapper {
        padding: 4px 6px 6px;
      }

      .player-theater-card {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 100% !important;
        aspect-ratio: 16 / 9;
        border-radius: var(--radius-md);
      }

      .control-actions-row {
        padding: 8px 12px 10px;
      }

      .vol-slider-input {
        width: 50px;
      }

      .standby-stage {
        width: 110px;
        height: 110px;
      }

      .standby-avatar-card {
        width: 104px;
        height: 104px;
      }

      .offline-title {
        font-size: 1.1rem;
      }

      .offline-sub {
        font-size: 0.82rem;
        max-width: 300px;
      }
    }

    .auth-overlay {
      position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px;
      background: rgba(4, 5, 8, .90); backdrop-filter: blur(16px);
      transition: opacity .2s ease, visibility .2s ease;
    }
    .auth-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
    .auth-card {
      width: min(430px, 100%); padding: clamp(26px, 6vw, 38px); text-align: center;
      border: 1px solid rgba(234, 179, 8, .25); border-radius: 22px;
      background: rgba(13, 15, 22, .96); box-shadow: 0 28px 80px rgba(0, 0, 0, .52);
    }
    .auth-icon { font-size: 2.3rem; margin-bottom: 10px; }
    .auth-title { font-size: 1.3rem; font-weight: 900; margin-bottom: 8px; }
    .auth-copy { color: var(--text-muted); font-size: .88rem; line-height: 1.7; margin-bottom: 20px; }
    .auth-form { display: grid; gap: 10px; }
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    .auth-input {
      width: 100%; min-height: 48px; padding: 12px 15px; border-radius: 12px;
      border: 1px solid var(--border-hover); background: rgba(255,255,255,.05); color: var(--text-main);
      font: inherit; text-align: center; outline: none;
    }

      .player-theater-card {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 100% !important;
        aspect-ratio: 16 / 9;
        border-radius: var(--radius-md);
      }

      .control-actions-row {
        padding: 8px 12px 10px;
      }

      .vol-slider-input {
        width: 50px;
      }

      .standby-stage {
        width: 110px;
        height: 110px;
      }

      .standby-avatar-card {
        width: 104px;
        height: 104px;
      }

      .offline-title {
        font-size: 1.1rem;
      }

      .offline-sub {
        font-size: 0.82rem;
        max-width: 300px;
      }
    }

    .auth-overlay {
      position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px;
      background: rgba(4, 5, 8, .90); backdrop-filter: blur(16px);
      transition: opacity .2s ease, visibility .2s ease;
    }
    .auth-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
    .auth-card {
      width: min(430px, 100%); padding: clamp(26px, 6vw, 38px); text-align: center;
      border: 1px solid rgba(234, 179, 8, .25); border-radius: 22px;
      background: rgba(13, 15, 22, .96); box-shadow: 0 28px 80px rgba(0, 0, 0, .52);
    }
    .auth-icon { font-size: 2.3rem; margin-bottom: 10px; }
    .auth-title { font-size: 1.3rem; font-weight: 900; margin-bottom: 8px; }
    .auth-copy { color: var(--text-muted); font-size: .88rem; line-height: 1.7; margin-bottom: 20px; }
    .auth-form { display: grid; gap: 10px; }
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    .auth-input {
      width: 100%; min-height: 48px; padding: 12px 15px; border-radius: 12px;
      border: 1px solid var(--border-hover); background: rgba(255,255,255,.05); color: var(--text-main);
      font: inherit; text-align: center; outline: none;
    }
    .auth-input:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px var(--accent-gold-glow); }
    .auth-submit {
      min-height: 48px; border: 0; border-radius: 12px; cursor: pointer;
      background: linear-gradient(135deg, #facc15, #d69d06); color: #171202; font: inherit; font-weight: 900;
    }
    .auth-submit:disabled { opacity: .58; cursor: wait; }
    #auth-gate { direction: rtl; grid-template-rows: minmax(0, 1fr); }
    #auth-gate .auth-card { max-height: 100%; min-height: 0; overflow-y: auto; }
    .auth-error { min-height: 22px; color: #fca5a5; font-size: .82rem; margin-top: 8px; }
    .player-btn { min-width: 44px; min-height: 44px; }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    }

    /* ═══════════════════════════════════════════════════════════════════════
       OBS Status Badge
    ═══════════════════════════════════════════════════════════════════════ */
    .obs-badge {
      display: none; /* يُظهَر بـ JS بعد التحقق من badge_visible */
      align-items: center;
      gap: 7px;
      padding: 6px 13px;
      border-radius: var(--radius-pill);
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.1);
      font-size: 0.82rem;
      font-weight: 700;
      color: #94a3b8;
      user-select: none;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
      transition: all 0.3s ease;
      cursor: pointer;
      white-space: nowrap;
    }

    .obs-badge:hover {
      transform: translateY(-1px);
      border-color: rgba(56, 189, 248, 0.36);
      color: #e2e8f0;
    }

    .obs-command-panel {
      position: fixed;
      top: calc(var(--header-h, 86px) + 8px);
      left: 50%;
      z-index: 70;
      width: min(430px, calc(100vw - 26px));
      padding: 16px;
      border: 1px solid rgba(148, 163, 184, 0.18);
      border-radius: 16px;
      background: rgba(8, 13, 23, 0.96);
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(22px) saturate(150%);
      -webkit-backdrop-filter: blur(22px) saturate(150%);
      direction: rtl;
      opacity: 0;
      visibility: hidden;
      transform: translate(-50%, -8px);
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    }

    body.obs-panel-open .obs-command-panel {
      opacity: 1;
      visibility: visible;
      transform: translate(-50%, 0);
      pointer-events: auto;
    }

    .obs-panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .obs-panel-title {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .obs-panel-title strong {
      color: #f8fafc;
      font-size: 1rem;
      font-weight: 900;
    }

    .obs-panel-title span,
    .obs-panel-note {
      color: #94a3b8;
      font-size: 0.78rem;
      line-height: 1.6;
    }

    .obs-panel-close {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(148, 163, 184, 0.16);
      border-radius: 12px;
      background: rgba(15, 23, 42, 0.72);
      color: #cbd5e1;
      cursor: pointer;
    }

    .obs-home-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 12px;
    }

    .obs-home-btn {
      min-height: 48px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border: 1px solid rgba(148, 163, 184, 0.16);
      border-radius: 13px;
      color: #e2e8f0;
      background: rgba(15, 23, 42, 0.72);
      font: inherit;
      font-weight: 900;
      cursor: pointer;
    }

    .obs-home-btn:disabled {
      opacity: 0.55;
      cursor: wait;
    }

    .obs-home-btn.start {
      color: #bbf7d0;
      border-color: rgba(34, 197, 94, 0.32);
      background: rgba(34, 197, 94, 0.10);
    }

    .obs-home-btn.stop {
      color: #fecaca;
      border-color: rgba(239, 68, 68, 0.34);
      background: rgba(239, 68, 68, 0.10);
    }

    .obs-home-error {
      min-height: 20px;
      color: #fca5a5;
      font-size: 0.78rem;
    }

    .obs-badge.obs-live {
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.45);
      color: #fca5a5;
      box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
    }

    .obs-badge.obs-recording {
      background: rgba(234, 179, 8, 0.08);
      border-color: rgba(234, 179, 8, 0.35);
      color: #fef08a;
    }

    .obs-badge.obs-disconnected {
      opacity: 0.45;
    }

    .obs-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #64748b;
      flex-shrink: 0;
    }

    .obs-badge.obs-live .obs-dot {
      background: #ef4444;
      box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
      animation: pulse-dot 1.2s infinite;
    }

    .obs-badge.obs-recording .obs-dot {
      background: #eab308;
      box-shadow: 0 0 8px rgba(234, 179, 8, 0.7);
      animation: pulse-dot 1.8s infinite;
    }

    body.obs-disabled .obs-badge,
    body.obs-disabled #obs-badge {
      display: none !important;
    }

    @media (max-width: 640px) {
      .obs-badge .obs-scene,
      .obs-badge .obs-timecode { display: none; }
    }

    /* Home command bar polish */
    .home-command-bar {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 16px;
      padding: 8px 18px;
    }

    .header-center-cluster {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      min-width: 0;
    }

    .command-pill {
      min-height: 46px;
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(8, 13, 23, 0.72));
      border: 1px solid rgba(148, 163, 184, 0.16);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 28px rgba(0, 0, 0, 0.28);
    }

    .remote-command {
      padding: 5px 12px 5px 8px;
      color: #dff8ff;
      gap: 10px;
    }

    .command-icon {
      width: 30px;
      height: 30px;
      display: grid;
      place-items: center;
      border-radius: 10px;
      background: rgba(14, 165, 233, 0.12);
      color: #67e8f9;
      border: 1px solid rgba(56, 189, 248, 0.18);
      flex: 0 0 auto;
    }

    .command-icon svg {
      width: 18px;
      height: 18px;
    }

    .obs-command {
      padding: 8px 13px;
      gap: 9px;
      color: #e2e8f0;
      font-weight: 900;
    }

    .obs-command.obs-live {
      border-color: rgba(239, 68, 68, 0.42);
      background: linear-gradient(180deg, rgba(127, 29, 29, 0.42), rgba(15, 23, 42, 0.72));
    }

    .obs-command.obs-recording {
      border-color: rgba(234, 179, 8, 0.42);
      background: linear-gradient(180deg, rgba(113, 63, 18, 0.34), rgba(15, 23, 42, 0.72));
    }

    .viewer-count-badge,
    .header-schedule-btn {
      min-height: 42px;
      border-radius: 13px;
    }

    @media (max-width: 900px) {
      .home-command-bar {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
      }
      .header-center-cluster {
        justify-content: flex-end;
      }
      .command-pill {
        min-height: 40px;
      }
      .command-icon {
        width: 28px;
        height: 28px;
      }
      .remote-command {
        padding: 5px 9px;
      }
    }

    @media (max-width: 640px) {
      .home-command-bar {
        grid-template-columns: auto auto;
        justify-content: space-between;
      }
      .header-center-cluster {
        order: 3;
        grid-column: 1 / -1;
        justify-content: center;
        width: 100%;
      }
      .header-right-cluster {
        justify-content: flex-end;
      }
      .remote-command .remote-status {
        display: inline-flex;
      }
      .obs-command-panel {
        top: 106px;
      }
    }
  