/* Kids learning-video portal — bright, rounded, phone-first, RTL-aware.
   No external fonts (CSP 'self'); system rounded stack. */
:root {
  --bg: #FFF8EE;
  --bg2: #FFF1DC;
  --card: #ffffff;
  --ink: #2B2D42;
  --muted: #6b7280;
  --brand1: #FF5A5F;
  --brand2: #118AB2;
  --accent: #FFD166;
  --good: #06D6A0;
  --bad: #EF476F;
  --cta: #E63946;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(43, 45, 66, .10);
  --shadow-sm: 0 3px 10px rgba(43, 45, 66, .10);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", "Noto Sans Arabic", "Noto Sans", Roboto, system-ui, -apple-system, sans-serif;
  --tap: 44px;
  --max: 1180px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  min-height: 100dvh; display: flex; flex-direction: column; line-height: 1.35;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; color: inherit; background: none; }
input { font-family: inherit; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--brand2); outline-offset: 3px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ── Header ───────────────────────────────────────── */
header { background: rgba(255,255,255,.92); backdrop-filter: blur(10px); box-shadow: 0 2px 12px rgba(43,45,66,.08); position: sticky; top: 0; z-index: 50; }
.nav { max-width: var(--max); margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; min-height: var(--tap); }
.logo .mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: linear-gradient(135deg, var(--accent), var(--brand1)); box-shadow: var(--shadow-sm); flex: none;
}
.logo .word { font-weight: 800; font-size: clamp(15px, 4.6vw, 22px); letter-spacing: .3px; line-height: 1; direction: ltr; unicode-bidi: isolate; display: inline-block; white-space: nowrap; }
.logo .word span { display: inline-block; }
.logo .tag { font-size: clamp(8px, 2.2vw, 10px); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; display: block; margin-top: 3px; white-space: nowrap; }
@media (max-width: 400px) { .logo .tag { display: none; } }
.nav .spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.kid-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 12px 0 8px; min-height: var(--tap);
  border-radius: 999px; background: var(--bg2); font-weight: 800; font-size: 14px;
}
html[dir="rtl"] .kid-chip { padding: 0 8px 0 12px; }
.kid-chip .ka { font-size: 20px; }
.kid-chip .ks { background: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12.5px; color: #b07a00; }
.icon-btn, .lang-btn {
  min-width: var(--tap); min-height: var(--tap); border-radius: 999px; background: #fff; border: 2px solid #eee;
  font-weight: 800; font-size: 16px; display: grid; place-items: center; transition: transform .12s;
}
.icon-btn:active, .lang-btn:active { transform: scale(.94); }
.lang-btn { font-size: 15px; padding: 0 12px; }
@media (max-width: 480px) {
  .logo .word { font-size: clamp(15px, 4.6vw, 18px); }
  .logo .mark { width: 38px; height: 38px; font-size: 20px; border-radius: 12px; }
  .nav { gap: 6px; padding: 8px 12px; }
  .nav-links { gap: 4px; }
  .kid-chip .kn { display: none; }
  .kid-chip { padding: 0 8px; }
}

/* ── Layout ───────────────────────────────────────── */
main { flex: 1; width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; width: 100%; }
.section { max-width: var(--max); margin: 0 auto; padding: 22px 16px; width: 100%; }
h1, h2, h3 { font-weight: 800; line-height: 1.2; }
.h-e { margin-inline-end: 8px; }

/* ── Hero ─────────────────────────────────────────── */
.hero { max-width: var(--max); margin: 16px auto 0; padding: 0 16px; width: 100%; }
.hero-card {
  border-radius: 26px; overflow: hidden; position: relative; color: #fff; padding: 30px 22px 26px;
  background: linear-gradient(120deg, #FFD166, #FF5A5F 55%, #7B5EA7); box-shadow: var(--shadow);
}
.hero-card .float { position: absolute; font-size: 54px; opacity: .3; animation: bob 4s ease-in-out infinite; pointer-events: none; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-14px) } }
.hero-card h1 { font-size: clamp(24px, 5vw, 40px); text-shadow: 0 2px 8px rgba(0,0,0,.18); position: relative; }
.hero-card p { margin-top: 8px; font-size: clamp(14px, 2.4vw, 18px); font-weight: 600; opacity: .95; position: relative; max-width: 620px; }
.hero-tools { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: relative; }
.search-box { flex: 1 1 260px; position: relative; display: flex; align-items: center; }
.search-box .s-ico { position: absolute; inset-inline-start: 16px; font-size: 18px; pointer-events: none; }
.search-box input {
  width: 100%; min-height: 50px; border-radius: 999px; border: 0; padding: 0 48px; font-size: 16px; font-weight: 700;
  color: var(--ink); background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.search-box input::placeholder { color: #9aa0a6; }
.search-box .s-clear {
  position: absolute; inset-inline-end: 6px; width: 40px; height: 40px; border-radius: 50%; background: var(--bg2); font-weight: 800; color: var(--muted);
}
.prog-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: relative; }
.pc { background: rgba(255,255,255,.9); color: var(--muted); border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.pc b { color: var(--ink); font-size: 14.5px; }

/* ── Chips ────────────────────────────────────────── */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  min-height: var(--tap); border-radius: 999px; padding: 0 18px; font-weight: 800; font-size: 14px;
  background: #fff; color: var(--ink); border: 2px solid #eee; transition: transform .12s, background .15s;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--brand2); color: #fff; border-color: var(--brand2); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 2px; }
.filters .lbl { font-weight: 800; color: var(--muted); font-size: 13.5px; }

/* ── Rails ────────────────────────────────────────── */
.rail-sec { margin-top: 22px; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rail-head h2 { font-size: 21px; display: flex; align-items: center; }
.rail-sub { color: var(--muted); font-weight: 600; font-size: 13.5px; margin-top: 2px; }
.see-all { font-weight: 800; color: var(--brand2); font-size: 14px; min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 6px; }
.rail {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding: 12px 4px 16px; margin: 0 -4px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #e4d9c6 transparent; -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: #e4d9c6; border-radius: 999px; }
.rail > * { flex: 0 0 auto; scroll-snap-align: start; }

/* ── Video card ───────────────────────────────────── */
.vcard {
  width: 212px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden;
  display: block; transition: transform .15s, box-shadow .15s; position: relative;
}
.vcard.wide { width: 260px; }
.vcard:hover, .vcard:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); }
.vthumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.poster { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; opacity: 0; transition: opacity .2s; }
.poster.has-img img { opacity: 1; }
.poster-fb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 12px 30px; text-align: center; width: 100%; height: 100%; }
.poster-fb .pe { font-size: 40px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.poster-fb .pt { font-weight: 800; font-size: 12.5px; text-shadow: 0 1px 4px rgba(0,0,0,.35); max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.poster.has-img .poster-fb { display: none; }
.play-badge {
  position: absolute; bottom: 8px; inset-inline-start: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.95); color: var(--cta); display: grid; place-items: center; font-size: 13px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); padding-inline-start: 2px;
}
html[dir="rtl"] .play-badge { transform: scaleX(-1); padding-inline-start: 0; padding-inline-end: 2px; }
.dur { position: absolute; bottom: 10px; inset-inline-end: 8px; background: rgba(0,0,0,.65); color: #fff; font-weight: 800; font-size: 11.5px; border-radius: 8px; padding: 3px 7px; direction: ltr; }
.tick { position: absolute; top: 8px; inset-inline-end: 8px; background: var(--good); color: #0b3d31; font-weight: 800; font-size: 11px; border-radius: 999px; padding: 3px 8px; }
.vprog { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.45); }
.vprog i { display: block; height: 100%; background: var(--cta); }
.vbody { padding: 10px 12px 12px; }
.vbody .vt { display: block; font-weight: 800; font-size: 14.5px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.5em; }
.vbody .vc { display: block; color: var(--muted); font-weight: 700; font-size: 12px; margin-top: 4px; }

/* ── Category tile ────────────────────────────────── */
.ctile {
  width: 150px; height: 128px; border-radius: 18px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .15s;
}
.ctile:hover, .ctile:focus-visible { transform: translateY(-4px) scale(1.02); }
.ctile .ce { position: absolute; top: 8px; inset-inline-end: 10px; font-size: 42px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.2)); }
.ctile .ct { font-weight: 800; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ctile .cn { font-weight: 700; font-size: 12px; opacity: .92; }
.ctile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.ctile-grid .ctile { width: auto; }

/* ── Grid (category page, search) ─────────────────── */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 14px; }
.vgrid .vcard { width: auto; }
@media (max-width: 480px) {
  .vgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .vbody .vt { font-size: 13px; }
}
.empty { text-align: center; color: var(--muted); font-weight: 700; padding: 34px 10px; }
.empty .ee { font-size: 46px; display: block; margin-bottom: 8px; }

/* ── Category hero ────────────────────────────────── */
.crumb { max-width: var(--max); margin: 12px auto 0; padding: 0 16px; width: 100%; font-weight: 700; font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumb a { color: var(--brand2); min-height: var(--tap); display: inline-flex; align-items: center; }
.cat-hero {
  border-radius: 26px; color: #fff; padding: 24px 22px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.cat-hero .big-e { font-size: clamp(56px, 12vw, 92px); line-height: 1; filter: drop-shadow(0 6px 12px rgba(0,0,0,.25)); }
.cat-hero .ch-body { flex: 1 1 220px; }
.cat-hero h1 { font-size: clamp(24px, 4.5vw, 38px); text-shadow: 0 2px 8px rgba(0,0,0,.2); }
.cat-hero .meta { margin-top: 6px; font-weight: 700; opacity: .95; font-size: 15px; display: flex; gap: 14px; flex-wrap: wrap; }
.cat-hero .ch-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--cta); color: #fff; font-weight: 800;
  border-radius: 999px; padding: 0 26px; min-height: 50px; font-size: 16px; box-shadow: 0 6px 16px rgba(230,57,70,.35); transition: transform .12s;
}
.btn-primary:active { transform: scale(.97); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--bg2); color: var(--ink); font-weight: 800;
  border-radius: 999px; padding: 0 22px; min-height: 50px; font-size: 15px; transition: transform .12s;
}
.btn-ghost:active { transform: scale(.97); }
.cat-hero .btn-primary { background: #fff; color: var(--ink); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.cat-hero .btn-ghost { background: rgba(255,255,255,.22); color: #fff; border: 2px solid rgba(255,255,255,.6); }
.sub-h { font-size: 19px; margin-top: 26px; display: flex; align-items: center; gap: 8px; }
.sub-h .cnt { color: var(--muted); font-size: 14px; font-weight: 700; }

/* ── Watch page ───────────────────────────────────── */
.watch-wrap { max-width: var(--max); margin: 14px auto 0; padding: 0 16px; width: 100%; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 960px) { .watch-wrap { grid-template-columns: 1fr; } }
.player-card { background: #0f1020; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); position: relative; color: #fff; }
.player-card:fullscreen { border-radius: 0; display: flex; flex-direction: column; justify-content: center; background: #000; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #0f1020; overflow: hidden; }
.player-card:fullscreen .stage { aspect-ratio: auto; height: 100%; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.stage .poster { z-index: 0; }
.stage .poster-fb .pe { font-size: clamp(60px, 16vw, 120px); }
.stage .poster-fb .pt { font-size: clamp(15px, 3vw, 24px); }
.stage .poster-fb { padding-bottom: 12px; }
.stage video { z-index: 1; }
.stage.has-video .poster { display: none; }
/* big centre play button (tap target) */
.big-play {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; z-index: 3;
  background: rgba(255,255,255,.95); color: var(--cta); font-size: 34px; display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); padding-inline-start: 6px; transition: transform .15s, opacity .2s;
}
.big-play:hover { transform: scale(1.06); }
html[dir="rtl"] .big-play { transform: scaleX(-1); padding-inline-start: 0; padding-inline-end: 6px; }
html[dir="rtl"] .big-play:hover { transform: scaleX(-1) scale(1.06); }
.stage.playing .big-play { opacity: 0; pointer-events: none; }
.spinner { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; border: 5px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .9s linear infinite; z-index: 3; display: none; }
.stage.buffering .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
/* overlays: error, quiz, up-next — on phones the stage grows to fit the overlay instead of clipping it */
@media (max-width: 960px) {
  .stage.has-overlay { aspect-ratio: auto; }
  .stage.has-overlay .overlay { position: relative; min-height: 56.25vw; }
  .stage.has-overlay video, .stage.has-overlay .poster, .stage.has-overlay .big-play, .stage.has-overlay .spinner { display: none; }
}
.overlay {
  position: absolute; inset: 0; z-index: 5; background: rgba(15,16,32,.86); backdrop-filter: blur(6px); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px; gap: 10px; overflow: auto;
}
.overlay .o-e { font-size: clamp(40px, 9vw, 64px); line-height: 1; }
.overlay h3 { font-size: clamp(18px, 3.6vw, 26px); }
.overlay p { font-weight: 600; opacity: .9; font-size: clamp(13px, 2.4vw, 15px); max-width: 520px; }
.overlay .o-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.overlay .btn-ghost { background: rgba(255,255,255,.18); color: #fff; }
.overlay .btn-primary, .overlay .btn-ghost { min-height: 44px; padding: 0 18px; font-size: 14.5px; }
@media (max-width: 600px) {
  .overlay { gap: 6px; padding: 12px; }
  .overlay .o-e { font-size: 30px; }
  .overlay h3 { font-size: 17px; }
  .overlay p { font-size: 12.5px; }
  .overlay .o-actions { gap: 6px; }
  .overlay .btn-primary, .overlay .btn-ghost { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
  .upnext-card { padding: 8px; gap: 10px; }
  .upnext-card .vthumb { width: 96px; }
  .result-stars { font-size: 30px; letter-spacing: 3px; }
}
.upnext-card { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.1); border-radius: 16px; padding: 10px 12px; max-width: 440px; width: 100%; text-align: start; }
.upnext-card .vthumb { width: 120px; flex: none; border-radius: 10px; }
.upnext-card .un-t { font-weight: 800; font-size: 15px; }
.upnext-card .un-c { font-weight: 700; font-size: 12.5px; opacity: .8; margin-top: 2px; }
.countdown { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.countdown .ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: conic-gradient(var(--accent) var(--p, 100%), rgba(255,255,255,.18) 0); position: relative; }
.countdown .ring::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #1a1b33; }
.countdown .ring b { position: relative; z-index: 1; }

/* controls */
.controls { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 6px; background: #14152b; }
.seek-row { display: flex; align-items: center; gap: 10px; direction: ltr; }
.seek-row .time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; color: #cfd2e4; min-width: 40px; text-align: center; }
input[type="range"].seek { flex: 1; -webkit-appearance: none; appearance: none; height: 28px; background: transparent; cursor: pointer; }
input[type="range"].seek::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--cta) var(--p, 0%), rgba(255,255,255,.22) 0); }
input[type="range"].seek::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; margin-top: -7px; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
input[type="range"].seek::-moz-range-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,.22); }
input[type="range"].seek::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--cta); }
input[type="range"].seek::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 0; }
.btn-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; direction: ltr; } /* transport controls keep the universal LTR order */
.btn-row .grow { flex: 1; }
.cbtn {
  min-width: var(--tap); min-height: var(--tap); border-radius: 12px; display: grid; place-items: center; font-size: 18px; color: #fff;
  background: transparent; transition: background .15s, transform .1s; font-weight: 800; padding: 0 8px;
}
.cbtn:hover { background: rgba(255,255,255,.1); }
.cbtn:active { transform: scale(.93); }
.cbtn.pp { background: var(--cta); width: 54px; height: 54px; border-radius: 50%; font-size: 22px; box-shadow: 0 6px 16px rgba(230,57,70,.45); }
.cbtn.txt { font-size: 13.5px; letter-spacing: .3px; }
.cbtn[aria-pressed="true"] { background: rgba(255,255,255,.22); outline: 2px solid rgba(255,255,255,.35); outline-offset: -2px; }
.vol-wrap { display: flex; align-items: center; gap: 4px; }
input[type="range"].vol { width: 80px; -webkit-appearance: none; appearance: none; height: 28px; background: transparent; direction: ltr; }
input[type="range"].vol::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.3); }
input[type="range"].vol::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; margin-top: -6px; }
input[type="range"].vol::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.3); }
input[type="range"].vol::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }
@media (max-width: 520px) { .vol-wrap input { display: none; } .cbtn.txt { font-size: 12.5px; padding: 0 6px; } }
.speed-menu { position: relative; }
.speed-menu .menu { position: absolute; bottom: calc(100% + 6px); inset-inline-end: 0; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 8; min-width: 110px; }
.speed-menu.open .menu { display: block; }
.speed-menu .menu button { display: block; width: 100%; min-height: var(--tap); border-radius: 10px; font-weight: 800; font-size: 14px; text-align: start; padding: 0 12px; }
.speed-menu .menu button:hover { background: var(--bg2); }
.speed-menu .menu button.on { background: var(--brand2); color: #fff; }

.watch-info { padding: 16px 4px 0; }
.watch-info h1 { font-size: clamp(20px, 3.6vw, 28px); }
.watch-info .wi-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.wi-meta .cat-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 0 12px; min-height: 36px; color: #fff; font-weight: 800; font-size: 13.5px; }
.wi-meta .pill { background: #fff; border-radius: 999px; padding: 0 12px; min-height: 36px; display: inline-flex; align-items: center; font-weight: 800; font-size: 13px; color: var(--muted); box-shadow: var(--shadow-sm); }
.watch-info .desc { margin-top: 10px; color: #444; font-weight: 600; font-size: 15px; line-height: 1.5; }
.watch-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; color: var(--muted); min-height: var(--tap); cursor: pointer; }
.toggle .sw { width: 46px; height: 28px; border-radius: 999px; background: #d9d9e3; position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.toggle[aria-checked="true"] .sw { background: var(--good); }
.toggle[aria-checked="true"] .sw::after { transform: translateX(18px); }
html[dir="rtl"] .toggle[aria-checked="true"] .sw::after { transform: translateX(-18px); }

.ep-side { background: var(--card); border-radius: 22px; box-shadow: var(--shadow-sm); overflow: hidden; }
.ep-side h2 { font-size: 17px; padding: 14px 16px 10px; display: flex; justify-content: space-between; align-items: center; }
.ep-side h2 .cnt { color: var(--muted); font-size: 13px; }
.ep-list { display: flex; flex-direction: column; max-height: 640px; overflow: auto; }
.ep-item { display: flex; gap: 12px; align-items: center; padding: 8px 12px; min-height: 64px; border-top: 1px solid #f1ece2; transition: background .15s; }
.ep-item:hover { background: var(--bg); }
.ep-item.now { background: var(--bg2); }
.ep-item .vthumb { width: 104px; flex: none; border-radius: 10px; }
.ep-item .ei-n { width: 26px; text-align: center; font-weight: 800; color: var(--muted); flex: none; font-size: 13px; }
.ep-item .ei-t { font-weight: 800; font-size: 14px; line-height: 1.25; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ep-item .ei-s { display: block; font-weight: 700; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ep-item .ei-tick { color: #067a5b; font-weight: 800; font-size: 13px; flex: none; }
.ep-item.now .ei-n { color: var(--cta); }

/* quiz inside the overlay */
.quiz { width: 100%; max-width: 560px; }
.quiz .q-prompt { font-weight: 800; font-size: clamp(16px, 3vw, 20px); }
.quiz .q-target { font-size: clamp(28px, 7vw, 54px); font-weight: 800; color: var(--accent); margin: 6px 0 12px; line-height: 1.15; cursor: pointer; }
.quiz .q-target.word { font-size: clamp(22px, 5vw, 34px); }
.q-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.q-grid.three { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
.q-grid button {
  background: #fff; color: var(--ink); border-radius: 18px; min-height: 64px; font-weight: 800; font-size: 16px; padding: 10px 12px;
  border: 4px solid transparent; transition: transform .12s; position: relative; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.q-grid button.pic { font-size: clamp(40px, 9vw, 60px); min-height: 84px; }
@media (max-width: 600px) { .q-grid button.pic { min-height: 68px; font-size: 38px; } .q-grid button { min-height: 52px; font-size: 15px; } }
.q-grid button:hover { transform: scale(1.03); }
.q-grid button.right { border-color: var(--good); background: #E9FBF4; }
.q-grid button.wrong { border-color: var(--bad); background: #FDECEF; animation: shake .3s; }
.q-grid button.right::after, .q-grid button.wrong::after { position: absolute; top: 4px; inset-inline-end: 8px; font-size: 18px; font-weight: 800; }
.q-grid button.right::after { content: '✓'; color: #067a5b; }
.q-grid button.wrong::after { content: '✗'; color: var(--bad); }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.q-step { font-weight: 800; font-size: 13px; opacity: .8; margin-top: 10px; }
.result-stars { font-size: clamp(34px, 8vw, 52px); letter-spacing: 6px; }
@media (max-height: 420px) and (max-width: 960px) { .overlay .o-e { display: none; } .q-grid button.pic { min-height: 56px; font-size: 32px; } }

/* ── Account page ─────────────────────────────────── */
.acct-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px 20px; max-width: 560px; margin: 16px auto; text-align: center; }
.acct-card .big { font-size: 56px; line-height: 1.1; }
.acct-card h2 { font-size: 22px; margin-top: 6px; }
.acct-card .mini { margin-top: 10px; min-height: var(--tap); padding: 0 16px; font-size: 13.5px; }
.acct-stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.acct-stats .pc { background: var(--bg); box-shadow: none; }
.mini-row-label { font-weight: 800; font-size: 13.5px; color: var(--muted); margin: 14px 0 6px; }
.mini-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mini-chip { background: var(--bg); border-radius: 999px; padding: 0 14px; min-height: var(--tap); font-weight: 800; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.mini-chip.kid.on { background: var(--brand2); color: #fff; }
.mini-chip.add { border: 2px dashed #d9cfc0; background: transparent; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 14px; }
.badge { background: var(--bg); border-radius: 16px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: .35; filter: grayscale(1); }
.badge.on { opacity: 1; filter: none; background: var(--bg2); box-shadow: var(--shadow-sm); }
.badge .be { font-size: 30px; }
.badge .bn { font-weight: 700; font-size: 11.5px; text-align: center; }
.sticker-hint { color: var(--muted); font-weight: 700; font-size: 13px; margin-top: 4px; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-top: 14px; }
.sticker { aspect-ratio: 1; border-radius: 14px; background: var(--bg); display: grid; place-items: center; font-size: 26px; color: #d8cbb6; font-weight: 800; }
.sticker.on { background: var(--bg2); box-shadow: var(--shadow-sm); animation: pop-in .35s both; }
@keyframes pop-in { from { transform: scale(0); } to { transform: scale(1); } }
.pgate-q { font-weight: 700; margin-top: 12px; font-size: 14.5px; text-align: start; }
.pgate-q.center { text-align: center; }
.pgate-in { width: 130px; border: 2px solid #eee; border-radius: 14px; padding: 10px 12px; margin: 10px auto 4px; font-size: 22px; font-weight: 800; text-align: center; display: block; min-height: var(--tap); letter-spacing: 6px; }
.fb { min-height: 22px; font-weight: 800; margin-top: 6px; font-size: 13.5px; }
.fb.more { color: #b07a00; }
.fb.ok { color: #067a5b; }
.pin-forgot { color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; margin-top: 10px; min-height: var(--tap); }
.parent-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.parent-table th { text-align: start; padding: 8px 6px; color: var(--muted); font-size: 12.5px; border-bottom: 2px solid #f0e8da; }
.parent-table td { padding: 8px 6px; border-bottom: 1px dashed #f0e8da; font-weight: 700; text-align: start; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.stat { background: var(--bg); border-radius: 16px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 22px; }
.stat small { font-weight: 700; color: var(--muted); font-size: 12px; }
.week-chart { display: flex; align-items: flex-end; gap: 8px; justify-content: center; margin: 10px 0 4px; height: 90px; }
.wc-col { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wc-col i { display: block; width: 24px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--accent), var(--good)); }
.wc-col small { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.age-row { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.cert-frame { border: 4px double var(--accent); border-radius: 18px; padding: 22px 14px; background: #FFFDF6; }
.cert-mark { font-size: 40px; }
.cert-name { font-size: 26px; font-weight: 800; margin: 10px 0 6px; color: var(--brand2); }
.cert-frame p { font-weight: 700; }
.cert-keep { color: var(--muted) !important; font-size: 14px; margin-top: 6px; }
.cert-brand { margin-top: 12px; font-weight: 800; font-size: 12.5px; color: var(--muted); letter-spacing: 1px; }
.cert-card .btn-primary { margin-top: 14px; }
@media print {
  body.cert-mode header, body.cert-mode footer, body.cert-mode .acct-card:not(.cert-card) { display: none !important; }
  body.cert-mode .cert-card { box-shadow: none; }
  body.cert-mode .cert-card .btn-primary { display: none; }
}
.op-note { color: var(--muted); font-weight: 700; font-size: 14.5px; line-height: 1.5; }

/* ── Modal ────────────────────────────────────────── */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(43,45,66,.6); align-items: center; justify-content: center; padding: 18px; }
.modal-wrap.open { display: flex; }
.modal { background: #fff; border-radius: 26px; max-width: 440px; width: 100%; padding: 24px 20px; text-align: center; max-height: 90dvh; overflow: auto; position: relative; scrollbar-width: thin; }
.modal h3 { font-size: 22px; }
.modal .modal-emoji { font-size: 52px; }
.modal input[type="text"] { width: 100%; border: 2px solid #eee; border-radius: 14px; padding: 12px 14px; font-size: 16px; font-weight: 700; margin-top: 10px; text-align: center; min-height: var(--tap); }
.pm-sub { color: var(--muted); font-weight: 700; margin-top: 6px; font-size: 14px; }
.pm-modal { padding-top: 54px; }
.pm-modal h3 { padding: 0 36px; }
.pm-x { position: absolute; top: 10px; inset-inline-end: 10px; width: var(--tap); height: var(--tap); border-radius: 50%; background: #f4efe6; font-size: 17px; font-weight: 800; color: var(--muted); z-index: 5; }
.ava-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 4px; }
.ava { font-size: 32px; min-height: 58px; border-radius: 16px; background: var(--bg); border: 3px solid transparent; transition: transform .12s; position: relative; }
.ava:hover { transform: scale(1.06); }
.ava.on { border-color: var(--brand2); background: #EAF6FB; }
.ava.on::after { content: '✓'; position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--good); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.unlock-lbl { margin-top: 14px; font-weight: 800; color: var(--ink); }
.prem-grid { background: var(--bg); border-radius: 16px; padding: 8px; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.prem-grid .ava { font-size: 22px; min-height: 48px; padding-bottom: 8px; border-radius: 12px; }
.ava.locked { opacity: .9; filter: saturate(.7); cursor: default; }
.ava-cost { position: absolute; bottom: -4px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 8.5px; font-weight: 800; border-radius: 999px; padding: 1px 6px; white-space: nowrap; }
html[dir="rtl"] .ava-cost { transform: translateX(50%); }
.modal .pm-go { position: sticky; bottom: -24px; display: flex; width: 100%; z-index: 3; margin-top: 14px; }

/* ── Toast + confetti ─────────────────────────────── */
.badge-toast {
  position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translate(-50%, 120%); background: var(--ink); color: #fff;
  border-radius: 18px; padding: 12px 20px; z-index: 200; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); transition: transform .35s ease; max-width: calc(100vw - 32px);
}
html[dir="rtl"] .badge-toast { transform: translate(50%, 120%); }
.badge-toast.on { transform: translate(-50%, 0); }
html[dir="rtl"] .badge-toast.on { transform: translate(50%, 0); }
.badge-toast .be { font-size: 28px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti span { position: absolute; top: -30px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(340deg); opacity: .7; } }
.fatal { position: fixed; inset-inline: 16px; top: 80px; background: #FDECEF; color: #7a1b2a; border-radius: 16px; padding: 14px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 700; z-index: 400; }
.fatal small { display: block; width: 100%; font-weight: 600; }

/* ── Footer ───────────────────────────────────────── */
footer { background: var(--ink); color: #cfd2e4; margin-top: 34px; }
.foot { max-width: var(--max); margin: 0 auto; padding: 26px 16px; text-align: center; }
.foot .flinks { display: flex; justify-content: center; gap: 6px 18px; flex-wrap: wrap; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.foot .flinks a { min-height: var(--tap); display: inline-flex; align-items: center; }
.foot .flinks a:hover { color: #fff; }
.foot .copy { font-size: 13px; font-weight: 600; }
.foot .copy b { color: #fff; }

/* ── Legal pages ──────────────────────────────────── */
.legal { max-width: 760px; margin: 10px auto; padding: 0 16px 30px; line-height: 1.65; width: 100%; }
.legal h1 { margin: 18px 0 8px; font-size: 28px; }
.legal h2 { margin: 18px 0 6px; font-size: 19px; }
.legal p, .legal li { color: #444; font-weight: 500; font-size: 15px; }
.legal ul { padding-inline-start: 22px; }
.legal a { color: var(--brand2); font-weight: 700; }
.legal [lang="ar"] { display: none; }
html[lang="ar"] .legal [lang="ar"] { display: block; }
html[lang="ar"] .legal [lang="en"] { display: none; }

/* ── Motion / misc ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero-card .float { display: none; }
}
html[dir="rtl"] body { letter-spacing: 0; }

/* numeric-only labels ("5 / 11", "0:00") must not flip in RTL */
.pill, .vbody .vc, .ei-n, .q-step, .cnt, .dur, .ks { unicode-bidi: plaintext; }
/* tiny thumbnails (episode list, up-next card): emoji only, no fallback title */
.ep-item .poster-fb .pt, .upnext-card .poster-fb .pt { display: none; }
.ep-item .poster-fb, .upnext-card .poster-fb { padding: 4px; }
.ep-item .poster-fb .pe { font-size: 26px; }
.upnext-card .poster-fb .pe { font-size: 30px; }
