@layer reset, base, components, utilities;

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  html {
    scroll-behavior: smooth;
  }
  body {
    font-family: 'Tajawal', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
  }
}

@layer base {
  :root {
    color-scheme: dark;

    /* Theme colors: HSL tailored */
    --color-gold-h: 45;
    --color-gold-s: 90%;
    --color-gold-l: 62%;
    --color-gold: hsl(var(--color-gold-h), var(--color-gold-s), var(--color-gold-l));
    --color-gold-glow: hsla(var(--color-gold-h), var(--color-gold-s), var(--color-gold-l), 0.22);
    --gold: var(--color-gold);
    --gold-dim: hsla(var(--color-gold-h), var(--color-gold-s), var(--color-gold-l), 0.12);

    --color-mint-h: 160;
    --color-mint-s: 82%;
    --color-mint-l: 54%;
    --color-mint: hsl(var(--color-mint-h), var(--color-mint-s), var(--color-mint-l));
    --mint: var(--color-mint);
    --mint-dim: hsla(var(--color-mint-h), var(--color-mint-s), var(--color-mint-l), 0.12);

    --color-sky-h: 205;
    --color-sky-s: 100%;
    --color-sky-l: 65%;
    --color-sky: hsl(var(--color-sky-h), var(--color-sky-s), var(--color-sky-l));
    --sky: var(--color-sky);
    --sky-dim: hsla(var(--color-sky-h), var(--color-sky-s), var(--color-sky-l), 0.12);

    --color-rose-h: 355;
    --color-rose-s: 90%;
    --color-rose-l: 70%;
    --color-rose: hsl(var(--color-rose-h), var(--color-rose-s), var(--color-rose-l));
    --rose: var(--color-rose);
    --rose-dim: hsla(var(--color-rose-h), var(--color-rose-s), var(--color-rose-l), 0.12);

    /* UI Surfaces */
    --bg: #030712; /* Deep space slate */
    --bg2: #090d16;
    --surface: rgba(15, 23, 42, 0.45);
    --surface-2: rgba(245, 200, 74, 0.06);
    --border: rgba(245, 200, 74, 0.16);
    --border-2: rgba(245, 200, 74, 0.32);

    --text: #f8fafc;
    --text-2: #cbd5e1;
    --text-3: #64748b;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 4px 16px -4px rgba(0, 0, 0, 0.4);
  }

  /* Ambient drifting stadium lighting blobs */
  body::before {
    content: '';
    position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
      radial-gradient(circle 800px at 85% -10%, rgba(245, 200, 74, 0.08), transparent 70%),
      radial-gradient(circle 700px at 15% 15%, rgba(200, 16, 46, 0.12), transparent 75%),
      radial-gradient(circle 650px at 50% 90%, rgba(46, 232, 165, 0.05), transparent 70%),
      linear-gradient(to bottom, var(--bg) 0%, var(--bg2) 100%);
    animation: bgPulse 16s ease-in-out infinite alternate;
  }
  @keyframes bgPulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.04) translate(10px, -10px); }
  }

  /* Typography */
  h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.1; text-wrap: balance; }
  h2 { font-size: clamp(1.1rem, 2.5vw, 1.45rem); font-weight: 800; line-height: 1.2; text-wrap: balance; }
  h3 { font-size: 1rem; font-weight: 700; }
  p, span, li { line-height: 1.65; text-wrap: pretty; }
}

@layer components {
  /* Glass Surface Utility */
  .glass {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }
  .glass:hover {
    border-color: var(--border-2);
  }

  /* Layout wrappers */
  .wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
  .stack { display: flex; flex-direction: column; }
  .row { display: flex; align-items: center; }

  /* Floating Glass Header */
  #site-header {
    position: sticky; top: 1rem; z-index: 50;
    margin: 1rem auto 0;
    max-width: 1100px;
    width: calc(100% - 2.5rem);
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow), 0 0 20px rgba(245, 200, 74, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #site-header:hover {
    border-color: var(--border-2);
    box-shadow: var(--shadow), 0 0 25px rgba(245, 200, 74, 0.08);
  }
  #site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0; }

  .logo { display: flex; align-items: center; gap: 0.75rem; }
  .logo-img {
    width: 44px; height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 12px rgba(245,200,74,0.3));
  }
  .logo-text { font-weight: 900; font-size: 1.05rem; line-height: 1.15; }
  .logo-text span { display: block; font-size: 0.7rem; font-weight: 500; color: var(--gold); }

  .header-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.88rem; font-weight: 700;
    cursor: pointer; border: none; outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none; white-space: nowrap;
    position: relative;
    overflow: hidden;
  }
  .btn:hover { transform: translateY(-2px); }
  .btn:active { transform: scale(0.97) translateY(0); }

  .btn-primary {
    background: var(--mint); color: #03140f;
    box-shadow: 0 4px 14px rgba(46,232,165,0.25);
  }
  .btn-primary:hover {
    background: #4efcca;
    box-shadow: 0 6px 20px rgba(46,232,165,0.4);
  }

  .btn-ghost {
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border);
  }
  .btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--border-2);
  }

  .btn-danger {
    background: rgba(248,113,113,0.12); color: var(--rose);
    border: 1px solid rgba(248,113,113,0.25);
  }
  .btn-danger:hover {
    background: rgba(248,113,113,0.22);
    border-color: rgba(248,113,113,0.45);
  }

  .btn-gold {
    background: var(--gold); color: #1a0e00; font-weight: 800;
    box-shadow: 0 4px 14px rgba(245,200,74,0.25);
  }
  .btn-gold:hover {
    background: #ffd96b;
    box-shadow: 0 6px 20px rgba(245,200,74,0.4);
  }

  .btn-sm { padding: 0.38rem 0.85rem; font-size: 0.8rem; border-radius: 6px; }
  .btn-lg { padding: 0.85rem 1.8rem; font-size: 1rem; border-radius: var(--radius); }

  /* Dev badge */
  .dev-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.75rem; border-radius: 999px;
    background: rgba(245,200,74,0.12); border: 1px solid rgba(245,200,74,0.35);
    color: var(--gold); font-size: 0.75rem; font-weight: 700;
  }
  @media (max-width: 768px) {
    .dev-badge { display: none; }
    #site-header {
      top: 0.75rem;
      width: calc(100% - 1.5rem);
      padding: 0.6rem 1rem;
      gap: 0.5rem;
    }
    .logo-img { width: 36px; height: 36px; }
    .logo-text { font-size: 0.95rem; }
    .logo-text span { font-size: 0.65rem; }
    .header-actions { gap: 0.4rem; }
  }

  @media (max-width: 480px) {
    #site-header {
      top: 0.5rem;
      width: calc(100% - 1rem);
      padding: 0.5rem 0.75rem;
      border-radius: 12px;
    }
    #site-header .wrap { gap: 0.5rem; }
    .logo-img { width: 32px; height: 32px; }
    .logo-text { font-size: 0.88rem; }
    .logo-text span { font-size: 0.6rem; }
    .header-actions { gap: 0.3rem; }
    .btn { padding: 0.45rem 0.85rem; font-size: 0.75rem; }
    .btn-sm { padding: 0.3rem 0.7rem; font-size: 0.7rem; }
  }

  /* ── Global Countdown Bar ──────────────────────────────────────────── */
  #global-countdown-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(
      135deg,
      rgba(5, 10, 22, 0.96) 0%,
      rgba(10, 18, 36, 0.94) 50%,
      rgba(6, 12, 26, 0.96) 100%
    );
    border-bottom: 1px solid rgba(245, 200, 74, 0.18);
    box-shadow:
      0 2px 20px rgba(0, 0, 0, 0.55),
      0 0 60px rgba(245, 200, 74, 0.04) inset;
    overflow: hidden;
    /* GPU compositing layer — prevents iOS scroll jank */
    transform: translateZ(0);
    will-change: transform;
  }

  /* Particle canvas — full-bleed behind content */
  #gc-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
    transition: opacity 0.6s ease;
  }

  /* Breathing watermark logo */
  #gc-bg-logo {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    object-fit: contain;
    opacity: 0.18;
    /* Initial fallback position (overridden by JS) */
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(44px, 7vw, 80px);
    height: clamp(44px, 7vw, 80px);
    filter:
      drop-shadow(0 0 18px rgba(245, 200, 74, 0.45))
      drop-shadow(0 0 5px rgba(245, 200, 74, 0.25));
    will-change: transform, opacity;
    transition: filter 0.3s ease;
  }

  /* Ripple overlay (click/hover interactive) */
  #gc-bg-logo-shadow {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,200,74,0.55) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transform: scale(0.4);
  }

  /* Impact ring burst */
  #gc-bg-impact {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(245, 200, 74, 0.7);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transform: scale(0.4);
  }

  /* Cursor hover — show golden glow trail on bar */
  #global-countdown-bar:hover #gc-bg-logo {
    filter:
      drop-shadow(0 0 24px rgba(245, 200, 74, 0.65))
      drop-shadow(0 0 8px rgba(245, 200, 74, 0.35));
  }

  @media (max-width: 768px) {
    #global-countdown-bar {
      min-height: 60px;
      gap: 0.75rem;
      padding: 0.6rem 1rem;
    }
    #gc-bg-logo { width: clamp(32px, 5vw, 60px); height: clamp(32px, 5vw, 60px); }
  }

  @media (max-width: 480px) {
    #global-countdown-bar {
      min-height: 52px;
      gap: 0.5rem;
      padding: 0.5rem 0.75rem;
      flex-wrap: wrap;
    }
    #gc-bg-logo { width: clamp(28px, 4vw, 48px); height: clamp(28px, 4vw, 48px); opacity: 0.1; }
    #gc-timer { font-size: 0.75rem; }
  }

  /* Section Containers */
  .section { padding: 2rem 0; position: relative; z-index: 1; }
  .section-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem;
  }
  .section-title {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 1.35rem; font-weight: 900;
    color: var(--text);
  }
  .section-icon {
    position: relative;
    width: 44px; height: 44px;
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
  }
  .section-icon .base-cup {
    width: 26px; height: 26px; object-fit: contain;
  }
  .section-icon .identity-overlay {
    position: absolute; bottom: -4px; right: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; border: 1.5px solid var(--bg2);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 2;
  }
  .section-icon .identity-overlay.gold { background: var(--gold); color: #1a0e00; }
  .section-icon .identity-overlay.mint { background: var(--mint); color: #03140f; }
  .section-icon .identity-overlay.sky { background: var(--sky); color: #002040; }
  .section-icon .identity-overlay.purple { background: #c084fc; color: #200040; }

  /* Live dot & banner */
  #live-banner {
    display: none; margin: 1.5rem 0; padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.3);
    align-items: center; gap: 1rem;
    box-shadow: 0 8px 30px rgba(34,197,94,0.05);
  }
  #live-banner.show { display: flex; }
  .live-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: #22c55e; flex-shrink: 0;
    animation: livePulse 1.4s ease-in-out infinite;
  }
  @keyframes livePulse {
    0%   { opacity: 0.5; box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
    50%  { opacity: 1;   box-shadow: 0 0 0 8px rgba(34,197,94,0); }
    100% { opacity: 0.5; box-shadow: 0 0 0 0 rgba(34,197,94,0); }
  }

  /* Leaderboard UI */
  #leaderboard-section .toggle-row,
  #matches-filter-toggle.toggle-row {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 999px; padding: 3px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  }
  #leaderboard-section .toggle-btn,
  #matches-filter-toggle .toggle-btn {
    font-family: inherit; min-width: 96px;
    padding: 0.35rem 0.75rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 800; line-height: 1.1;
    cursor: pointer; border: 1px solid transparent;
    background: transparent; color: var(--text-2);
    transition: all 0.2s ease;
    white-space: nowrap;
  }
  #leaderboard-section .toggle-btn:hover,
  #matches-filter-toggle .toggle-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
  }
  #leaderboard-section .toggle-btn.active,
  #matches-filter-toggle .toggle-btn.active {
    background: linear-gradient(180deg, rgba(245, 200, 74, 0.25), rgba(245, 200, 74, 0.12));
    color: #ffe8a0;
    border-color: rgba(245, 200, 74, 0.3);
    box-shadow: 0 4px 12px rgba(245, 200, 74, 0.12);
  }

  .lb-container {
    max-height: 440px; overflow-y: auto; overflow-x: auto;
    border-radius: var(--radius);
  }
  .lb-container::-webkit-scrollbar { width: 6px; height: 6px; }
  .lb-container::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
  .lb-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
  .lb-container::-webkit-scrollbar-thumb:hover { background: var(--color-gold); }

  .lb-table {
    width: 100%; min-width: 320px; border-collapse: separate; border-spacing: 0;
    font-size: 0.9rem;
  }
  .lb-table th {
    position: sticky; top: 0; z-index: 2;
    background: #0f172a;
    padding: 0.75rem 1rem; text-align: start;
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-3); border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .lb-table td { padding: 0.8rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.03); white-space: nowrap; }
  .lb-table tr:last-child td { border-bottom: none; }
  .lb-table tr:hover td { background: rgba(255,255,255,0.015); }
  @media (max-width: 768px) {
    .lb-table td, .lb-table th { padding: 0.8rem 0.75rem; }
  }

  .lb-rank { font-size: 1rem; font-weight: 900; width: 2.5rem; text-align: center; color: var(--text-2); }
  .lb-pts {
    font-size: 1.05rem; font-weight: 800; color: var(--mint);
    font-family: 'Inter', sans-serif;
  }
  .lb-my-row td { background: rgba(46,232,165,0.05) !important; }

  @media (max-width: 480px) {
    .lb-col-accuracy, .lb-col-preds { display: none; }
    .lb-table { font-size: 0.82rem; min-width: 220px; }
    .lb-table th, .lb-table td { padding: 0.65rem 0.5rem; }
  }

  /* 3D Visual Leaderboard Podium */
  .podium-container {
    display: flex; align-items: flex-end; justify-content: center;
    gap: 0.75rem; margin: 1.5rem auto 2rem; padding: 1rem 0.5rem;
    max-width: 580px; width: 100%; direction: rtl;
  }
  .podium-col {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    position: relative; transition: all 0.3s ease;
  }
  .podium-col.placeholder { visibility: hidden; }

  /* Podium visually: 2nd on right, 1st center, 3rd left in RTL flow */
  .podium-gold { order: 2; z-index: 3; }
  .podium-silver { order: 1; z-index: 2; }
  .podium-bronze { order: 3; z-index: 1; }

  .podium-avatar {
    width: 68px; height: 68px; border-radius: 50%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex; align-items: center; justify-content: center;
    position: relative; margin-bottom: 0.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--text-3);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .podium-gold .podium-avatar {
    width: 82px; height: 82px;
    border-color: var(--color-gold);
    box-shadow: 0 0 20px var(--color-gold-glow);
  }
  .podium-silver .podium-avatar { border-color: #94a3b8; }
  .podium-bronze .podium-avatar { border-color: #b45309; }

  .podium-col:hover .podium-avatar {
    transform: translateY(-4px) scale(1.04);
  }

  .avatar-badge { position: absolute; top: -8px; right: -8px; font-size: 1.2rem; }
  .podium-gold .avatar-badge { font-size: 1.5rem; top: -10px; right: -10px; }
  
  .avatar-initials {
    font-family: 'Inter', sans-serif; font-size: 1.1rem; font-weight: 800;
    color: var(--text-2);
  }
  .podium-gold .avatar-initials { font-size: 1.3rem; color: var(--color-gold); }

  .podium-name {
    font-size: 0.88rem; font-weight: 800; color: var(--text);
    text-align: center; max-width: 110px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 0.15rem;
  }
  .podium-me-tag { display: block; font-size: 0.65rem; color: var(--color-mint); margin-top: 1px; }

  .podium-pts { font-size: 0.82rem; color: var(--mint); margin-bottom: 0.5rem; }
  .podium-pts strong { font-family: 'Inter', sans-serif; font-size: 1.1rem; font-weight: 800; }
  .podium-gold .podium-pts strong { font-size: 1.3rem; }
  .pts-lbl { font-size: 0.7rem; color: var(--text-3); }

  .podium-accuracy { display: flex; gap: 0.3rem; font-size: 0.72rem; margin-bottom: 0.6rem; }
  .acc-exact { color: var(--color-gold); font-weight: 700; }
  .acc-ok { color: var(--color-sky); font-weight: 700; }

  .podium-step {
    width: 100%;
    background: linear-gradient(to bottom, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid var(--border); border-bottom: none;
    border-radius: 8px 8px 0 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .podium-gold .podium-step { height: 96px; border-color: rgba(245, 200, 74, 0.28); }
  .podium-silver .podium-step { height: 68px; }
  .podium-bronze .podium-step { height: 44px; }

  .podium-num {
    font-family: 'Inter', sans-serif; font-size: 1.6rem; font-weight: 900;
    color: var(--text-3); opacity: 0.45;
  }
  .podium-gold .podium-num { color: var(--color-gold); opacity: 0.85; font-size: 2.1rem; }
  .podium-silver .podium-num { color: #94a3b8; opacity: 0.8; font-size: 1.8rem; }
  .podium-bronze .podium-num { color: #b45309; opacity: 0.8; }

  .podium-col.is-me .podium-avatar {
    border-color: var(--color-mint);
    box-shadow: 0 0 15px rgba(46, 232, 165, 0.25);
  }

  /* Matches Grid & Premium Match Cards */
  #matches-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
  }
  .match-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    position: relative; overflow: hidden;
  }
  .match-card .card-meta,
  .match-card .card-teams,
  .match-card .card-footer,
  .match-card .my-pred-pill {
    position: relative; z-index: 2;
  }
  
  .match-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-gold);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 200, 74, 0.12);
  }
  .match-card.locked { cursor: default; opacity: 0.78; }
  .match-card.locked:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow); }

  .match-card.user-predicted {
    border-color: var(--color-mint);
    box-shadow: var(--shadow), 0 0 12px rgba(46, 232, 165, 0.08);
  }
  .match-card.user-predicted:hover {
    border-color: #4efcca;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 25px rgba(46, 232, 165, 0.18);
  }
  .match-card.user-predicted::before {
    content: '✓ توقعت';
    position: absolute; top: 0.75rem; right: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, var(--mint), #10b981);
    color: #03140f; font-weight: 800; font-size: 0.7rem;
    border-radius: var(--radius-sm); z-index: 3;
    box-shadow: 0 2px 8px rgba(46,232,165,0.3);
  }

  /* Split background flags on cards */
  .card-flags-bg {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 0; overflow: hidden;
    transition: opacity 0.35s ease, transform 0.35s ease;
    opacity: 0.12;
  }
  .match-card:hover .card-flags-bg {
    opacity: 0.25;
    transform: scale(1.04);
  }
  .card-flag-half {
    flex: 0 0 50%; height: 100%;
    display: flex; align-items: center;
    pointer-events: none; user-select: none; overflow: hidden;
  }
  .card-flag-half .fi {
    font-size: 9.5rem; display: block; flex-shrink: 0;
    filter: saturate(1.2) contrast(1.05);
    transition: transform 0.35s ease;
  }
  .card-flag-half.home { justify-content: flex-end; }
  .card-flag-half.home .fi {
    transform: translateX(25%);
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 85%);
    mask-image: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 85%);
  }
  .card-flag-half.away { justify-content: flex-start; }
  .card-flag-half.away .fi {
    transform: translateX(-25%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 85%);
    mask-image: linear-gradient(to left, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 85%);
  }
  .card-flags-bg::after {
    content: ''; position: absolute;
    top: 10%; bottom: 10%; left: 50%; width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.08) 50%, transparent);
    pointer-events: none;
  }

  .card-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem; gap: 0.5rem; flex-wrap: wrap;
  }
  .card-time { font-size: 0.78rem; color: var(--text-2); font-weight: 600; }
  .card-badges { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

  .badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.25rem 0.65rem; border-radius: 99px;
    font-size: 0.72rem; font-weight: 800;
  }
  .badge-group  { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
  .badge-live   { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
  .badge-finish { background: var(--rose-dim); color: #fca5a5; border: 1px solid rgba(248,113,113,0.22); }
  .badge-soon   { background: rgba(245,200,74,0.12); color: var(--gold); border: 1px solid rgba(245,200,74,0.3); }
  .badge-locked { background: rgba(90,90,120,0.15); color: #94a3b8; border: 1px solid rgba(90,90,120,0.25); }

  .card-teams { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
  .team-name {
    flex: 1; font-size: 1rem; font-weight: 800; line-height: 1.25;
    display: flex; align-items: center; gap: 0.5rem;
  }
  .team-name.home { justify-content: flex-start; }
  .team-name.away { justify-content: flex-end; }
  .team-flag {
    flex-shrink: 0; font-size: 1.2rem; border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  }
  .vs-badge {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(90,180,255,0.15), rgba(46,232,165,0.15));
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 800; color: var(--text-2);
  }

  .card-footer { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-3); }
  .card-footer i { color: var(--sky); }

  .btn-highlights {
    display: inline-flex; align-items: center; gap: 0.45rem;
    margin-top: 0.75rem; padding: 0.45rem 1rem; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(245,200,74,0.16), rgba(245,200,74,0.06));
    border: 1px solid rgba(245,200,74,0.35);
    color: var(--gold); font-size: 0.78rem; font-weight: 800;
    cursor: pointer; text-decoration: none; justify-content: center;
    transition: all 0.2s ease;
  }
  .btn-highlights:hover {
    background: linear-gradient(135deg, rgba(245,200,74,0.28), rgba(245,200,74,0.12));
    box-shadow: 0 4px 12px rgba(245,200,74,0.2);
    transform: translateY(-1px);
  }

  .my-pred-pill {
    margin-top: 0.8rem; padding: 0.5rem 0.85rem; border-radius: var(--radius-sm);
    font-size: 0.8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  }
  .my-pred-pill.pending   { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
  .my-pred-pill.pts-exact { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.2); }
  .my-pred-pill.pts-ok    { background: var(--sky-dim); color: #93c5fd; border: 1px solid rgba(90,180,255,0.2); }
  .my-pred-pill.pts-miss  { background: var(--rose-dim); color: #fca5a5; border: 1px solid rgba(248,113,113,0.2); }

  /* Who is Here Widget */
  #who-is-here {
    display: none; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    padding: 0.6rem 1.1rem; border-radius: var(--radius); margin-top: 1rem;
  }
  #who-is-here.has-users { display: flex; }
  #wih-label { font-size: 0.7rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; flex-shrink: 0; }
  #wih-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; flex: 1; }
  .wih-chip {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.22rem 0.55rem;
    border-radius: 99px; font-size: 0.75rem; font-weight: 600; border: 1px solid transparent;
  }
  .wih-chip.me     { background: rgba(46,232,165,.08); border-color: rgba(46,232,165,.22); color: var(--mint); }
  .wih-chip.admin  { background: rgba(245,200,74,.08); border-color: rgba(245,200,74,.22); color: var(--gold); }
  .wih-chip.user   { background: rgba(90,180,255,.06); border-color: rgba(90,180,255,.18); color: var(--sky); }
  .wih-chip.recent { opacity: 0.55; }
  .wih-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
  .wih-dot.now    { background: var(--mint); box-shadow: 0 0 5px var(--mint); }
  .wih-dot.recent { background: var(--gold); }

  /* Total Hits widget */
  #hits-counter {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    margin: 2.5rem auto 0; padding: 0.75rem 1.5rem; width: fit-content;
    border-radius: 999px; font-size: 0.85rem; font-weight: 700; color: var(--text-2);
    visibility: hidden;
  }
  #hits-counter.loaded { visibility: visible; }
  #hits-counter i { color: var(--gold); }
  #hits-counter strong {
    font-family: 'Inter', sans-serif; font-size: 1.15rem; font-weight: 800; color: var(--gold);
    letter-spacing: 0.04em;
  }

  /* Latest predictions list cards */
  #latest-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
  }
  .latest-card { border-radius: var(--radius); padding: 1rem; font-size: 0.86rem; }
  .latest-card .pred-score { font-family: 'Inter', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--gold); }
  .latest-match-name { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; font-size: 0.73rem; color: var(--text-3); }
  .latest-match-name .fi { flex-shrink: 0; border-radius: 2px; }
  @media (max-width: 500px) {
    #latest-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .latest-card { padding: 0.75rem; }
  }

  /* My predictions cards */
  #my-predictions-list { display: flex; flex-direction: column; gap: 0.85rem; }
  .my-pred-card { border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
  .my-pred-card .pred-info { flex: 1; min-width: 180px; }
  .pts-badge {
    padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 800;
    font-family: 'Inter', sans-serif; white-space: nowrap; flex-shrink: 0;
  }

  /* Modal Base */
  .modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: none; align-items: flex-start; justify-content: center;
    padding: 1.5rem; overflow-y: auto;
    
    /* Support Discrete Animations */
    transition: display 0.3s allow-discrete, opacity 0.3s;
    opacity: 0;
  }
  .modal-overlay.show {
    display: flex;
    opacity: 1;
    
    @starting-style {
      opacity: 0;
    }
  }

  .modal-box {
    width: 100%; max-width: 520px;
    border-radius: var(--radius-xl); padding: 2rem;
    position: relative; margin: auto;
    max-height: calc(100dvh - 3rem); overflow: auto;
    
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0.92) translateY(15px);
  }
  .modal-overlay.show .modal-box {
    transform: scale(1) translateY(0);
    
    @starting-style {
      transform: scale(0.92) translateY(15px);
    }
  }

  .modal-close {
    position: absolute; top: 1rem; left: 1rem;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-2); font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
  }
  .modal-close:hover { color: var(--text); border-color: var(--border-2); background: rgba(255,255,255,0.05); }

  /* Prediction modal specifics */
  #pred-modal .score-picker {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem 1rem 1rem; text-align: center;
  }
  #pred-modal-box { max-width: 720px; width: min(720px, 100%); overflow-x: hidden; padding-bottom: 1.5rem; }
  #pred-modal .scores-row { display: flex; gap: 0.75rem; align-items: stretch; margin-bottom: 1.25rem; }
  #pred-modal .modal-actions { display: flex; gap: 0.5rem; align-items: stretch; }
  #pred-modal .modal-actions > .btn { min-width: 0; }
  
  .score-num {
    font-family: 'Inter', sans-serif; font-size: 3rem; font-weight: 900; line-height: 1;
    min-width: 80px; display: inline-block; transition: transform 0.12s ease;
  }
  .score-num.bump { transform: scale(1.2); }
  
  .score-adj {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border-2);
    color: var(--text); font-size: 1.25rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
  }
  .score-adj:hover { border-color: var(--mint); color: var(--mint); background: var(--mint-dim); }
  .score-adj:active { transform: scale(0.9); }
  
  .score-presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem; margin-top: 0.75rem; }
  .score-preset {
    padding: 0.35rem 0; border-radius: 7px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-2); font-size: 0.82rem; font-weight: 700;
    cursor: pointer; transition: all 0.15s;
  }
  .score-preset:hover { border-color: var(--mint); color: var(--mint); background: var(--mint-dim); }
  .score-preset.active { background: var(--mint-dim); border-color: var(--mint); color: var(--mint); }

  /* Auth modal specifics */
  #auth-modal .tab-row {
    display: flex; gap: 0.4rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 3px; margin-bottom: 1.5rem;
  }
  #auth-modal .tab-btn {
    flex: 1; padding: 0.55rem; border-radius: 7px;
    font-size: 0.88rem; font-weight: 700;
    border: none; background: transparent; color: var(--text-2); cursor: pointer;
    transition: all 0.2s;
  }
  #auth-modal .tab-btn.active { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }

  .form-field { margin-bottom: 1rem; }
  .form-field label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text-2); margin-bottom: 0.4rem; }
  .form-field input {
    width: 100%; background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 0.75rem 1rem; color: #fff; font-family: inherit; font-size: 0.95rem;
    outline: none; transition: border-color 0.2s ease;
  }
  .form-field input:focus { border-color: var(--mint); }
  .form-hint { font-size: 0.75rem; color: var(--text-3); margin-top: 0.35rem; }
  .form-error {
    background: var(--rose-dim); border: 1px solid rgba(248,113,113,0.3);
    color: #fca5a5; border-radius: var(--radius-sm);
    padding: 0.65rem 0.95rem; font-size: 0.84rem; font-weight: 600;
    margin-bottom: 1rem; display: none;
  }
  .form-error.show { display: block; }

  /* 60s pre-match countdown modal */
  #countdown-modal {
    background: linear-gradient(135deg, rgba(3, 7, 18, 0.92) 0%, rgba(28, 6, 12, 0.94) 100%) !important;
    position: relative; overflow: hidden;
  }
  #countdown-modal::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background-image:
      radial-gradient(ellipse 400px 300px at 30% 20%, rgba(245,200,74,0.06) 0%, transparent 50%),
      radial-gradient(ellipse 350px 280px at 70% 70%, rgba(248,113,113,0.05) 0%, transparent 50%);
    animation: countdownBgBreathe 4s ease-in-out infinite; pointer-events: none;
  }
  @keyframes countdownBgBreathe {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
  }
  #countdown-modal .modal-box {
    position: relative; z-index: 10;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(245, 200, 74, 0.2);
    box-shadow: inset 0 0 30px rgba(245,200,74,0.06);
  }
  #countdown-modal-logo {
    position: absolute; z-index: 1; opacity: 0.08; width: 280px; height: auto;
    filter: drop-shadow(0 0 20px rgba(245,200,74,0.1));
    animation: countdownLogoAnimate 12s linear infinite; pointer-events: none;
  }
  @keyframes countdownLogoAnimate {
    0% { bottom: 20%; right: 15%; transform: rotate(0deg) scale(1); }
    12% { bottom: 70%; right: 20%; transform: rotate(45deg) scale(1.05); }
    24% { bottom: 75%; right: 60%; transform: rotate(90deg) scale(1.08); }
    36% { bottom: 65%; right: 80%; transform: rotate(135deg) scale(1.06); }
    48% { bottom: 25%; right: 75%; transform: rotate(180deg) scale(1.04); }
    60% { bottom: 15%; right: 50%; transform: rotate(225deg) scale(1.05); }
    72% { bottom: 20%; right: 20%; transform: rotate(270deg) scale(1.07); }
    84% { bottom: 45%; right: 15%; transform: rotate(315deg) scale(1.06); }
    100% { bottom: 20%; right: 15%; transform: rotate(360deg) scale(1); }
  }
  #countdown-modal .countdown-circle { position: relative; width: 120px; height: 120px; margin: 0 auto 1.25rem; z-index: 15; }
  #countdown-modal svg.ring { transform: rotate(-90deg); position: absolute; inset: 0; filter: drop-shadow(0 0 8px rgba(248,113,113,0.3)); }
  #countdown-modal .ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 8; }
  #countdown-modal .ring-progress {
    fill: none; stroke: var(--rose); stroke-width: 8; stroke-linecap: round;
    stroke-dasharray: 339; stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.5s;
    filter: drop-shadow(0 0 12px currentColor);
  }
  #countdown-modal .ring-num {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: 'Inter', sans-serif; font-size: 2.2rem; font-weight: 900; color: var(--rose);
    text-shadow: 0 0 20px rgba(248,113,113,0.5);
  }

  /* Toasts */
  #toast-container {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none;
  }
  .toast {
    padding: 0.7rem 1.4rem; border-radius: 99px; font-size: 0.88rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 0.5rem; box-shadow: var(--shadow);
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: all;
  }
  @keyframes toastIn {
    from { opacity: 0; transform: translateY(15px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  .toast-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.35); color: #86efac; }
  .toast-error   { background: var(--rose-dim); border: 1px solid rgba(248,113,113,0.3); color: #fca5a5; }
  .toast-info    { background: var(--sky-dim); border: 1px solid rgba(90,180,255,0.3); color: #93c5fd; }

  /* Prediction success modal toast overlay */
  #pred-toast-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,0); backdrop-filter: blur(0px);
    display: flex; align-items: center; justify-content: center; pointer-events: none;
    transition: background 0.25s ease, backdrop-filter 0.25s ease;
  }
  #pred-toast-overlay.show { background: rgba(3, 7, 18, 0.65); backdrop-filter: blur(5px); pointer-events: all; }
  #pred-toast-box {
    background: linear-gradient(145deg, rgba(30,40,60,0.96), rgba(15,22,40,0.98));
    border: 1px solid rgba(46,232,165,0.35); border-radius: 1.25rem;
    padding: 2.2rem 2.8rem; text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.65);
    transform: scale(0.82) translateY(20px); opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
    min-width: 280px; max-width: 350px; direction: rtl;
  }
  #pred-toast-overlay.show #pred-toast-box { transform: scale(1) translateY(0); opacity: 1; }
  #pred-toast-box .ptb-icon { font-size: 3rem; margin-bottom: 0.6rem; animation: ptbPop 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.15s both; }
  @keyframes ptbPop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  #pred-toast-box .ptb-title { font-size: 1.25rem; font-weight: 800; color: var(--mint); margin-bottom: 0.3rem; }
  #pred-toast-box .ptb-sub { font-size: 0.88rem; color: var(--text-2); line-height: 1.55; }

  /* Empty state */
  .empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-3); font-size: 0.92rem; }
  .empty-state i { font-size: 2rem; margin-bottom: 0.75rem; display: block; opacity: 0.3; }

  /* Interactive Onboarding Tour */
  #tutorial-overlay { position: fixed; inset: 0; z-index: 11000; display: none; pointer-events: none; }
  #tutorial-overlay.show { display: block; }
  .tutorial-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 18, 0.75); backdrop-filter: blur(3px); transition: all 0.28s ease; pointer-events: auto; }
  .tutorial-spotlight {
    position: fixed; top: 0; left: 0; width: 0; height: 0; border-radius: var(--radius-lg);
    border: 2px solid var(--color-gold); box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
    background: radial-gradient(circle at center, rgba(245,200,74,0.12), rgba(245,200,74,0.02));
    opacity: 0; transition: all 0.28s ease; pointer-events: none;
  }
  .tutorial-spotlight::after {
    content: ''; position: absolute; inset: -12px; border-radius: inherit;
    border: 1px solid rgba(245, 200, 74, 0.35); animation: tutorialPulse 1.6s ease-in-out infinite;
  }
  .tutorial-spotlight.hidden { opacity: 0; width: 0; height: 0; }
  .tutorial-popover {
    position: fixed; width: min(380px, calc(100vw - 32px));
    background: linear-gradient(180deg, rgba(20, 26, 44, 0.97), rgba(9, 12, 20, 0.98));
    color: #fff; border: 1px solid rgba(245, 200, 74, 0.35); border-radius: 24px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.55), 0 0 28px rgba(245,200,74,0.1);
    padding: 1.25rem; direction: rtl; pointer-events: auto;
    transition: top 0.28s ease, left 0.28s ease, opacity 0.2s ease;
  }
  .tutorial-progress { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 0.75rem; color: var(--text-3); font-size: 0.78rem; font-family: 'Inter', sans-serif; direction: ltr; }
  .tutorial-title { color: #fff; text-align: right; font-size: 1rem; font-weight: 800; }
  .tutorial-description { margin-top: 0.8rem; color: #d8deee; text-align: right; font-size: 0.95rem; line-height: 1.7; }
  .tutorial-actions { display: flex; justify-content: space-between; gap: 0.7rem; margin-top: 1rem; direction: ltr; }
  
  .tutorial-btn {
    appearance: none; border: none; border-radius: 12px; padding: 0.7rem 1rem;
    font-family: inherit; font-size: 0.88rem; font-weight: 800; cursor: pointer;
    transition: all 0.18s ease;
  }
  .tutorial-btn:hover { transform: translateY(-1px); }
  .tutorial-btn-primary { background: var(--gold); color: #1a0e00; flex: 1; }
  .tutorial-btn-secondary { background: rgba(255,255,255,0.08); color: #c9d3ea; border: 1px solid rgba(255,255,255,0.12); min-width: 94px; }
  .tutorial-btn-ghost { background: transparent; color: #8e9ab4; padding-inline: 0.25rem; }
  .tutorial-btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
  @keyframes tutorialPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.02); opacity: 0.55; } }
  
  @media (max-width: 640px) {
    .tutorial-popover { width: calc(100vw - 24px); padding: 1rem; }
    .tutorial-btn { font-size: 0.84rem; padding: 0.65rem 0.85rem; }
  }

  /* Splash Screen Preloader */
  #splash-screen {
    position: fixed; inset: 0; z-index: 10000;
    background: radial-gradient(circle at 50% 40%, #0c1220 0%, #04070e 80%);
    display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
    transition: opacity .4s ease, visibility .4s ease;
  }
  #splash-screen.hidden,
  #splash-screen.is-dismissed {
    opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; display: none !important;
  }

  /* Preloader overlay */
  #preloader {
    position: fixed; inset: 0; z-index: 9999;
    background: radial-gradient(circle at 50% 40%, #0c1220 0%, #04070e 80%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1.5rem;
  }
  #preloader.hidden {
    display: none !important; opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  .spinner {
    width: 48px; height: 48px; border: 3px solid rgba(245,200,74,0.2);
    border-top-color: var(--gold); border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
  }
  @keyframes spinnerRotate { to { transform: rotate(360deg); } }

  #splash-bg-glow { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 40% at 50% 55%, rgba(200,16,46,.15) 0%, transparent 70%); opacity: 0; }
  #splash-grid {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
    background-size: 60px 60px; opacity: 0;
  }
  #splash-ball-wrap { position: relative; display: flex; flex-direction: column; align-items: center; z-index: 2; }
  #splash-ring-svg {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: calc(clamp(170px,42vw,230px) + 28px); height: calc(clamp(170px,42vw,230px) + 28px);
    opacity: 0; z-index: 3;
  }
  #splash-ring-track { fill: none; stroke: rgba(255,255,255,.05); stroke-width: 3; }
  #splash-ring-progress {
    fill: none; stroke: url(#ringGrad); stroke-width: 3; stroke-linecap: round;
    stroke-dasharray: 1000; stroke-dashoffset: 1000;
    transform-origin: 50% 50%; transform: rotate(-90deg);
    transition: stroke-dashoffset 0.5s ease-out;
  }
  #splash-ball-3d {
    width: clamp(170px, 42vw, 230px); height: clamp(170px, 42vw, 230px);
    border-radius: 50%; overflow: hidden;
    box-shadow:
      inset -14px -14px 30px rgba(0,0,0,.65),
      inset 5px 5px 16px rgba(255,255,255,.1),
      0 0 60px rgba(245,200,74,.25),
      0 20px 44px rgba(0,0,0,.6);
    transform-origin: center center; will-change: transform;
  }
  #splash-ball-3d::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.18) 0%, transparent 55%);
  }
  #splash-ball { width: 100%; height: 100%; object-fit: cover; display: block; }
  #splash-shadow {
    width: clamp(120px, 30vw, 170px); height: clamp(12px, 3vw, 20px); border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0,0,0,.55) 0%, transparent 70%);
    margin-top: 8px; transform-origin: center; will-change: transform, opacity;
  }
  #splash-impact-ring {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%) scale(0);
    width: clamp(170px,42vw,230px); height: clamp(170px,42vw,230px); border-radius: 50%;
    border: 3px solid rgba(245,200,74,.6); opacity: 0;
  }
  #splash-particles { position: absolute; inset: 0; pointer-events: none; }
  .splash-tagline {
    color: rgba(245,200,74,.85); font-size: clamp(.85rem, 2vw, 1.05rem); font-weight: 800;
    letter-spacing: .18em; text-transform: uppercase; margin-top: 2rem; opacity: 0;
    background: linear-gradient(90deg, rgba(245,200,74,0) 0%, rgba(245,200,74,1) 30%, #fff 50%, rgba(245,200,74,1) 70%, rgba(245,200,74,0) 100%);
    background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  }
  .splash-tagline.shimmer { animation: shimmerSweep 2s linear infinite; }
  @keyframes shimmerSweep { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }
  #splash-screen.iris-out {
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.55s cubic-bezier(0.7,0,1,1), opacity 0.1s ease 0.5s, visibility 0s 0.6s;
  }

  /* Sponsor reveal inside preload */
  #splash-sponsor { display: flex; flex-direction: column; align-items: center; margin-top: 1.6rem; opacity: 0; }
  #splash-sponsor-label { color: rgba(255,255,255,0.4); font-size: clamp(0.62rem, 1.3vw, 0.76rem); font-weight: 500; margin-bottom: 0.55rem; direction: rtl; }
  #splash-sponsor-stage { position: relative; width: min(475px, 93vw); height: 170px; display: flex; align-items: center; justify-content: center; perspective: 900px; }
  #splash-sponsor-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  #splash-sponsor-card {
    position: relative; z-index: 2; background: rgba(255,255,255,0.96); border-radius: 14px;
    padding: 13px 34px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); opacity: 0;
  }
  #splash-sponsor-card.glowing { animation: sponsorPulse 2.6s ease-in-out infinite; }
  @keyframes sponsorPulse {
    0%,100% { box-shadow: 0 8px 40px rgba(0,0,0,0.45), 0 0 0 2px rgba(245,200,74,0.6), 0 0 50px rgba(245,200,74,0.3); }
    50%      { box-shadow: 0 8px 40px rgba(0,0,0,0.45), 0 0 0 3px rgba(245,200,74,0.9), 0 0 75px rgba(245,200,74,0.5); }
  }
  #splash-sponsor-card img { height: 110px; width: auto; display: block; object-fit: contain; }

  /* Footer Sponsor Credits */
  .footer-sponsor-wrap { margin-bottom: 1.6rem; padding-bottom: 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .footer-sponsor-label { color: rgba(255,255,255,0.3); font-size: 0.7rem; font-weight: 500; margin-bottom: 0.65rem; direction: rtl; }
  .footer-sponsor-card { display: inline-block; background: rgba(255,255,255,0.92); border-radius: 10px; padding: 7px 16px; box-shadow: var(--shadow-sm); }
  .footer-sponsor-card img { height: 56px; width: auto; display: block; object-fit: contain; }

  /* Live Match Stats Panel */
  #live-stats-panel {
    display: none; margin: 0 0 1.5rem; border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(46, 232, 165, 0.25);
    background: linear-gradient(135deg, rgba(46, 232, 165, 0.06) 0%, rgba(15, 23, 42, 0.95) 70%);
    box-shadow: 0 8px 32px rgba(46, 232, 165, 0.08);
    animation: lspFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  #live-stats-panel.visible { display: block; }
  @keyframes lspFadeIn { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
  
  .lsp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1.25rem; background: rgba(46, 232, 165, 0.08);
    border-bottom: 1px solid rgba(46, 232, 165, 0.15); flex-wrap: wrap; gap: 0.4rem;
  }
  .lsp-live-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: var(--color-mint); color: #03140f; font-size: 0.7rem; font-weight: 800;
    padding: 0.25rem 0.6rem; border-radius: 6px; text-transform: uppercase;
  }
  .lsp-live-badge::before {
    content:''; width:7px; height:7px; border-radius:50%; background:#03140f;
    animation: lspBlink 1s infinite;
  }
  .lsp-clock { font-size: 0.82rem; color: rgba(255,255,255,0.6); font-variant-numeric: tabular-nums; font-weight: 600; }
  
  .lsp-scoreboard { display: flex; align-items: center; justify-content: center; gap: 1.25rem; padding: 1.25rem 1rem 0.5rem; }
  .lsp-team { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; min-width: 90px; }
  .lsp-team-name { font-size: 0.85rem; color: var(--text-2); font-weight: 700; }
  .lsp-score-box {
    display: flex; align-items: center; gap: 0.6rem;
    font-size: 2.6rem; font-weight: 900; color: #fff; letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
  }
  .lsp-score-sep { color: rgba(255,255,255,0.25); font-weight: 300; }
  
  .lsp-possession {
    margin: 0.75rem 1.25rem 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem; align-items: center;
  }
  .lsp-poss-label { font-size: 0.65rem; color: var(--text-3); text-transform: uppercase; text-align: center; }
  .lsp-poss-bar-wrap { position: relative; height: 6px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,0.08); }
  .lsp-poss-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--color-mint), #00c8ff); transition: width 0.8s ease; }
  .lsp-poss-pct { font-size: 0.72rem; font-weight: 800; color: var(--text-2); }
  
  .lsp-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.6rem; padding: 1rem 1.25rem; }
  .lsp-stat {
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); border-radius: 10px; padding: 0.6rem 0.4rem;
    text-align: center; display: flex; flex-direction: column; gap: 0.2rem;
  }
  .lsp-stat-label { font-size: 0.62rem; color: var(--text-3); text-transform: uppercase; }
  .lsp-stat-values { display: flex; justify-content: center; align-items: center; gap: 0.5rem; }
  .lsp-stat-val { font-size: 1.05rem; font-weight: 800; color: #fff; }
  .lsp-stat-sep { font-size: 0.7rem; color: rgba(255,255,255,0.2); }
  
  .lsp-events {
    padding: 0 1.25rem 0.85rem; max-height: 180px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
  }
  .lsp-events-title { font-size: 0.65rem; color: var(--text-3); text-transform: uppercase; margin-bottom: 0.5rem; }
  .lsp-event-row {
    display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.78rem; color: rgba(255,255,255,0.85);
    padding: 0.25rem 0; border-bottom: 1px solid rgba(255,255,255,0.03);
  }
  .lsp-event-clock { min-width: 32px; color: var(--text-3); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
  .lsp-refresh-note { text-align: center; font-size: 0.62rem; color: var(--text-3); padding: 0.3rem 1rem 0.6rem; }

  /* Latest Updates widget */
  #latest-updates-widget {
    display: none; margin: 2rem auto 0; max-width: 460px;
    background: linear-gradient(140deg, rgba(15,23,42,0.95) 0%, rgba(9,12,22,0.98) 100%);
    border: 1px solid rgba(245,200,74,0.15); border-radius: 1rem; overflow: hidden;
    box-shadow: var(--shadow);
  }
  .cl-header { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1.1rem; background: rgba(255,255,255,0.015); border-bottom: 1px solid rgba(255,255,255,0.03); }
  .cl-new-badge {
    background: linear-gradient(135deg, var(--gold) 0%, #e59e0c 100%);
    color: #030712; font-size: 0.62rem; font-weight: 900;
    padding: 0.2rem 0.55rem; border-radius: 4px;
    animation: clBadgePulse 2s ease-in-out infinite;
  }
  @keyframes clBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,200,74,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(245,200,74,0); }
  }
  .cl-header-label { font-size: 0.68rem; font-weight: 700; color: var(--text-3); direction: rtl; }
  .cl-body { display: flex; align-items: center; gap: 1rem; padding: 1.1rem; border-left: 3px solid var(--gold); min-height: 5.8rem; }
  .cl-body[data-type="enhancement"] { border-left-color: var(--sky); }
  .cl-body[data-type="fix"]         { border-left-color: var(--mint); }
  .cl-body[data-type="launch"]      { border-left-color: var(--rose); }
  .cl-icon-wrap { flex-shrink: 0; width: 3rem; text-align: center; }
  .cl-icon { font-size: 2rem; display: inline-block; filter: drop-shadow(0 0 8px rgba(245,200,74,0.2)); }
  .cl-icon.pop { transform: scale(1.3) rotate(-8deg); filter: drop-shadow(0 0 12px rgba(245,200,74,0.5)); }
  .cl-content { flex: 1; min-width: 0; }
  .cl-slide-title { font-size: 0.9rem; font-weight: 800; color: #fff; margin-bottom: 0.35rem; direction: rtl; text-align: right; line-height: 1.35; }
  .cl-slide-desc { font-size: 0.75rem; color: var(--text-2); direction: rtl; text-align: right; line-height: 1.5; margin-bottom: 0.4rem; }
  .cl-slide-meta { font-size: 0.6rem; color: var(--gold); opacity: 0.7; }
  
  .cl-footer { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 1.1rem 0.65rem; border-top: 1px solid rgba(255,255,255,0.03); }
  .cl-dots { display: flex; gap: 0.35rem; flex-shrink: 0; }
  .cl-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.15); cursor: pointer; transition: background 0.3s, transform 0.25s, width 0.3s; }
  .cl-dot.active { background: var(--gold); transform: scale(1.2); width: 14px; border-radius: 3px; }
  .cl-progress-track { flex: 1; height: 2px; background: rgba(255,255,255,0.05); border-radius: 1px; overflow: hidden; }
  .cl-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), #e59e0c); }

  /* Footer logo parent */
  .footer-logo-parent { height: 36px; width: auto; object-fit: contain; border-radius: 6px; opacity: 0.75; }

  /* Footer 3D model attribution */
  .footer-model-credit {
    margin-top: 0.65rem;
    color: var(--text-3);
    font-size: 0.72rem;
    direction: ltr;
  }
  .footer-model-credit a {
    color: var(--text-3);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
  }
  .footer-model-credit a:hover { color: var(--text-2); }

  /* Footer Grok credit */
  .footer-grok-credit { margin-top: 1rem; }
  .footer-grok-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.52);
    font-size: 0.76rem;
    direction: rtl;
    text-decoration: none;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease, transform 0.25s ease;
  }
  .footer-grok-link:hover {
    border-color: rgba(245,200,74,0.28);
    background: rgba(245,200,74,0.06);
    color: rgba(255,255,255,0.88);
    transform: translateY(-1px);
  }
  .footer-grok-label { line-height: 1; }
  .footer-grok-logo {
    height: 18px;
    width: auto;
    display: block;
    opacity: 0.9;
    transition: opacity 0.25s ease;
  }
  .footer-grok-link:hover .footer-grok-logo { opacity: 1; }

  /* Unsplash static mobile fallback background */
  #bg-mobile-fallback {
    display: none; position: absolute; inset: 0;
    background: radial-gradient(circle at center, rgba(12,20,38,0.7) 0%, rgba(3,5,10,0.95) 100%);
    opacity: 0.2;
  }

  #bg-model-container { position: fixed; top: 0; right: 0; width: 60vw; height: 100vh; z-index: -1; opacity: 0; pointer-events: none; }
  #bg-model-container.loaded { animation: cinematicEntrance 2.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
  @keyframes cinematicEntrance { 0% { opacity: 0; transform: translateY(50px) scale(0.9); } 100% { opacity: 0.75; transform: translateY(0) scale(1); } }
  #bg-model-canvas { width: 100%; height: 100%; display: block; }
  
  body > header, body > main, body > footer, #global-countdown-bar { opacity: 0; }
  body.ready > header, body.ready > main, body.ready > footer, body.ready #global-countdown-bar {
    animation: uiFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.6s;
  }
  @keyframes uiFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

  /* ── FlipDown Countdown Timer (Optimized) ─────────────────────────────── */
  #gc-timer {
    font-family: 'Inter', monospace;
    font-weight: 700;
    letter-spacing: 0.05em;
  }

  /* Enhanced dark theme with brand colors */
  #gc-timer.flipdown.flipdown__theme-dark {
    font-family: 'Inter', monospace;
    font-weight: 700;
  }

  #gc-timer.flipdown.flipdown__theme-dark .rotor,
  #gc-timer.flipdown.flipdown__theme-dark .rotor-top,
  #gc-timer.flipdown.flipdown__theme-dark .rotor-leaf-front {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(10, 18, 36, 0.95) 100%);
    color: var(--gold);
    border: 1px solid rgba(245, 200, 74, 0.2);
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(245, 200, 74, 0.1), 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  #gc-timer.flipdown.flipdown__theme-dark .rotor-bottom,
  #gc-timer.flipdown.flipdown__theme-dark .rotor-leaf-rear {
    background: linear-gradient(180deg, rgba(10, 18, 36, 0.95) 0%, rgba(5, 10, 22, 0.98) 100%);
    color: rgba(245, 200, 74, 0.8);
    border-radius: 8px;
  }

  #gc-timer.flipdown.flipdown__theme-dark .rotor:after {
    border-top: 1px solid rgba(245, 200, 74, 0.15);
  }

  #gc-timer.flipdown.flipdown__theme-dark .rotor-group:nth-child(n+2):nth-child(-n+3):before,
  #gc-timer.flipdown.flipdown__theme-dark .rotor-group:nth-child(n+2):nth-child(-n+3):after {
    background: var(--gold);
    box-shadow: 0 0 6px rgba(245, 200, 74, 0.4);
  }

  #gc-timer.flipdown.flipdown__theme-dark .rotor-group-heading:before {
    color: var(--text-2);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  /* Hide days rotor when < 24h remaining */
  #gc-timer.no-days .rotor-group:first-child {
    display: none;
  }

  /* Highlight timer on critical countdown (< 1 hour) */
  #gc-timer.highlight-timer .rotor {
    animation: timerPulse 1.5s ease-in-out infinite;
  }
  @keyframes timerPulse {
    0%, 100% { box-shadow: inset 0 1px 3px rgba(245, 200, 74, 0.1), 0 4px 12px rgba(0, 0, 0, 0.4); }
    50% { box-shadow: inset 0 1px 3px rgba(245, 200, 74, 0.2), 0 8px 20px rgba(245, 200, 74, 0.15); }
  }

  /* Mobile responsive optimization */
  @media (max-width: 768px) {
    #gc-timer.flipdown {
      width: auto;
      height: auto;
      transform: scale(0.85);
      transform-origin: right center;
    }
  }

  @media (max-width: 480px) {
    #gc-timer.flipdown {
      transform: scale(0.7);
    }
  }

  .divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

  /* Clickable user profile badge in header */
  #user-name-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.4rem 0.85rem;
    cursor: pointer; transition: all 0.2s ease;
  }
  #user-name-chip:hover {
    background: rgba(245,200,74,0.12); border-color: var(--gold);
    box-shadow: 0 0 10px rgba(245, 200, 74, 0.05);
  }

  /* Score update blinker */
  .score-pulse { animation: scorePulse 0.7s ease; }
  @keyframes scorePulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.7) drop-shadow(0 0 8px currentColor); } }

  /* Profile modal */
  #profile-modal .modal-box { max-width: 420px; }
  .profile-avatar {
    width: 68px; height: 68px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #e0a800);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 900; color: #000;
    margin: 0 auto 1rem; box-shadow: 0 0 0 3px rgba(245,200,74,.2);
  }
  .profile-email { text-align: center; color: var(--text-3); font-size: .82rem; margin-bottom: 1.5rem; }
  .profile-section-title { font-size: .78rem; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; }
  .profile-input {
    width: 100%; padding: .7rem 1rem; background: rgba(0,0,0,.35);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-family: inherit; font-size: .95rem; outline: none; transition: border-color .2s;
  }
  .profile-input:focus { border-color: var(--gold); }
  .profile-field { margin-bottom: .85rem; }
  .profile-err { color: var(--rose); font-size: .82rem; min-height: 1.1em; margin-top: .35rem; }
  .profile-ok  { color: var(--mint); font-size: .82rem; min-height: 1.1em; margin-top: .35rem; }

  /* ── 3D World-Space Office ─────────────────────────────────────────────── */
  #office-shell {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
  }

  #office-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
  }

  #office-css3d-host,
  .office-css3d-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
  }

  #office-nav {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 45;
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-width: calc(100vw - 2rem);
    overflow-x: auto;
    scrollbar-width: none;
  }
  #office-nav::-webkit-scrollbar { display: none; }

  .office-nav-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-3);
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
    white-space: nowrap;
    min-width: 3.4rem;
  }
  .office-nav-btn i { font-size: 0.95rem; }
  .office-nav-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
  }
  .office-nav-btn.active {
    color: var(--gold);
    background: var(--surface-2);
    border-color: var(--border-2);
    transform: translateY(-2px);
  }

  #office-hint {
    display: none;
    position: fixed;
    top: calc(5.5rem + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 44;
    margin: 0;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.68rem;
    color: var(--text-3);
    background: rgba(3, 7, 18, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
    direction: rtl;
  }
  #office-hint kbd {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    background: rgba(245, 200, 74, 0.12);
    color: var(--gold);
    font-family: inherit;
    font-size: 0.62rem;
  }

  body.office-mode {
    overflow-y: auto;
    overflow-x: hidden;
  }
  body.office-mode #office-shell,
  body.office-mode #office-nav,
  body.office-mode #office-hint {
    display: block;
  }
  body.office-mode #office-nav {
    display: flex;
  }

  body.office-mode #bg-model-container.office-hidden,
  body.office-mode #bg-model-container {
    opacity: 0 !important;
    visibility: hidden;
  }

  body.office-mode > footer {
    display: none;
  }

  body.office-mode #office-panels-root {
    position: fixed;
    inset: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  body.office-mode #site-header,
  body.office-mode #global-countdown-bar {
    z-index: 50;
    pointer-events: auto;
  }

  .office-screen,
  body.office-mode .office-panel-mounted {
    pointer-events: auto;
    backface-visibility: hidden;
    transform-style: preserve-3d;
  }

  body.office-mode .office-panel-mounted {
    background: linear-gradient(160deg, rgba(12, 18, 32, 0.96) 0%, rgba(8, 12, 22, 0.98) 100%);
    border: 1px solid rgba(245, 200, 74, 0.22);
    border-radius: var(--radius);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.03) inset,
      0 18px 50px rgba(0, 0, 0, 0.55),
      0 0 40px rgba(245, 200, 74, 0.06);
    overflow: hidden;
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 200, 74, 0.25) transparent;
  }

  body.office-mode .office-panel-mounted.office-panel-focused {
    border-color: rgba(245, 200, 74, 0.45);
    box-shadow:
      0 0 0 1px rgba(245, 200, 74, 0.15) inset,
      0 22px 60px rgba(0, 0, 0, 0.6),
      0 0 55px rgba(245, 200, 74, 0.12);
  }

  body.office-mode #office-screen-live {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
  }

  body.office-mode #office-screen-social {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.65rem;
  }

  body.office-mode #office-screen-social #who-is-here,
  body.office-mode #office-screen-social #hits-counter {
    margin: 0;
  }

  body.office-mode .section {
    padding: 0.85rem;
  }

  body.office-mode .section-header {
    margin-bottom: 0.75rem;
  }

  body.office-mode #matches-grid,
  body.office-mode #latest-grid {
    max-height: 52vh;
    overflow-y: auto;
  }

  body.office-mode #lb-body {
    max-height: 48vh;
    overflow-y: auto;
  }

  @media (max-width: 768px) {
    #office-shell,
    #office-nav,
    #office-hint {
      display: none !important;
    }
  }
}

@layer utilities {
  .fade-up { animation: fadeUp 0.5s ease both; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
  
  /* Keyboard outline accessibility focus states */
  input:focus-visible, button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
    outline: 2.5px solid var(--color-mint) !important;
    outline-offset: 3px !important;
  }
  
  /* Touch target sizes on coarse pointers (mobiles) */
  @media (pointer: coarse) {
    .btn, button, input, [role="button"] {
      min-block-size: 44px;
      min-inline-size: 44px;
    }
  }

  /* View Transitions API configurations */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.28s;
  }
}