/* ============================================================
   Parsisho — Header Pro  ·  premium info topbar  (v4)
   Loaded by assets/header-pro.js (self-injected <link>)
   Signature: deep brand gradient, gold hairline, glass chips,
   live Tehran clock, animated day/night switch.
   Standards: RTL, WCAG contrast, focus-visible, reduced-motion.
   ============================================================ */

:root{
  --ph-gold:#e7c072; --ph-gold2:#f7e3b0;
  --ph-blue:#0f63d7; --ph-blue2:#3f9dff;
  --ph-ink:#eaf3ff; --ph-ease:cubic-bezier(.22,1,.36,1);
}
.ph-num{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}

/* ---------------- TOPBAR ---------------- */
.ph-topbar{position:relative;z-index:40;overflow:hidden;color:var(--ph-ink);
  font:600 12.5px/1 Vazirmatn,system-ui,Tahoma,sans-serif;-webkit-font-smoothing:antialiased;
  background:linear-gradient(100deg,#062040 0%,#0a3b82 46%,var(--ph-accent,#0f63d7) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10),0 6px 20px rgba(7,28,58,.18);
  animation:ph-in .65s var(--ph-ease) both}
@keyframes ph-in{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:none}}
.ph-topbar.ph-noanim,.ph-topbar.ph-noanim::after,.ph-topbar.ph-noanim .ph-live::after{animation:none}
.ph-topbar::before{content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(130% 220% at 84% -60%,rgba(130,196,255,.40),transparent 58%)}
.ph-topbar::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.18),transparent);
  transform:translateX(-120%);animation:ph-sweep 8s var(--ph-ease) infinite}
@keyframes ph-sweep{0%,72%{transform:translateX(-120%)}100%{transform:translateX(120%)}}
.ph-topbar .ph-rule{position:absolute;left:0;right:0;bottom:0;height:2px;z-index:3;pointer-events:none;
  background:linear-gradient(90deg,transparent,var(--ph-accent,#3f9dff) 18%,var(--ph-gold) 50%,var(--ph-accent,#3f9dff) 82%,transparent);
  opacity:.55}

.ph-topbar .ph-tb-in{position:relative;z-index:2;max-width:80rem;margin:0 auto;
  height:38px;padding:0 12px;display:flex;align-items:center;justify-content:space-between;gap:14px}
@media (min-width:640px){.ph-topbar .ph-tb-in{padding:0 24px}}
.ph-topbar .ph-tb-r,.ph-topbar .ph-tb-l{display:flex;align-items:center;gap:10px;white-space:nowrap}
.ph-topbar .ph-links{display:none;align-items:center;gap:4px}

/* glass chips */
.ph-chip{display:inline-flex;align-items:center;gap:7px;height:25px;padding:0 10px;border-radius:999px;
  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  transition:background .25s,border-color .25s}
.ph-chip:hover{background:rgba(255,255,255,.17)}
.ph-chip svg{opacity:.92;flex:none}
.ph-chip b{font-weight:800;letter-spacing:.2px}
.ph-region{display:inline-flex;align-items:center;gap:6px;opacity:.82;font-weight:600}
.ph-topbar .ph-tb-dshort{display:none}

/* live dot */
.ph-live{position:relative;width:7px;height:7px;border-radius:50%;background:#3fe6a0;flex:none}
.ph-live::after{content:"";position:absolute;inset:-4px;border-radius:50%;
  border:1px solid rgba(63,230,160,.55);animation:ph-pulse 2.4s var(--ph-ease) infinite}
@keyframes ph-pulse{0%{transform:scale(.6);opacity:.9}70%,100%{transform:scale(1.6);opacity:0}}

/* quick links */
.ph-link{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 9px;border-radius:8px;
  color:var(--ph-ink);text-decoration:none;opacity:.9;position:relative;
  transition:background .2s,opacity .2s}
.ph-link:hover{opacity:1;background:rgba(255,255,255,.12)}
.ph-link svg{opacity:.85}
.ph-link::after{content:"";position:absolute;left:9px;right:9px;bottom:2px;height:1.5px;border-radius:2px;
  background:linear-gradient(90deg,var(--ph-gold),var(--ph-gold2));transform:scaleX(0);transform-origin:right;
  transition:transform .3s var(--ph-ease)}
.ph-link:hover::after{transform:scaleX(1)}
.ph-topbar .ph-vsep{width:1px;height:16px;background:rgba(255,255,255,.22);margin:0 3px}

/* ---------------- DAY / NIGHT SWITCH ---------------- */
.ph-switch{position:relative;flex:none;width:52px;height:26px;border-radius:999px;padding:0;cursor:pointer;
  border:1px solid rgba(255,255,255,.22);
  background:linear-gradient(135deg,#a7ceff,#e4f0ff);
  transition:background .45s var(--ph-ease),border-color .45s;box-shadow:inset 0 1px 2px rgba(6,32,64,.18)}
.ph-switch:focus-visible{outline:2px solid #fff;outline-offset:2px}
.ph-switch .sky{position:absolute;inset:0;border-radius:inherit;opacity:0;transition:opacity .45s;
  background-image:
    radial-gradient(1.3px 1.3px at 18% 30%,#fff,transparent),
    radial-gradient(1.1px 1.1px at 40% 62%,#dbe8ff,transparent),
    radial-gradient(1.5px 1.5px at 66% 26%,#fff,transparent),
    radial-gradient(1.1px 1.1px at 80% 58%,#cfe0ff,transparent),
    radial-gradient(1.2px 1.2px at 54% 78%,#fff,transparent)}
.ph-switch .knob{position:absolute;top:2px;inset-inline-start:2px;width:20px;height:20px;border-radius:50%;
  background:#fff;display:grid;place-items:center;z-index:2;
  box-shadow:0 3px 9px rgba(6,26,54,.38);
  transition:transform .5s var(--ph-ease),background .45s}
.ph-switch .knob svg{position:absolute;width:12px;height:12px;transition:opacity .35s,transform .5s var(--ph-ease)}
.ph-switch .knob .i-sun{color:#e0a52a;opacity:1;transform:rotate(0)}
.ph-switch .knob .i-moon{color:#cfe1ff;opacity:0;transform:rotate(-90deg)}

html.ph-night .ph-switch{background:linear-gradient(135deg,#081226,#16305a);border-color:rgba(255,255,255,.16)}
html.ph-night .ph-switch .sky{opacity:.95}
html.ph-night .ph-switch .knob{transform:translateX(-26px);background:#0b1830;
  box-shadow:0 3px 12px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.06) inset}
html.ph-night .ph-switch .knob .i-sun{opacity:0;transform:rotate(90deg)}
html.ph-night .ph-switch .knob .i-moon{opacity:1;transform:rotate(0)}

/* ---------------- HEADER FIT (let the SPA header shrink, no h-scroll) ---------------- */
header .flex-1{min-width:0}
header .items-center.justify-between{min-width:0}
header .shrink-0{min-width:0}

/* ---------------- NIGHT THEME (site chrome) ---------------- */
html.ph-night{color-scheme:dark}
html.ph-night .ph-topbar{background:linear-gradient(100deg,#03070e 0%,#061426 52%,#0b2141 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 6px 22px rgba(0,0,0,.5)}
html.ph-night .ph-topbar::before{background:radial-gradient(130% 220% at 84% -60%,rgba(80,140,220,.28),transparent 60%)}
html.ph-night .ph-topbar .ph-rule{opacity:.4}
html.ph-night .ph-chip{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.12)}

html.ph-night header{background:rgba(9,16,29,.9) !important;border-color:rgba(255,255,255,.09) !important;
  box-shadow:0 10px 34px rgba(0,0,0,.5) !important}
html.ph-night header a,html.ph-night header span,html.ph-night header button{color:#dfe9fb}
html.ph-night header .text-neutral-700,html.ph-night header .text-neutral-600{color:#c3d1e8 !important}
html.ph-night header .text-primary-700{color:#8fc0ff !important}
html.ph-night header input{background:rgba(255,255,255,.06) !important;color:#e8eefc !important;border-color:rgba(255,255,255,.10) !important}
html.ph-night header input::placeholder{color:#7f93b3}

/* ---------------- RESPONSIVE ---------------- */
@media (min-width:900px){.ph-topbar .ph-links{display:flex}}
@media (max-width:899px){.ph-topbar .ph-hide-sm{display:none}}
@media (max-width:460px){
  .ph-topbar .ph-tb-in{padding:0 10px;gap:8px}
  .ph-topbar .ph-tb-r{gap:7px}
  .ph-topbar .ph-tb-dlong{display:none}
  .ph-topbar .ph-tb-dshort{display:inline}
  .ph-switch{width:46px;height:24px}
  .ph-switch .knob{width:18px;height:18px;top:2px}
  html.ph-night .ph-switch .knob{transform:translateX(-22px)}
}
@media (max-width:380px){.ph-topbar .ph-hide-xs{display:none}}

@media (prefers-reduced-motion:reduce){
  .ph-topbar,.ph-topbar::after,.ph-live::after{animation:none !important}
  .ph-switch,.ph-switch .knob,.ph-switch .knob svg,.ph-link::after,.ph-chip{transition:none !important}
}

/* ---------------------------------------------------------------------------
   Global horizontal-overflow guard.
   Decorative art (e.g. the سرزمین هیجان hero aurora SVG, which is drawn ~24px
   wider than the viewport) widened the document on mobile; in RTL that shifted
   the whole page and clipped the right-hand column of the game cards, hiding
   their «شروع بازی» buttons. `overflow-x: clip` (not `hidden`) removes the page
   level horizontal scroll WITHOUT creating a scroll container, so the sticky
   header and every inner scroller keep working.
--------------------------------------------------------------------------- */
html,body{overflow-x:clip}
