/* ============================================================
   Game Update Radar — professional 2026 dark UI (RTL-first)
   Logical properties throughout so the layout mirrors under dir=rtl.
   ============================================================ */

:root{
  --bg-0:#0B0F17; --bg-1:#0F1522;
  --surface:#141B29; --surface-2:#1A2233; --surface-hover:#1E273B;
  --border:rgba(255,255,255,.08); --border-strong:rgba(255,255,255,.16);
  --text:#EAEEF6; --text-2:#9AA6B8; --text-muted:#66748B;
  --accent:#6366F1; --accent-2:#8B5CF6; --grad:linear-gradient(135deg,#6366F1,#8B5CF6);
  --ok:#34D399; --warn:#FBBF24; --danger:#F87171; --info:#38BDF8;
  --ios:#38BDF8; --android:#34D399;
  --ios-tint:rgba(56,189,248,.06); --android-tint:rgba(52,211,153,.06);
  --r-lg:20px; --r-md:14px; --r-sm:10px; --r-pill:999px;
  --shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 12px 34px -14px rgba(0,0,0,.75);
  --glass:blur(16px) saturate(140%);
  --fs-ar:"Cairo"; --fs-en:"Inter";
}
:root[data-theme="light"]{
  --bg-0:#FFFFFF; --bg-1:#FFFFFF;
  --surface:#FFFFFF; --surface-2:#F2F5FA; --surface-hover:#EAEFF7;
  --border:rgba(15,23,42,.10); --border-strong:rgba(15,23,42,.20);
  --text:#0F172A; --text-2:#51607A; --text-muted:#8894A8;
  --ios-tint:rgba(56,189,248,.07); --android-tint:rgba(16,185,129,.07);
  --shadow:0 1px 2px rgba(15,23,42,.05), 0 10px 26px -18px rgba(15,23,42,.30);
}
/* soften the ambient orbs on the light (daytime) theme */
:root[data-theme="light"] .orb-1{opacity:.14}
:root[data-theme="light"] .orb-2{opacity:.12}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--fs-en),var(--fs-ar),system-ui,sans-serif;
  background:var(--bg-0); color:var(--text); min-height:100vh; line-height:1.55;
  -webkit-font-smoothing:antialiased; overflow-x:hidden;
}
:lang(ar),[dir="rtl"]{font-family:var(--fs-ar),var(--fs-en),system-ui,sans-serif; line-height:1.75}
.wrap{width:100%;max-width:1240px;margin-inline:auto;padding-inline:20px}
.ic{width:20px;height:20px;display:inline-block;vertical-align:middle;flex:none}

/* ambient orbs */
.orb{position:fixed;border-radius:50%;filter:blur(90px);opacity:.35;z-index:-1;pointer-events:none}
.orb-1{width:520px;height:520px;background:#6366F1;inset-block-start:-160px;inset-inline-end:-120px}
.orb-2{width:460px;height:460px;background:#8B5CF6;inset-block-end:-180px;inset-inline-start:-120px;opacity:.25}

/* topbar */
.topbar{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg-1) 62%, transparent);
  backdrop-filter:var(--glass);border-block-end:1px solid var(--border)}
.topbar__inner{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-block:12px}
.brand{display:flex;align-items:center;gap:12px;min-width:0}
.brand__mark{width:42px;height:42px;border-radius:12px;background:var(--grad);display:grid;place-items:center;color:#fff;flex:none;box-shadow:0 8px 20px -8px var(--accent)}
.brand__mark .ic{width:24px;height:24px}
.brand__text{display:flex;flex-direction:column;min-width:0}
.brand__text strong{font-size:16px;font-weight:800;letter-spacing:-.01em}
.brand__tag{font-size:12px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw}
.topbar__actions{display:flex;align-items:center;gap:8px}

.btn{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border);background:var(--surface-2);
  color:var(--text);border-radius:var(--r-pill);padding:8px 14px;font:inherit;font-weight:600;font-size:13px;
  cursor:pointer;transition:.18s;white-space:nowrap;text-decoration:none}
.btn:hover{border-color:var(--border-strong);background:var(--surface-hover)}
.btn-icon{padding:8px;border-radius:12px}
.btn-ghost{background:transparent}
.btn-accent{background:var(--grad);border:none;color:#fff;box-shadow:0 8px 20px -10px var(--accent)}
.btn-accent:hover{filter:brightness(1.08)}

.live-pill{display:inline-flex;align-items:center;gap:7px;border-radius:var(--r-pill);
  padding:6px 12px;font-size:12px;font-weight:700;background:rgba(52,211,153,.12);color:var(--ok);border:1px solid rgba(52,211,153,.22)}
.live-pill.is-off{background:rgba(248,113,113,.12);color:var(--danger);border-color:rgba(248,113,113,.22)}
.live-dot{width:8px;height:8px;border-radius:50%;background:currentColor;box-shadow:0 0 0 0 currentColor;animation:pulse 1.8s infinite}
.live-pill.is-off .live-dot{animation:none}
@keyframes pulse{70%{box-shadow:0 0 0 7px transparent}100%{box-shadow:0 0 0 0 transparent}}

/* main */
.main{padding-block:24px 60px}

/* explainer */
.explainer{display:flex;gap:14px;background:linear-gradient(120deg,rgba(99,102,241,.10),rgba(139,92,246,.06));
  border:1px solid var(--border);border-radius:var(--r-lg);padding:16px 18px;margin-block-end:18px}
.explainer__icon{width:38px;height:38px;border-radius:11px;background:var(--surface-2);display:grid;place-items:center;color:var(--accent-2);flex:none}
.explainer strong{display:block;margin-block-end:4px;font-size:15px}
.explainer p{margin:0;color:var(--text-2);font-size:13.5px}
.conf-legend{display:flex;flex-wrap:wrap;gap:8px;margin-block-start:10px}
.conf-legend .chip{font-size:11px;padding:3px 9px;border-radius:var(--r-pill);border:1px solid var(--border);color:var(--text-2)}

/* KPI strip */
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-block-end:22px}
.kpi{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);padding:14px 16px}
.kpi__v{font-size:22px;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.kpi__l{font-size:12px;color:var(--text-2);margin-block-start:2px}

/* split */
.split{display:grid;grid-template-columns:1fr 1px 1fr;gap:22px;align-items:start}
.split__divider{background:linear-gradient(var(--border),transparent);align-self:stretch}
.side{border-radius:var(--r-lg);padding:4px}
.side--ios{background:var(--ios-tint)}
.side--android{background:var(--android-tint)}
.side__head{display:flex;align-items:center;gap:12px;padding:14px 12px}
.side__badge{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;flex:none;color:#fff}
.side__badge--ios{background:linear-gradient(135deg,#38BDF8,#0EA5E9)}
.side__badge--android{background:linear-gradient(135deg,#34D399,#10B981)}
.side__badge .ic{width:22px;height:22px}
.side__head strong{font-size:16px;font-weight:800;display:block}
.side__sub{font-size:11.5px;color:var(--text-2)}
.side__count{margin-inline-start:auto;font-size:13px;font-weight:700;color:var(--text-2);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-pill);padding:3px 11px;font-variant-numeric:tabular-nums}

.games{display:flex;flex-direction:column;gap:14px}

/* game group */
.ggroup{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);overflow:hidden;box-shadow:var(--shadow);border-top:3px solid var(--gc,var(--accent))}
.ggroup__head{display:flex;align-items:center;gap:10px;padding:14px 16px 8px}
.ggroup__name{font-size:15px;font-weight:800}
.ggroup__est{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:0 16px 12px;font-size:12.5px;color:var(--text-2);border-block-end:1px solid var(--border)}
.ggroup__est .est-date{color:var(--text);font-weight:700}

.edition{padding:12px 16px;border-block-end:1px solid var(--border)}
.edition:last-child{border-block-end:none}
.edition__top{display:flex;align-items:center;gap:12px}
.logo{width:50px;height:50px;border-radius:14px;object-fit:cover;flex:none;background:var(--surface-2);border:1px solid var(--border)}
.logo.placeholder{display:grid;place-items:center;color:var(--text-muted)}
.edition__title{font-size:14px;font-weight:700}
.edition__meta{font-size:11.5px;color:var(--text-muted)}
.edition__store{margin-inline-start:auto}
.link{display:inline-flex;align-items:center;gap:5px;color:var(--info);text-decoration:none;font-size:12px;font-weight:600}
.link:hover{text-decoration:underline}

.ggroup__count{font-size:12px;font-weight:700;color:var(--text-2);background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-pill);padding:2px 10px;font-variant-numeric:tabular-nums}
.src-chip{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:700;color:var(--text-2);background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-pill);padding:2px 9px}
.src-chip .ic{width:13px;height:13px}
.src-chip--ok{color:var(--ok);background:rgba(52,211,153,.12);border-color:rgba(52,211,153,.25)}
.mirror-note{font-size:10px;color:var(--text-muted);margin-inline-start:6px}

/* per-edition next-update estimate */
.edition__est{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-block-start:11px;padding:8px 11px;border-radius:var(--r-sm);
  background:linear-gradient(120deg,rgba(99,102,241,.08),rgba(139,92,246,.05));border:1px solid var(--border);font-size:12.5px;color:var(--text-2)}
.edition__est .ic{width:16px;height:16px;color:var(--accent-2)}
.edition__est .est-label{color:var(--text-2)}
.edition__est .est-date{color:var(--text);font-weight:700}
.edition__est .est-days{color:var(--text-muted)}
.edition__status{display:flex;align-items:center;gap:8px;margin-block-start:10px}
.edition__status .label{font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-2)}

.fields{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;margin-block-start:12px}
.field{display:flex;flex-direction:column;gap:2px}
.field .label{font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-2)}
.field .val{font-size:13.5px;font-weight:600;font-variant-numeric:tabular-nums}
.field .val.mono{font-family:ui-monospace,"Cascadia Code",monospace}
.field .val.dim{color:var(--text-muted);font-weight:500}

.pill{display:inline-flex;align-items:center;gap:5px;border-radius:var(--r-pill);padding:3px 10px;font-size:11.5px;font-weight:700}
.pill--ok{background:rgba(52,211,153,.14);color:var(--ok)}
.pill--warn{background:rgba(251,191,36,.14);color:var(--warn)}
.pill--info{background:rgba(56,189,248,.14);color:var(--info)}
.pill--muted{background:rgba(125,136,150,.16);color:var(--text-2)}
.pill--confirmed{background:rgba(52,211,153,.16);color:var(--ok)}
.pill--high{background:rgba(52,211,153,.12);color:var(--ok)}
.pill--medium{background:rgba(251,191,36,.14);color:var(--warn)}
.pill--low{background:rgba(125,136,150,.16);color:var(--text-2)}

/* flash on update */
@keyframes flash{0%{box-shadow:0 0 0 0 rgba(99,102,241,.7)}100%{box-shadow:0 0 0 14px rgba(99,102,241,0)}}
.edition.flash{animation:flash 1.4s ease-out 2}

/* skeleton */
.skeleton{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-hover) 37%,var(--surface-2) 63%);
  background-size:400% 100%;animation:sh 1.4s ease infinite;border-radius:8px;color:transparent!important}
@keyframes sh{0%{background-position:100% 0}100%{background-position:-100% 0}}

/* feed */
.feed{margin-block-start:30px}
.feed__title{display:flex;align-items:center;gap:8px;font-size:17px;margin-block-end:12px}
.feed__title .ic{color:var(--accent-2)}
.feed__list{display:flex;flex-direction:column;gap:10px}
.feed-item{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);padding:11px 15px}
.feed-item .logo{width:38px;height:38px;border-radius:10px}
.feed-item__body{flex:1;min-width:0}
.feed-item__t{font-weight:700;font-size:13.5px}
.feed-item__m{font-size:12px;color:var(--text-2)}
.feed-empty{color:var(--text-muted);padding:22px;text-align:center;background:var(--surface);border:1px dashed var(--border);border-radius:var(--r-md)}

/* footer */
.footer{border-block-start:1px solid var(--border);padding-block:22px;color:var(--text-muted);font-size:12.5px}

/* toasts */
.toasts{position:fixed;inset-block-end:18px;inset-inline-end:18px;display:flex;flex-direction:column;gap:10px;z-index:50}
.toast{display:flex;align-items:center;gap:10px;background:var(--surface-2);border:1px solid var(--border-strong);
  border-radius:var(--r-md);padding:12px 15px;box-shadow:var(--shadow);min-width:240px;max-width:340px;
  animation:slidein .3s ease}
.toast .logo{width:34px;height:34px;border-radius:9px}
@keyframes slidein{from{transform:translateY(12px);opacity:0}to{transform:none;opacity:1}}

/* directional glyph mirroring in RTL */
[dir="rtl"] .link .ic{transform:scaleX(-1)}

@media (prefers-reduced-motion:reduce){.live-dot,.skeleton,.edition.flash,.toast{animation:none}}

/* filter bar */
.filterbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-block:2px 20px}
.filter-field{display:flex;align-items:center;gap:8px}
.filter-label{font-size:13px;color:var(--text-2);font-weight:600}
.select-wrap{position:relative;display:inline-flex;align-items:center}
.select-wrap select{appearance:none;-webkit-appearance:none;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:var(--r-pill);padding-block:9px;padding-inline:16px 38px;font:inherit;font-weight:600;font-size:13px;cursor:pointer;min-width:200px}
.select-wrap select:hover{border-color:var(--border-strong)}
.select-chevron{position:absolute;inset-inline-end:12px;width:16px;height:16px;color:var(--text-2);pointer-events:none}
.seg{display:inline-flex;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-pill);padding:3px;gap:2px}
.seg-btn{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;color:var(--text-2);border-radius:var(--r-pill);padding:7px 14px;font:inherit;font-weight:600;font-size:13px;cursor:pointer;transition:.15s}
.seg-btn .ic{width:15px;height:15px}
.seg-btn:hover{color:var(--text)}
.seg-btn.is-active{background:var(--grad);color:#fff;box-shadow:0 6px 16px -8px var(--accent)}

/* notifications */
.notif-wrap{position:relative}
.notif-badge{position:absolute;inset-block-start:-4px;inset-inline-end:-4px;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:var(--danger);color:#fff;font-size:10px;font-weight:800;display:grid;place-items:center;line-height:1}
.notif-panel{position:absolute;inset-block-start:calc(100% + 10px);inset-inline-end:0;width:350px;max-width:92vw;background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r-md);box-shadow:var(--shadow);z-index:40;overflow:hidden}
.notif-panel__head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-block-end:1px solid var(--border)}
.notif-clear{background:transparent;border:none;color:var(--info);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.notif-list{max-height:min(60vh,440px);overflow-y:auto}
.notif-item{display:flex;gap:10px;align-items:flex-start;padding:11px 14px;border-block-end:1px solid var(--border)}
.notif-item:last-child{border-block-end:none}
.notif-item.is-unread{background:color-mix(in srgb,var(--accent) 8%,transparent)}
.notif-ic{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;flex:none}
.notif-ic .ic{width:17px;height:17px}
.notif-ic--released{background:rgba(52,211,153,.15);color:var(--ok)}
.notif-ic--estimate{background:rgba(99,102,241,.15);color:var(--accent-2)}
.notif-item__body{flex:1;min-width:0}
.notif-item__t{font-size:13px;font-weight:700}
.notif-item__m{font-size:12px;color:var(--text-2)}
.notif-item__time{font-size:11px;color:var(--text-muted);margin-block-start:2px}
.notif-empty{padding:26px;text-align:center;color:var(--text-muted);font-size:13px}

/* platform icon next to game name */
.ggroup__plat{width:17px;height:17px;color:var(--text-2);flex:none}

/* responsive */
@media (max-width:900px){
  .kpis{grid-template-columns:repeat(2,1fr)}
  .split{grid-template-columns:1fr;gap:16px}
  .split__divider{display:none}
  .brand__tag{display:none}
}
@media (max-width:560px){
  .topbar__actions .btn-accent span{display:none}
  .fields{grid-template-columns:1fr 1fr}
  .subscribe-label{display:none}
}
