/* ============================================================
   تكتيك هجومي — Public Page CSS
   § 1  Reference style block — copied verbatim from
        design_reference/stage5_design_reference.html <style>…</style>
        Do NOT restyle or "clean up" this section.
   § 2  Real-page context overrides — minimal adaptations so the
        phone-screen classes work on a full-browser page instead of
        inside .phone>.screen (a fixed-size positioned container).
   § 3  Extra classes used by app.js / replay.js but absent from
        the reference (skeletons, badge-img, state-wrap, etc.).
   ============================================================ */

/* ── § 1  VERBATIM REFERENCE ──────────────────────────────── */

  :root{
    --g1:#1E5FA8;  /* blob 1 */
    --g2:#E0603A;  /* blob 2 */
    --g3:#C23B4E;  /* blob 3 */
    --g4:#0E2E52;  /* base */

    --glass:rgba(255,255,255,.10);
    --glass-2:rgba(255,255,255,.16);
    --glass-in:rgba(255,255,255,.06);

    /* Tunable appearance (overridden by applyAppearance() in app.js) */
    --blob-opacity:0.45;         /* background_intensity default 45 */
    --blob-opacity-sub:0.36;     /* wall i — slightly less than main blobs */
    --veil-a:0.82;               /* veil_strength default 82 */
    --card-glass:rgba(6,12,22,.86);   /* card_opacity default 86 — dark-subtractive */
    --card-glass-2:rgba(14,22,38,.80); /* card hover */
    --edge:rgba(255,255,255,.22);
    --edge-soft:rgba(255,255,255,.12);

    --txt:#FFFFFF;
    --txt-2:rgba(255,255,255,.72);
    --txt-3:rgba(255,255,255,.48);

    --pitch:#7BD97A;
    --live:#FF7A5C;
    --bad:#FF6B6B;
  }
  *{box-sizing:border-box;margin:0;padding:0}
  html,body{font-family:'Tajawal',sans-serif;-webkit-font-smoothing:antialiased}
  body{
    min-height:100vh;padding:46px 20px 80px;
    background:#0B1220;color:#fff;
    position:relative;overflow-x:hidden;
  }
  .num{font-family:'Space Grotesk','Tajawal',sans-serif;font-variant-numeric:tabular-nums}

  /* ============ page backdrop ============ */
  .page-bg{position:fixed;inset:0;z-index:-2;background:var(--g4);transition:background 1.2s ease}
  .blob{position:fixed;border-radius:50%;filter:blur(90px);opacity:.85;z-index:-1;transition:background 1.2s ease}
  .b1{width:56vw;height:56vw;background:var(--g1);top:-14vw;right:-10vw;animation:d1 26s ease-in-out infinite}
  .b2{width:52vw;height:52vw;background:var(--g2);bottom:-16vw;left:-8vw;animation:d2 31s ease-in-out infinite}
  .b3{width:40vw;height:40vw;background:var(--g3);bottom:-6vw;right:14vw;animation:d3 36s ease-in-out infinite}
  @keyframes d1{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(-4vw,5vw) scale(1.1)}}
  @keyframes d2{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(5vw,-4vw) scale(1.08)}}
  @keyframes d3{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(-3vw,-3vw) scale(1.14)}}

  /* ============ page head ============ */
  .top{max-width:1100px;margin:0 auto 40px;text-align:center;position:relative;z-index:2}
  .lock{
    display:inline-flex;align-items:center;gap:13px;padding:13px 24px 13px 19px;border-radius:24px;
    background:var(--glass);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
    border:1px solid var(--edge);box-shadow:0 8px 32px rgba(0,0,0,.22);
  }
  .lock svg{width:30px;height:38px}
  .lock .w{font-size:22px;font-weight:300;letter-spacing:.05em;line-height:1.1;text-align:right}
  .lock .w b{display:block;font-weight:300}
  .top p{color:var(--txt-2);font-size:13px;margin-top:16px}

  .stage{display:flex;justify-content:center;align-items:flex-start;gap:54px;max-width:1100px;margin:0 auto;flex-wrap:wrap;position:relative;z-index:2}
  .grp{display:flex;flex-direction:column;align-items:center}
  .grp .lbl{font-size:12.5px;font-weight:700;color:var(--txt-2);margin-bottom:18px;display:flex;align-items:center;gap:8px}
  .grp .lbl i{width:6px;height:6px;border-radius:50%;background:#fff;font-style:normal;opacity:.7}

  /* ============ phone ============ */
  .phone{
    width:375px;height:812px;background:rgba(0,0,0,.35);border-radius:52px;padding:11px;
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 40px 80px -20px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.16);
    animation:in .75s cubic-bezier(.2,.8,.2,1) both;
  }
  .grp.b .phone{animation-delay:.14s}
  @keyframes in{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:none}}
  .screen{
    width:100%;height:100%;border-radius:42px;overflow:hidden;position:relative;display:flex;flex-direction:column;
    background:linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.45));
  }
  /* the in-phone wallpaper — swappable from admin */
  .wall{position:absolute;inset:0;z-index:0;transition:opacity .8s ease}
  .wall::before,.wall::after{content:"";position:absolute;border-radius:50%;filter:blur(52px);transition:background 1s ease}
  .wall::before{width:110%;height:55%;background:var(--g1);top:-14%;right:-22%;opacity:var(--blob-opacity);animation:w1 24s ease-in-out infinite}
  .wall::after{width:120%;height:60%;background:var(--g2);bottom:-20%;left:-26%;opacity:var(--blob-opacity);animation:w2 29s ease-in-out infinite}
  .wall i{position:absolute;width:80%;height:38%;border-radius:50%;filter:blur(48px);background:var(--g3);bottom:6%;right:-14%;opacity:var(--blob-opacity-sub);animation:w3 33s ease-in-out infinite}
  @keyframes w1{0%,100%{transform:translate(0,0)}50%{transform:translate(-6%,7%)}}
  @keyframes w2{0%,100%{transform:translate(0,0)}50%{transform:translate(7%,-6%)}}
  @keyframes w3{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(-5%,-4%) scale(1.12)}}
  .veil{position:absolute;inset:0;z-index:1;background:linear-gradient(180deg,rgb(6 10 20/calc(var(--veil-a)*.75)),rgb(6 10 20/var(--veil-a)));pointer-events:none}
  .layer{position:relative;z-index:2;display:flex;flex-direction:column;height:100%}

  /* .island removed — was mockup-only chrome */
  .sb{display:flex;justify-content:space-between;align-items:center;padding:16px 26px 8px;font-size:12.5px;font-weight:700;flex-shrink:0;color:#fff}
  .sb .ic{display:flex;gap:5px;align-items:center;opacity:.9}
  .scroll{flex:1;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;padding-bottom:40px}
  .scroll::-webkit-scrollbar{display:none}

  /* ============ top navbar (public page) ============ */
  .topnav{display:flex;align-items:center;justify-content:space-between;padding:0 20px;
          background:#fff;border-bottom:1px solid rgba(0,0,0,.08);height:62px;flex-shrink:0}
  .topnav-brand{display:flex;align-items:center;gap:10px}
  .topnav-logo{height:40px;width:auto;display:block;border-radius:6px}
  .topnav-text{display:flex;flex-direction:column;gap:1px}
  .topnav-title{font-size:15px;font-weight:800;color:#111;letter-spacing:-.01em;line-height:1.1}
  .topnav-sub{font-size:10px;font-weight:500;color:rgba(0,0,0,.42);line-height:1}
  .topnav-btn{width:38px;height:38px;border-radius:10px;background:rgba(0,0,0,.06);
              display:flex;align-items:center;justify-content:center;
              text-decoration:none;cursor:pointer;transition:background .2s,transform .15s}
  .topnav-btn:hover{background:rgba(0,0,0,.11)}
  .topnav-btn:active{transform:scale(.93)}
  .topnav-btn svg{width:17px;height:17px;stroke:#1a1a1a}

  /* ============ header ============ */
  .hd{padding:6px 18px 2px;display:flex;align-items:center;justify-content:space-between}
  .brand{display:flex;align-items:center;gap:10px}
  .brand .mk{width:24px;height:30px;flex-shrink:0;filter:drop-shadow(0 2px 6px rgba(0,0,0,.35))}
  .brand .w{font-size:15.5px;font-weight:300;letter-spacing:.03em;line-height:1.1;color:#fff}
  .brand .w span{display:block;font-size:9px;font-weight:500;letter-spacing:0;color:var(--txt-3);margin-top:3px}
  /* Official logo image (admin pages) */
  .logo-img{height:48px;width:auto;display:block;flex-shrink:0;border-radius:10px;
            box-shadow:0 2px 12px rgba(0,0,0,.45)}
  .brand-sub{font-size:9px;font-weight:500;color:var(--txt-3);letter-spacing:.03em;line-height:1.1;align-self:flex-end;padding-bottom:2px}
  .rnd{
    width:38px;height:38px;border-radius:50%;background:var(--glass);border:1px solid var(--edge-soft);
    backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
    display:flex;align-items:center;justify-content:center;position:relative;cursor:pointer;
    transition:background .22s, transform .22s;
  }
  .rnd:hover{background:var(--glass-2)}
  .rnd:active{transform:scale(.94)}
  .rnd svg{width:16px;height:16px;stroke:#fff}
  .dotn{position:absolute;top:0;left:0;width:15px;height:15px;border-radius:50%;background:var(--live);color:#fff;font-size:8.5px;font-weight:800;display:flex;align-items:center;justify-content:center;border:2px solid rgba(10,14,22,.6)}

  /* ============ carousel ============ */
  .car{display:flex;gap:8px;overflow-x:auto;padding:18px 18px 8px;scrollbar-width:none}
  .car::-webkit-scrollbar{display:none}
  .chip{
    flex-shrink:0;display:flex;align-items:center;gap:7px;padding:9px 15px;border-radius:100px;
    background:var(--glass);border:1px solid var(--edge-soft);
    backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
    font-size:12px;font-weight:700;color:var(--txt-2);cursor:pointer;white-space:nowrap;
    transition:all .26s cubic-bezier(.2,.8,.2,1);
  }
  .chip:hover{background:var(--glass-2);color:#fff}
  .chip.dim{background:rgba(255,255,255,.045);border-color:rgba(255,255,255,.07);color:var(--txt-3)}
  .chip.on{
    background:rgba(255,255,255,.92);color:#0E1420;border-color:transparent;
    box-shadow:0 6px 20px rgba(0,0,0,.28);
  }
  .chip .rg{width:15px;height:15px;flex-shrink:0;display:flex}
  .chip .lv{width:6px;height:6px;border-radius:50%;background:var(--live);animation:pl 1.8s infinite}
  @keyframes pl{0%{box-shadow:0 0 0 0 rgba(255,122,92,.55)}70%{box-shadow:0 0 0 7px rgba(255,122,92,0)}100%{box-shadow:0 0 0 0 rgba(255,122,92,0)}}

  /* ============ round head ============ */
  /* flex-wrap so long round titles never collide with the status pill */
  .rh{padding:14px 20px 4px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
  .rh h2{font-size:22px;font-weight:800;letter-spacing:-.02em;color:#fff;text-shadow:0 2px 12px rgba(0,0,0,.28)}
  .rh .m{font-size:11px;color:var(--txt-2);margin-top:3px}
  .pill{
    display:flex;align-items:center;gap:7px;padding:7px 13px 7px 9px;border-radius:100px;
    background:var(--glass);border:1px solid var(--edge-soft);backdrop-filter:blur(14px);
    font-size:11.5px;font-weight:800;color:#fff;
  }
  .pill .rg{width:20px;height:20px}
  .pill.lv{color:var(--live);padding:7px 13px}
  .pill.lv i{width:6px;height:6px;border-radius:50%;background:var(--live);animation:pl 1.8s infinite;font-style:normal}
  .pill.up{color:var(--txt-2);padding:7px 13px;margin-inline-start:auto}

  /* ============ match card ============ */
  .list{padding:12px 18px 10px;display:flex;flex-direction:column;gap:9px}
  .mc{
    position:relative;overflow:hidden;
    background:var(--card-glass);border:1px solid var(--edge-soft);border-radius:26px;padding:15px 18px 14px;
    backdrop-filter:blur(22px) saturate(1.3);-webkit-backdrop-filter:blur(22px) saturate(1.3);
    box-shadow:0 8px 28px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.14);
    opacity:0;transform:translateY(12px);animation:cin .6s cubic-bezier(.2,.8,.2,1) forwards;
    transition:transform .3s cubic-bezier(.2,.8,.2,1), background .3s, box-shadow .3s;
  }
  .mc:hover{transform:translateY(-3px);background:var(--card-glass-2);box-shadow:0 14px 38px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.2)}
  /* upcoming — darker recessed fill, same solid border; no dashed */
  .mc.next{background:rgba(4,8,18,.80);border-color:rgba(255,255,255,.10)}
  @keyframes cin{to{opacity:1;transform:none}}
  /* one slow shine sweep on entry — subtle */
  .mc::after{
    content:"";position:absolute;top:0;bottom:0;width:38%;
    background:linear-gradient(100deg,transparent,rgba(255,255,255,.13),transparent);
    transform:translateX(-160%);animation:sheen 1.5s .5s cubic-bezier(.3,.7,.4,1) 1 forwards;pointer-events:none;
  }
  @keyframes sheen{to{transform:translateX(420%)}}

  .mt{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
  .tg{font-size:9.5px;font-weight:800;padding:4px 10px;border-radius:100px;display:inline-flex;align-items:center;gap:5px}
  .tg.live{background:var(--live);color:#fff;box-shadow:0 3px 12px rgba(255,122,92,.4)}
  .tg.fin{background:rgba(255,255,255,.12);color:var(--txt-2);border:1px solid var(--edge-soft)}
  /* upcoming tag — fully muted, never white, never resembles the selected chip */
  .tg.nxt{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.10);color:rgba(255,255,255,.50)}
  .dw{width:5px;height:5px;border-radius:50%;background:#fff;animation:pw 1.8s infinite}
  @keyframes pw{0%{box-shadow:0 0 0 0 rgba(255,255,255,.7)}70%{box-shadow:0 0 0 6px rgba(255,255,255,0)}100%{box-shadow:0 0 0 0 rgba(255,255,255,0)}}
  /* date/time — smaller, dimmer; numeric font applied via .num in HTML */
  .mt .wh{font-size:9px;color:var(--txt-3);font-weight:500;opacity:.75}

  /* Team row — 3-column grid so VS/score is always perfectly centred */
  .tm{display:grid;grid-template-columns:1fr 68px 1fr;align-items:center}
  .side{display:flex;align-items:center;gap:9px;min-width:0;overflow:hidden}
  .side.aw{flex-direction:row-reverse}
  /* team names — primary subject of the card: larger + heavier */
  .side .n{font-size:13.5px;font-weight:800;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
  .bg{
    width:40px;height:40px;border-radius:13px;color:#fff;display:flex;align-items:center;justify-content:center;
    font-weight:800;font-size:11px;flex-shrink:0;
    background:rgba(255,255,255,.10);
    box-shadow:0 3px 10px rgba(0,0,0,.28);
  }
  /* direction:ltr is load-bearing: the RTL flex row reversal would swap goal order
     without it. All score-rendering JS writes ${away_goals}-${home_goals} and relies
     on this declaration to ensure away appears LEFT, home appears RIGHT. */
  .sc{display:flex;align-items:center;justify-content:center;font-size:23px;font-weight:700;color:#fff;direction:ltr}
  .sc i{color:var(--txt-3);font-weight:300;font-style:normal;margin:0 5px}
  .vs{font-size:11px;font-weight:700;color:var(--txt-3);text-align:center;letter-spacing:.08em}

  .pb{margin-top:14px}
  .pb .lb{display:flex;justify-content:space-between;font-size:8.5px;font-weight:700;color:var(--txt-3);margin-bottom:6px}
  .pb .lb b{font-weight:800;color:#fff;font-size:9.5px}
  .bar{display:flex;height:5px;border-radius:5px;overflow:hidden;gap:2px}
  .bar i{display:block;height:100%;border-radius:3px;width:0;animation:gw 1s .3s cubic-bezier(.2,.8,.2,1) forwards}
  @keyframes gw{to{width:var(--w)}}

  /* Prediction row: label · text (flex) · badge · verdict
     flex-wrap lets the badge drop to a new line on narrow screens
     rather than ever truncating the prediction text                */
  .nt{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px;margin-top:13px;padding-top:11px;border-top:1px solid var(--edge-soft)}
  /* "توقعناها" — quiet descriptive label, not a button */
  .kw{font-size:9px;font-weight:600;color:var(--txt-3);white-space:nowrap;flex-shrink:0;letter-spacing:.01em}
  /* prediction text — takes all available flex space; wraps, never clips */
  .nt .tx{font-size:11.5px;font-weight:800;color:#fff;flex:1;min-width:0}
  .nt .tx.cl{font-weight:600;color:var(--txt-2)}
  .vd{
    width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;
    background:rgba(255,255,255,.14);border:1px solid var(--edge-soft);
    margin-inline-start:auto;
    animation:pop .45s .4s cubic-bezier(.34,1.56,.64,1) both;
  }
  @keyframes pop{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}
  .vd svg{width:11px;height:11px}
  .vd.ok{color:var(--pitch)}
  .vd.no{color:var(--bad)}

  /* ============ admin ============ */
  .seg{
    display:flex;gap:4px;margin:16px 18px 6px;padding:5px;border-radius:18px;
    background:rgba(255,255,255,.08);border:1px solid var(--edge-soft);backdrop-filter:blur(14px);
  }
  .sgi{flex:1;text-align:center;padding:9px 0;font-size:11.5px;font-weight:800;color:var(--txt-2);border-radius:14px;cursor:pointer;transition:all .26s cubic-bezier(.2,.8,.2,1)}
  .sgi.on{background:rgba(255,255,255,.92);color:#0E1420;box-shadow:0 4px 14px rgba(0,0,0,.24)}
  .pn{display:none;padding:14px 18px 10px}
  .pn.on{display:block;animation:cin .42s ease both;opacity:1;transform:none}

  .glass-box{
    background:var(--glass);border:1px solid var(--edge-soft);border-radius:22px;
    backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
    box-shadow:0 8px 26px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.12);
  }

  .kpi{display:flex;gap:10px;margin-bottom:16px}
  .kc{flex:1;padding:14px}
  .kc .l{font-size:9.5px;color:var(--txt-3);font-weight:700;margin-bottom:6px}
  .kc .v{font-size:19px;font-weight:700;color:#fff}
  .kc .v.s{font-size:13px;font-weight:800}
  .kc .s{font-size:9px;color:var(--txt-3);margin-top:3px}
  .qb{height:5px;background:rgba(255,255,255,.14);border-radius:5px;margin-top:9px;overflow:hidden}
  .qb span{display:block;height:100%;background:#fff;border-radius:5px}
  .lvd{width:6px;height:6px;border-radius:50%;background:var(--pitch);display:inline-block;margin-left:6px;box-shadow:0 0 8px var(--pitch)}

  .sl{font-size:11px;font-weight:800;color:var(--txt-3);margin:8px 4px 11px}
  .ac{margin-bottom:11px;overflow:hidden}
  .ah{display:flex;align-items:center;justify-content:space-between;padding:14px;cursor:pointer}
  .ah .lf{display:flex;align-items:center;gap:11px}
  .mbs{display:flex;align-items:center}
  .mbb{width:26px;height:26px;border-radius:9px;color:#fff;font-size:9.5px;font-weight:800;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 10px rgba(0,0,0,.3)}
  .mbb:last-child{margin-right:-9px}
  .fxn{font-size:12.5px;font-weight:800;color:#fff}
  .fxs{font-size:9.5px;color:var(--txt-3);margin-top:2px}
  .cv{transition:transform .3s ease}
  .ac.open .cv{transform:rotate(180deg)}
  .ab{max-height:0;overflow:hidden;transition:max-height .4s ease;padding:0 14px}
  .ac.open .ab{max-height:420px;padding-bottom:15px}
  .pl2{display:flex;align-items:center;justify-content:space-between;background:rgba(255,255,255,.10);border:1px solid var(--edge-soft);border-radius:14px;padding:11px 13px;margin-bottom:13px}
  .pl2 .l{font-size:10px;font-weight:700;color:var(--txt-3)}
  .pl2 .r{font-size:12.5px;font-weight:800;color:#fff}
  .ft{margin-bottom:9px}
  .ft .r1{display:flex;justify-content:space-between;font-size:10.5px;margin-bottom:5px;color:#fff}
  .ft .r1 .v{font-weight:800;color:var(--txt-3)}
  .ft .b{height:5px;background:rgba(255,255,255,.13);border-radius:5px;overflow:hidden}
  .ft .b span{display:block;height:100%;border-radius:5px;background:#fff;width:0;animation:gw .9s .2s cubic-bezier(.2,.8,.2,1) forwards}
  .imp{font-size:8px;font-weight:800;color:#fff;background:rgba(255,255,255,.16);padding:2px 6px;border-radius:5px;margin-right:6px}

  .tr{display:flex;align-items:center;justify-content:space-between;padding:14px 15px;margin-bottom:10px;border-radius:20px}
  .tr .n{font-size:12.5px;font-weight:700;color:#fff}
  .tr .s{font-size:10px;color:var(--txt-3);margin-top:3px}
  .sw{width:44px;height:26px;border-radius:100px;background:rgba(255,255,255,.16);border:1px solid var(--edge-soft);position:relative;flex-shrink:0;cursor:pointer;transition:background .25s}
  .sw.on{background:rgba(255,255,255,.9)}
  .sw::after{content:"";position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .3s cubic-bezier(.2,.8,.2,1);box-shadow:0 2px 6px rgba(0,0,0,.3)}
  .sw.on::after{background:#0E1420;transform:translateX(-18px)}
  .big{font-size:20px;font-weight:700;color:#fff}

  /* --- wallpaper picker --- */
  .themes{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;padding:13px;border-radius:20px}
  .th{
    height:62px;border-radius:14px;cursor:pointer;position:relative;overflow:hidden;
    border:2px solid transparent;transition:transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s;
  }
  .th:hover{transform:translateY(-3px)}
  .th.on{border-color:#fff;box-shadow:0 6px 18px rgba(0,0,0,.35)}
  .th span{position:absolute;bottom:5px;right:7px;font-size:8.5px;font-weight:800;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,.6)}
  .th b{position:absolute;top:5px;left:5px;width:15px;height:15px;border-radius:50%;background:#fff;display:none;align-items:center;justify-content:center}
  .th.on b{display:flex}
  .th b svg{width:9px;height:9px;stroke:#0E1420;stroke-width:3.5}

  .nf{display:flex;gap:12px;padding:14px;margin-bottom:10px;border-radius:20px}
  .nf .ic2{width:32px;height:32px;border-radius:11px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:rgba(255,255,255,.13);border:1px solid var(--edge-soft)}
  .nf .t{font-size:12px;font-weight:800;color:#fff}
  .nf .d{font-size:10px;color:var(--txt-2);margin-top:3px;line-height:1.5}
  .nf .tm2{font-size:9px;color:var(--txt-3);margin-top:6px}
  .ur{width:6px;height:6px;border-radius:50%;background:var(--live);flex-shrink:0;margin-top:6px;box-shadow:0 0 8px var(--live)}

  @media (prefers-reduced-motion:reduce){
    *{animation-duration:.001ms!important;transition-duration:.001ms!important}
    .bar i,.ft .b span{width:var(--w,100%)!important}
    .mc::after{display:none}
  }

/* ── § 2  REAL-PAGE CONTEXT OVERRIDES ─────────────────────────
   The reference renders the phone UI inside .phone>.screen, which
   is position:relative with fixed pixel dimensions.  On the real
   public page there is no .phone/.screen wrapper — the phone
   classes apply directly to the viewport.  These overrides are
   the minimum needed to make that work.                         */

/* Body: no desktop-mockup padding; allow the layer to fill it. */
body { padding: 0; overflow: hidden; }

/* Wall and veil: fixed instead of absolute so they pin to the
   viewport even though there is no .screen containing block.   */
.wall { position: fixed; }
.veil { position: fixed; }

/* Dynamic Island: fixed so it stays top-centre while .scroll
   moves underneath.                                            */
/* .island removed */

/* Top navbar: first flex child inside .layer — no fixed positioning needed */
.topnav {
  flex-shrink: 0;
  background: #fff;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0);
  height: calc(62px + env(safe-area-inset-top, 0px));
  box-shadow: 0 1px 0 rgba(0,0,0,.09), 0 4px 24px rgba(0,0,0,.08);
}

/* Layer: full viewport, flex-column — topnav + content stack naturally */
.layer { position: fixed; inset: 0; height: 100%; }

/* ── Topnav action buttons ── */
.topnav-actions {
  display: flex; align-items: center; gap: 9px;
}

/* لعبة التوقعات pill button */
.topnav-game-btn {
  display: flex; align-items: center; gap: 6px;
  background: #C6F24E; color: #0B0D11;
  border-radius: 11px; padding: 8px 13px;
  font-size: 12px; font-weight: 800; line-height: 1;
  text-decoration: none; white-space: nowrap;
  font-family: 'Tajawal', sans-serif;
  transition: opacity .18s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.topnav-game-btn svg {
  width: 15px; height: 15px; stroke: #0B0D11;
  stroke-width: 2.1; flex-shrink: 0;
}
.topnav-game-btn:hover  { opacity: .88; }
.topnav-game-btn:active { transform: scale(.93); opacity: .78; }

/* Notification bell */
.topnav-notif-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 11px;
  background: rgba(0,0,0,.06); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .18s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.topnav-notif-btn svg {
  width: 20px; height: 20px;
  stroke: #888; transition: stroke .2s;
}
.topnav-notif-btn:hover  { background: rgba(0,0,0,.10); }
.topnav-notif-btn:active { transform: scale(.91); }
.topnav-notif-btn.has-notif svg { stroke: #C0392B; }

/* Pulsing badge dot on bell */
.notif-badge {
  position: absolute; top: 7px; left: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #C0392B; border: 2px solid #fff;
  display: none;
  animation: notif-pulse 1.5s ease-in-out infinite;
}
.topnav-notif-btn.has-notif .notif-badge { display: block; }
@keyframes notif-pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.35); opacity: .65; }
}

/* ── Announcement bar (legacy — hidden; replaced by bell icon) ── */
#ann-bar { display: none !important; }
.ann-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; flex-shrink: 0;
  animation: ann-pulse 1.6s ease-in-out infinite;
}
@keyframes ann-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.75); }
}
.ann-txt {
  flex: 1; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ann-arr { width: 14px; height: 14px; flex-shrink: 0; opacity: .7; }

/* ── Announcement sheet (modal) ── */
#ann-sheet {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 9000;
  align-items: flex-end; justify-content: center;
  padding: 0;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
#ann-sheet.open { display: flex; }
.ann-sheet-card {
  background: #1a1f2e; border-radius: 20px 20px 0 0;
  padding: 20px 18px 36px; width: 100%; max-width: 520px;
  display: flex; flex-direction: column; gap: 14px;
  direction: rtl; color: #fff;
}
.ann-sheet-hd {
  display: flex; align-items: center; gap: 8px;
}

/* Scroll: momentum scrolling on iOS. */
.scroll { -webkit-overflow-scrolling: touch; }

/* Legacy header — hidden on public page (navbar replaced it);
   still used in admin pages which include it via admin.css.   */
.hd {
  padding: env(safe-area-inset-top, 16px) 18px 8px;
  padding-top: max(env(safe-area-inset-top), 16px);
  background: linear-gradient(180deg, rgba(6,10,20,.52), transparent);
  flex-shrink: 0;
}

/* ── § 3  EXTRA CLASSES (used by app.js / replay.js) ─────────
   Not in the reference.  Added here, not in § 1.              */

/* Drag-scroll cursor */
#car              { cursor: grab; }
#car.car-dragging { cursor: grabbing; user-select: none; }

/* Ghost carousel box — clips horizontally so chips never touch screen
   edges; the box itself has no visual appearance (no bg, no border).
   § 1 side-padding is zeroed out here so the box margin is the sole
   margin; a ::after flex-spacer preserves the trailing gap on scroll. */
.car-box {
  margin: 0 18px;
  overflow: hidden;
}
.car { padding: 18px 0 8px !important; }
.car::after {
  content: ''; display: block;
  min-width: 6px; flex-shrink: 0;
}

/* Flat layout wrapper (used by admin pages and replay page). */
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 80px;
  position: relative;
  z-index: 2;
}

/* Team badge with logo image — 40×40 uniform container */
.badge-img {
  width: 40px; height: 40px; border-radius: 13px; object-fit: contain;
  /* neutral backdrop so light and dark logos both sit comfortably */
  background: rgba(255,255,255,.10);
  padding: 4px;           /* logo never touches the container edge */
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
}
.badge-wrap { display: flex; flex-shrink: 0; }

/* Early-season notice */
.early-notice {
  background: var(--glass);
  border: 1px solid var(--edge-soft);
  border-radius: 14px;
  padding: 9px 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 11px;
  color: var(--txt-2);
  text-align: center;
  line-height: 1.6;
  direction: rtl;
}

/* Low-confidence / history marker */
.cf-mk {
  display: inline-block;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--txt-3);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px;
  padding: 1px 5px;
  margin: 0 4px;
  vertical-align: middle;
  white-space: nowrap;
  letter-spacing: .01em;
}

/* Unpublished prediction text */
.nt .tx.unpub { font-size: 11px; color: rgba(255,255,255,.72); font-weight: 500; }

/* No-prediction compact line — no divider, no full .nt row */
.unpub-note {
  margin-top: 9px;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,.36);
  text-align: center;
  direction: rtl;
  letter-spacing: .01em;
}

/* Skeleton loading */
.skel-card {
  height: 148px; border-radius: 26px;
  background: var(--glass); border: 1px solid var(--edge-soft);
  animation: pulse 1.4s ease-in-out infinite;
}
.skel-chip {
  height: 36px; width: 80px; border-radius: 100px; flex-shrink: 0;
  background: var(--glass); border: 1px solid var(--edge-soft);
  animation: pulse 1.4s ease-in-out infinite;
}
.skel-rh {
  height: 48px; margin: 14px 20px 4px; border-radius: 16px;
  background: var(--glass);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:.8} }

/* Empty / error states */
.state-wrap { text-align: center; padding: 60px 24px 40px; }
.state-wrap .ico { font-size: 44px; margin-bottom: 16px; opacity: .7; }
.state-wrap h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; color: #fff; }
.state-wrap p { font-size: 13px; line-height: 1.6; color: var(--txt-2); }
.retry-btn {
  margin-top: 20px; padding: 12px 28px; border-radius: 100px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  transition: background .22s;
}
.retry-btn:hover { background: rgba(255,255,255,.2); }

/* ── Fixture table ───────────────────────────────────────────────────────── */

/* Container — same glass surface as .mc cards */
.fxt {
  background: var(--card-glass);
  border: 1px solid var(--edge-soft);
  border-radius: 26px;
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 8px 28px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.14);
  /* fade-in matching .mc */
  opacity: 0;
  transform: translateY(12px);
  animation: cin .6s cubic-bezier(.2,.8,.2,1) forwards;
}

/* Four-column grid — same declaration used by header, rows, and footer.
   In RTL auto-placement: col 1 = rightmost (home), col 4 = leftmost (pred). */
.fxt-hdr,
.fxt-row {
  display: grid;
  grid-template-columns: 1fr 58px 1fr 54px;
}

/* ── Column header ───────────────────────────────────────────────────────── */
.fxt-hdr {
  align-items: center;
  padding: 7px 14px;
  border-bottom: 1px solid var(--edge-soft);
  background: rgba(255,255,255,.04);
  font-size: 8px;
  font-weight: 700;
  color: var(--txt-3);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fxt-hdr span:nth-child(1) { text-align: right;  } /* المضيف  */
.fxt-hdr span:nth-child(2) { text-align: center; } /* النتيجة */
.fxt-hdr span:nth-child(3) { text-align: left;   } /* الضيف   */
.fxt-hdr span:nth-child(4) { text-align: center; } /* توقعنا  */

/* ── Day heading ─────────────────────────────────────────────────────────── */
.fxt-day {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--txt-2);
  border-top: 1px solid var(--edge-soft);
}
/* Thin rule extends from the label to the left edge */
.fxt-day::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--edge-soft);
}
/* First day group — no double border under the column header */
.fxt-hdr + .fxt-day { border-top: none; }

/* ── Row ─────────────────────────────────────────────────────────────────── */
.fxt-row {
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  position: relative; /* needed for background-image gradient tint */
}
/* Remove the double hairline immediately below a day heading */
.fxt-day + .fxt-row { border-top: none; }

/* Home column: badge on right (RTL flex-start), name flows toward center */
.fxt-home {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 0;
}
/* Away column: flex-direction row-reverse in RTL puts badge at outer-left,
   name between badge and score — mirrors home layout.
   justify-content flex-end (in RTL + row-reverse) pins the group to the left edge.
   padding-left keeps the badge from pressing flush against the prediction column. */
.fxt-away {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  padding: 6px 0 6px 10px;
}
.fxt-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.fxt-name.dim { color: var(--txt-3); font-weight: 600; }

/* ── Score / time cell ───────────────────────────────────────────────────── */
.fxt-sc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
/* direction:ltr is load-bearing: keeps away_goals left, home_goals right
   inside the score string regardless of page RTL direction.              */
.fxt-score {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', 'Tajawal', sans-serif;
  font-variant-numeric: tabular-nums;
}
.fxt-score i {
  color: var(--txt-3);
  font-weight: 300;
  font-style: normal;
  margin: 0 3px;
}
.fxt-score.live { color: var(--live); }
.fxt-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-3);
  text-align: center;
  white-space: nowrap;
  font-family: 'Space Grotesk', 'Tajawal', sans-serif;
}
.fxt-min {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  font-weight: 700;
  color: var(--live);
  white-space: nowrap;
}
.fxt-pulse {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--live);
  flex-shrink: 0;
  font-style: normal;
  animation: pl 1.8s infinite;
}

/* ── Prediction cell ─────────────────────────────────────────────────────── */
/* direction:ltr is load-bearing on BOTH the CSS class AND the HTML element
   (dir="ltr" is set in JS). CSS direction alone does not create a bidi
   isolation context — without the HTML attribute the Unicode BiDi Algorithm
   reorders numbers and neutral chars (%, ·, -) based on the surrounding RTL
   page, producing different layouts row-by-row when content changes.
   unicode-bidi:isolate is belt-and-suspenders: it tells the engine to treat
   this element as an independent bidi paragraph.                            */
.fxt-pred-col {
  display: flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
}
.fxt-pred {
  font-size: 12px;
  font-weight: 700;
  color: var(--txt-2);
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  direction: ltr;          /* load-bearing — see comment above */
  unicode-bidi: isolate;   /* belt-and-suspenders bidi isolation */
  font-family: 'Space Grotesk', 'Tajawal', sans-serif;
  font-variant-numeric: tabular-nums;
}
.fxt-pred i { color: var(--txt-3); font-weight: 300; font-style: normal; }
.fxt-vd {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,.12);
  border: 1px solid var(--edge-soft);
}
.fxt-vd svg { width: 9px; height: 9px; }
.fxt-vd.ok { color: var(--pitch); }
.fxt-vd.no { color: var(--bad); }
.fxt-conf {
  font-size: 9px;
  font-weight: 700;
  color: var(--txt-3);
  font-family: 'Space Grotesk', monospace;
}
.fxt-sep {
  font-size: 8px;
  color: var(--txt-3);
  opacity: 0.45;
  font-style: normal;
}
.fxt-dash { font-size: 13px; color: var(--txt-3); }

/* ── Mini team badge (28 px) ─────────────────────────────────────────────── */
.fxt-bw { display: flex; flex-shrink: 0; }
.fxt-badge {
  width: 28px; height: 28px;
  border-radius: 9px;
  object-fit: contain;
  background: rgba(255,255,255,.10);
  padding: 3px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
}
.fxt-badge-fb {
  width: 28px; height: 28px;
  border-radius: 9px;
  color: #fff;
  display: flex;
  align-items: center; justify-content: center;
  font-weight: 800; font-size: 9px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.fxt-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px 11px;
  border-top: 1px solid var(--edge-soft);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--txt-3);
}

/* ── Table skeleton ──────────────────────────────────────────────────────── */
.skel-table {
  height: 300px;
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid var(--edge-soft);
  animation: pulse 1.4s ease-in-out infinite;
}

/* Reduced motion — also cover skeletons */
@media (prefers-reduced-motion: reduce) {
  .skel-card, .skel-chip, .skel-rh, .skel-table { animation: none !important; }
  .bar i { width: var(--w, 0) !important; }
}

/* Background animation pause (set via JS when background_motion toggle is off) */
.wall.pause-anim::before,
.wall.pause-anim::after,
.wall.pause-anim i { animation-play-state: paused; }

/* ── Admin appearance sliders ─────────────────────────────── */
.slider-row {
  padding: 12px 14px 14px;
  margin-bottom: 8px;
}
.slider-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.slider-val {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  font-family: 'Space Grotesk', monospace;
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.app-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,.18);
  outline: none;
  cursor: pointer;
}
.app-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  cursor: pointer;
  transition: transform .15s;
}
.app-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.app-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  border: none;
  cursor: pointer;
}

/* Background image upload */
.bg-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 0;
  border-radius: 12px;
  border: 1.5px dashed rgba(255,255,255,.22);
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  font-family: 'Tajawal', sans-serif;
}
.bg-upload-label:hover { border-color: rgba(255,255,255,.5); color: #fff; }

.bg-remove-btn {
  width: 100%;
  padding: 9px 0;
  border-radius: 10px;
  border: 1px solid rgba(255,100,100,.32);
  background: rgba(255,60,60,.12);
  color: rgba(255,170,170,.9);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  transition: background .2s;
}
.bg-remove-btn:hover { background: rgba(255,60,60,.22); }
