/* El Lesta (اللستة) · 7arif squad recall, retro magazine look. Loads after ../retro/kit.css (tokens, poster,
   cover, buttons, sticker, clip / bad / stamp, panels, sheet, search rows, feel tokens, settings rows). Only what the kit
   does not have lives here: the issue strip, panel pair + timer sticker, the ready card (squad shape on a pitch, relaxed
   switch), the full-screen play view (bar, board, dock pinned above the keyboard, 3-2-1, pause card), shirts, the squad
   sheet (empty / found / missed slots) and the help list. Logical properties only. */

html.sheet-open, html.sheet-open body, html.sq-full, html.sq-full body { overflow: hidden; }

/* ---- issue strip ---- */
.sq-issue { display: grid; grid-template-columns: var(--tap) 1fr var(--tap); gap: 4px; padding: 2px 0; }
.sq-issue__mid { text-align: center; min-width: 0; }
.sq-issue__row { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ---- head: team crest + tournament panels, timer sticker ---- */
.sq-head { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.sq-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 280px; }
.sq-panels .r-panel { aspect-ratio: 1 / 1.08; min-height: 0; box-shadow: 2px 2px 0 var(--ink); }
.sq-clock { display: grid; place-items: center; padding-inline-end: 4px; }
.sq-sticker { width: 92px; }
.sq-sticker b { font-size: 30px; }
.sq-clock.relaxed .sq-sticker b { font-size: 24px; }
.sq-clock.low .sq-sticker { background: var(--red); color: var(--paper-clip); }
.sq-sticker small:empty { display: none; }

.sq-title { margin-top: 12px; }
.sq-title .r-kicker { font-size: 16px; line-height: 1.6; }
.sq-name { margin: 0 0 4px; font-size: 26px; }
.sq-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; font-weight: 700; color: var(--ink-meta); }
.sq-champ { display: inline-flex; align-items: center; gap: 4px; }

/* ---- shirts: outline (paper) + fill (navy) layered, the fill fades + grows in 200 ms when a name lands ---- */
.shirt { position: relative; display: inline-grid; place-items: center; width: 32px; aspect-ratio: 1; flex: 0 0 auto; }
.shirt svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shirt__o { fill: var(--paper-clip); stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.shirt__f { fill: var(--navy); stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; opacity: 0; transform-origin: 16px 16px; }
.shirt i { position: relative; font: 800 13px/1 var(--font-ui); font-style: normal; color: var(--ink); padding-top: 5px; direction: ltr; }
.shirt.on .shirt__f { opacity: 1; }
.shirt.on i { color: var(--paper-clip); background: var(--navy); line-height: 1.1; padding: 1px 1px 0; margin-top: 5px; }
.shirt.fill-in .shirt__f { animation: sq-fill 200ms ease-out both; }
@keyframes sq-fill { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.shirt.miss .shirt__o { fill: transparent; stroke: var(--ink-soft); stroke-dasharray: 2.5 2; }
.shirt.miss i { color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .shirt.fill-in .shirt__f { animation: sq-fade 150ms ease-out both; } }
@keyframes sq-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- ready: "جاهز؟", the squad shape on a pitch, the bench, relaxed switch, start ---- */
.sq-ready { margin-top: 14px; padding-top: 10px; border-top: 1.5px solid var(--ink); }
.sq-ready__q { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.15; margin: 0; padding-top: 4px; color: var(--red-ink); }
.sq-ready__sub { margin: 2px 0 10px; font-size: 16px; line-height: 1.6; font-weight: 700; color: var(--ink-meta); }
.sq-pitch { position: relative; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; min-height: 196px; padding: 14px 8px;
            background: var(--fam-profile); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); overflow: hidden; }
.sq-pitch__lines { position: absolute; inset: 6px; border: 2px solid rgba(251,247,236,.55); pointer-events: none; }
.sq-pitch__lines::before { content: ""; position: absolute; inset-inline: 0; top: 50%; border-top: 2px solid rgba(251,247,236,.55); }
.sq-pitch__lines::after { content: ""; position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border: 2px solid rgba(251,247,236,.55); border-radius: 50%; }
.sq-pitch__row { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; }
.sq-pitch .shirt { width: 34px; }
.sq-pitch .shirt__o { stroke: var(--ink); }
.sq-bench { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 8px; background: var(--paper-2); border: 2px solid var(--ink); }
.sq-bench__t { flex: 0 0 auto; font-weight: 800; font-size: 16px; }
.sq-bench__row { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.sq-bench .shirt { width: 30px; }
.sq-bench .shirt i { font-size: 13px; padding-top: 4px; }   /* UI sweep: bench numbers 13 px */
.sq-relax { margin-top: 12px; }
.sq-paused { margin: 12px 0 0; font-weight: 700; font-size: 16px; line-height: 1.6; }
.sq-ready .r-btn { margin-top: 12px; }
/* phones: Start stays in the thumb zone while the shape scrolls under it (rule 17) */
.sq-go { display: grid; gap: 12px; margin-top: 12px; }
.sq-go .sq-relax, .sq-go .r-btn { margin-top: 0; }
@media (max-width: 1023px) {
  .sq-go { position: sticky; bottom: var(--ib); z-index: 5; margin-inline: -10px; padding: 10px 10px 12px; background: var(--paper); border-top: 2px solid var(--ink); }
}
.sq-wide { width: 100%; }
.sq-cover.is-started .sq-pitch, .sq-cover.is-started .sq-bench, .sq-cover.is-started .sq-ready__sub { display: none; }

/* ---- result: the back page ---- */
.sq-result { text-align: center; padding-top: 6px; }
.sq-result .r-issue__meta { font-size: 14px; }
.sq-result .r-btns { margin-top: 16px; }
.sq-cover.fin .sq-clock { visibility: hidden; }

.under { margin-top: 18px; grid-template-columns: 1fr; }

/* ---- the squad sheet (reveal) ---- */
.sq-sheet { margin-top: 18px; background: var(--paper); border-radius: 4px; box-shadow: var(--shadow-navy); padding: 12px 12px 16px; }
.sq-sheet.pre { display: none; }
.sq-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 6px 0; margin-bottom: 12px; }
.sq-sheet__head h2 { margin: 0; }
.sq-sheet__head .r-tag { font-size: 14px; padding: 1px 8px; }
.sq-sheet__head .r-tag small { font-size: 12px; }
.group + .group { margin-top: 16px; }
.group h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; background: var(--ink); color: var(--paper-clip);
            font: 800 16px/1.3 var(--font-ui); padding: 5px 10px 6px; }
.group h3 b { font-weight: 800; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.slot { position: relative; display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 7px 10px; min-width: 0; }
.slot .nm { min-width: 0; overflow-wrap: anywhere; }
.slot.empty { background: var(--paper-2); border: 2px dashed rgba(26,26,26,.35); }
.slot.empty .nm { flex: 1 1 auto; height: 0; border-bottom: 2px dotted rgba(26,26,26,.35); margin-top: 14px; }
.slot.found { padding: 8px 26px 8px 12px; padding-inline: 12px 26px; }
.slot.found .nm { font: 800 16px/1.35 var(--font-ui); }
.slot.missed { background: transparent; border: 2px dashed rgba(107,93,67,.55); color: var(--ink-soft); flex-wrap: wrap; row-gap: 0; }
.slot.missed .nm { font: 700 16px/1.35 var(--font-ui); flex: 1 1 0; }
/* eleven-only rounds (xi): a bench man nobody named, shown after the end; greyed like a missed one, without the tag */
.slot.rest { background: transparent; border: 2px dashed rgba(107,93,67,.55); color: var(--ink-soft); }
.slot.rest .nm { font: 700 16px/1.35 var(--font-ui); flex: 1 1 0; }
.slot__miss { position: absolute; top: 3px; inset-inline-end: 4px; background: var(--paper); border: 1.5px solid var(--ink-soft); color: var(--ink-soft);
              font: 800 12px/1.4 var(--font-ui); padding: 0 6px; }
.extras { margin-top: 14px; font-size: 16px; font-weight: 700; color: var(--ink-soft); line-height: 1.6; }

/* ---- play view: full screen while the clock runs ---- */
.sq-play { position: fixed; inset-inline: 0; top: 0; height: 100dvh; z-index: 30; display: flex; flex-direction: column; background: var(--paper); }
.sq-play__bar { flex: 0 0 auto; display: grid; gap: 6px; background: var(--navy); color: var(--paper-clip); border-bottom: 3px solid var(--ink);
                padding: calc(6px + var(--it)) max(10px, var(--ir)) 6px max(10px, var(--il)); }
.sq-play__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sq-ibtn { width: var(--tap); height: var(--tap); flex: 0 0 auto; display: grid; place-items: center; padding: 0; font-size: 20px;
           border: 2px solid var(--ink); background: var(--paper-clip); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); border-radius: 2px; }
.sq-play__mid { flex: 1 1 auto; min-width: 0; }
.sq-play__title { display: block; font: 800 16px/1.3 var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-count { flex: 0 0 auto; font-family: var(--font-display); font-size: 26px; line-height: 1; padding-top: 4px; white-space: nowrap; color: var(--yellow); }
.sq-count small { font-size: 26px; color: var(--paper-clip); }
.sq-give { min-height: var(--tap); padding: 0 8px; color: var(--paper-clip); }   /* a small text button on the navy bar (end.css .r-giveup); it asks first */
/* the clock: the kit's TIMER look (number + bar, the remaining part anchored at the inline end); relaxed = a tag, no bar */
.sq-tm { min-height: 34px; }
.sq-tm .tm-bar { height: 12px; border-color: var(--paper-clip); background: rgba(251,247,236,.15); }
.sq-tm.is-relaxed .tm-bar { display: none; }
.sq-tm .tm-tag { margin-inline-start: auto; }

.sq-play__board { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px max(12px, var(--ir)) 16px max(12px, var(--il)); }
.sq-play__board .group + .group { margin-top: 14px; }
.sq-play__board .group h3 { margin-bottom: 12px; }
.sq-play__board .slots { gap: 12px 8px; }
.sq-play__board .slot { min-height: 48px; padding: 5px 8px; }

.sq-play__dock { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--paper-2); border-top: 3px solid var(--ink);
                 padding: 8px max(10px, var(--ir)) calc(8px + var(--ib)) max(10px, var(--il)); }
.sq-play__dock .r-search { flex: 0 0 auto; box-shadow: 3px 3px 0 var(--navy); }
.sq-play__dock .r-sugg { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 8px 0 0; background: var(--paper-clip); }
.sq-play__dock .r-sugg li { min-height: 48px; padding: 4px 8px; }
.sq-play__dock .r-sugg b { font: 800 17px/1.35 var(--font-ui); padding-top: 0; }
/* UI sweep E3: Arabic UI rows show both names: the Arabic one 18 px, the English one on its own line 13.5 px (ltr) */
.sq-play__dock .r-sugg li { min-height: 56px; }
.sq-play__dock .r-sugg b .r-dn { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.sq-play__dock .r-sugg b .r-dn__ar { font-size: 18px; }
.sq-play__dock .r-sugg b .r-dn__en { font-size: 13.5px; line-height: 1.3; }
.sq-play__dock .r-sugg small { font-size: 14px; }
.sq-play__dock:has(.r-sugg:not(.hidden)) .sq-feedback { display: none; }
.sq-feedback:empty { display: none; }
.sq-feedback { margin-bottom: 8px; }
.sq-fb { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 4px 12px; }
.sq-fb.ok { flex-direction: row; justify-content: flex-start; align-items: baseline; padding-inline-end: 30px; }
.sq-fb small { font: 800 14px/1.3 var(--font-ui); color: var(--ink-meta); }
.sq-fb.ok b, .sq-fb.same b { font: 800 18px/1.35 var(--font-ui); }
.sq-fb__txt { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sq-fb.bad s { font: 800 18px/1.35 var(--font-ui); }
.sq-fb .r-stamp { font-size: 24px; flex: 0 0 auto; margin-inline-end: 4px; }

/* 3-2-1 (typing already works: a right name starts the clock at once) */
.sq-321 { position: absolute; inset-inline: 0; top: 0; bottom: 0; display: grid; place-content: center; justify-items: center; gap: 6px;
          background: rgba(13,18,56,.55); pointer-events: none; z-index: 2; }
.sq-321 b { font-family: var(--font-display); font-weight: 400; font-size: 120px; line-height: 1; padding-top: 14px; color: var(--yellow);
            -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; text-shadow: 6px 6px 0 var(--ink); }
.sq-321 small { font: 800 18px/1.4 var(--font-ui); color: var(--paper-clip); }
.sq-321.tick b { animation: sq-pop 300ms var(--ease-pop) both; }
@keyframes sq-pop { from { opacity: 0; transform: scale(1.5); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .sq-321.tick b { animation: sq-fade 150ms ease-out both; } }

/* pause card over the board: the input goes away, nothing moves */
.sq-pausecard { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 16px; background: rgba(13,18,56,.72); }
.sq-pausecard .r-card { width: min(420px, 100%); text-align: center; padding: 18px 16px; }
.sq-pausecard p { font-size: 16px; line-height: 1.6; font-weight: 600; margin: 0 0 6px; }
.sq-pausecard .r-btn { margin-top: 10px; }

/* ---- help sheet ---- */
.sq-help .r-h2 { margin-bottom: 4px; }
.sq-tagline { margin: 0 0 12px; font-weight: 700; font-size: 16px; line-height: 1.6; }
.sq-howto { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sq-howto li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 16px; line-height: 1.6; }
.sq-howto b { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: var(--paper-clip); display: grid; place-items: center;
              font: 800 16px/1 var(--font-ui); border: 2px solid var(--ink); }
.sq-fine { font-size: 14px; font-weight: 700; color: var(--ink-soft); margin: 14px 0; line-height: 1.6; }

/* ---- small phones ---- */
@media (max-width: 359px) {
  .sq-sticker { width: 78px; }
  .sq-sticker b { font-size: 26px; }
  .sq-name { font-size: 24px; }
  .slots { gap: 10px 8px; }
  .slot { padding: 6px 7px; gap: 6px; }
  .shirt { width: 28px; }
  .sq-pitch .shirt { width: 30px; }
  .r-btn { font-size: 16px; padding: 0 10px; }
  .sq-play__row { gap: 6px; }
  .sq-give { padding: 0 8px; }
}
/* very short screens (keyboard open on a 640 px phone): a tighter bar */
@media (max-height: 420px) {
  .sq-play__bar { padding-top: calc(4px + var(--it)); padding-bottom: 4px; }
  .sq-play__board { padding-top: 10px; }
  .sq-321 b { font-size: 80px; }
}

/* ---- desktop: a two-page spread (cover on the start page, the squad sheet facing it); the play view spreads the four
   lines side by side like a team sheet ---- */
@media (min-width: 1024px) {
  .sq-spread { padding-top: 8px; }
  .sq-col { position: sticky; top: 12px; }
  .sq-sheet { margin-top: 0; padding: 16px 18px 20px; }
  .sq-sheet.pre { display: block; }
  .sq-panels { max-width: 320px; }
  .sq-sticker { width: 104px; }
  .sq-sticker b { font-size: 34px; }
  .sq-name { font-size: 30px; }
  .sq-pitch { min-height: 240px; }
  .sq-pitch .shirt { width: 40px; }
  .sq-play { background: var(--navy-deep); }
  .sq-play__bar { padding-inline: max(24px, calc(50% - 560px)); }
  .sq-play__board { background: var(--paper); width: min(1120px, 100%); margin: 0 auto; padding: 20px 24px; }
  .sq-play__board .groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; align-items: start; }
  .sq-play__board .group + .group { margin-top: 0; }
  .sq-play__board .slots { grid-template-columns: 1fr; }
  .sq-play__dock { width: min(640px, 100%); margin: 0 auto; border-inline: 3px solid var(--ink); }
}

/* play bar (owner 2026-11-11: the squad name is the question, never cut): pause | the squad name (wraps, up to 2 lines) |
   give up on the first row, the found count + the clock on the second */
.sq-play__bar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "pause title give" "count tm tm"; align-items: center; column-gap: 8px; row-gap: 4px; }
.sq-play__row { display: contents; }
.sq-play__bar #pauseBtn { grid-area: pause; }
.sq-play__bar .sq-play__mid { grid-area: title; }
.sq-play__bar .sq-count { grid-area: count; font-size: 24px; }
.sq-play__bar .sq-count small { font-size: 24px; }
.sq-play__bar .sq-give { grid-area: give; }
.sq-play__bar #tm { grid-area: tm; min-height: 30px; }
.sq-play__title { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; overflow-wrap: anywhere; }
.sq-play__bar .tm-num { font-size: 24px; min-width: 2.6em; }
.sq-play__board { padding-top: 10px; }
.sq-play__board .group + .group { margin-top: 10px; }
.sq-play__board .group h3 { margin-bottom: 8px; }
.sq-play__board .slots { gap: 8px; }
.sq-play__board .slot { min-height: 44px; }

/* owner 2026-11-11: while the board scrolls, the line you are filling keeps its header (goalkeepers / defence / ...)
   on screen under the play bar (the squad name itself is in the fixed play bar) */
.sq-play__board .group h3 { position: sticky; top: -10px; z-index: 2; }
/* the "missed" tag sits inside the slot's top corner (owner rule: nothing past a box edge); room above the name */
.slot.missed.slot { padding-top: 20px; }

/* CLS (kit.css "CLS gate"): the masthead (until it is on its final row) and the round card are unpainted until game.js has filled it (#roundTitle) and switcher.js has
   labelled the top bar's games button and kit.js fitTopbar() has run (it adds .is-fitted to the masthead) */
#main:has(#roundTitle:empty), .r-poster:has(.r-round.games[data-hareef-games="icon"]:not(.has-label), .r-topbar .r-masthead:not(.is-fitted)) #main,
.r-topbar .r-masthead:not(.is-fitted) { visibility: hidden; animation: r-gate-open 0s 3s forwards; }

/* UI sweep small type: panel bands 14 px, the clock label 13 px bold (a sticker label), the sheet tag's small 13 px */
.sq-panels .r-band { font-size: 14px; }
.sq-sticker small { font-size: 13px; }
.sq-sheet__head .r-tag small { font-size: 13px; }
.slot__miss { font-size: 13px; }
/* G3 (UI sweep 2026-11-16): on a slow line the gate above opens (3 s) before the data lands; the first paint keeps the
   final sizes so nothing on screen moves then: the issue strip with its date, the two panels (same aspect ratio), the
   squad title block (kicker + one-line name + meta) and the two-line "ready" sub-line */
.sq-issue { min-height: 57px; }
#panels:empty::before { content: ""; aspect-ratio: 1 / 1.08; }
.sq-title:has(#kicker:empty) { min-height: 85px; }
#readySub:empty { min-height: 51px; }
/* UI sweep E1: the champions / runners-up tag 14 px */
.sq-champ.r-tag { font-size: 14px; }
