/* kids-mode.css — عارفها للصغار (2026-11-12, own screens 2026-11-13).

   PART 1 (.kids-entry): the way in on the ordinary launcher — the only rules that apply
   when kids mode is off.
   PART 2 (.kids-app): the kids screens. ui/kids-mode.js draws them in #kidsApp and sets
   html.kt-kids + html[data-kids-view]; while a kids view is up, the seven ordinary game
   screens and the lobby chrome are hidden behind it.

   The look: Band Gold ground, Prop Paper cards, Ink Plum outlines with the brand's hard
   "printed edge" instead of blurred shadows, big type. Colours are DESIGN.md's own:
   gold #efb235, paper #fffcf4, ink #221b2d, teal #155d54, ember #bb451e, violet #7140a2. */

/* ── the للكبار / للصغار switch (2026-11-13). Base rules = the ordinary launcher's look;
   .kids-app .kids-switch further down gives the kids screens' own version. ── */
.kids-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px;
  background: #fffcf4; border: 1px solid #d6cab8; font-weight: 700; font-size: .92rem; line-height: 1; direction: rtl;
}
.kids-switch > * {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 18px; border-radius: 999px;
  color: #221b2d; text-decoration: none; white-space: nowrap; transition: background-color .15s ease;
}
.kids-switch > [aria-current] { background: #221b2d; color: #f8f3e8; }
.kids-switch > a:hover { background: #eee5f4; }
.kids-switch > a:focus-visible { outline: 3px solid #7140a2; outline-offset: 3px; }
#launcher .launcher__inner { position: relative; }
#launcher .launcher__inner > .kids-switch { position: absolute; z-index: 4; inset-block-start: 14px; inset-inline-end: 0; }
@media (max-width: 920px) {
  #launcher .launcher__inner > .kids-switch { position: static; display: flex; width: max-content; margin: 0 auto 10px; }
}
@media (orientation: landscape) and (max-height: 550px) {
  #launcher .launcher__inner > .kids-switch { position: absolute; inset-block-start: 4px; margin: 0; }
  .kids-switch > * { min-height: 32px; padding: 0 14px; }
}

/* ── the way in, on the ordinary launcher (not scoped to .kt-kids) ──
   Desktop: a band under the five mode cards. Tablet and phone: the grid is 3 or 2 columns,
   so the five cards leave one empty cell — the entry sits in it as a sixth card. */
.ar-mode-grid .kids-entry {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px; border-radius: 14px;
  background: #efb235; color: #221b2d; text-decoration: none; text-align: start;
  transition: transform .2s;
}
.ar-mode-grid .kids-entry:hover { transform: translateY(-2px); }
.ar-mode-grid .kids-entry:focus-visible { outline: 3px solid #7140a2; outline-offset: 3px; }
.kids-entry__new {
  flex: none; padding: 3px 12px; border-radius: 999px;
  background: #221b2d; color: #f8f3e8; font-weight: 700; font-size: 13px; line-height: 1.5;
}
.kids-entry__copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kids-entry__copy strong {
  font-family: 'Thmanyah Display', var(--font-ar-display, inherit); font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.3;
}
.kids-entry__copy > span { font-size: 1rem; line-height: 1.6; }
.kids-entry__go {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 22px;
  border-radius: 7px; background: #221b2d; color: #f8f3e8; font-weight: 700; font-size: 1rem;
}
.kids-entry:hover .kids-entry__go { background: #41324b; }

@media (max-width: 920px) {
  .ar-mode-grid .kids-entry {
    grid-column: auto; flex-direction: column; align-items: flex-start; justify-content: space-between;
    gap: 8px; padding: 14px; border-radius: 8px;
  }
  .kids-entry__copy { flex: 0 1 auto; gap: 4px; }
  .kids-entry__copy strong { font-size: clamp(1.15rem, 5vw, 1.6rem); }
  .kids-entry__copy > span { font-size: .86rem; line-height: 1.55; }
  .kids-entry__go { min-height: 40px; padding: 6px 14px; font-size: .86rem; }
}
@media (orientation: landscape) and (max-height: 550px) {
  .ar-mode-grid .kids-entry { grid-column: 1 / -1; flex-direction: row; align-items: center; padding: 8px 16px; gap: 14px; }
  .kids-entry__copy strong { font-size: 1.1rem; }
  .kids-entry__copy > span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ar-mode-grid .kids-entry { transition: none; } .ar-mode-grid .kids-entry:hover { transform: none; } }

/* ══ PART 2 — the kids screens ══════════════════════════════════════ */
html.kt-kids:not([data-kids-view="adult"]) body { background: #efb235 !important; padding: 0 !important; }
html.kt-kids:not([data-kids-view="adult"]) :is(#launcher, #setup, #categorySelect, #board, #question, #answer, #gameover),
html.kt-kids:not([data-kids-view="adult"]) :is(.ar-lobby-header, #kt-drawer, #kt-drawer-scrim, #kt-miniboard, #kt-audio-dock, #ktRotate, .kt-intro) { display: none !important; }
html.kt-kids[data-kids-view="adult"] .kids-app { display: none; }

.kids-app {
  --k-sun: #efb235; --k-sun-hi: #f7cf73; --k-sun-lo: #d9951b; --k-tint: #fdf0cd;
  --k-paper: #fffcf4; --k-ink: #221b2d; --k-mauve: #67536c; --k-amber: #8a5300;
  --k-teal: #155d54; --k-teal-lo: #0b3d37; --k-ember: #bb451e; --k-violet: #7140a2;
  --k-red: #c8362f; --k-blue: #2f5fa8;
  --k-display: 'Thmanyah Display', 'Reem Kufi', 'Cairo', serif;
  --k-pad: clamp(14px, 2.4vw, 36px);
  position: relative; isolation: isolate; overflow: clip;
  min-height: 100vh; min-height: 100svh;
  background: var(--k-sun); color: var(--k-ink);
  font-family: 'Thmanyah Text', 'Tajawal', 'Cairo', system-ui, sans-serif; font-size: 17px; line-height: 1.6;
  text-align: start; -webkit-tap-highlight-color: transparent;
}
.kids-app *, .kids-app *::before, .kids-app *::after { box-sizing: border-box; }
.kids-app :where(h1, h2, p, ol) { margin: 0; padding: 0; }
.kids-app [hidden] { display: none !important; }
/* two quiet shapes from the brand's own art: a sun disc and the eight-point burst */
.kids-app::before, .kids-app::after { content: ""; position: absolute; z-index: -1; pointer-events: none; background: var(--k-sun-hi); }
.kids-app::before { width: min(62vw, 760px); aspect-ratio: 1; border-radius: 50%; inset-block-start: -22vw; inset-inline-start: -14vw; opacity: .55; }
.kids-app::after {
  width: min(34vw, 380px); aspect-ratio: 1; inset-block-end: 6vh; inset-inline-end: -9vw; opacity: .5;
  clip-path: polygon(50% 0, 60% 26%, 85% 15%, 74% 40%, 100% 50%, 74% 60%, 85% 85%, 60% 74%, 50% 100%, 40% 74%, 15% 85%, 26% 60%, 0 50%, 26% 40%, 15% 15%, 40% 26%);
}

.kv { display: none; }
.kids-app[data-view="home"] .kv-home, .kids-app[data-view="over"] .kv-over { display: flex; }
.kids-app[data-view="board"] .kv-board, .kids-app[data-view="qa"] .kv-qa { display: grid; }

/* ── shared pieces ── */
.k-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-bar__start, .k-bar__end { display: flex; align-items: center; gap: 12px; min-width: 0; }
.k-brand { display: flex; align-items: center; gap: 10px; }
.k-brand__word { font-family: var(--k-display); font-weight: 900; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1; }
.k-brand__word i { font-style: normal; color: var(--k-ember); }
.k-brand__tag {
  padding: 3px 14px 5px; border-radius: 999px; background: var(--k-ink); color: var(--k-paper);
  font-weight: 700; font-size: clamp(.95rem, 1.5vw, 1.15rem); transform: rotate(-4deg);
}
.kids-app .kids-switch { background: var(--k-paper); border: 3px solid var(--k-ink); box-shadow: 0 4px 0 var(--k-ink); font-size: 1rem; flex: none; }
.kids-app .kids-switch > * { min-height: 36px; padding: 0 16px 2px; color: var(--k-ink); }
.kids-app .kids-switch > [aria-current] { background: var(--k-ink); color: var(--k-paper); }
.kids-app .kids-switch > a:hover { background: var(--k-tint); }
.k-link { color: var(--k-ink); font-weight: 700; font-size: .98rem; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; white-space: nowrap; }
.k-link:hover { color: var(--k-teal-lo); }

.k-btn, .k-icon {
  appearance: none; cursor: pointer; font: inherit; color: var(--k-ink);
  background: var(--k-paper); border: 3px solid var(--k-ink); box-shadow: 0 5px 0 var(--k-ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease;
}
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 8px 24px; border-radius: 18px;
  font-family: var(--k-display); font-weight: 700; font-size: 1.15rem; line-height: 1.3; white-space: nowrap;
}
.k-btn--sm { min-height: 44px; padding: 5px 18px; border-radius: 14px; font-size: 1rem; box-shadow: 0 4px 0 var(--k-ink); }
.k-btn--big { min-height: clamp(58px, 8vh, 76px); padding: 10px clamp(26px, 4vw, 52px); border-radius: 22px; font-weight: 900; font-size: clamp(1.3rem, 2.4vw, 1.9rem); box-shadow: 0 7px 0 var(--k-ink); }
.k-btn--teal { background: var(--k-teal); color: var(--k-paper); }
.k-btn--team-a { background: var(--k-red); color: #fff; }
.k-btn--team-b { background: var(--k-blue); color: #fff; }
.k-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; box-shadow: 0 4px 0 var(--k-ink); flex: none; }
.k-icon svg { width: 24px; height: 24px; }
.k-icon.is-off { background: var(--k-tint); color: var(--k-mauve); }
:is(.k-btn, .k-icon):hover:not(:disabled) { transform: translateY(-2px); }
:is(.k-btn, .k-icon):active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--k-ink); }
.k-btn:disabled { cursor: default; background: var(--k-tint); color: rgba(34, 27, 45, .45); border-color: rgba(34, 27, 45, .35); box-shadow: 0 5px 0 rgba(34, 27, 45, .18); }
.kids-app :is(button, a, input):focus-visible { outline: 4px solid var(--k-violet); outline-offset: 3px; }
.k-team-a { color: var(--k-red); } .k-team-b { color: var(--k-blue); }
.k-stars { display: inline-flex; gap: 2px; }
.k-stars svg { width: 1em; height: 1em; }

/* ── home ── */
.kv-home { flex-direction: column; gap: clamp(12px, 2.2vh, 22px); min-height: 100vh; min-height: 100svh; padding: clamp(12px, 2vh, 22px) var(--k-pad) 0; }
.kh-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px 32px; }
.kh-hero h1 { font-family: var(--k-display); font-weight: 900; font-size: clamp(2rem, 4.2vw, 3.5rem); line-height: 1.25; text-wrap: balance; }
.kh-hero p { margin-top: 4px; font-size: clamp(1.02rem, 1.6vw, 1.3rem); font-weight: 500; max-width: 46ch; }
.kh-teams { display: flex; gap: 12px; }
.kh-team {
  display: grid; gap: 0; width: clamp(150px, 17vw, 230px); padding: 6px 14px 8px; border-radius: 18px;
  background: var(--k-paper); border: 3px solid var(--k-ink); box-shadow: 0 5px 0 var(--k-ink); border-inline-start-width: 16px;
}
.kh-team--a { border-inline-start-color: var(--k-red); } .kh-team--b { border-inline-start-color: var(--k-blue); }
.kh-team span { font-size: .8rem; font-weight: 700; color: var(--k-mauve); }
.kh-team input {
  width: 100%; min-width: 0; padding: 0; border: 0; background: none; color: var(--k-ink);
  font-family: var(--k-display); font-weight: 700; font-size: 1.3rem; line-height: 1.4; text-align: start;
}
.kh-team input::placeholder { color: rgba(34, 27, 45, .42); opacity: 1; }
.kh-team input:focus-visible { outline: none; }
.kh-team:focus-within { outline: 4px solid var(--k-violet); outline-offset: 3px; }

.kh-resume {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px;
  padding: 12px 18px; border-radius: 20px; background: var(--k-paper); border: 3px solid var(--k-ink); box-shadow: 0 5px 0 var(--k-ink);
}
.kh-resume p { display: grid; } .kh-resume p b { font-family: var(--k-display); font-size: 1.2rem; } .kh-resume p span { font-size: .95rem; color: var(--k-mauve); }
.kh-resume > div { display: flex; gap: 10px; flex-wrap: wrap; }

.kh-shelves { display: grid; gap: clamp(14px, 2.6vh, 26px); flex: 1; align-content: start; }
.kh-shelf__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.kh-shelf__head h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 1rem; font-weight: 500; }
.kh-shelf__head h2 b { padding: 2px 16px 4px; border-radius: 999px; background: var(--k-ink); color: var(--k-paper); font-family: var(--k-display); font-weight: 700; font-size: clamp(1.05rem, 1.7vw, 1.3rem); }
.kh-shelf__head h2 span { font-weight: 700; }
.kh-lucky { appearance: none; border: 0; background: none; padding: 6px 2px; cursor: pointer; font: inherit; font-weight: 700; font-size: .95rem; color: var(--k-ink); text-decoration: underline dashed 2px; text-underline-offset: 5px; white-space: nowrap; }
.kh-lucky:hover { color: var(--k-teal-lo); }
.kh-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 16px); }
.kh-card { appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; font: inherit; color: inherit; display: grid; gap: 9px; text-align: center; min-width: 0; }
.kh-card__art {
  position: relative; display: block; aspect-ratio: 1; width: 100%; justify-self: center; border-radius: clamp(12px, 1.6vw, 22px);
  border: 3px solid var(--k-ink); box-shadow: 0 6px 0 var(--k-ink); background: var(--k-paper);
  transition: transform .14s ease, box-shadow .14s ease, opacity .2s ease, filter .2s ease;
}
.kh-card__art img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; border-radius: calc(clamp(12px, 1.6vw, 22px) - 3px); }
.kh-card__name { font-weight: 700; font-size: clamp(.82rem, 1.25vw, 1.08rem); line-height: 1.35; text-wrap: balance; }
.kh-card__badge {
  position: absolute; inset-block-start: -12px; inset-inline-start: -10px; display: none; place-items: center;
  width: clamp(30px, 3.2vw, 42px); aspect-ratio: 1; border-radius: 50%;
  background: var(--k-teal); color: var(--k-paper); border: 3px solid var(--k-ink);
  font-style: normal; font-family: var(--k-display); font-weight: 900; font-size: clamp(1rem, 1.6vw, 1.35rem); line-height: 1;
}
.kh-card:hover:not(.is-dim) .kh-card__art { transform: translateY(-3px) rotate(-1.5deg); }
.kh-card.is-on .kh-card__art { transform: translateY(3px); border-color: var(--k-teal); box-shadow: 0 0 0 4px var(--k-teal), 0 5px 0 4px var(--k-teal-lo); }
.kh-card.is-on .kh-card__badge { display: grid; animation: k-pop .28s cubic-bezier(.3, 1.6, .5, 1); }
.kh-card.is-dim .kh-card__art { opacity: .5; filter: saturate(.55); box-shadow: 0 3px 0 rgba(34, 27, 45, .5); }
.kh-card.is-dim .kh-card__name { opacity: .6; }
.kh-card:focus-visible { outline: none; }
.kh-card:focus-visible .kh-card__art { outline: 4px solid var(--k-violet); outline-offset: 3px; }

.kh-dock { position: sticky; inset-block-end: 0; z-index: 5; margin: auto calc(-1 * var(--k-pad)) 0; background: var(--k-paper); border-top: 3px solid var(--k-ink); }
.kh-dock__in { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px var(--k-pad) calc(14px + env(safe-area-inset-bottom, 0px)); }
.kh-count { display: flex; align-items: center; gap: 14px; min-width: 0; }
.kh-count p { font-family: var(--k-display); font-weight: 700; font-size: clamp(1rem, 1.7vw, 1.3rem); line-height: 1.35; }
.kh-dots { display: flex; gap: 7px; flex: none; }
.kh-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--k-ink); background: var(--k-paper); transition: background-color .15s ease, transform .15s ease; }
.kh-dots i.on { background: var(--k-teal); transform: scale(1.12); }
.kh-count.is-nudge { animation: k-shake .4s ease; }
.kh-dock .k-btn--big { flex: none; }
.k-btn.is-loading { background: var(--k-teal-lo); color: var(--k-paper); border-color: var(--k-ink); }

/* ── board ── */
.kv-board { grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(10px, 1.8vh, 18px); height: 100vh; height: 100svh; padding: clamp(10px, 1.8vh, 18px) var(--k-pad) calc(clamp(14px, 2.2vh, 22px) + env(safe-area-inset-bottom, 0px)); }
.kb-turn { font-family: var(--k-display); font-weight: 900; font-size: clamp(1.25rem, 2.4vw, 2rem); line-height: 1.3; }
.kb-turn b { display: inline-block; padding: 0 14px 3px; border-radius: 14px; background: var(--k-paper); border: 3px solid var(--k-ink); }
.kb-left { font-weight: 700; font-size: clamp(.9rem, 1.3vw, 1.05rem); opacity: .8; white-space: nowrap; }
.k-menu { position: relative; }
.k-menu__list {
  position: absolute; z-index: 20; inset-block-start: calc(100% + 10px); inset-inline-end: 0; display: grid; gap: 4px; min-width: 240px; padding: 8px;
  background: var(--k-paper); border: 3px solid var(--k-ink); border-radius: 18px; box-shadow: 0 6px 0 var(--k-ink);
}
.k-menu__list button { appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 700; color: var(--k-ink); text-align: start; padding: 10px 14px; border-radius: 12px; min-height: 44px; }
.k-menu__list button:hover { background: var(--k-tint); }

.kb-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1.1vw, 16px); min-height: 0; }
.kb-col { display: flex; flex-direction: column; gap: clamp(7px, 1.2vh, 12px); min-width: 0; min-height: 0; }
.kb-col__head { position: relative; flex: 1 1 0; min-height: 56px; border-radius: clamp(14px, 1.6vw, 22px); border: 3px solid var(--k-ink); box-shadow: 0 5px 0 var(--k-ink); background: var(--k-ink); overflow: hidden; }
.kb-col__head img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kb-col__head b {
  position: absolute; inset-inline: 0; inset-block-end: 0; padding: 4px 6px 6px; background: var(--k-paper); border-top: 3px solid var(--k-ink);
  font-family: var(--k-display); font-weight: 700; font-size: clamp(.92rem, 1.5vw, 1.3rem); line-height: 1.35; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kb-tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(6px, .8vw, 10px) clamp(6px, .7vw, 10px); padding-bottom: 5px; }
.kb-tile {
  appearance: none; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: clamp(46px, 9.4vh, 96px); padding: 0; border-radius: clamp(12px, 1.3vw, 18px);
  border: 3px solid var(--k-ink); box-shadow: 0 5px 0 var(--k-ink); color: var(--k-paper);
  transition: transform .12s ease, box-shadow .12s ease;
}
.kb-tile b { font-family: var(--k-display); font-weight: 900; font-size: clamp(1.25rem, 2.5vw, 2.3rem); line-height: 1.05; }
.kb-tile .k-stars { font-size: clamp(.6rem, 1.05vw, .95rem); color: var(--k-sun-hi); }
.kb-tile--1 { background: var(--k-teal); } .kb-tile--2 { background: var(--k-violet); } .kb-tile--3 { background: var(--k-ember); }
.kb-tile:hover:not(:disabled) { transform: translateY(-3px) rotate(-1deg); }
.kb-tile:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--k-ink); }
.kb-tile.is-used { cursor: default; background: rgba(255, 252, 244, .28); border: 3px dashed rgba(34, 27, 45, .38); box-shadow: none; color: rgba(34, 27, 45, .45); transform: translateY(5px); }
.kb-tile.is-used svg { width: clamp(18px, 2vw, 28px); height: clamp(18px, 2vw, 28px); }

.kb-scores { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.6vw, 22px); }
.kb-team {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0;
  padding: clamp(6px, 1.2vh, 12px) clamp(16px, 2.4vw, 32px); border-radius: clamp(16px, 1.8vw, 24px);
  border: 3px solid var(--k-ink); box-shadow: 0 6px 0 var(--k-ink); color: #fff;
}
.kb-team--a { background: var(--k-red); } .kb-team--b { background: var(--k-blue); }
.kb-team__name { font-family: var(--k-display); font-weight: 700; font-size: clamp(1.1rem, 2.1vw, 1.8rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-team__score { font-family: var(--k-display); font-weight: 900; font-size: clamp(1.8rem, 3.6vw, 3.2rem); line-height: 1.1; }
.kb-team__turn {
  position: absolute; inset-block-start: -15px; inset-inline-start: 22px; padding: 0 14px 2px; border-radius: 999px;
  background: var(--k-paper); color: var(--k-ink); border: 3px solid var(--k-ink); font-style: normal; font-weight: 700; font-size: .92rem; line-height: 1.5;
}
.kb-team:not(.is-turn) { box-shadow: 0 3px 0 var(--k-ink); transform: translateY(3px); }
.kb-team.is-gain .kb-team__score { animation: k-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.kb-team__gain {
  position: absolute; inset-block-start: -17px; inset-inline-end: clamp(14px, 2.2vw, 30px); padding: 0 14px 2px; border-radius: 999px; direction: ltr;
  background: var(--k-sun); color: var(--k-ink); border: 3px solid var(--k-ink); font-style: normal; font-family: var(--k-display); font-weight: 900; font-size: clamp(1rem, 1.7vw, 1.35rem); line-height: 1.45;
  animation: k-gain 2.4s ease forwards; pointer-events: none;
}

/* ── question / answer ── */
.kv-qa { grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(12px, 2.2vh, 22px); height: 100vh; height: 100svh; padding: clamp(10px, 1.8vh, 18px) var(--k-pad) calc(clamp(14px, 2.4vh, 26px) + env(safe-area-inset-bottom, 0px)); }
.kq-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.kq-head > .k-btn { justify-self: start; }
.kq-cat { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kq-cat img { width: clamp(44px, 5vw, 64px); height: clamp(44px, 5vw, 64px); border-radius: 16px; border: 3px solid var(--k-ink); object-fit: cover; flex: none; transform: rotate(-4deg); background: var(--k-paper); }
.kq-cat div { display: grid; min-width: 0; }
.kq-cat b { font-family: var(--k-display); font-weight: 900; font-size: clamp(1.1rem, 2vw, 1.7rem); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kq-cat span { font-weight: 700; font-size: clamp(.85rem, 1.25vw, 1.05rem); white-space: nowrap; }
.kq-timer {
  justify-self: end; display: grid; place-items: center; align-content: center; width: clamp(64px, 7.4vw, 96px); aspect-ratio: 1; border-radius: 50%;
  background: var(--k-paper); border: 4px solid var(--k-ink); box-shadow: 0 5px 0 var(--k-ink); line-height: 1;
}
.kq-timer b { font-family: var(--k-display); font-weight: 900; font-size: clamp(1.5rem, 2.9vw, 2.5rem); }
.kq-timer small { font-size: clamp(.62rem, .95vw, .8rem); font-weight: 700; color: var(--k-mauve); margin-top: 2px; }
.kq-timer.is-urgent { background: var(--k-ember); color: #fff; animation: k-beat 1s ease-in-out infinite; }
.kq-timer.is-urgent small { color: #fff; }
.kq-timer.is-over { background: var(--k-ink); color: var(--k-paper); }
.kq-timer.is-over small { color: var(--k-paper); }
.kv-qa[data-step="answer"] .kq-timer { visibility: hidden; }

.kq-card { display: flex; flex-direction: column; min-height: 0; background: var(--k-paper); border: 3px solid var(--k-ink); border-radius: clamp(20px, 2.6vw, 36px); box-shadow: 0 8px 0 var(--k-ink); overflow: hidden; }
.kq-track { height: 14px; background: var(--k-tint); border-bottom: 3px solid var(--k-ink); flex: none; }
.kq-track i { display: block; height: 100%; width: 100%; background: var(--k-teal); transition: width 1s linear, background-color .3s ease; }
.kq-track i.is-urgent { background: var(--k-ember); }
.kv-qa[data-step="answer"] .kq-track i { width: 0 !important; transition: none; }
.kq-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 1.8vh, 18px); padding: clamp(16px, 3.4vh, 40px) clamp(18px, 4vw, 64px); text-align: center; }
.kq-turn { font-weight: 700; font-size: clamp(.95rem, 1.5vw, 1.25rem); }
.kq-turn:empty { display: none; }
.kq-q { font-family: var(--k-display); font-weight: 700; font-size: clamp(1.9rem, 4.7vw, 4.6rem); line-height: 1.5; text-wrap: balance; overflow-wrap: anywhere; max-width: 24em; }
.kq-ans { display: none; flex-direction: column; align-items: center; gap: clamp(6px, 1.4vh, 14px); width: 100%; }
.kv-qa[data-step="answer"] .kq-ans { display: flex; }
.kv-qa[data-step="answer"] .kq-q { font-size: clamp(1.05rem, 1.9vw, 1.6rem) !important; font-weight: 500; color: var(--k-mauve); line-height: 1.6; }
.kq-ans__label { padding: 1px 18px 3px; border-radius: 999px; background: var(--k-teal); color: var(--k-paper); font-weight: 700; font-size: clamp(.9rem, 1.3vw, 1.1rem); }
.kq-a { font-family: var(--k-display); font-weight: 900; font-size: clamp(2.1rem, 5.2vw, 5rem); line-height: 1.4; color: var(--k-teal); text-wrap: balance; overflow-wrap: anywhere; animation: k-pop .45s cubic-bezier(.3, 1.5, .5, 1); }
.kq-note { display: grid; gap: 4px; max-width: min(100%, 44em); margin-top: clamp(2px, 1vh, 10px); padding: clamp(10px, 1.6vh, 16px) clamp(16px, 2vw, 26px); border-radius: 20px; background: var(--k-tint); border: 3px dashed rgba(34, 27, 45, .45); text-align: start; font-size: clamp(1rem, 1.75vw, 1.5rem); line-height: 1.65; }
.kq-note b { margin-inline-end: .6em; font-size: .78em; font-weight: 700; color: var(--k-amber); }
.kq-alt span { font-weight: 700; }

.kq-actions { min-height: clamp(58px, 8vh, 76px); }
.kq-actions__q, .kq-actions__a { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.6vw, 20px); }
.kv-qa[data-step="answer"] .kq-actions__q, .kv-qa[data-step="question"] .kq-actions__a { display: none; }
.kq-actions__a p { font-family: var(--k-display); font-weight: 900; font-size: clamp(1.1rem, 2vw, 1.6rem); white-space: nowrap; }
.kq-award { display: flex; gap: clamp(10px, 1.6vw, 20px); min-width: 0; }
.kq-award .k-btn { min-width: 0; }
.kq-award .k-btn span { overflow: hidden; text-overflow: ellipsis; }

/* ── end of the game ── */
.kv-over { flex-direction: column; gap: 18px; min-height: 100vh; min-height: 100svh; padding: clamp(12px, 2vh, 22px) var(--k-pad) clamp(18px, 4vh, 40px); }
.ko-card {
  margin: auto; width: min(100%, max(860px, 54vw)); display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2.4vh, 24px); text-align: center;
  padding: clamp(22px, 4.5vh, 48px) clamp(18px, 4vw, 56px); background: var(--k-paper); border: 3px solid var(--k-ink); border-radius: clamp(24px, 3vw, 40px); box-shadow: 0 9px 0 var(--k-ink);
}
.ko-kicker { padding: 1px 18px 3px; border-radius: 999px; background: var(--k-ink); color: var(--k-paper); font-weight: 700; }
.ko-card h1 { font-family: var(--k-display); font-weight: 900; font-size: clamp(2.2rem, 6vw, 4.8rem); line-height: 1.3; text-wrap: balance; }
.ko-scores { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px); width: 100%; align-items: end; }
.ko-team { position: relative; display: grid; gap: 0; padding: 12px 14px 14px; border-radius: 24px; border: 3px solid var(--k-ink); box-shadow: 0 6px 0 var(--k-ink); color: #fff; }
.ko-team--a { background: var(--k-red); } .ko-team--b { background: var(--k-blue); }
.ko-team span { font-family: var(--k-display); font-weight: 700; font-size: clamp(1.1rem, 2.2vw, 1.7rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ko-team b { font-family: var(--k-display); font-weight: 900; font-size: clamp(2.2rem, 5.4vw, 4.2rem); line-height: 1.15; }
.ko-team.is-win { padding-block: 22px 20px; }
.ko-team em { position: absolute; inset-block-start: -17px; inset-inline-start: 50%; transform: translateX(50%) rotate(-3deg); padding: 0 16px 2px; border-radius: 999px; background: var(--k-sun); color: var(--k-ink); border: 3px solid var(--k-ink); font-style: normal; font-weight: 700; }
.ko-line { font-size: clamp(1.05rem, 1.9vw, 1.45rem); font-weight: 500; }

/* ── how to play ── */
.k-how { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: rgba(34, 27, 45, .6); opacity: 0; transition: opacity .2s ease; }
.k-how.is-in { opacity: 1; }
.k-how__card { width: min(100%, 720px); max-height: 100%; overflow: auto; display: grid; gap: clamp(12px, 2.4vh, 22px); padding: clamp(20px, 4vh, 40px) clamp(18px, 3.4vw, 44px); background: var(--k-paper); border: 3px solid var(--k-ink); border-radius: clamp(22px, 3vw, 36px); box-shadow: 0 9px 0 var(--k-ink); }
.k-how__card h2 { font-family: var(--k-display); font-weight: 900; font-size: clamp(1.8rem, 3.8vw, 2.8rem); line-height: 1.3; }
.k-how__card ol { list-style: none; counter-reset: k; display: grid; gap: clamp(10px, 1.8vh, 16px); }
.k-how__card li { counter-increment: k; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; font-size: clamp(1.02rem, 1.8vw, 1.35rem); font-weight: 500; line-height: 1.65; }
.k-how__card li::before { content: counter(k, arabic-indic); display: grid; place-items: center; width: clamp(40px, 4.4vw, 54px); aspect-ratio: 1; border-radius: 50%; background: var(--k-sun); border: 3px solid var(--k-ink); font-family: var(--k-display); font-weight: 900; font-size: clamp(1.2rem, 2.2vw, 1.7rem); line-height: 1; }
.k-how__card .k-btn { justify-self: center; }

@keyframes k-pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes k-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(7px); } 75% { transform: translateX(-7px); } }
@keyframes k-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes k-gain { 0% { transform: scale(.5); opacity: 0; } 12% { transform: scale(1.12); opacity: 1; } 20%, 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9); opacity: 0; } }

/* ── wide screens: both shelves fit without scrolling, so the covers follow the window's height ── */
@media (min-width: 900px) {
  .kh-card__art { width: min(100%, max(92px, calc((100svh - 506px) / 2))); }
  .kh-hero h1 { font-size: clamp(2rem, min(4.2vw, 6.4vh), 3.5rem); }
}
/* ── tablets ── */
@media (max-width: 899px) {
  .kh-top { grid-template-columns: 1fr; }
  .kh-team { flex: 1; width: auto; }
}
@media (max-width: 899px) and (orientation: portrait) {
  .kh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 12px; }
}
@media (min-width: 700px) and (max-width: 899px) and (orientation: portrait) {
  .kb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; gap: 16px 14px; }
  .kb-tile { height: clamp(46px, 6.2vh, 76px); }
}
@media (max-width: 899px) and (orientation: landscape) {
  .kh-card__art { width: 100%; }
  .kh-top { grid-template-columns: minmax(0, 1fr) auto; }
  .kh-team { flex: none; width: clamp(130px, 19vw, 200px); }
}
/* ── phones, upright ── */
@media (max-width: 699px) {
  .kids-app { font-size: 16px; }
  .k-brand__tag { padding: 1px 10px 3px; }
  .k-link { font-size: .86rem; }
  .kids-app .kids-switch { font-size: .9rem; border-width: 2px; box-shadow: 0 3px 0 var(--k-ink); }
  .kids-app .kids-switch > * { padding: 0 11px 2px; min-height: 34px; }
  .k-bar { gap: 8px; } .k-bar__end { gap: 8px; }
  .k-icon { width: 42px; height: 42px; }
  .kh-grid { gap: 14px 9px; }
  .kh-card { gap: 6px; }
  .kh-card__art { box-shadow: 0 4px 0 var(--k-ink); }
  .kh-card__badge { inset-block-start: -9px; inset-inline-start: -7px; }
  .kh-shelf__head h2 span { display: none; }
  .kh-lucky { font-size: .86rem; }
  .kh-dock__in { padding-top: 10px; gap: 10px; }
  .kh-dots { gap: 4px; } .kh-dots i { width: 13px; height: 13px; border-width: 2px; }
  .kh-count { flex-direction: column; align-items: flex-start; gap: 4px; }
  .kh-count p { font-size: .92rem; }
  .kh-dock .k-btn--big { padding-inline: 22px; font-size: 1.2rem; min-height: 56px; }

  .kv-board { height: auto; min-height: 100svh; grid-template-rows: auto auto auto; padding-bottom: 0; }
  .kb-left { display: none; }
  .kb-grid { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .kb-col__head { flex: none; height: 78px; }
  .kb-tile { height: 50px; }
  .kb-tile b { font-size: 1.3rem; } .kb-tile .k-stars { font-size: .6rem; }
  .kb-scores { position: sticky; inset-block-end: 0; z-index: 4; margin: 6px calc(-1 * var(--k-pad)) 0; padding: 18px var(--k-pad) calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--k-sun); border-top: 3px solid var(--k-ink); gap: 10px; }
  .kb-team { padding: 6px 14px; box-shadow: 0 4px 0 var(--k-ink); }
  .kb-team__turn { inset-block-start: -14px; inset-inline-start: 12px; font-size: .8rem; }

  .kq-head { grid-template-columns: auto 1fr auto; }
  .kq-head > .k-btn { grid-row: 2; grid-column: 1 / -1; justify-self: start; min-height: 40px; }
  .kq-cat { grid-column: 1 / 3; }
  .kq-timer { grid-column: 3; }
  .kq-actions__q { flex-direction: column-reverse; align-items: stretch; }
  .kq-actions__a { flex-direction: column; align-items: stretch; gap: 8px; }
  .kq-actions__a p { text-align: center; }
  .kq-award { display: grid; grid-template-columns: 1fr 1fr; }
  .kq-award .k-btn { min-height: 56px; padding-inline: 10px; font-size: 1.1rem; flex-direction: column; gap: 0; line-height: 1.2; }
  .kq-award .k-btn--none { grid-column: 1 / -1; min-height: 46px; flex-direction: row; }
  .ko-scores { gap: 10px; }
}
/* ── short screens (a phone on its side, a small laptop) ── */
@media (max-height: 560px) and (min-width: 560px) {
  .k-icon { width: 40px; height: 40px; box-shadow: 0 3px 0 var(--k-ink); }
  .kv-board { gap: 8px; padding-block: 8px 12px; }
  .kb-col { gap: 6px; }
  .kb-col__head { flex: none; height: 34px; min-height: 0; box-shadow: 0 3px 0 var(--k-ink); border-radius: 12px; }
  .kb-col__head img { display: none; }
  .kb-col__head b { position: static; display: block; border: 0; padding: 2px 4px; font-size: .95rem; }
  .kb-tiles { flex: 1; grid-auto-rows: minmax(0, 1fr); gap: 6px; }
  .kb-tile { height: auto; min-height: 30px; box-shadow: 0 3px 0 var(--k-ink); border-radius: 12px; }
  .kb-tile b { font-size: clamp(1.15rem, 5.6vh, 1.7rem); } .kb-tile .k-stars { display: none; }
  .kb-team { padding-block: 2px; box-shadow: 0 4px 0 var(--k-ink); }
  .kb-team__score { font-size: 1.7rem; } .kb-team__name { font-size: 1.1rem; }
  .kb-team__turn { inset-block-start: -13px; font-size: .78rem; }
  .kv-qa { gap: 8px; padding-block: 8px 10px; }
  .kq-timer { width: 54px; border-width: 3px; box-shadow: 0 3px 0 var(--k-ink); } .kq-timer b { font-size: 1.25rem; } .kq-timer small { display: none; }
  .kq-cat img { width: 38px; height: 38px; border-radius: 10px; }
  .kq-body { padding: 10px 20px; gap: 6px; }
  .kq-track { height: 10px; }
  .kq-q { font-size: clamp(1.4rem, 3.6vw, 2.4rem); line-height: 1.4; }
  .kq-a { font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1.3; }
  .kq-note { font-size: .95rem; padding: 6px 14px; line-height: 1.5; }
  .kq-actions { min-height: 48px; }
  .kv-qa .k-btn--big, .kv-over .k-btn--big { min-height: 46px; font-size: 1.15rem; box-shadow: 0 4px 0 var(--k-ink); border-radius: 16px; }
  .ko-card { gap: 8px; padding-block: 14px; }
  .ko-card h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
  .ko-team b { font-size: 2rem; } .ko-team.is-win { padding-block: 16px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .kids-app *, .kids-app *::before, .kids-app *::after { animation: none !important; transition: none !important; }
}
