/* 7arif / حريف · retro Arab sports-magazine look (branch redesign/retro-magazine).
   Source of truth: inpo/harif-handover (01_CONCEPT, 02_DESIGN_SYSTEM, tokens.css: variable names kept) and the approved
   mockup reference/grid-screen.html at 390 px. Every daily round is an issue of a magazine: navy poster border, cream
   cover card with a cyan rule, red outlined masthead, two doors (solo / versus friends) over the cover, issue strip, yellow
   attempts sticker, category panels in kit colours with halftone and a label band, empty cells with a red ring "+" and a
   "No." serial, correct = taped newspaper clipping, wrong = red "غلط" rubber stamp, print buttons with hard offset
   shadows, the result as the back page. Wide screens get a two-page spread (cover + inside page), not a phone column.
   Owner rules on top of the handover: no emoji, rarity hidden (the clipping shows how many players fit), Egyptian
   Arabic copy, men's football only, every label in AR and EN, 44 px touch targets.

   Presentation hooks written by retro.js (it never touches game state): th.panel + --kit (kit background), .pa (logo,
   glyph or big numeral), data-band, [data-issue-title]/[data-issue-date], td.fx-ok / td.fx-bad (feel.js marks), th.corner.pop.
   Mechanics kept from the mobile sweep (docs/reports/mobile_layout.md): the 3x3 <table> is a 4-column CSS grid (rows
   display:contents), square cells via aspect-ratio (4:3 on landscape phones), env() safe areas, sheets follow the
   visual viewport via mobile.js (html.kb-open), body scroll lock via html.sheet-open, every tap target >= 44 px.
   Fonts (SIL OFL, web/fonts): Lalezar (display) + Cairo (UI, variable, Arabic + Latin subset). */

/* fonts: generated by scripts/make_fonts.py */
@font-face { font-family: "Cairo"; src: url("fonts/cairo.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap;
  unicode-range: U+0020-007E, U+00A0, U+00A7, U+00AB, U+00B7, U+00BB, U+00D7, U+060C, U+061B, U+061F, U+0621-063A, U+0640-0652, U+0660-066D, U+0670-0671, U+067E, U+0686, U+06A4, U+06A9, U+06CC, U+2013-2014, U+2019, U+201C-201D, U+2026; }
@font-face { font-family: "Cairo"; src: url("fonts/cairo-ext.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap;
  unicode-range: U+0010, U+00A1-00A6, U+00A8-00AA, U+00AC-00B6, U+00B8-00BA, U+00BC-00D6, U+00D8-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+060D, U+0615, U+0653-0656, U+0658, U+066E-066F, U+0679, U+0688, U+0691, U+0698, U+06A1, U+06AF, U+06BA, U+06BE, U+06C1-06C3, U+06D2-06D4, U+06F0-06F9, U+2018, U+201A, U+201E, U+2020-2022, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB51, U+FB57-FB59, U+FB67-FB69, U+FB6B-FB6D, U+FB7B-FB7D, U+FB89, U+FB8B, U+FB8D, U+FB8F-FB91, U+FB93-FB95, U+FB9F, U+FBA7-FBA9, U+FBAB-FBAD, U+FBAF, U+FBB1-FBB9, U+FBBD-FBBE, U+FBE8-FBE9, U+FBFD-FBFF, U+FC43-FC44, U+FC64-FC65, U+FC67-FC6B, U+FC6D-FC71, U+FC73-FC77, U+FC79-FC7B, U+FC86-FC87, U+FC8A-FC8B, U+FC8D-FC8F, U+FC91-FC92, U+FC94, U+FC96, U+FCFB-FCFE, U+FD05-FD08, U+FD0D-FD10, U+FD17-FD1A, U+FD21-FD24, U+FD29-FD2C, U+FD3E-FD3F, U+FDF2, U+FE82, U+FE84, U+FE86, U+FE88, U+FE8A-FE8C, U+FE8E, U+FE90-FE92, U+FE94, U+FE96-FE98, U+FE9A-FE9C, U+FE9E-FEA0, U+FEA2-FEA4, U+FEA6-FEA8, U+FEAA, U+FEAC, U+FEAE, U+FEB0, U+FEB2-FEB4, U+FEB6-FEB8, U+FEBA-FEBC, U+FEBE-FEC0, U+FEC2-FEC4, U+FEC6-FEC8, U+FECA-FECC, U+FECE-FED0, U+FED2-FED4, U+FED6-FED8, U+FEDA-FEDC, U+FEDE-FEE0, U+FEE2-FEE4, U+FEE6-FEE8, U+FEEA-FEEC, U+FEEE, U+FEF0, U+FEF2-FEFC; }
@font-face { font-family: "Lalezar"; src: url("fonts/lalezar.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0020-007E, U+00A0, U+00A7, U+00AB, U+00B7, U+00BB, U+00D7, U+060C, U+061B, U+061F, U+0621-063A, U+0640-0652, U+0660-066D, U+0670-0671, U+067E, U+0686, U+06A4, U+06A9, U+06CC, U+2013-2014, U+2019, U+201C-201D, U+2026; }
@font-face { font-family: "Lalezar"; src: url("fonts/lalezar-ext.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000, U+000D, U+00A1-00A6, U+00A8-00A9, U+00AC, U+00AE-00B1, U+00B4, U+00B6, U+00B8, U+00BF-00D6, U+00D8-0107, U+010A-0113, U+0116-011B, U+011E-0123, U+0126-012B, U+012E-0131, U+0136-0137, U+0139-013E, U+0141-0148, U+014A-014D, U+0150-015B, U+015E-016B, U+016E-017E, U+0189, U+01A0-01A1, U+01AF-01B0, U+01CD-01DC, U+01DE-01DF, U+01E6-01E7, U+01FE-01FF, U+0218-021B, U+0229-022B, U+0243-0244, U+024C, U+0268, U+0289, U+02C6-02C7, U+02D8-02DD, U+0300-0304, U+0306-030C, U+0312, U+031B, U+0323, U+0326-0328, U+032D, U+0335-0338, U+0601, U+0603, U+060B, U+0615, U+0653-0656, U+0658, U+066E-066F, U+0672-0673, U+0679, U+0688, U+0691, U+0698, U+06A1, U+06AF, U+06BA, U+06BE, U+06C0-06C3, U+06D2-06D4, U+06D6, U+06F0-06F9, U+1E04-1E05, U+1E0C-1E0F, U+1E12-1E13, U+1E24-1E25, U+1E2E-1E2F, U+1E36-1E37, U+1E3C-1E3F, U+1E44-1E47, U+1E4A-1E4D, U+1E50-1E53, U+1E62-1E63, U+1E6C-1E71, U+1E80-1E85, U+1E92-1E93, U+1EA0-1EF9, U+2002-2003, U+2009, U+2018, U+201A, U+201E, U+2020-2022, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2202, U+2205, U+220F, U+2211-2212, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+25CC, U+FB01-FB02, U+FB51, U+FB57-FB59, U+FB67-FB69, U+FB6B-FB6D, U+FB7B-FB7D, U+FB89, U+FB8B, U+FB8D, U+FB8F-FB91, U+FB93-FB95, U+FB9F, U+FBA5, U+FBA7-FBA9, U+FBAB-FBAD, U+FBAF, U+FBB1-FBB9, U+FBBD-FBBE, U+FBF9-FBFA, U+FBFD-FBFF, U+FC02-FC04, U+FC08-FC0A, U+FC0E-FC10, U+FC12-FC14, U+FC1F, U+FC21, U+FC25, U+FC31-FC32, U+FC35-FC36, U+FC3D-FC3E, U+FC42-FC44, U+FC4E-FC50, U+FC58, U+FC64-FC6E, U+FC70-FC7C, U+FC7E, U+FC83-FC84, U+FC86-FC87, U+FC8A-FC8F, U+FC91-FC94, U+FC9A-FC9B, U+FC9F-FCA0, U+FCA4-FCA6, U+FCB0, U+FCB3, U+FCB7, U+FCCC, U+FCD5-FCD6, U+FCDD-FCEA, U+FCEE-FCF1, U+FCFB-FCFF, U+FD03, U+FD05-FD08, U+FD0C-FD10, U+FD17-FD1A, U+FD1F-FD20, U+FD22-FD24, U+FD28-FD2C, U+FD30-FD32, U+FD3E-FD3F, U+FDF2, U+FDFA, U+FDFC, U+FE82, U+FE84, U+FE86, U+FE88, U+FE8A-FE8C, U+FE8E, U+FE90-FE92, U+FE94, U+FE96-FE98, U+FE9A-FE9C, U+FE9E-FEA0, U+FEA2-FEA4, U+FEA6-FEA8, U+FEAA, U+FEAC, U+FEAE, U+FEB0, U+FEB2-FEB4, U+FEB6-FEB8, U+FEBA-FEBC, U+FEBE-FEC0, U+FEC2-FEC4, U+FEC6-FEC8, U+FECA-FECC, U+FECE-FED0, U+FED2-FED4, U+FED6-FED8, U+FEDA-FEDC, U+FEDE-FEE0, U+FEE2-FEE4, U+FEE6-FEE8, U+FEEA-FEEC, U+FEEE, U+FEF0, U+FEF2-FEFC; }
/* /fonts */
/* the board keeps its square while the day's grid pack loads (grid/split_bundle.py), so nothing below it jumps (CLS) */
#grid:empty { display: block; width: 100%; aspect-ratio: 1; }

:root {
  /* color (tokens.css) */
  --navy: #1E2A6B; --navy-deep: #0D1238;
  --paper: #EFE6D2; --paper-2: #E6DAC0; --paper-clip: #FBF7EC;
  --ink: #1A1A1A; --ink-soft: #6B5D43; --ink-meta: #4a3f2c;
  --red: #D7262E; --red-kit: #C8202A; --yellow: #F4D21F; --lime: #7BC43A; --cyan: #3BB3E5; --blue: #2A4DA0;
  /* type */
  --font-display: "Lalezar", "Cairo", sans-serif;
  --font-ui: "Cairo", system-ui, "Segoe UI", Tahoma, sans-serif;
  /* shape */
  --shadow-hard: 3px 3px 0 var(--ink); --shadow-hard-navy: 3px 3px 0 var(--navy-deep);
  --radius-print: 2px; --tap: 44px;
  /* textures: code fallbacks now; the Higgsfield paper texture replaces --tex-paper when it exists */
  --tex-halftone: radial-gradient(rgba(0,0,0,.24) 1.1px, transparent 1.4px);
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --maxw: 480px;
  --il: env(safe-area-inset-left, 0px); --ir: env(safe-area-inset-right, 0px);
  --it: env(safe-area-inset-top, 0px); --ib: env(safe-area-inset-bottom, 0px);
  /* pwa.js reads these for its footer links and toast */
  --muted: #EFE6D2; --blue-text: #1A1A1A; --white: #EFE6D2; --blue-line: #1A1A1A; --blue-tint: #E6DAC0;
  color-scheme: dark;
}

/* =====================================================================================================================
   SYSTEM TOKENS v2: the same block as games/retro/kit.css (that file is the source; tests/web/test_system_tokens.py
   keeps the two equal). Usage notes: .sweep/visual/TOKENS.md
   ===================================================================================================================== */
:root {
  /* type: 4 steps per screen, each >= 1.25x the one below. Arabic and English share the px values. */
  --fs-meta: 14px;      /* labels, dates, kickers, tags, English name line, counts      Cairo 700 (800 on fills) / 1.5 */
  --fs-body: 18px;      /* answers, names, body copy, every button, search input         Cairo 800 / 1.6 (1.5 in controls) */
  --fs-title: 24px;     /* questions (Cairo 800); verdict + next-game name (Lalezar)     1.5 */
  --fs-display: 32px;   /* masthead, in-game big numbers (Lalezar only)                  1 alone, 1.5 in text */
  --fs-score: 56px;     /* the end-screen score only                                     Lalezar, ink stroke 5 */
  --fs-name-sm: 15px; --fs-name-sm-en: 12px;   /* the ONE compact name pair (tiles too narrow for 18/14): never smaller */
  --lh-text: 1.6; --lh-title: 1.5;
  --fw-meta: 700; --fw-body: 800;
  /* spacing: the 4 / 8 scale, nothing else */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --margin: 16px;       /* content edge from the screen edge on phones: frame 8 + card 8 */
  --gutter: 8px;        /* 4 columns of 76 px at 360: (360 - 2 x 16 - 3 x 8) / 4 */
  /* colour roles: one meaning each */
  --c-paper: var(--paper); --c-paper-hi: var(--paper-clip); --c-paper-lo: var(--paper-2);
  --c-ink: var(--ink); --c-meta: var(--ink-meta);
  --c-frame: var(--navy);         /* the poster border only */
  --c-action: #0D1238;            /* the ONE primary action per screen (navy-deep ticket), nothing else in the card */
  --c-action-ink: #FBF7EC;
  --c-tap: var(--navy);           /* "tap here" outline on an empty slot (grid +, empty answer slot) */
  --c-wrong: #AE1C23;             /* wrong only: stamp fill, wrong-card border, struck answer */
  --c-right: #7BC43A;             /* right only: clipping frame, seal pill, right pip */
  --c-note: #F4D21F;              /* attempts / streak sticker, tape, timer warning, the current progress box. No other fill */
  --c-next: #F4D21F;              /* round 2 (owner, U5): the end screen's next-game card is a yellow ticket (Share stays navy) */
  --c-stamp: #2A4DA0;             /* round 2 (owner, U2): the tilted issue stamp "أوروبي" / "Europe" next to the issue: always blue */
  /* round 3 (owner 2026-11-19, R3-12): the page behind every card is a calm, flat blue (was the textured navy backdrop
     image), with at most a faint dot grid; navy-deep stays the action colour on top of it */
  --c-page: #1D2A73;
  --page-tex: radial-gradient(rgba(251, 247, 236, .045) 1px, transparent 1.4px) 0 0 / 16px 16px;
  /* round 4 (owner 2026-11-19, ROUND4.md): content sits straight on the calm blue (no box behind labels, crests, names).
     On the blue: light text, soft translucent panels only where something is functional (a tappable slot, an input) */
  --c-on: #FBF7EC;                          /* text / icons on the blue page */
  --c-on-soft: rgba(251, 247, 236, .78);    /* secondary text on the blue (dates, English names, hints): AA on --c-page */
  --c-soft: rgba(251, 247, 236, .08);       /* the soft panel: a tappable slot / option / secondary control on the blue */
  --c-soft-hi: rgba(251, 247, 236, .14);    /* its pressed / hover state */
  --c-line: rgba(251, 247, 236, .3);        /* dashed empty-slot outline, hairlines between rows on the blue */
  --c-wrong-on: rgba(13, 18, 56, .45);      /* a wrong answer card on the blue (with a 2 px --c-wrong rim) */
  --rad: 14px;                              /* the one corner radius of soft panels, slots and buttons */
  /* round 2 (owner, U6): the four game groups (list order and colour everywhere; catalog.js HAREEF_GROUPS) */
  --grp-grid: #1A1A1A; --grp-who: #1E2A6B; --grp-career: #3BB3E5; --grp-mates: #2C7A3F; --grp-quick: #E0B43A;
  /* round 6 (owner 2026-11-21, K12 "deep press inks"): the game cover / poster / tile colour per catalog GROUP (not the icon
     family), egg-white glyph (every one >= 4.9:1); Versus keeps its loud red + yellow */
  --cov-grid: #0D1238; --cov-who: #2A4DA0; --cov-career: #1C6F99; --cov-mates: #2C7A3F; --cov-quick: #4A2C7A; --cov-ink: #FBF7EC;
  --card-rule: rgba(26, 26, 26, .6);   /* 1 px hairline 4 px inside the paper card (the cyan rule is gone) */
  --grain-opacity: .09;           /* main-page card grain; game cards are flat */
  /* marks (right / wrong / near): one size, one place, one clock */
  --mark-h: 32px; --mark-seal: 28px; --mark-in: 240ms; --mark-done: 300ms;
  --pip: 22px;                    /* round 2 (owner, U7): one progress box; the current one is yellow and tilted */
  /* round 2 (owner, U1): THE yellow sticker disc (attempts, streak, lives, timer): diameter on phones / desktop */
  --sticker: 72px; --sticker-lg: 84px;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23141821' stroke-width='3.6' stroke-linecap='square'/%3E%3C/svg%3E");
  --cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='%23FBF7EC' stroke-width='4'/%3E%3C/svg%3E");
  /* end screen */
  --end-top: 8px;                 /* the end block's top edge (its first child is the score) from the viewport top */
  --end-in: 200ms; --end-step: 40ms;
  /* the action dock + the fixed phone header */
  --dock-h: 52px; --dock-b: calc(12px + var(--ib, 0px)); --dock-room: calc(var(--dock-h) + 24px + var(--ib, 0px));
  --head-h: 112px;              /* round 6 (K4): was 100; 12 px of room between the buttons and the wordmark row */
}

/* the poster is navy either way; at night the paper is dimmed a touch so it does not glare */
@media (prefers-color-scheme: dark) {
  :root { --navy: #18225a; --navy-deep: #080b26; --paper: #E3D8C0; --paper-2: #D6C8AA; --paper-clip: #EEE7D6;
          --ink-soft: #55482F; /* AA on the darker paper-2 */ }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--navy); overflow-x: hidden; overscroll-behavior-y: none; font-synthesis: none; }
body { margin: 0; color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.45; min-height: 100vh; min-height: 100svh; overflow-wrap: break-word;
       background: var(--page-tex), var(--c-page); }   /* round 3 (R3-12): flat calm blue, no backdrop image */
@media (prefers-color-scheme: dark) { :root { --c-page: #18235F; } }
html { background: var(--c-page); }
button, input { font: inherit; color: inherit; }
button, label, summary, [role="button"] { touch-action: manipulation; }
button { cursor: pointer; }
svg { width: 1em; height: 1em; flex: 0 0 auto; }
img { max-width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[lang="en"] .t-ar, html:not([lang="en"]) .t-en { display: none; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
html.sheet-open, html.sheet-open body { overflow: hidden; overscroll-behavior: none; }
/* Arabic is a joined script: tracking pulls the letters apart. Spacing is for Latin only. */
html[lang="ar"] body * { letter-spacing: normal !important; }

.poster { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; min-height: 100svh; padding-bottom: calc(28px + var(--ib)); overflow: hidden;
          background: transparent; }
main { padding: 0 max(10px, var(--ir)) 0 max(10px, var(--il)); }

/* =====================================================================================================
   top bar + masthead
   ===================================================================================================== */
.topbar { padding: var(--it) max(14px, var(--ir)) 0 max(14px, var(--il)); }
.topbar-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.topbar-side { display: flex; gap: 8px; }
.btn-round { position: relative; width: var(--tap); height: var(--tap); border-radius: 50%; border: 2px solid var(--paper); background: transparent; color: var(--paper);
             display: inline-grid; place-items: center; padding: 0; font-size: 20px; text-decoration: none; transition: transform 80ms, scale 80ms; flex: 0 0 auto; }
.btn-round:active { transform: scale(.94); background: rgba(239,230,210,.12); }
.btn-round.q { font-family: var(--font-display); font-size: 24px; line-height: 1; }
.q-mark::before { content: "\061F"; display: block; padding-top: 5px; }
html[lang="en"] .q-mark::before { content: "?"; padding-top: 3px; }
.btn-round.pill { width: auto; min-width: var(--tap); padding: 0 12px; border-radius: 22px; font: 800 14px/1 var(--font-ui); }
/* alignment pass 2026-11-12: in English the pill reads "ع", whose ink hangs below the line: lift it to the optical middle */
html[lang="en"] .btn-round.pill { font-size: 16px; padding-bottom: 4px; }
/* the games button as a yellow paper pill "icon + الألعاب / Games" (copied from games/retro/switcher.css, which is no longer
   on the first load: switcher.js brings it on the first open, UI sweep A7). Drawn as the pill from the first paint: before
   switcher.js adds its span (.has-label) the word comes from ::after, so the top bar never changes width (CLS) */
.btn-round.games svg { width: 22px; height: 22px; }
/* visual system v2 (SYS-COLOUR): a paper OUTLINE pill like the other top-bar buttons (yellow = attempts / streak only) */
.btn-round.games.has-label, .btn-round.games[data-hareef-games="icon"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: auto; min-width: var(--tap, 44px); height: var(--tap, 44px);
  padding: 0 11px 0 9px; border-radius: 22px; border: 2px solid var(--paper); background: transparent; color: var(--paper-clip);
  box-shadow: none; text-decoration: none; }
html[dir="rtl"] .btn-round.games.has-label, html[dir="rtl"] .btn-round.games[data-hareef-games="icon"] { padding: 0 9px 0 11px; }
.btn-round.games.has-label svg, .btn-round.games[data-hareef-games="icon"] svg { width: 19px; height: 19px; }
.hs-open-label, .btn-round.games[data-hareef-games="icon"]:not(.has-label)::after { font: 800 var(--fs-meta)/1 var(--font-ui, sans-serif); white-space: nowrap; padding-top: 1px; }
.btn-round.games[data-hareef-games="icon"]:not(.has-label)::after { content: "Games"; }
html[lang="ar"] .hs-open-label, html[lang="ar"] .btn-round.games[data-hareef-games="icon"]:not(.has-label)::after { padding-top: 2px; }
html[lang="ar"] .btn-round.games[data-hareef-games="icon"]:not(.has-label)::after { content: "الألعاب"; }
.btn-round.games.has-label:active, .btn-round.games[data-hareef-games="icon"]:active { transform: scale(.94); background: rgba(239,230,210,.12); }
@media (hover: hover) { .btn-round.games.has-label:hover, .btn-round.games[data-hareef-games="icon"]:hover { background: rgba(239,230,210,.12); } }
/* round 2 (owner 2026-11-18, U4): the OLD yellow pill at the v2 size (same rule as games/retro/switcher.css) */
.btn-round.games.has-label, .btn-round.games[data-hareef-games="icon"] {
  border: 2px solid var(--ink); background: var(--yellow); color: var(--ink); box-shadow: 2px 2px 0 var(--navy-deep); }
.btn-round.games.has-label:active, .btn-round.games[data-hareef-games="icon"]:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--navy-deep); background: var(--yellow); }
@media (hover: hover) { .btn-round.games.has-label:hover, .btn-round.games[data-hareef-games="icon"]:hover { background: #F8DE4E; } }
@media (max-width: 349px) {
  .btn-round.games.has-label, .btn-round.games[data-hareef-games="icon"] { width: var(--tap, 44px); padding: 0; border-radius: 50%; }
  .hs-open-label, .btn-round.games[data-hareef-games="icon"]::after { display: none; }
}
@media (forced-colors: active) { .btn-round.games.has-label, .btn-round.games[data-hareef-games="icon"] { border-color: ButtonText; } }
.badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--yellow); color: var(--ink);
         font: 800 11px/16px var(--font-ui); text-align: center; border: 1.5px solid var(--ink); }
.badge:empty { display: none; }
.masthead { margin: 0; font-family: var(--font-display); font-weight: 400; line-height: 1; font-size: clamp(42px, 13vw, 50px); color: var(--red);
            -webkit-text-stroke: 7px var(--paper); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--navy-deep); transform: rotate(-3deg); padding-top: 6px; white-space: nowrap; }
.masthead .wm-en { font-size: .8em; }

/* =====================================================================================================
   cover card
   ===================================================================================================== */
/* SYS-DECOR: grain at --grain-opacity (9 %, the main card only), a 1 px ink hairline 4 px inside the card, no cyan rule */
.cover { position: relative; background: var(--paper); border-radius: 4px; padding: var(--s2); box-shadow: 0 4px 0 var(--ink); outline: 1px solid var(--card-rule); outline-offset: -4px; }
.cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; mix-blend-mode: multiply; opacity: var(--grain-opacity);
                background-image: var(--tex-grain); background-size: 220px; }
.cover__rule { border: 0; border-radius: var(--radius-print); padding: var(--s2) 0 var(--s3); position: relative; overflow: hidden; }

/* IssueStrip */
.issue-strip { display: flex; align-items: center; justify-content: space-between; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 6px 0; margin-bottom: 10px; }
.round-title { text-align: center; min-width: 0; flex: 1 1 auto; }
.round-head { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.issue-title { font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); padding-top: 0; }   /* the dateline is not display type (SYS-TYPE) */
.round-meta { font-size: var(--fs-meta); font-weight: var(--fw-meta); color: var(--ink-meta); display: flex; justify-content: center; flex-wrap: wrap; gap: 0 5px; line-height: 1.5; }
/* round 2 (owner 2026-11-18, U2): the OLD tilted issue stamp, always blue (--c-stamp), on raised paper (same as kit .r-modetag) */
.modetag { display: inline-block; font: 800 var(--fs-meta)/1.5 var(--font-ui); color: var(--c-stamp); background: var(--c-paper-hi); border: 2px solid currentColor; padding: 0 6px;
           transform: rotate(-4deg); white-space: nowrap; }
.modetag.eu { color: var(--c-stamp); }
.modetag:empty { display: none; }
html[data-mode="eu"] .modetag { display: none !important; }   /* owner 2026-11-21: only the Egypt edition shows its stamp (games/mode.js data-mode) */
.roundnav { width: var(--tap); height: var(--tap); border: 0; background: transparent; padding: 0; color: var(--ink); display: grid; place-items: center; font-size: 22px; flex: 0 0 auto; }
.roundnav:disabled { opacity: .45; cursor: default; }
.roundnav:not(:disabled):active { transform: scale(.9); }
/* RTL: "previous" sits on the right and points right (back towards the start) */
.roundnav.prev svg { transform: scaleX(-1); }
html[dir="ltr"] .roundnav.prev svg { transform: none; }
html[dir="ltr"] .roundnav.next svg { transform: scaleX(-1); }

/* =====================================================================================================
   the board
   ===================================================================================================== */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.grid tr, .grid tbody, .grid thead { display: contents; }
.grid th, .grid td { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; font-weight: 400; text-align: center; container-type: inline-size; }

/* StickerBadge: attempts left */
.grid th.corner { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.grid th.corner::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(96%, 120px); aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-8deg);
                          border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); box-shadow: var(--shadow-hard); }
.grid th.corner b, .grid th.corner small { position: relative; transform: rotate(-8deg); }
.grid th.corner b { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-display); line-height: 1.25; padding-top: 4px; }
.grid th.corner small { font: var(--fw-body) var(--fs-meta)/1.25 var(--font-ui); }
.grid th.corner.pop b { animation: pop .25s ease-out; }
.grid th.corner.done::before { background: var(--paper-2); }

/* CategoryPanel: kit background + halftone, art (logo / glyph / big numeral), label band at the bottom */
.grid th:not(.corner) { --kit: var(--paper-2); display: flex; flex-direction: column; border: 2px solid var(--ink); overflow: hidden; background: var(--kit); }
.grid th:not(.corner)::before { content: ""; position: absolute; inset: 0; background-image: var(--tex-halftone); background-size: 5px 5px; pointer-events: none; }
.grid th img:not(.pa-logo):not(.pa-pic) { display: none; }      /* app.js's Egyptian crest: the retro grid shows kit colours instead */
.grid th .pa { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 4%; padding: 0 7%; overflow: hidden; font-style: normal; }
.grid th .pa > * { margin: 7% 0 5%; }
.pa-roundel { height: 100%; max-height: 64cqi; aspect-ratio: 1; min-height: 0; max-width: 100%; border-radius: 50%; background: var(--paper-clip); border: 2px solid var(--ink);
              box-shadow: 2px 2px 0 var(--ink); display: grid; place-items: center; padding: 12%; overflow: hidden; }
.pa.two .pa-roundel { max-height: 46cqi; }
.pa-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
/* generic icon: the shape is a mask (assets/icons/<name>.png or the code stand-in), the paint is the category's own
   colours (--fill: kit stripes, flag scarf, gold) under a halftone; the rim and the hard shadow are stacked
   drop-shadows on the wrapper, so they follow the shape. Paper rim on blue backdrops, ink rim on the others. */
.pa-ico { position: relative; display: block; height: 100%; max-height: 66cqi; aspect-ratio: 1; min-height: 0; max-width: 100%; --rim: var(--ink);
          filter: drop-shadow(1.6px 0 0 var(--rim)) drop-shadow(-1.6px 0 0 var(--rim)) drop-shadow(0 1.6px 0 var(--rim)) drop-shadow(0 -1.6px 0 var(--rim)) drop-shadow(2.5px 2.5px 0 var(--ink)); }
.pa-ico::before { content: ""; position: absolute; inset: 0; background: var(--tex-halftone) 0 0 / 5px 5px, var(--fill, #FBF7EC);
                  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.grid th[data-rim="paper"] .pa-ico { --rim: var(--paper-clip); }
.pa.two .pa-ico { max-height: 50cqi; }
/* a finished per-category icon (assets/icons/manifest.json): pre-coloured, so only the hard print shadow is added */
.pa-pic { display: block; height: 100%; max-height: 70cqi; max-width: 100%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(2.5px 2.5px 0 var(--ink)); }
/* the band's type is set on the th itself (the span inherits it), so a probe placed in the th measures the same font */
.board { container-type: inline-size; }   /* th font sizes below are in board units: a cell is about 23.5cqi wide */
.grid th:not(.corner) { font-family: var(--font-display); font-size: clamp(11px, 3.5cqi, 18px); line-height: 1.2; }
/* Lalezar is wide: labels over 20 characters switch to Cairo 800, which fits about twice the text per line */
.grid th.long, .grid th.xlong, html[lang="en"] .grid th:not(.corner) { font-family: var(--font-ui); font-weight: 800; line-height: 1.15; }
.grid th.long { font-size: clamp(10.5px, 3.05cqi, 16px); }
.grid th.xlong { font-size: clamp(10px, 2.8cqi, 15px); }
/* (visual system v2 leaves the category-label sizes to the main-page builders: the board's label fit (retro.js fitLabel,
   tests/mobile/sweep.py) is tuned to these sizes; at 14 px a dozen labels no longer fit a 320 px board) */
.grid th:not(.corner) > span { position: relative; flex: 0 0 auto; padding: 2px 2px max(4px, .4em); background: var(--ink); color: #fff; font: inherit; hyphens: auto; }
.grid th[data-band="yellow"] > span { background: var(--yellow); color: var(--ink); }

/* EmptyCell */
.grid td { display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; background: var(--paper-2); border: 2px dashed rgba(26,26,26,.35); }
/* "tap here" on an empty cell = navy OUTLINE (--c-tap), never red */
.grid td .plus { width: 32px; aspect-ratio: 1; border-radius: 50%; border: 2.5px solid var(--c-tap); color: var(--c-tap); font-family: var(--font-display);
                 font-size: var(--fs-title); line-height: 1; display: grid; place-items: center; padding-top: .16em; transition: transform 120ms; }
.grid td .count { position: absolute; bottom: 3px; inset-inline-end: 5px; direction: ltr; unicode-bidi: isolate; font-size: var(--fs-meta); font-weight: 700; color: var(--c-meta); line-height: 1.2; }
.grid td .count::before { content: ""; }
.grid td:not(.ok):not(.bad):not(.revealed):active .plus { transform: scale(.88) rotate(-10deg); background: rgba(30,42,107,.1); }
/* ClippingCell: correct */
.grid td.ok { background: var(--paper-clip); border: 0; box-shadow: 2px 3px 0 rgba(26,26,26,.55); padding: 8px 9px; cursor: default; }   /* names clear of the lime frame (inset 7 px) */
.grid tr:nth-child(odd) td.ok { --tilt: 0deg; }
.grid tr td:nth-child(3).ok { --tilt: 0deg; }
.grid td.ok::before { content: none; }   /* the clipping's tape is the "N fit" tape (.sub.tape) */
.grid td.ok .mark { display: none; }
/* correct reads as correct: lime frame inside the clipping + a lime "approved" seal with a drawn tick in the corner */
.grid td.ok { outline: 3px solid var(--lime, #7BC43A); outline-offset: -7px; }
.grid td.ok::after { content: none; position: absolute; top: 4px; inset-inline-end: 4px; width: clamp(16px, 16cqi, 22px); aspect-ratio: 1; border-radius: 50%; z-index: 2;
  background: var(--lime, #7BC43A) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23141821' stroke-width='3.6' stroke-linecap='square'/%3E%3C/svg%3E") center / 70% no-repeat; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.grid td.ok .name { font: var(--fw-body) var(--fs-name-sm)/1.25 var(--font-ui); color: var(--ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.grid td.ok .sub { margin-top: 4px; font-size: var(--fs-name-sm-en); font-weight: 800; line-height: 1.35; color: var(--ink); background: var(--yellow); padding: 1px 5px; border-radius: var(--radius-print); max-width: 100%; }
/* StampMark: wrong */
/* the wrong card (SYS-MARKS): paper-lo, no pink, no hatch; the stamp is the kit's */
.grid td.bad { overflow: hidden; cursor: default; border: 2px solid var(--c-wrong); background-color: var(--c-paper-lo); background-image: none; }
.grid td.bad .plus, .grid td.bad .serial { display: none; }
.grid td.bad .mark { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-family: var(--font-display); font-size: var(--fs-title); line-height: 1.25; margin-bottom: 14px;
                     color: var(--paper-clip); background: var(--c-wrong); border: 3px double var(--paper-clip); outline: 2px solid var(--c-wrong); padding: 1px 6px 0;
                     transform: rotate(-6deg); box-shadow: 2px 2px 0 var(--ink); max-width: calc(100% - 16px); white-space: nowrap; }   /* the whole stamp inside the cell (no clipped corners) */
.grid td.bad .mark::before { content: "غلط"; padding-top: .12em; }   /* غلط */
html[lang="en"] .grid td.bad .mark { font: 800 var(--fs-meta)/1.25 var(--font-ui); }
html[lang="en"] .grid td.bad .mark::before { content: "WRONG"; font-size: 1em; padding-top: 0; letter-spacing: .02em; }
.grid td.bad .mark svg { width: .6em; height: .6em; stroke-width: 4; }
.grid td.bad .name { position: absolute; bottom: 3px; inset-inline: 4px; font-size: var(--fs-name-sm-en); font-weight: 800; color: var(--c-wrong); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                     text-decoration: line-through; text-decoration-thickness: 2px; }
/* after the round: the top answer, set small */
.grid td.revealed { padding: 6px 4px 14px; }
.grid td.revealed .name { font-size: var(--fs-name-sm-en); font-weight: 700; color: var(--ink-soft); line-height: 1.2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.grid td.revealed .sub { position: absolute; bottom: 3px; inset-inline-end: 5px; direction: ltr; unicode-bidi: isolate; font-size: var(--fs-meta); font-weight: 700; color: var(--c-meta); }

/* motion: the marks follow the feel tokens (FEEL block at the end of this file, games/retro/feel.js); the sticker pops */
@keyframes clip-drop { from { transform: translateY(-12px) rotate(0); opacity: 0; } to { transform: translateY(0) rotate(var(--tilt, 0deg)); opacity: 1; } }
@keyframes pop { 0% { transform: rotate(-8deg) scale(1.18); } 100% { transform: rotate(-8deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================================================
   print buttons
   ===================================================================================================== */
.under-board { display: flex; gap: 8px; margin: 18px 0 0; }
.under-board > * { flex: 1 1 0; }
/* give up (2026-11-15): a small text button on its own line under «إزاي تلعب؟», away from the board; it asks first (end.js) */
.under-board { flex-wrap: wrap; row-gap: 14px; }
.under-board > .r-giveup { flex: 0 0 100%; justify-content: center; color: var(--paper-clip, #FBF7EC); }   /* on the navy page */
/* the primary action = the navy-deep ticket (kit .r-btn): two punched notches, Cairo 800 18; --paper = secondary */
.btn-print { position: relative; min-height: var(--dock-h); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px;
             font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); text-decoration: none; border: 2px solid var(--ink); border-radius: 0; box-shadow: var(--shadow-hard);
             background: var(--c-action); color: var(--c-action-ink); transition: transform 80ms, translate 80ms; }
.btn-print:not(.btn-print--paper)::before, .btn-print:not(.btn-print--paper)::after { content: ""; position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px;
             border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); pointer-events: none; }
/* the punched notches: half discs bitten into the short edges, drawn INSIDE the ticket's border box (nothing past its edge) */
.btn-print::before, .btn-print::after { width: 8px; height: 14px; margin-top: -7px; border-radius: 0; }
.btn-print::before { inset-inline-start: -2px; border-inline-start: 0; border-start-end-radius: 8px; border-end-end-radius: 8px; }
.btn-print::after { inset-inline-end: -2px; border-inline-end: 0; border-start-start-radius: 8px; border-end-start-radius: 8px; }
.btn-print svg { font-size: 19px; margin-top: 0; }
.btn-print--paper { background: var(--paper-clip); color: var(--ink); padding: 0 var(--s4); }
.btn-print:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-print:disabled { opacity: 1; cursor: default; background: var(--c-paper-lo); color: var(--c-meta); border-style: dashed; box-shadow: none; }
.btn-print:disabled::before, .btn-print:disabled::after { content: none; }

/* =====================================================================================================
   result: the back page
   ===================================================================================================== */
.result { margin-top: 22px; }
.result .cover { animation: clip-drop 260ms cubic-bezier(.3,1.4,.5,1); --tilt: 0deg; }
.result-head { text-align: center; padding: 4px 0 2px; }
.result-kicker { display: inline-block; font-size: 12px; font-weight: 800; background: var(--ink); color: #fff; padding: 1px 10px; }
.headline { font-family: var(--font-display); font-weight: 400; line-height: 1.05; color: var(--lime); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.headline--yellow { color: var(--yellow); }
.result-score { font-size: 76px; margin-top: 6px; direction: ltr; unicode-bidi: isolate; }
.result:not(.perfect) .result-score { color: var(--yellow); }
.result-label { font-family: var(--font-display); font-size: 26px; line-height: 1.2; margin-top: 2px; }
.statrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 2px 18px; }
.stat { text-align: center; border: 3px solid var(--red); color: var(--red); padding: 4px 2px 2px; background: rgba(251,247,236,.5); }
.stat:nth-child(2) { border-color: var(--blue); color: var(--blue); }
.stat:nth-child(3) { }
.stat b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.1; padding-top: 3px; }
.stat span { font-size: 11px; font-weight: 800; }
.statrow.compact { margin: 4px 2px 14px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tryother { display: flex; align-items: center; gap: 10px; min-height: 56px; margin: 18px -30px 0; padding: 8px 48px; background: var(--blue); color: #fff; text-decoration: none;
            box-shadow: 0 3px 0 var(--ink); }
html[dir="ltr"] .tryother { }
.tryother .more-icon { display: none; }
.tryother b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 19px; line-height: 1.2; color: var(--yellow); }
.tryother small { display: block; font-size: 12px; font-weight: 700; }
.share-out { position: relative; margin: 20px 0 0; background: var(--paper-clip); padding: 12px; white-space: pre-wrap; font: 700 14px/1.6 var(--font-ui); unicode-bidi: plaintext; text-align: start;
             overflow-x: auto; box-shadow: 2px 3px 0 rgba(26,26,26,.55); }
.share-out.flash { background: #fff6c2; }

/* =====================================================================================================
   more games: the newsstand (each game a small magazine cover; no icons, the cover is the picture)
   ===================================================================================================== */
.more { margin-top: 30px; counter-reset: game; }
.more-kicker { display: inline-block; font-size: 12px; font-weight: 800; background: var(--yellow); color: var(--ink); padding: 1px 10px; transform: rotate(-2deg); margin-bottom: 6px; }
.more-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.more-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.2; color: var(--yellow); }
.more-all { color: var(--paper); font-weight: 800; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; justify-content: flex-end; }
.more-sub { margin: 0 0 12px; color: var(--paper); opacity: .85; font-size: 13px; font-weight: 600; }
.more-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.more-list li { counter-increment: game; }
.more-card { position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; background: var(--paper); padding: 6px 6px 10px; color: var(--ink); text-decoration: none; box-shadow: 0 5px 0 var(--navy-deep); }
.more-card::before { content: ""; display: block; aspect-ratio: 16 / 9; border: 2px solid var(--cyan); margin-bottom: 2px;
                     background: var(--tex-halftone) 0 0 / 5px 5px, var(--kit, linear-gradient(160deg, #3BB3E5, #1E2A6B)); }
.more-card::after { content: counter(game, arabic-indic); position: absolute; top: 12px; inset-inline-start: 12px; width: 34px; height: 34px; border-radius: 50%;
                    background: var(--yellow); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); display: grid; place-items: center;
                    font-family: var(--font-display); font-size: 19px; padding-top: 4px; transform: rotate(-8deg); }
html[lang="en"] .more-card::after { content: counter(game); padding-top: 3px; }
.more-list li:nth-child(4n+1) .more-card { --kit: radial-gradient(circle at 30% 25%, #e0383f, #a3141c 70%); }
.more-list li:nth-child(4n+2) .more-card { --kit: repeating-conic-gradient(from -90deg at 50% 100%, #F4D21F 0 9deg, #E0B43A 9deg 18deg); }
.more-list li:nth-child(4n+3) .more-card { --kit: repeating-linear-gradient(90deg, #2c7a3f 0 12.5%, #35894b 12.5% 25%); }
.more-card:active { transform: translate(1px, 2px); box-shadow: 0 2px 0 var(--navy-deep); }
/* today's page finished (games/retro/progress.js): the lime tick seal of the contents page and the games switcher */
.more-tick { position: absolute; z-index: 2; top: 6px; inset-inline-end: 6px; width: 30px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--ink); box-shadow: none;
  background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23141821' stroke-width='3.6' stroke-linecap='square'/%3E%3C/svg%3E") center / 70% no-repeat; }
.more-card.is-done .more-go { background: var(--paper-clip); color: var(--ink); }
.more-icon { display: none; }
.more-name { font-family: var(--font-display); font-size: 23px; line-height: 1.15; color: var(--red); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink); padding: 2px 2px 0; }
.more-list li:nth-child(4n+2) .more-name { color: var(--yellow); }
.more-list li:nth-child(4n+3) .more-name { color: var(--lime); }
.more-list li:nth-child(4n+4) .more-name { color: var(--cyan); }
.more-desc { font-size: 12px; font-weight: 700; line-height: 1.4; color: var(--ink-meta); flex: 1 1 auto; padding: 0 2px; }
.more-go { align-self: flex-start; margin: 4px 2px 0; font-family: var(--font-display); font-size: 16px; padding: 3px 12px 0; background: var(--red); color: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
html[lang="en"] .more-go { font-family: var(--font-ui); font-weight: 800; font-size: 13px; padding-top: 1px; }

/* =====================================================================================================
   reveal: clipping strips
   ===================================================================================================== */
.reveal h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; color: var(--yellow); margin: 28px 0 10px; }
.reveal details { background: var(--paper); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--navy-deep); margin-bottom: 8px; }
.reveal summary { cursor: pointer; padding: 10px 12px; padding-inline-end: 38px; min-height: var(--tap); font-weight: 800; font-size: 14px; list-style: none; position: relative; }
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::after { content: "+"; position: absolute; inset-inline-end: 8px; top: 9px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--red); color: var(--red);
                         font-family: var(--font-display); font-size: 18px; line-height: 26px; text-align: center; }
.reveal details[open] summary::after { content: "\2212"; }
.reveal summary > span[class^="mark-"] { display: inline-grid; place-items: center; width: 19px; height: 19px; vertical-align: -4px; margin-inline-end: 6px; font-size: 11px; border: 2px solid currentColor; }
.reveal summary > span[class^="mark-"] svg { stroke-width: 4; }
.reveal .mark-ok { color: var(--blue); } .reveal .mark-bad { color: var(--red); } .reveal .mark-none { color: var(--ink-soft); }
.reveal .meta { color: var(--ink-soft); font-weight: 700; font-size: 12px; }
.reveal ol { margin: 0; padding: 0 12px 10px; padding-inline-start: 30px; }
.reveal li { padding: 7px 2px; border-top: 1px solid var(--ink); font-size: 14px; }
.reveal li.mine { background: rgba(244,210,31,.45); }
.reveal li .career { color: var(--ink-soft); font-size: 12px; font-weight: 600; }

/* =====================================================================================================
   sheets: paper with a torn top edge
   ===================================================================================================== */
.sheet { position: fixed; inset: 0; background: rgba(13, 18, 56, .62); display: flex; align-items: flex-end; justify-content: center; z-index: 30; animation: fade .18s ease-out; }
.sheet-box { position: relative; background: var(--paper); color: var(--ink); width: min(var(--maxw), 100%); max-height: 90%; display: flex; flex-direction: column; overflow: hidden; outline: none;
             padding: 22px max(16px, var(--ir)) calc(16px + var(--ib)) max(16px, var(--il)); animation: sheet-in .26s cubic-bezier(.2,.8,.2,1);
             clip-path: polygon(0 9px, 4% 4px, 8% 8px, 12% 2px, 17% 7px, 21% 3px, 26% 9px, 30% 4px, 35% 7px, 39% 1px, 44% 6px, 48% 3px, 53% 9px, 57% 4px, 62% 7px, 66% 2px, 71% 8px, 75% 3px, 80% 7px, 84% 1px, 89% 6px, 93% 3px, 97% 8px, 100% 4px, 100% 100%, 0 100%); }
.sheet-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: .2; background: var(--tex-grain); background-size: 220px; }
@keyframes sheet-in { from { transform: translateY(40px); } to { transform: none; } }
.sheet-kicker { font-size: var(--fs-meta); font-weight: 800; color: var(--c-meta); flex: 0 0 auto; }
.sheet-title { font-weight: 800; margin: 0 0 10px; font-size: 16px; line-height: 1.35; flex: 0 0 auto; }
.sheet-title.big { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.15; }
.sheet-box > .btn-print { flex: 0 0 auto; width: 100%; margin-top: 12px; position: relative; z-index: 1; }
.sheet-scroll { position: relative; z-index: 1; overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; padding: 4px 4px 6px; margin: -4px -4px 0; }
#helpTitle { text-align: center; font-size: 40px; margin-top: 4px; }
.archive-list { position: relative; z-index: 1; list-style: none; padding: 0; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
html.kb-open .sheet-box { max-height: 100%; animation: none; }
html.kb-open .sheet-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.kb-open .archive-list { max-height: none; }
.archive-list { margin: 0; max-height: 60vh; max-height: 60dvh; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-content: start; padding: 4px; }
.archive-list li { height: 64px; background: var(--paper-clip); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.archive-list li .num { font-family: var(--font-display); font-size: 22px; line-height: 1.1; padding-top: 3px; }
.archive-list li .res { font-size: var(--fs-meta); font-weight: 800; color: var(--c-meta); direction: ltr; }
.archive-list li.done { background: var(--paper-2); }
.archive-list li.perfect { background: var(--yellow); }
.archive-list li.current { outline: 3px solid var(--cyan); outline-offset: 2px; }
.tagline { margin: 4px 0 14px; color: var(--ink-meta); font-size: 14px; font-weight: 700; text-align: center; }
.howto { list-style: none; counter-reset: s; margin: 0 0 8px; padding: 0; display: grid; gap: 12px; }
.howto li { counter-increment: s; display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; font-size: 15px; font-weight: 700; }
.howto li::before { content: counter(s, arabic-indic); width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
                    display: grid; place-items: center; font-family: var(--font-display); font-size: 20px; padding-top: 4px; transform: rotate(-6deg); }
html[lang="en"] .howto li::before { content: counter(s); }
.hint { display: none; }
.settings { border: 2px solid var(--ink); margin: 16px 0 18px; background: var(--paper-clip); }
.setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; min-height: 52px; padding: 0 12px; width: 100%; background: transparent; border: 0; font-weight: 800; font-size: 15px; text-align: start; cursor: pointer; }
.setting + .setting { border-top: 1px solid var(--ink); }
.mode-setting { cursor: default; }
.setting-btn { color: var(--red); }
.setting-btn:disabled { color: var(--ink-soft); opacity: .6; cursor: default; }
.seg { display: inline-flex; border: 2px solid var(--ink); padding: 2px; gap: 2px; flex: 0 1 auto; max-width: 100%; background: var(--paper); }
.seg-btn { min-width: 64px; min-height: var(--tap); padding: 0 12px; border: 0; background: transparent; color: var(--ink); font-weight: 800; font-size: 14px; }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper-clip); }
.toggle { -webkit-appearance: none; appearance: none; width: 52px; height: 28px; border: 2px solid var(--ink); background: var(--paper-2); position: relative; flex: 0 0 auto; margin: 0; cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; background: var(--ink); transition: translate .15s; }
.toggle:checked { background: var(--lime); }
.toggle:checked::after { translate: 24px 0; }
html[dir="rtl"] .toggle:checked::after { translate: -24px 0; }
.about h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.about-body { color: var(--ink-meta); font-size: 13.5px; font-weight: 600; }
.about-body .kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.about-body .kpi { text-align: center; min-width: 0; border: 2px solid var(--ink); background: var(--paper-clip); padding: 6px 2px; }
.about-body .kpi b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 21px; line-height: 1.2; color: var(--red); padding-top: 2px; }
.about-body .kpi span { font-size: 11px; font-weight: 800; }
.about-body p { margin: 6px 0; }
.fineprint { color: var(--ink-soft); font-size: 11px; font-weight: 700; margin: 14px 0 4px; }
footer { max-width: var(--maxw); margin: 0 auto; padding: 0 12px calc(16px + var(--ib)); }
footer:empty { display: none; }
footer .pwa-footer a { border-radius: 0; border-width: 2px; box-shadow: var(--shadow-hard-navy); font-weight: 800; }

/* =====================================================================================================
   responsive
   ===================================================================================================== */
@media (hover: hover) and (pointer: fine) {
  .grid td:not(.ok):not(.bad):not(.revealed):hover .plus { background: rgba(215,38,46,.1); transform: rotate(-8deg); }
  .setting:hover { background: rgba(244,210,31,.4); }
  .btn-round:hover { background: rgba(239,230,210,.12); }
  .btn-print:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--navy-deep); }
  .more-card:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--navy-deep); }
}
@media (max-width: 345px) {
  .topbar { padding-inline: 8px; }
  .topbar-side { gap: 4px; }
  .masthead { font-size: 38px; -webkit-text-stroke-width: 6px; }
  main { padding-inline: 6px; }
  .grid { gap: var(--s1); }
  .grid th.long { font-size: 9.5px; } .grid th.xlong { font-size: 9px; }
  .result-score { font-size: 64px; }
  .result-actions { grid-template-columns: 1fr; }
  .archive-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .more-list { gap: 12px 8px; }
  .more-name { font-size: 21px; }
}
/* landscape phones: shorter cells so the board fits */
@media (orientation: landscape) and (max-height: 520px) {
  .topbar-inner { height: 58px; }
  .masthead { font-size: 36px; }
  main { max-width: 460px; margin: 0 auto; }
  .grid td { aspect-ratio: 4 / 3; }
  .sheet { align-items: center; }
  .sheet-box { max-height: 96%; padding-top: 14px; }
}
@media (min-width: 600px) {
  .sheet { align-items: center; }
  .sheet-box { max-height: 86%; padding-bottom: 18px; }
}
/* tablets: a wider single column */
@media (min-width: 600px) and (max-width: 1023px) {
  :root { --maxw: 600px; }
}

/* Desktop: the page becomes a magazine spread. The cover (this round) is the big page; the inside page beside it
   carries the back page (result) when the round is over, and the newsstand. The reveal runs under the cover. */
@media (min-width: 1024px) {
  :root { --cw: min(calc(100vw - 500px), max(520px, calc((100vh - 345px) * .98)), 760px); }
  .poster { max-width: none; background: transparent; overflow: visible; }
  .topbar { padding-top: calc(10px + var(--it)); }
  .topbar-inner { max-width: calc(var(--cw) + 460px); margin: 0 auto; height: 84px; }
  .topbar .masthead { font-size: 62px; }
  main.spread { display: grid; grid-template-columns: var(--cw) minmax(340px, 400px); grid-template-rows: auto auto 1fr; column-gap: clamp(36px, 4vw, 60px);
                justify-content: center; align-items: start; padding: 6px 32px 56px; }
  .cover--issue { grid-column: 1; grid-row: 1; padding: 10px; box-shadow: 0 8px 0 var(--navy-deep); }
  .cover--issue > .cover__rule { padding: 14px 14px 16px; }
  .under-board { grid-column: 1; grid-row: 2; margin-top: 22px; }
  .under-board .btn-print { min-height: 54px; font-size: 22px; }
  .side { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 16px; }
  .reveal { grid-column: 1; grid-row: 3; }
  .grid { gap: 10px; }
  .issue-title { font-size: 32px; }
  .round-meta { font-size: 14px; }
  .issue-strip { margin-bottom: 14px; }
  .result { margin: 0 0 26px; }
  .result-score { font-size: 84px; }
  /* the inside page: paper, ink rules, the newsstand as a contents page */
  .more { margin: 0; background: var(--paper-2); padding: 18px 18px 20px; box-shadow: 0 8px 0 var(--navy-deep); position: relative; }
  html[dir="ltr"] .more { }
  .more::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: .2; background: var(--tex-grain); background-size: 220px; }
  .more-head { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 4px 0; margin-bottom: 6px; }
  .more-head h2 { color: var(--ink); font-size: 30px; }
  .more-all { color: var(--ink); }
  .more-sub { color: var(--ink-meta); opacity: 1; }
  .more-list { gap: 14px 12px; }
  .more-card { box-shadow: 3px 3px 0 var(--ink); border: 2px solid var(--ink); background: var(--paper-clip); }
  .more-card::before { aspect-ratio: 2 / 1; }
  .more-name { font-size: 21px; }
  .more-desc { font-size: 11.5px; }
  .more-card:active { box-shadow: 1px 1px 0 var(--ink); }
  .sheet-box { --maxw: 520px; }
  footer { max-width: calc(var(--cw) + 460px); }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .more-card:hover { box-shadow: 4px 5px 0 var(--ink); }
}

/* =====================================================================================================
   preferences
   ===================================================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-contrast: more) {
  :root { --ink-soft: #3e3424; --ink-meta: #2a2318; }
  .grid td { border-style: solid; border-color: var(--ink); }
}
@media (forced-colors: active) {
  .grid td, .grid th, .btn-print, .btn-round, .roundnav, .sheet-box, .stat, .archive-list li, .choice { border: 1px solid CanvasText; }
  .grid td.ok, .btn-print { forced-color-adjust: none; }
  .grid td.ok { background: Highlight; color: HighlightText; }
}


/* =====================================================================================================
   How to play: a magazine guide page (owner: the old sheet was "ugly"). Phone: one clean column. Desktop: a
   two-page spread, the guide on one page, settings + the data fact box on the other. Each step shows a small
   picture of what the player will actually see (empty cell, clipping with tick, the guesses sticker).
   ===================================================================================================== */
#help .sheet-box { --maxw: 560px; }
.help-kicker { margin: 0; text-align: center; font: 800 var(--fs-meta)/1.5 var(--font-ui); color: var(--c-meta); }
#helpTitle.help-title { color: var(--red); -webkit-text-stroke: 0; text-shadow: 3px 3px 0 var(--ink); font-size: 44px; margin: 2px 0 2px; }
#help .tagline { margin: 0 0 14px; padding-bottom: 12px; border-bottom: 3px solid var(--ink); }
.howto { gap: 10px; }
.howto li { grid-template-columns: 40px 1fr 64px; background: var(--paper-clip); border: 2px solid var(--ink); box-shadow: var(--shadow-hard); padding: 10px 10px; min-height: 84px; line-height: 1.45; }
.howto li::before { background: var(--yellow); color: var(--ink); }
.howto li::after { content: ""; width: 56px; height: 56px; justify-self: end; }
/* 1: an empty cell with the red ring "+" */
.howto li:nth-child(1)::after { border: 2px dashed var(--ink-soft); background: radial-gradient(circle, transparent 13px, var(--red) 13.5px 16px, transparent 16.5px),
  linear-gradient(var(--red), var(--red)) center / 12px 3px no-repeat, linear-gradient(var(--red), var(--red)) center / 3px 12px no-repeat, var(--paper-2); }
/* 2: a taped clipping with the lime tick seal */
.howto li:nth-child(2)::after { outline: 3px solid var(--lime); outline-offset: -6px; transform: rotate(3deg); box-shadow: 2px 2px 0 rgba(26,26,26,.5);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%237BC43A' stroke='%23141821' stroke-width='1.6'/%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%23141821' stroke-width='2.8' stroke-linecap='square'/%3E%3C/svg%3E") center / 30px no-repeat, var(--paper); }
/* 3: the yellow guesses sticker */
.howto li:nth-child(3)::after { content: "\0669"; width: 50px; height: 50px; border-radius: 50%; background: var(--yellow); border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); transform: rotate(-8deg);
  display: grid; place-items: center; font-family: var(--font-display); font-size: 30px; padding-top: 5px; }
html[lang="en"] .howto li:nth-child(3)::after { content: "9"; }
.help-h { margin: 18px 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.2; display: flex; align-items: center; gap: 8px; }
.help-h::after { content: ""; flex: 1 1 auto; border-top: 3px solid var(--ink); margin-top: -4px; }
#help .settings { margin: 0 0 4px; box-shadow: var(--shadow-hard); }
#help .about { margin-top: 6px; }
#help .about-body .kpis { gap: 0; border: 2px solid var(--ink); background: var(--ink); box-shadow: var(--shadow-hard); margin: 0 0 12px; }
#help .about-body .kpi { border: 0; background: var(--yellow); }
#help .about-body .kpi + .kpi { border-inline-start: 2px solid var(--ink); }
#help .about-body .kpi b { color: var(--ink); font-size: 26px; }
#help .about-body p { line-height: 1.6; }
#help .fineprint { border-top: 1px solid var(--ink-soft); padding-top: 8px; }
@media (min-width: 900px) {
  #help .sheet-box { --maxw: 980px; padding: 30px 30px 22px; }
  .help-spread { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; }
  .help-main { padding-inline-end: 26px; }
  .help-side { padding-inline-start: 26px; border-inline-start: 3px double var(--ink); }
  .help-side > .help-h:first-child { margin-top: 0; }
  #helpTitle.help-title { font-size: 56px; }
  #help .sheet-box > .btn-print { width: auto; min-width: 280px; align-self: center; }
}

/* list separator: a middle dot next to Eastern Arabic digits reads as a zero, so Arabic uses a bar (app.js SEP()) */
.r-sep::before { content: "\00a0\00B7\00a0"; }
html[lang="ar"] .r-sep::before { content: "\00a0|\00a0"; }
.r-sep:has(+ :empty) { display: none; }

/* ---- game poster (hub cards, main page newsstand): the game's glyph as a big rubber stamp on a halftone panel in its
   panel family colour (games/icons.js HAREEF_POSTER). Icon colour per family as on the grid: paper on navy / green,
   gold on the red sunburst, ink on cyan / yellow. ---- */
.g-poster { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border: 2px solid #1A1A1A;
            background: #1E2A6B; color: #FBF7EC; container-type: inline-size; }
.g-poster::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0,0,0,.24) 1.1px, transparent 1.4px); background-size: 5px 5px; pointer-events: none; opacity: .6; }
.g-poster[data-family="honours"] { background: #D7262E; color: #F4D21F; }   /* round 5 (ROUND5.md): live's red poster again (flat + halftone), gold glyph */
.g-poster[data-family="where"] { background: #3BB3E5; color: #141821; }
.g-poster[data-family="profile"] { background: repeating-linear-gradient(90deg, #2c7a3f 0 12.5%, #35894b 12.5% 25%); color: #FBF7EC; }
.g-poster[data-family="numbers"] { background: #F4D21F; color: #141821; }
.g-poster__stamp { position: relative; display: grid; place-items: center; height: 76%; aspect-ratio: 1; border-radius: 50%;
                   border: max(3px, 2.2cqi) solid currentColor; outline: max(1.5px, 1cqi) solid currentColor; outline-offset: max(3px, 2cqi);
                   transform: rotate(-8deg); filter: drop-shadow(3px 3px 0 rgba(0,0,0,.4)); }
.g-poster__stamp svg { width: 62%; height: 62%; stroke-width: 2.3; }

/* newsstand covers carry the game poster (above) instead of a plain colour block; names in ink (lime / cyan are feedback
   and family colours, not type colours) */
.more-card::before { content: none; display: none; }
.more-card .g-poster { margin-bottom: 4px; }
.more-list li .more-card .more-name { color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; }

/* =====================================================================================================================
   FEEL (Foundation B; games/retro/feel.js, the same tokens as games/retro/kit.css): pressed state within 100 ms, the marks
   in 400 ms (clipping 250 ms scale 1.08 -> 1, tape 150 ms, tick seal at 300 ms; stamp 200 ms + a 3 px two-cycle shake of
   THAT cell), only transform / opacity, reduced motion = opacity <= 150 ms. High contrast via html[data-contrast="high"].
   ===================================================================================================================== */
:root { --t-press: 60ms; --t-clip: 250ms; --t-tape-at: 100ms; --t-tape: 150ms; --t-seal-at: 300ms; --t-seal: 100ms; --t-stamp: 200ms; --t-shake: 100ms;
        --t-reduced: 150ms; --ease-pop: cubic-bezier(.3, 1.5, .5, 1); }
@keyframes fx-clip { from { scale: 1.08; opacity: .55; } to { scale: 1; opacity: 1; } }
@keyframes fx-tape { from { scale: 0 1; opacity: 0; } to { scale: 1 1; opacity: 1; } }
@keyframes fx-seal { from { scale: 0; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes fx-stamp { 0% { scale: 1.6; opacity: 0; } 70% { scale: .95; opacity: 1; } 100% { scale: 1; opacity: 1; } }
@keyframes fx-shake { 0%, 100% { translate: 0 0; } 25% { translate: -3px 0; } 75% { translate: 3px 0; } }
@keyframes fx-fade { from { opacity: .35; } to { opacity: 1; } }
.grid td.ok.fx-ok, .grid td.ok.fresh { animation: fx-clip var(--t-clip) var(--ease-pop) both; }
.grid td.ok.fx-ok::before, .grid td.ok.fresh::before { animation: fx-tape var(--t-tape) var(--t-tape-at) ease-out both; }
.grid td.ok.fx-ok::after, .grid td.ok.fresh::after { animation: fx-seal var(--t-seal) var(--t-seal-at) var(--ease-pop) both; }
.grid td.bad.fx-bad, .grid td.bad.fresh { animation: fx-shake var(--t-shake) var(--t-stamp) 2; }
.grid td.bad.fx-bad .mark, .grid td.bad.fresh .mark { animation: fx-stamp var(--t-stamp) ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .grid td.fx-ok, .grid td.fx-bad, .grid td.fresh { animation: fx-fade var(--t-reduced) ease-out both !important; }
}

/* pressed: feel.js sets .is-pressed on pointerdown; 2 px into the hard shadow (translate composes with rotate / scale) */
.btn-print.is-pressed { translate: 2px 2px; box-shadow: 1px 1px 0 var(--navy-deep); }
.btn-print:active { transform: none; translate: 2px 2px; }
.btn-round.is-pressed { scale: .94; background: rgba(239,230,210,.12); }
.roundnav.is-pressed:not(:disabled) { scale: .9; }
.grid td.is-pressed:not(.ok):not(.bad):not(.revealed) .plus { transform: scale(.88) rotate(-10deg); background: rgba(215,38,46,.1); }
.grid td.revealed.is-pressed, .grid td.ok.is-pressed, .grid td.bad.is-pressed { translate: 1px 1px; }
.more-card.is-pressed { translate: 1px 2px; box-shadow: 0 2px 0 var(--navy-deep); }
.door.is-pressed, .tryother.is-pressed, .choice.is-pressed { translate: 0 2px; }
.more-all.is-pressed, .reveal summary.is-pressed, .archive-list li.is-pressed, .setting.is-pressed, .seg-btn.is-pressed, .lang-opt.is-pressed { translate: 1px 1px; }
.btn-print, .btn-round, .roundnav, .more-card, .door, .tryother, .seg-btn, .lang-opt, .setting { transition-property: translate, scale, transform; transition-duration: var(--t-press); }
a[href], summary, .archive-list li, .grid td[role="button"], .toggle { touch-action: manipulation; }
@media (prefers-reduced-motion: reduce) {
  .is-pressed { translate: none !important; scale: none !important; opacity: .8; }
}

/* high contrast ("ألوان واضحة", mode.js): Okabe-Ito blue for correct, orange for highlights, red stays. The states keep
   their words and icons (tick seal, "غلط" stamp, hatch), so colour is never the only signal (rule 10). */
html[data-contrast="high"] { --lime: #0072B2; --yellow: #E69F00; }
html[data-contrast="high"] .grid td.ok::after { box-shadow: 2px 2px 0 var(--ink), 0 0 0 2px var(--paper-clip); }
html[data-contrast="high"] .grid td.ok .sub { background: var(--yellow); }

/* help: the worked example (one cell solved) */
.help-example { margin: 4px 0 10px; padding: 10px 10px 12px; border: 2px dashed var(--ink); background: var(--paper-2); }
.hx-k { margin: 0 0 6px; font: 800 var(--fs-meta)/1.5 var(--font-ui); color: var(--c-meta); }
.hx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hx-panel { display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; line-height: 1.9; max-width: 100%; min-width: 0; white-space: normal; padding: 4px 8px; background: var(--ink); color: var(--paper-clip); font: 800 14px/1.4 var(--font-ui); border: 2px solid var(--ink); }
.hx-panel.hx-honours { background: #E0B43A; border-color: var(--ink); color: var(--ink); }   /* honours = flat gold (SYS-COLOUR) */
.hx-op { font: 900 18px/1 var(--font-ui); color: var(--ink); }
.hx-clip { position: relative; padding: 4px 12px; background: var(--paper-clip); outline: 2px solid var(--lime); outline-offset: -5px; box-shadow: 2px 2px 0 rgba(26,26,26,.55);
           font: 800 16px/1.5 var(--font-ui); color: var(--ink); }

/* =====================================================================================================================
   FOUNDATION A (games/retro/end.js + end.css): the back page and the full reveal on the board.
   A missed cell shows its best-known answer, greyed, and "N لاعب ينفع" as a yellow tag (rule C9: fair loss endings).
   ===================================================================================================================== */
.grid td.revealed { padding: 6px 4px; gap: 4px; }
.grid td.revealed .sub { position: static; direction: inherit; unicode-bidi: normal; background: var(--yellow); color: var(--ink); padding: 0 4px;
                         font-size: clamp(9px, 10.5cqi, 12px); font-weight: 800; line-height: 1.45; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .cover--back > .cover__rule { padding: 12px 12px 16px; }
@media (min-width: 1024px) { .result .cover--back > .cover__rule { padding: 16px 16px 18px; } }

/* =====================================================================================================================
   RULES (Foundation B, tests/rules/audit.py): rule 1 (8 px between adjacent targets), rule 12 (Lalezar only at 24 px or
   more; Arabic body text 16 px / 1.6). Display type that has to stay smaller is set in Cairo 800 instead of Lalezar.
   ===================================================================================================================== */
.grid { gap: 8px; }
@media (max-width: 345px) { .grid { gap: 8px; } }
/* Lalezar >= 24 px */
.btn-print { font-size: 24px; }
html[lang="en"] .btn-print { font-size: 17px; }
.btn-print svg { font-size: 20px; }
.tryother b { font-size: 24px; }
.more-name { font-size: 24px; }
@media (max-width: 345px) { .more-name { font-size: 24px; } }
@media (min-width: 1024px) { .more-name { font-size: 24px; } .under-board .btn-print { font-size: 24px; } html[lang="en"] .under-board .btn-print { font-size: 18px; } }
.more-go { font-family: var(--font-ui); font-weight: 800; font-size: 14px; padding-top: 1px; }
.archive-list li .num { font-size: 24px; }
.about h2 { font-size: 24px; }
.about-body .kpi b { font-size: 24px; }
.howto li::before { font-size: 24px; }
.reveal summary::after { font-family: var(--font-ui); font-weight: 900; line-height: 22px; }
/* the board: panel labels and clipping names are too small for Lalezar, so they are Cairo 800 */
.grid th:not(.corner) { font-family: var(--font-ui); font-weight: 800; line-height: 1.15; }
.grid td.ok .name { font-family: var(--font-ui); font-weight: 800; font-size: clamp(12px, 15cqi, 18px); line-height: 1.25; }
.grid td .plus { font-size: clamp(24px, 32cqi, 40px); }
.grid td.bad .mark { font-size: clamp(16px, 20cqi, 28px); padding: 1px 6px 0; }   /* the stamp fits inside a phone cell (overflow would cut its corners) */
/* Arabic body text: 16 px / 1.6 */
.more-sub, .tagline, .about-body, .about-body p, .fineprint, .howto li, .reveal li, .reveal li .career { font-size: 16px; line-height: 1.6; }
.reveal li .career { font-weight: 600; }
html[lang="en"] .fineprint, html[lang="en"] .more-sub { font-size: 14px; line-height: 1.5; }
.fineprint small { font-size: inherit; }
.help-kicker { color: var(--c-meta); }   /* never red: red means wrong (SYS-COLOUR) */
.seg { gap: 8px; }
@media (max-width: 1023px) { .grid { gap: 10px; } }
/* the newsstand numbers follow the issue page numbers (main grid = page 1, so Mashwar is page 2 ... Ashra Ala Ashra 11) */
.more { counter-reset: game 1; }
/* crest library (assets/clubs-icons.js): a pair of clubs shows both crests side by side */
.pa.two .pa-pic { max-height: 50cqi; max-width: 46%; }
/* the worked example: both panels on the first line, "<- like Zidane" under them */
.hx-row { display: grid; grid-template-columns: minmax(0, max-content) max-content minmax(0, max-content);   /* v2: the panels wrap inside the card at 320 */ justify-content: start; align-items: center; gap: 8px 6px; }
.hx-arrow { justify-self: end; }
.hx-clip { grid-column: 2 / span 2; justify-self: start; }
@media (max-width: 359px) { .hx-panel { font-size: 13px; padding: 3px 6px; } }
/* English "WRONG" stamp: the word is set small to fit the cell, so it is Cairo 900 (Lalezar only at 24 px or more) */
html[lang="en"] .grid td.bad .mark { font-family: var(--font-ui); font-weight: 900; }
/* alignment pass 2026-11-12: "WRONG x" was wider than a phone cell and lost its first and last letters to the cell's
   overflow: the English stamp scales with the cell and keeps a slimmer frame */
html[lang="en"] .grid td.bad .mark { font-size: clamp(13px, 15.5cqi, 24px); padding: 1px 5px 0; gap: 3px; max-width: calc(100% - 16px); }
html[lang="en"] .grid td.bad .mark::before { font-size: .86em; letter-spacing: 0; }

/* the search sheet's title on the main grid: "row × column" in short form, each with its category panel art on the
   panel's own kit colour (app.js sheetTitleHtml copies the header's .pa), wraps instead of cutting (owner 2026-11-11) */
#modalTitle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; line-height: 1.3; }
.ss-cat { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ss-cat b { font: 800 16px/1.3 var(--font-ui); }
.ss-cat__ico { position: relative; flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--ink);
               background: var(--kit, var(--paper-2)); container-type: inline-size; }
.ss-cat__ico::before { content: ""; position: absolute; inset: 0; background-image: var(--tex-halftone); background-size: 5px 5px; pointer-events: none; }
.ss-cat__ico .pa { position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 100%; padding: 3px; font-style: normal; }
.ss-cat__ico .pa-ico { max-height: 80cqi; }
.ss-cat__ico .pa.two .pa-ico, .ss-cat__ico .pa.two .pa-pic, .ss-cat__ico .pa.two .pa-roundel { max-height: 50cqi; }
.ss-cat__ico .pa-pic { max-height: 86cqi; filter: drop-shadow(1.5px 1.5px 0 var(--ink)); }
.ss-cat__ico .pa-roundel { max-height: 80cqi; padding: 8%; border-width: 1.5px; box-shadow: none; }
.ss-cat__ico[data-rim="paper"] .pa-ico { --rim: var(--paper-clip); }
.ss-x { font: 800 18px/1 var(--font-ui); color: var(--red); }

/* =====================================================================================================================
   COMPACT PHONES (owner 2026-11-11, from phone playtests: "make everything a bit smaller ... so you can ALWAYS see the
   question while you're playing"). Same look, less air: top bar, masthead, the doors, the issue strip, the board gaps and
   the buttons under it, so the whole board + "how to play / give up" sit on one screen. Minimums kept: 44 px targets 8 px
   apart, Lalezar 24 px or more. Desktop (the spread) is unchanged.
   ===================================================================================================================== */
@media (max-width: 1023px) {
  .topbar-inner { height: 60px; }
  .masthead { font-size: clamp(34px, 10.4vw, 42px); -webkit-text-stroke-width: 6px; text-shadow: 3px 3px 0 var(--navy-deep); padding-top: 4px; }
  .issue-strip { padding: 3px 0; margin-bottom: 8px; }
  .under-board { margin-top: 12px; }
  .under-board .btn-print { min-height: 46px; }
  .poster { padding-bottom: calc(18px + var(--ib)); }
}

/* =====================================================================================================================
   THE TWO DOORS (owner 2026-11-11: "after Egypt or Europe, play alone or versus friends, with equal weight"). Two match
   tickets of the same size on the navy poster, right under the top bar: "لوحدك / Solo" (yellow: today's 15 games, opens
   the games switcher; the board below is game 1) and "ضد صحابك / Versus friends" (red: live, 2 to 5 players). Each has a
   glyph roundel, a Lalezar title, one line, and a rubber stamp ("يومي / Daily", "لايف / Live"). On the desktop spread they
   head the inside page, bigger, above the newsstand.
   ===================================================================================================================== */
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 2px 0 12px; }
.door { --bg: var(--yellow); --fg: var(--ink); --ttl: var(--ink); --sub: var(--ink-meta);
        position: relative; display: flex; align-items: center; gap: 8px; min-height: 66px; padding: 10px 10px 8px 8px;
        background: var(--bg); color: var(--fg); border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--navy-deep); text-decoration: none; }
html[dir="rtl"] .door { padding: 10px 8px 8px 10px; }
/* visual system v2: the door's stamp sits inside its top edge (it hung 11 px over it); the door keeps a top row for it */
.door, html[dir="rtl"] .door { padding-top: 26px; }
.door::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: var(--tex-halftone); background-size: 5px 5px; opacity: .55; }
/* ticket perforation along the inner edge */
.door::after { content: ""; position: absolute; top: 6px; bottom: 6px; inset-inline-end: 5px; border-inline-end: 2px dashed currentColor; opacity: .35; pointer-events: none; }
.door > * { position: relative; }
.door--vs { --bg: var(--red); --fg: var(--paper-clip); --ttl: var(--yellow); --sub: var(--paper-clip); }
.door--solo { }
.door--vs { }
.door__ico { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--paper-clip); color: var(--ink);
             border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-size: 24px; }
.door--vs .door__ico { background: var(--yellow); }
.door__txt { display: flex; flex-direction: column; min-width: 0; }
.door__title { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.05; padding-top: 4px; color: var(--ttl); white-space: nowrap; }
html[lang="en"] .door__title { font-family: var(--font-ui); font-weight: 900; font-size: 17px; line-height: 1.15; padding-top: 0; white-space: normal; }
.door__sub { font-size: 12px; font-weight: 800; line-height: 1.35; color: var(--sub); }
.door__stamp { position: absolute; top: 3px; inset-inline-end: 8px; z-index: 1; box-shadow: 1.5px 1.5px 0 var(--ink); font: 800 10.5px/1.4 var(--font-ui); padding: 0 5px; border: 1.5px solid currentColor; transform: rotate(-6deg);
               color: var(--red-ink, #AE1C23); background: var(--paper-clip); }
.door--vs .door__stamp { color: var(--red); background: var(--yellow); border-color: var(--ink); }
.door--vs .door__stamp::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-inline-end: 4px; vertical-align: 1px;
                                 animation: door-live 1.6s ease-in-out infinite; }
@keyframes door-live { 50% { opacity: .25; } }
.door:active { translate: 2px 2px; box-shadow: 1px 1px 0 var(--navy-deep); }
@media (hover: hover) and (pointer: fine) { .door:hover { box-shadow: 4px 5px 0 var(--navy-deep); translate: 0 -2px; } }
.door:focus-visible { outline: 3px solid var(--paper-clip); outline-offset: 3px; }
@media (max-width: 374px) {
  .doors { gap: 8px; }
  .door { gap: 6px; padding-inline: 6px 8px; }
  .door__ico { width: 32px; height: 32px; font-size: 20px; }
  .door__title { font-size: 24px; }
  html[lang="en"] .door__title { font-size: 16px; }
  .door__sub { font-size: 11.5px; }
}
@media (max-width: 1023px) { .doors { margin: 6px 0 10px; } .door { min-height: 60px; } }
@media (forced-colors: active) { .door { border: 2px solid CanvasText; } }

/* desktop spread: the doors head the inside page (the column beside the cover), as two tall poster tickets */
@media (min-width: 1024px) {
  .doors { grid-column: 2; grid-row: 1; margin: 0 0 24px; gap: 16px; }
  main.spread { grid-template-rows: auto auto auto 1fr; }
  .cover--issue { grid-row: 1 / span 2; }
  .under-board { grid-row: 3; }
  .side { grid-row: 2 / span 3; }
  .reveal { grid-row: 4; }
  .door { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; min-height: 168px; padding: 16px 16px 14px; box-shadow: 5px 5px 0 var(--navy-deep); }
  html[dir="rtl"] .door { padding: 16px 16px 14px; }
  .door::after { bottom: auto; inset-inline: 10px; top: 84px; border-inline-end: 0; border-top: 2px dashed currentColor; opacity: .25; }
  .door__ico { width: 56px; height: 56px; font-size: 34px; margin-bottom: auto; }
  .door__title { font-size: 40px; }
  html[lang="en"] .door__title { font-size: 25px; }
  .door__sub { font-size: 14px; }
  .door__stamp { top: 14px; inset-inline-end: 14px; font-size: 13px; padding: 1px 8px; }
  .doors { margin-top: 10px; }
}
/* the Versus poster closes the newsstand (games/retro/vs-poster.js + vs-poster.css) */
#versusHome { margin-top: 22px; }
/* a player's name in the Arabic UI (app.js pdual): the same component as kit.css .r-dn (SYS-PARTS / SYS-TYPE): English
   line meta 14 (12 in the compact pair), ink-meta, never cut, never broken mid-word; .is-inline = one row, nowrap */
.r-dn { display: inline-flex; flex-direction: column; align-items: inherit; max-width: 100%; vertical-align: middle; line-height: 1.5; }
.r-dn__ar { min-width: 0; }
.r-dn__en { display: block; max-width: 100%; font-family: var(--font-ui, sans-serif); font-weight: var(--fw-meta); font-size: var(--fs-meta); line-height: 1.5; letter-spacing: 0; color: var(--ink-meta);
  unicode-bidi: isolate; overflow-wrap: normal; word-break: normal; hyphens: none; -webkit-text-stroke: 0; text-shadow: none; }
.r-dn.is-sm .r-dn__ar { font-size: var(--fs-name-sm); line-height: 1.25; }
.r-dn.is-sm .r-dn__en { font-size: var(--fs-name-sm-en); }
.r-dn.is-inline { display: inline; }
.r-dn__en.is-inline, .r-dn.is-inline .r-dn__en { display: inline; white-space: nowrap; margin-inline-start: var(--s1); }
.grid td .name:has(.r-dn) { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.grid td.bad .name .r-dn { display: flex; width: 100%; }
.grid td.bad .name .r-dn > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: line-through; text-decoration-thickness: 2px; }
.grid td.bad .name .r-dn > .r-dn__en { text-decoration: none; }
.grid td.bad .name:has(.r-dn) { bottom: 2px; text-decoration: none; }
.grid td.bad .mark:has(~ .name .r-dn) { margin-bottom: 26px; }

/* =====================================================================================================================
   UI/UX SWEEP 2026-11-16 (P1-main; ids are the owner's approval references, .sweep/BRIEF.md). Same tokens, same look:
   sizes, weights, order, states only.
   ===================================================================================================================== */
/* E1: body text 16 px / 1.6 */
body { font-size: 16px; line-height: 1.6; }
/* A7: the issue title is written by retro.js (no static "العدد ١" placeholder): its line is reserved so nothing jumps */
.round-head { min-height: 32px; }
/* and the date / status line under it (empty until app.js + retro.js fill it; with fewer stylesheets in <head> the first
   paint now comes before that) */
.round-meta { min-height: 1.5em; }

/* A2: «إزاي تلعب؟» is a quiet paper button sharing one row with «استسلم»; the board stays the loudest thing.
   .r-giveup is styled here too: end.css (its home) loads after the first tap (A7). */
.under-board { flex-wrap: nowrap; align-items: center; gap: 12px; }
.under-board > * { flex: 0 0 auto; }
.under-board > .btn-quiet { flex: 1 1 auto; }
.under-board > .r-giveup { flex: 0 0 auto; }
.btn-quiet { min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px;
             font: 800 16px/1.3 var(--font-ui); color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 0;
             box-shadow: 2px 2px 0 var(--navy-deep); text-decoration: none; transition: translate var(--t-press, 60ms); }
.btn-quiet:active, .btn-quiet.is-pressed { translate: 1px 1px; box-shadow: 1px 1px 0 var(--navy-deep); }
.r-giveup { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap); padding: 0 10px; margin: 0; border: 0;
            background: transparent; box-shadow: none; cursor: pointer; font: 800 14px/1.3 var(--font-ui); text-decoration: underline; text-underline-offset: 3px; }
.under-board > .r-giveup { color: var(--paper-clip, #FBF7EC); }
.r-giveup.hidden { display: none; }
@media (min-width: 1024px) { .under-board .btn-quiet { min-height: 48px; font-size: 17px; } }

/* A5: cells stay square whatever the name (no tall torn rows): content never sets the row height */
.grid th, .grid td { min-height: 0; }
/* category labels 12.5-13 px; the art gives up room (about half the panel), at most three lines */
.grid th:not(.corner), .grid th.long, .grid th.xlong, html[lang="en"] .grid th:not(.corner) { font-size: clamp(12.5px, 3.8cqi, 16px); line-height: 1.15; }
.grid th:not(.corner) > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; flex: 0 0 auto;
                                padding: 2px 2px 4px; line-height: 1.1; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
/* a single word wider than the band (retro.js fitLabels): one step smaller instead of splitting an Arabic word */
.grid th.panel.tight:not(.corner) { font-size: 11.5px; }
.grid th.panel.tight2:not(.corner) { font-size: 10.5px; }
.grid th.panel.tight3:not(.corner) { font-size: 9.5px; }   /* the 320 px floor only, as before the sweep */
.grid th.panel.tight3:not(.corner) > span { -webkit-line-clamp: 4; line-clamp: 4; }
.grid th .pa { min-height: 24%; }
@media (max-width: 345px) { .grid th .pa { min-height: 16%; } .grid th:not(.corner) > span { padding-bottom: 3px; } }
.grid th .pa > * { margin: 6% 0 4%; }
.grid th.corner small { font-size: var(--fs-meta); }
/* right: the compact name pair (15 / 12), Arabic on up to two lines, the English line whole (wraps at a space, never cut);
   the "N fit" count rides on the tape at the top */
.grid td.ok { padding: 9px 9px 7px; justify-content: center; overflow: visible; }
.grid td.ok .name, .grid td.ok .name:has(.r-dn) { display: block; font: var(--fw-body) var(--fs-name-sm)/1.25 var(--font-ui); max-width: 100%; overflow: hidden; }
.grid td.ok .name:not(:has(.r-dn)), .grid td.ok .r-dn__ar { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.grid td .r-dn { display: flex; flex-direction: column; align-items: center; width: 100%; line-height: 1.25; }
.grid td .r-dn__ar { font-size: var(--fs-name-sm); line-height: 1.25; }
.grid td .r-dn__en, .grid td.ok .r-dn__en { display: block; max-width: 100%; font-size: var(--fs-name-sm-en); line-height: 1.25; white-space: normal; opacity: 1; color: var(--ink-meta); }
.grid td.ok .sub.tape { position: absolute; z-index: 3; top: -9px; left: 50%; margin: 0; transform: translateX(-50%) rotate(-3deg); max-width: 110%;
                        padding: 0 6px; border-radius: 0; background: rgba(244, 210, 31, .94); color: var(--ink); box-shadow: 1px 1px 0 rgba(26,26,26,.35);
                        font: 800 var(--fs-meta)/1.45 var(--font-ui); white-space: nowrap; pointer-events: none; }
/* wrong: the name readable in ink (no strike-through), the "غلط" stamp shrunk to an icon stamp in the corner; the red
   frame and the hatch still say wrong (colour is never the only signal) */
.grid td.bad { padding: 19px 5px 3px; justify-content: flex-start; }
.grid td.bad .mark, html[lang="en"] .grid td.bad .mark { position: absolute; top: 3px; inset-inline-end: 3px; z-index: 2; margin: 0; padding: 0; width: 20px; height: 20px; max-width: none;
  display: grid; place-items: center; font-size: 15px; color: var(--paper-clip); background: var(--c-wrong); border: 2px solid var(--paper-clip); outline: 2px solid var(--c-wrong);
  box-shadow: 1.5px 1.5px 0 var(--ink); transform: rotate(-8deg); }
.grid td.bad .mark::before, html[lang="en"] .grid td.bad .mark::before { content: none; }
.grid td.bad .mark svg { width: 12px; height: 12px; stroke-width: 3.6; }
.grid td.bad .mark:has(~ .name .r-dn) { margin: 0; }
.grid td.bad .name, .grid td.bad .name:has(.r-dn) { position: static; inset: auto; max-width: 100%; color: var(--c-wrong); font: var(--fw-body) var(--fs-name-sm)/1.25 var(--font-ui);
  text-decoration: none; white-space: normal; overflow: hidden; display: block; }
.grid td.bad .name:not(:has(.r-dn)), .grid td.bad .name .r-dn > .r-dn__ar { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  white-space: normal; text-decoration: none; }
.grid td.bad .name .r-dn > span { text-decoration: none; }
.grid td.bad .name .r-dn > .r-dn__en { font-size: var(--fs-name-sm-en); line-height: 1.25; color: var(--ink-meta); opacity: 1; white-space: normal; }
.grid td.bad .name .r-dn > .r-dn__ar { line-height: 1.25; }
/* the smallest phones (cells ~60 px): the Arabic keeps one line in a wrong cell and the clipping frame sits closer */
@media (max-width: 345px) {
  .grid td.ok { padding: 7px 6px 5px; outline-offset: -5px; }
  .grid td.ok .r-dn__ar, .grid td.ok .name:not(:has(.r-dn)) { -webkit-line-clamp: 2; line-clamp: 2; }
  .grid td.bad { padding-top: 17px; }
  .grid td.bad .name .r-dn > .r-dn__ar { -webkit-line-clamp: 1; line-clamp: 1; }
}
/* the revealed answers after the round: same clamps */
.grid td.revealed .name:has(.r-dn) { display: block; overflow: hidden; }
.grid td.revealed .r-dn__ar { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
/* visual system v2 (2026-11-17): a filled cell's name is never clamped or ellipsised: retro.js fitCells steps the name
   pair down to fit the cell instead (SYS-TYPE: never cut, never broken mid-word) */
.grid td .name, .grid td .name:has(.r-dn), .grid td .r-dn__ar, .grid td.ok .name:not(:has(.r-dn)), .grid td.bad .name:not(:has(.r-dn)),
.grid td.bad .name .r-dn > .r-dn__ar, .grid td.revealed .r-dn__ar, .grid td.ok .r-dn__ar, .grid td.ok .name, .grid td.ok .name:has(.r-dn),
.grid td.bad .name, .grid td.bad .name:has(.r-dn), .grid td.revealed .name, .grid td.revealed .name:has(.r-dn) { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; white-space: normal; text-overflow: clip; }
.grid td .r-dn__en, .grid td.ok .r-dn__en, .grid td.bad .name .r-dn > .r-dn__en { white-space: normal; overflow: visible; text-overflow: clip; }
/* (category labels: the pre-sweep sizes and 3-line clamp stay, see the note at the board section) */
@media (max-width: 345px) { .grid th.corner small { font-size: var(--fs-name-sm-en); } }
/* the "N fit" tape on a right cell crosses the top edge by 2 px only, and the name starts under it */
.grid td.ok { padding-top: 16px; }
.grid td.ok .sub.tape { top: -2px; font-size: var(--fs-name-sm-en); }
/* the wrong cell's corner stamp keeps the name clear */
.grid td.bad { padding-top: 24px; }
.grid td.revealed .sub { font-size: var(--fs-name-sm-en); }
/* A6: an empty cell says how many players fit ("٧ ينفعوا" / "7 fit"), not a "No." serial */
.grid td .count { inset-inline: 2px; bottom: 2px; text-align: center; direction: inherit; unicode-bidi: normal; font-size: var(--fs-name-sm-en); font-weight: 800; color: var(--ink-meta);
                  white-space: nowrap; }   /* the compact 12 px: "٥٠ ينفعوا" stays whole in a 64 px cell (never ellipsised) */
.grid td .count::before { content: none; }

/* D3: the archive, newest first, with a divider per month */
.archive-list .arch-month { grid-column: 1 / -1; height: auto; min-height: 30px; background: none; border: 0; box-shadow: none; cursor: default; display: block;
                            padding: 8px 2px 0; border-bottom: 2px solid var(--ink); font: 800 14px/1.5 var(--font-ui); color: var(--ink); text-align: start; }
.archive-list .arch-month:first-child { padding-top: 0; }
.archive-list li .res { font-size: 13px; }

/* D4: switches say their state in words, and the track fills yellow when on */
.tg { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.tg-state { min-width: 44px; text-align: end; font: 800 14px/1.3 var(--font-ui); color: var(--ink-meta); }
.toggle:checked { background: var(--yellow); }
.tg:has(.toggle:checked) .tg-state { color: var(--ink); }

/* E1: secondary labels 14 px (sticker labels 12 px bold); no Lalezar under 20 px */
.round-meta { font-size: 14px; }
.badge { font-size: 12px; }
.stat span, .about-body .kpi span { font-size: 14px; }
.sheet-kicker, .help-kicker, .result-kicker, .reveal .meta, .tryother small, .hx-k { font-size: 14px; }
.more-desc { font-size: 14px; line-height: 1.6; }
@media (min-width: 1024px) { .more-desc { font-size: 14px; } }
.door__sub { font-size: 14px; }
.door__stamp { font-size: 12px; }
@media (max-width: 374px) { .door__sub { font-size: 13px; } }
.r-dn__en { opacity: 1; color: var(--ink-meta); }
/* E6 contrast on the Versus door: the "لايف / Live" stamp is ink on yellow (was red on yellow, 3.35:1); the Arabic title
   stays yellow Lalezar 24-40 px (large text, 3:1 applies); the English title (Cairo 900 16-17 px, not "large") is paper on
   red (about 4.8:1). Door sizes and layout unchanged. */
.door--vs .door__stamp { color: var(--ink); }
html[lang="en"] .door--vs .door__title { color: var(--paper-clip); }

/* visual system v2: the 8 px gutter makes the cells 1.5 px smaller: the label band gives 1 px of its bottom padding */
.grid th:not(.corner) > span { padding-bottom: 3px; }

/* =====================================================================================================================
   HOME v2 (visual sweep, approved H1-H8, 2026-11-17), on the system v2 tokens (TOKENS.md). Last in the file: it settles
   the main page's own parts after the layers above. No new sizes, gaps or colours: tokens only.
   ===================================================================================================================== */

/* ---- H1 (reversed in round 2, H-b: the doors are back ABOVE the board): the two doors as one row of equal paper match tickets; "How to play" a text link ----
   index.html: nav#doors sits after the cover. Phones: a ticket = paper-hi, 2 px ink rule, ink hard shadow, a coloured
   stub at the inline start (navy = solo, the Versus red = versus) with a dashed perforation, the title and one line.
   The rotated "يومي / لايف" stickers go; "Live" moves into the Versus line with its dot. Desktop keeps its tall doors. */
@media (max-width: 1023px) {
  .doors { margin: 0 0 var(--s3); gap: var(--s2); }   /* round 2 (H-b): above the board again, as on live */
  .door, .door--vs, .door--solo { --bg: var(--c-paper-hi); --fg: var(--ink); --ttl: var(--ink); --sub: var(--c-meta);
          min-height: 64px; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) 0; align-items: center;
          border: 2px solid var(--ink); box-shadow: var(--shadow-hard); overflow: hidden; }
  html[dir="rtl"] .door, html[dir="rtl"] .door--vs { padding: var(--s2) 0 var(--s2) var(--s2); }
  .door, html[dir="rtl"] .door { padding-top: var(--s2); }
  .door::before, .door::after { content: none; }
  .door__ico, .door--vs .door__ico { align-self: stretch; width: var(--s6); height: auto; margin-block: calc(-1 * var(--s2)); border: 0; border-radius: 0;
               box-shadow: none; font-size: var(--fs-title); background: var(--navy); color: var(--c-paper-hi);
               border-inline-end: 2px dashed var(--c-paper-hi); }
  .door--vs .door__ico { background: var(--red); }
  .door__ico svg { width: 22px; height: 22px; }
  .door__title, html[lang="en"] .door__title, html[lang="en"] .door--vs .door__title { color: var(--ink); white-space: normal; }
  .door__title { font: 400 var(--fs-title)/1.25 var(--font-display); padding-top: var(--s1); }
  html[lang="en"] .door__title { font: var(--fw-body) var(--fs-body)/1.25 var(--font-ui); padding-top: 0; }
  .door__sub, .door--vs .door__sub { font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--c-meta); }
  .door__stamp { display: none; }
  .door:active { translate: 2px 2px; box-shadow: 1px 1px 0 var(--ink); }
  .door:focus-visible { outline: 3px solid var(--c-paper-hi); outline-offset: 3px; }
  /* under the doors: "how to play" (and, after the first guess, "give up") as quiet text links on the navy */
  .under-board { justify-content: center; gap: var(--s5); margin-top: var(--s3); flex-wrap: wrap; }
  .under-board > .btn-quiet, .under-board > .r-giveup { flex: 0 0 auto; }
  .under-board > .btn-quiet { min-height: var(--tap); padding: 0 var(--s2); background: none; border: 0; box-shadow: none; color: var(--c-paper-hi);
                              font: var(--fw-body) var(--fs-meta)/1.5 var(--font-ui); text-decoration: underline; text-underline-offset: 3px; }
}
.door__live { display: inline-block; width: var(--s2); height: var(--s2); border-radius: 50%; background: var(--red); margin-inline-end: var(--s1); vertical-align: 1px;
              animation: vs-live 1.6s ease-in-out infinite; }
@keyframes vs-live { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .door__live { animation: none; } }
@media (min-width: 1024px) { .door__live { display: none; } }

/* ---- H2: quiet empty cells: a flat paper-lo slot, a thin solid rule, the navy ringed "+" (round 2), the count ---- */
.grid td:not(.ok):not(.bad):not(.revealed) { border: 1px solid var(--card-rule); background: var(--c-paper-lo); }
/* round 2 (owner H-a, Q1): the OLD ringed "+" is back, in navy (--c-tap, the "tap here" outline), never red; the old
   ring size (42 % of the cell, 28-54 px), the "+" at the title size, centred on the ring by its ink */
.grid td .plus { display: grid; place-items: center; width: clamp(28px, 42cqi, 54px); aspect-ratio: 1; border: 2.5px solid var(--c-tap); border-radius: 50%;
                 color: var(--c-tap); font: 400 var(--fs-title)/1 var(--font-display); padding-top: .16em; box-sizing: border-box; transition: transform 120ms; }
.grid td:not(.ok):not(.bad):not(.revealed):active .plus, .grid td.is-pressed:not(.ok):not(.bad):not(.revealed) .plus { background: none; transform: scale(.88) rotate(-10deg); }
.grid td:not(.ok):not(.bad):not(.revealed):active { background: var(--c-paper-hi); }
@media (hover: hover) { .grid td:not(.ok):not(.bad):not(.revealed):hover .plus { background: none; transform: rotate(-8deg); } }
.grid td .count { color: var(--c-meta); }

/* ---- H3: calmer paper: the sheets' grain at the token, the category halftone at 60 % (SYS-DECOR) ---- */
.sheet-box::after { opacity: var(--grain-opacity); }
.grid th:not(.corner)::before { opacity: .6; }

/* ---- H5: the archive as a back-issue shelf ---- */
#stats.statrow { gap: 0; margin: 0 0 var(--s3); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
#stats .stat, #stats .stat:nth-child(2) { border: 0; background: none; color: var(--ink); padding: var(--s1) var(--s1); }
#stats .stat:nth-child(2) { border-inline: 1px solid var(--card-rule); }
#stats .stat b { font: var(--fw-body) var(--fs-title)/1.5 var(--font-ui); padding-top: 0; }
#stats .stat span { font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--c-meta); }
#stats.is-zero { display: block; padding: var(--s2) 0; }
#stats.is-zero > .stat { display: none; }
#stats.is-zero::before { content: attr(data-empty); display: block; font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--c-meta); text-align: start; }
.archive-list li.arch-issue { background: transparent; border: 1px solid var(--card-rule); box-shadow: none; }
.archive-list li.arch-issue .num { color: var(--c-meta); }
.archive-list li.arch-issue.started, .archive-list li.arch-issue.done { background: var(--c-paper-hi); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.archive-list li.arch-issue.perfect { background: var(--c-note); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.archive-list li.arch-issue.started .num, .archive-list li.arch-issue.done .num, .archive-list li.arch-issue.perfect .num { color: var(--ink); }
.archive-list li.arch-issue.current { outline: 0; border: 3px solid var(--ink); background: var(--c-paper-hi); }
.archive-list li.arch-issue.current .num { color: var(--ink); }
.archive-list li.arch-issue .res { color: var(--c-meta); font: var(--fw-meta) var(--fs-name-sm-en)/1.25 var(--font-ui); }

/* ---- H-d (round 2, owner 2026-11-18; replaces H8): the newsstand in its OLD layout (two columns of small covers: the
   poster with its page disc, the name, the short line, a "Play" ticket) in the NEW colours, grouped (FEEDBACK_1 Q2):
   app.js renders the four catalog.js HAREEF_GROUPS in list order, each under its heading (li.more-gh, the full row), and
   every poster of a group in the group's one colour (--grp-*), so a group's covers always sit together and never beside
   another group's. The same groups, order and colours as the contents page (games/index.html) and the games sheet
   (retro/switcher.*). Card: paper-hi, ink rule, ink hard shadow; page disc paper-hi + ink (as on the contents page);
   "Play" = a small navy-deep ticket (the old red one: red is wrong only); a finished game: lime frame + tick seal on the
   poster corner + "see your result" on paper. ---- */
.more-list li[data-grp="grid"]   { --grp-c: var(--grp-grid);   --grp-ink: var(--c-paper-hi); }
.more-list li[data-grp="who"]    { --grp-c: var(--grp-who);    --grp-ink: var(--c-paper-hi); }
.more-list li[data-grp="career"] { --grp-c: var(--grp-career); --grp-ink: var(--c-ink); }
.more-list li[data-grp="mates"]  { --grp-c: var(--grp-mates);  --grp-ink: var(--c-paper-hi); }
.more-list li[data-grp="quick"]  { --grp-c: var(--grp-quick);  --grp-ink: var(--c-ink); }
.more-kicker { transform: none; }
.more-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s3); }
.more-list li { counter-increment: none; }
.more-gh { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.more-gh:first-child { margin-top: 0; }
/* the heading: a paper-hi tab (ink rule) holding the group's colour swatch and its name, then a paper rule across the
   navy (the navy "Who is he?" swatch must read on the navy page, so the swatch sits on paper) */
.more-gh::after { content: ""; flex: 1 1 auto; border-top: 2px solid var(--c-paper-hi); }
.more-gh h3 { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; flex: 0 1 auto; min-height: var(--s6); box-sizing: border-box; padding: 0 var(--s2);
              background: var(--c-paper-hi); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); color: var(--ink); font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); }
.more-gh h3::before { content: ""; flex: 0 0 auto; box-sizing: border-box; width: var(--s4); height: var(--s4); background: var(--grp-c); border: 2px solid var(--ink); }
.more-card, .more-list li .more-card { display: flex; flex-direction: column; align-items: stretch; gap: var(--s1); height: 100%; min-height: 0; box-sizing: border-box;
             padding: var(--s2) var(--s2) var(--s3); background: var(--c-paper-hi); border: 2px solid var(--ink); box-shadow: var(--shadow-hard); color: var(--ink); }
.more-card::before, .more-card::after { content: none; display: none; }
.more-art { position: relative; display: block; }
.more-card .g-poster, .more-art .g-poster { display: grid; width: 100%; aspect-ratio: 16 / 9; margin: 0; background: var(--grp-c); color: var(--grp-ink); }
.more-page { position: absolute; z-index: 1; top: var(--s1); inset-inline-start: var(--s1); display: grid; place-items: center; box-sizing: border-box; width: var(--s5); aspect-ratio: 1;
             border-radius: 50%; background: var(--c-paper-hi); color: var(--ink); border: 2px solid var(--ink); font: 800 var(--fs-meta)/1 var(--font-ui); }
.more-list li .more-card .more-name { font: 400 var(--fs-title)/1.25 var(--font-display); padding: var(--s1) 0 0; color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; }
html[lang="en"] .more-list li .more-card .more-name { font: var(--fw-body) var(--fs-body)/1.5 var(--font-ui); padding: 0; }
.more-desc, .more-list li .more-card .more-desc { flex: 1 1 auto; font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--c-meta); padding: 0; }
.more-go, html[lang="en"] .more-go { align-self: flex-start; display: inline-flex; align-items: center; box-sizing: border-box; width: auto; height: auto; min-height: var(--s6); margin: auto 0 0;
           padding: 0 var(--s3); overflow: visible; transform: none; background: var(--c-action); color: var(--c-action-ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
           font: var(--fw-body) var(--fs-meta)/1.5 var(--font-ui); white-space: nowrap; }
.more-card.is-done .more-go { background: var(--c-paper-hi); color: var(--ink); }
.more-card.is-done { outline: 3px solid var(--c-right); outline-offset: -6px; }
.more-tick { position: absolute; z-index: 1; top: var(--s1); inset-inline-end: var(--s1); width: var(--s5); box-shadow: none; }
.more-card:active, .more-card.is-pressed { translate: 2px 2px; box-shadow: 1px 1px 0 var(--ink); }
@media (hover: hover) and (pointer: fine) { .more-card:hover { transform: none; translate: 0 -2px; box-shadow: 4px 5px 0 var(--ink); } }
/* the desktop inside page is paper: the headings' rule in ink there */
@media (min-width: 1024px) { .more-gh::after { border-top-color: var(--ink); } }

/* ---- the board on phones (home v2): category labels at the system sizes only (meta 14, the compact 12 when a word or the
   label does not fit: retro.js fitLabel), never clamped; names in the cells never under 12 (retro.js fitCells). The room
   for that: rows are a MINIMUM height (88 px: two Arabic lines at 15 + two English lines at 12 under the tape; square
   when the cell is wider than that) instead of a fixed square; the art keeps a 32 px minimum and gives the rest to the
   label band; a right cell's lime frame sits 3 px in and its name 5 px from the edge (a 320 px cell's line was 48 px
   wide, now 56). A label or a name that still needs more makes its row taller rather than being cut. Desktop keeps its
   square cells. ---- */
.grid th:not(.corner), .grid th.long, .grid th.xlong, html[lang="en"] .grid th:not(.corner) { font: var(--fw-body) var(--fs-meta)/1.25 var(--font-ui); }
.grid th.panel.tight:not(.corner) { font-size: var(--fs-name-sm-en); }
/* the one exception (retro.js fitLabel): a single word wider than the whole band at 12 px ("international", "البوندسليجا"
   in a 320 px phone's 66 px column) steps to 11, then 10, only that label, so the word stays whole */
.grid th.panel.tight2:not(.corner) { font-size: 11px; }
.grid th.panel.tight3:not(.corner) { font-size: 10px; }
/* the frame is an inset ring (not a border), so the ink label band runs the panel's full width: +4 px for every line */
.grid th:not(.corner) { border: 0; box-shadow: inset 0 0 0 2px var(--ink); }
.grid th:not(.corner) > span, .grid th.panel.tight3:not(.corner) > span { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; padding: 2px 0 3px; line-height: 1.25; }
@media (max-width: 1023px) {
  .grid th, .grid td { aspect-ratio: auto; min-height: max(calc((100cqi - 3 * var(--gutter)) / 4), 88px); }
  .grid th .pa { min-height: var(--s6); }
  .grid td.ok { padding: var(--s4) 5px 5px; outline-offset: -3px; }
  .grid td.bad { padding-inline: 5px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .grid th, .grid td { aspect-ratio: auto; min-height: calc((100cqi - 3 * var(--gutter)) / 4 * .75); }
}
.door__sub .nw { white-space: nowrap; }
/* a name in a cell wraps only at a space or hyphen (body has overflow-wrap: break-word, which split "Cristian / o"):
   a word too wide for the cell is stepped down by retro.js fitCells instead */
.grid td .name, .grid td .name .r-dn__ar, .grid td .name .r-dn__en { overflow-wrap: normal; word-break: normal; }
.grid td .name .r-dn__ar { max-width: 100%; }
/* H1/H4 on the desktop spread: the doors keep their place and height (the inside page's head) but become the same paper
   tickets as on phones: paper-hi, ink rule, ink shadow, the glyph on a navy (solo) or Versus-red stub disc, ink title,
   no rotated stickers, "Live" in the Versus line with its dot (yellow stays the attempts sticker only) */
@media (min-width: 1024px) {
  .door, .door--vs, .door--solo { --bg: var(--c-paper-hi); --fg: var(--ink); --ttl: var(--ink); --sub: var(--c-meta); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
  .door::before { content: none; }
  .door::after { color: var(--ink); }
  .door__ico, .door--vs .door__ico { background: var(--navy); color: var(--c-paper-hi); border-color: var(--ink); }
  .door--vs .door__ico { background: var(--red); }
  .door__title, html[lang="en"] .door__title, html[lang="en"] .door--vs .door__title { color: var(--ink); }
  .door__sub, .door--vs .door__sub { color: var(--c-meta); font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); }
  .door__stamp { display: none; }
  .door__live { display: inline-block; }
  .grid th:not(.corner) > span { padding-inline: 2px; }
}
/* the attempts sticker in a 66 px corner (320 px phones): the figure sits on a 1.0 line so the word under it stays where
   the disc is widest */
@media (max-width: 345px) { .grid th.corner b { line-height: 1; padding-top: var(--s1); } }

/* =====================================================================================================
   round 2 (owner 2026-11-18, U1): THE yellow sticker
   ===================================================================================================== */
/* ---- (copy of games/retro/kit.css; the end screen's streak sticker uses it here) THE yellow sticker (round 2, owner 2026-11-18, U1): ONE component for attempts, streak ("يوم ورا بعض"), "N محاولة",
   lives and the timer, in every game, the end screen and the help sheets. Markup: <div class="r-sticker">[<small>top</small>]
   <b>N</b><small>label</small></div>. The disc is --st wide (--sticker 72 on phones, .is-lg = --sticker-lg 84; desktop 84 /
   96); everything inside scales with it: the number is Lalezar at .48 x --st (34 px at 72), the label Cairo 800 at .18 x --st
   (13 px); the number + label block is centred on the disc by its INK, not its line boxes: Lalezar's digits ride .09 em
   high in their line box and Cairo's Arabic sits .15 em low (measured from the font files), so both are nudged back. kit.js
   fitSticker() keeps the label inside the disc: it steps the label down to 11 px and lets it take two lines, hides a top
   label ("فاضل") that does not fit, and only then steps the number down (never under 24 px). A game sets position only. ---- */
.r-sticker { --st: var(--sticker); position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--st) * .05);
             box-sizing: border-box; width: var(--st); height: var(--st); min-width: var(--st); aspect-ratio: 1; flex: 0 0 auto; padding: 0; margin: 0; border-radius: 50%;
             background: var(--c-note); color: var(--c-ink); border: 2.5px solid var(--c-ink); box-shadow: 3px 3px 0 var(--c-ink); transform: rotate(-6deg);
             text-align: center; line-height: 1; overflow: visible; white-space: normal; }
.r-sticker.is-lg { --st: var(--sticker-lg); }
.r-sticker > b { display: block; margin: 0; padding: 0; font: 400 calc(var(--st) * .48)/.64 var(--font-display); translate: 0 .09em; white-space: nowrap; color: var(--c-ink);
                 direction: ltr; unicode-bidi: isolate; -webkit-text-stroke: 0; text-shadow: none; }
.r-sticker > small { display: block; box-sizing: border-box; width: max-content; max-width: calc(var(--st) * .8); margin: 0; padding: 0; font: 800 calc(var(--st) * .18)/1.1 var(--font-ui);
                     color: var(--c-ink); white-space: normal; text-wrap: balance; overflow-wrap: normal; word-break: normal; text-align: center; letter-spacing: 0; }
html[lang="ar"] .r-sticker > small { translate: 0 -.15em; }
.r-sticker > small:empty, .r-sticker > small.is-cut { display: none; }
@media (min-width: 1024px) { .r-sticker { --st: var(--sticker-lg); } .r-sticker.is-lg { --st: 96px; } }
/* the board's attempts sticker ("٩ محاولة", H-c): the same component's proportions on the corner cell's disc (the ::before,
   border-box, min(90% of the cell, 120 px): the old content-box disc + its 3 px rim and shadow ran 6 px past the cell and the
   card cut it): number Lalezar .48 x the disc, label Cairo 800 .18 x the disc (never under 11 px), the pair
   centred on the disc by its ink (Lalezar digits ride .09 em high, Arabic Cairo sits .15 em low in their line boxes) */
.grid th.corner { gap: var(--s1); }
.grid th.corner::before { box-sizing: border-box; width: min(90%, 120px); }
.grid th.corner b { font: 400 calc(min(90cqi, 120px) * .48)/.64 var(--font-display); padding: 0; translate: 0 .09em; white-space: nowrap; }
.grid th.corner small { font: 800 max(11px, calc(min(90cqi, 120px) * .18))/1.1 var(--font-ui); max-width: calc(min(90cqi, 120px) * .8); text-align: center; text-wrap: balance; }
html[lang="ar"] .grid th.corner small { translate: 0 -.15em; }

/* live rarity (app.js, live since 2026-11-18): the "14% picked him" line rides on the right cell's yellow tape (the
   tape that says "N fit" without rarity: same compact 12 px, nowrap) and waits empty for the server (<= 1.5 s); on a
   narrow phone the English " him" is dropped (.rr-x). The help sheet's points-and-levels part: tokens only. */
.grid td.ok .sub.rr:empty { visibility: hidden; }
@media (max-width: 409px) { .grid td.ok .sub.rr .rr-x { display: none; } }   /* v2 cells (8 px gutter): "44% picked him" fits from 410 px */
/* the smallest phones (cells ~65 px): «٩٣٪ اختاروه» keeps inside its cell with the meta weight (700) and 2 px tape ends */
@media (max-width: 345px) { .grid td.ok .sub.rr { padding-inline: 2px; font-weight: var(--fw-meta); } }
.rarity-help p { margin: 0 0 var(--s2); font: var(--fw-meta) var(--fs-meta)/var(--lh-text) var(--font-ui); }
.rarity-help p b { font-weight: var(--fw-body); font-size: var(--fs-body); }
.rarity-help .rh-levels { list-style: none; margin: var(--s1) 0 var(--s2); padding: 0; display: grid; gap: var(--s1); }
.rarity-help .rh-levels li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; column-gap: var(--s3); padding: var(--s1) var(--s3);
                             background: var(--c-paper-hi); border: 2px solid var(--ink); font: var(--fw-body) var(--fs-meta)/1.5 var(--font-ui); }
.rarity-help .rh-levels li span { font-weight: var(--fw-meta); color: var(--c-meta); }

/* =====================================================================================================================
   ROUND 3: THE HOME / GRID PAGE (owner 2026-11-19, from the external FTUX review, .sweep/visual/ROUND3.md). The page
   now looks mostly like the reviewer's mock: a calm flat blue (R3-12, --c-page), clean rounded flat cards, coloured
   category tiles, plain dashed empty squares, one progress strip, a cream rounded sheet, the red "not quite" line and a
   "More ways to play" swipe row. Kept from ours: the حريف wordmark, Lalezar for the issue title / score / verdict, the
   blue tilted issue stamp, the navy "+" disc, Eastern digits, the dual names, red = wrong only, Egyptian copy.
   Last in the file: it settles the page after every layer above. (This file is the main page's only: game pages keep
   their own look this round; they share only the background tokens.)
   ===================================================================================================================== */
:root { --r3-card: rgba(251, 247, 236, .08); --r3-line: rgba(251, 247, 236, .3); --r3-soft: rgba(251, 247, 236, .78); --r3-rad: 14px; }

/* ---- the top bar: the wordmark, then the games menu and the language (R3-1 / R3-2: no calendar, no "?") ---- */
.topbar-inner { height: 60px; }
.topbar .masthead { font-size: 36px; -webkit-text-stroke-width: 5px; text-shadow: 2px 2px 0 var(--navy-deep); transform: rotate(-3deg); padding-top: 6px; }
.topbar .btn-round, .topbar .btn-round.pill { border: 0; border-radius: 12px; background: var(--r3-card); color: var(--c-paper-hi); box-shadow: none; }
/* round 5 (ROUND5.md 50/50): the games menu is the yellow pill again (as in every game), rounded, ink rim, navy drop */
.topbar .btn-round.games.has-label, .topbar .btn-round.games[data-hareef-games="icon"] {
  border: 2px solid var(--ink); border-radius: 12px; background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 var(--navy-deep); }
.topbar .btn-round.games.has-label:active, .topbar .btn-round.games[data-hareef-games="icon"]:active { transform: none; translate: 0 1px; background: var(--yellow); box-shadow: 0 2px 0 var(--navy-deep); }
@media (hover: hover) { .topbar .btn-round:hover { background: rgba(251, 247, 236, .16); } .topbar .btn-round.games.has-label:hover, .topbar .btn-round.games[data-hareef-games="icon"]:hover { background: #F8DE4E; } }
@media (max-width: 349px) { .topbar .btn-round.games.has-label, .topbar .btn-round.games[data-hareef-games="icon"] { border-radius: 12px; } }

/* ---- R3-3: Versus as ONE slim ticket above the board (the Solo door is gone).
   round 6 (owner 2026-11-20, K5: "too calm, too software"): the strip is the red Versus card of the "more ways to play"
   row laid flat: red fill, 2 px ink rim + the small hard drop, the yellow tile with the ink faces, the title in Lalezar
   (Arabic), cream type (K9, owner 2026-11-21: no "Live" tag) ---- */
.vs-ticket { display: flex; align-items: center; gap: var(--s3); min-height: 64px; margin: var(--s1) 0 var(--s3); padding: var(--s2) var(--s3) var(--s2) var(--s2);
             border: 2px solid var(--ink); border-radius: 14px; background: var(--red-kit, #C8202A); color: var(--c-paper-hi); box-shadow: 0 3px 0 var(--ink);
             text-decoration: none; transition: translate var(--t-press, 60ms); }
html[dir="rtl"] .vs-ticket { padding: var(--s2) var(--s2) var(--s2) var(--s3); }
.vs-ticket__ico { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 10px; background: var(--c-note); color: var(--c-ink); }
.vs-ticket__ico svg { width: 26px; height: 26px; }
.vs-ticket__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.vs-ticket__title { font: 400 22px/1.35 var(--font-display); padding-top: 3px; }
html[lang="en"] .vs-ticket__title { font: var(--fw-body) var(--fs-body)/1.35 var(--font-ui); padding-top: 0; }
.vs-ticket__sub { font: var(--fw-meta) var(--fs-meta)/1.4 var(--font-ui); color: var(--c-paper-hi); }
.vs-ticket__live { flex: 0 0 auto; display: inline-flex; align-items: center; gap: var(--s1); padding: 0 var(--s2); border-radius: 999px; background: var(--navy-deep);
                   color: var(--c-paper-hi); font: var(--fw-body) var(--fs-name-sm-en)/1.8 var(--font-ui); }
.vs-ticket__live i, .rail-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-note); animation: vs-live 1.6s ease-in-out infinite; }
.vs-ticket__go { flex: 0 0 auto; width: 16px; height: 16px; color: var(--c-paper-hi); }
html[dir="ltr"] .vs-ticket__go { transform: scaleX(-1); }
.vs-ticket:active, .vs-ticket.is-pressed { translate: 0 2px; box-shadow: 0 1px 0 var(--ink); }
@media (hover: hover) { .vs-ticket:hover { background: #D7262E; } }
.vs-ticket:focus-visible { outline: 3px solid var(--c-note); outline-offset: 2px; }
@media (max-width: 359px) { .vs-ticket__live { display: none; } }
@media (prefers-reduced-motion: reduce) { .vs-ticket__live i, .rail-live i { animation: none; } }

/* ---- the board sits on the page itself (no paper cover) ---- */
.cover.cover--issue { background: none; padding: 0; border-radius: 0; box-shadow: none; outline: 0; }
.cover.cover--issue::after { content: none; }
.cover--issue > .cover__rule { padding: 0; overflow: visible; }

/* the dateline: < [العدد ١٠٥ (stamp) / the date  v] >; the title is the archive button (R3-1).
   round 6 (owner 2026-11-20, ROUND6.md K2): the whole dateline sits in ONE egg-white strip like the cards (as in every
   game, kit.css .r-calm .r-issue): paper-clip, ink type, rounded, 2 px ink rim + the small hard drop; arrows paper-lo */
.issue-strip { border: 2px solid var(--ink); border-radius: 14px; background: var(--paper-clip); box-shadow: 0 3px 0 var(--ink);
               padding: var(--s1); margin: 0 0 var(--s3); gap: var(--s2); align-items: center; }
.roundnav { width: var(--tap); height: var(--tap); border-radius: 10px; background: var(--c-paper-lo); color: var(--c-ink); font-size: 18px; }
.roundnav:disabled { opacity: .35; }
.round-title { display: flex; flex-direction: column; align-items: center; gap: 0; min-height: var(--tap); padding: 0 var(--s2); border: 0; border-radius: 10px; background: none;
               color: var(--c-ink); font: inherit; cursor: pointer; }
.round-title:focus-visible { outline: 3px solid var(--c-note); outline-offset: 2px; }
@media (hover: hover) { .round-title:hover { background: rgba(26, 26, 26, .06); } .roundnav:not(:disabled):hover { background: #fff; } }
.round-head { min-height: 0; gap: var(--s2); }
.issue-title { font: 400 var(--fs-title)/1.4 var(--font-display); padding-top: 4px; color: var(--c-ink); }
.round-meta { color: var(--c-meta); align-items: center; gap: 0 var(--s1); }
.round-more { width: 12px; height: 12px; transform: rotate(-90deg); color: var(--c-meta); margin-inline-start: var(--s1); }
.modetag { box-shadow: none; }

/* R3-5: the ONE progress strip ("٠/٩ صح" | nine dots, "٩ محاولات فاضلة") */
.gstrip { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: var(--dock-h); margin: 0 0 var(--s2); padding: 2px var(--s4);
          border-radius: var(--r3-rad); background: var(--r3-card); color: var(--c-paper-hi); }
.gstrip__score { display: inline-flex; align-items: baseline; gap: var(--s2); white-space: nowrap; }
.gstrip__score b { font: 400 var(--fs-title)/1.3 var(--font-display); padding-top: 3px; unicode-bidi: isolate; }
.gstrip__score span { font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--r3-soft); }
.gstrip__left { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.gstrip__dots { display: flex; gap: 4px; direction: ltr; }
html[dir="rtl"] .gstrip__dots { direction: rtl; }
.gstrip__dots i { width: 10px; height: 10px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--r3-line); }
.gstrip__dots i.on { background: var(--c-note); border-color: var(--c-note); }
.gstrip__left small { font: var(--fw-meta) var(--fs-name-sm-en)/1.4 var(--font-ui); color: var(--r3-soft); white-space: nowrap; }
.gstrip.is-over .gstrip__dots { display: none; }

/* the board: coloured flat tiles, dashed empty squares, the navy "+" disc */
/* owner 2026-11-19: no box behind the categories (crest + light name straight on the blue); the guesses sticker sits in
   the shared corner; the progress strip is gone */
#progress.gstrip { display: none; }
.grid th:not(.corner) { background: transparent; border: 0; border-radius: var(--r3-rad); box-shadow: none; overflow: visible; color: var(--c-paper-hi); }
.grid th:not(.corner)::before { content: none; }
.grid th:not(.corner) > span, .grid th[data-band="yellow"] > span { background: none; color: var(--c-paper-hi); padding: 0 0 5px; }   /* no side padding: retro.js fitLabel measures words against the band */
.grid th[data-tone="dark"] > span { color: var(--c-paper-hi); }
.grid th .pa { padding-top: var(--s1); }
.pa-ico { filter: none; }
.pa-ico::before { background: var(--fill, #FBF7EC); }
.pa-pic { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.pa-roundel { border: 0; box-shadow: none; }
.grid td { border-radius: var(--r3-rad); }
.grid td:not(.ok):not(.bad):not(.revealed) { background: rgba(251, 247, 236, .04); border: 1.5px dashed var(--r3-line); }
/* round 6 (owner 2026-11-21, K11): the "+" alone in the dashed cell, no navy disc: light, a size up so it still reads */
.grid td .plus { width: clamp(28px, 34cqi, 40px); border: 0; background: none; color: var(--c-on); font: 400 clamp(30px, 30cqi, 40px)/1 var(--font-display); padding-top: .16em; }
.grid td:not(.ok):not(.bad):not(.revealed):active, .grid td.is-pressed:not(.ok):not(.bad):not(.revealed) { background: rgba(251, 247, 236, .12); }
.grid td:not(.ok):not(.bad):not(.revealed):active .plus, .grid td.is-pressed:not(.ok):not(.bad):not(.revealed) .plus { background: none; transform: scale(.9); }
@media (hover: hover) { .grid td:not(.ok):not(.bad):not(.revealed):hover { background: rgba(251, 247, 236, .1); }
                        .grid td:not(.ok):not(.bad):not(.revealed):hover .plus { background: none; transform: none; } }
/* right: a cream card, the name pair in ink, a small lime tick disc in its corner; live rarity as a quiet line under the name */
.grid td.ok { background: var(--c-paper-hi); outline: 0; box-shadow: 0 2px 0 rgba(0, 0, 0, .22); padding: 22px 5px 6px; }
.grid td.ok::after { content: ""; position: absolute; z-index: 2; top: 4px; inset-inline-end: 4px; width: 16px; height: 16px; border-radius: 50%; border: 0; box-shadow: none;
  background: var(--c-right) var(--tick) center / 72% no-repeat; }
.grid td.ok .sub.tape { position: static; transform: none; margin: 2px 0 0; padding: 0; background: none; box-shadow: none; color: var(--c-meta);
                        font: var(--fw-meta) var(--fs-name-sm-en)/1.3 var(--font-ui); white-space: nowrap; max-width: 100%; }
/* wrong: a dark card with a red rim and a small red cross disc; the name readable in paper */
.grid td.bad { background: rgba(13, 18, 56, .45); border: 2px solid var(--red); padding-top: 22px; }
.grid td.bad .mark, html[lang="en"] .grid td.bad .mark { top: 4px; inset-inline-end: 4px; width: 16px; height: 16px; border: 0; outline: 0; border-radius: 50%; box-shadow: none; transform: none;
  background: var(--red); color: var(--c-paper-hi); }
.grid td.bad .mark svg { width: 10px; height: 10px; }
.grid td.bad .name, .grid td.bad .name:has(.r-dn) { color: var(--c-paper-hi); }
.grid td.bad .name .r-dn > .r-dn__en { color: var(--r3-soft); }
/* after the round: the best-known answer, quiet, on the dashed square */
.grid td.revealed { background: rgba(251, 247, 236, .06); border: 1.5px dashed var(--r3-line); }
.grid td.revealed .name { color: var(--c-paper-hi); }
.grid td.revealed .r-dn__en { color: var(--r3-soft); }
.grid td.revealed .sub { background: none; color: var(--r3-soft); padding: 0; }
/* R3-7: the square being answered lights up with its row and column tiles; the rest of the board steps back */
.grid th, .grid td { transition: opacity 120ms; }
.grid.is-picking th:not(.corner):not(.is-hl), .grid.is-picking td:not(.is-pick) { opacity: .38; }
.grid th.is-hl { box-shadow: inset 0 0 0 3px var(--c-note); }
.grid td.is-pick, .grid td.is-pick:not(.ok):not(.bad):not(.revealed) { background: var(--c-note); border: 2px solid var(--c-note); }
.grid td.is-pick .plus { background: none; color: var(--c-ink); }
/* the board column needs room for the tiles' 2 px drop */
.board { padding-bottom: 2px; }

/* ---- R3-8: the "not quite" line under the board after a wrong guess ---- */
.wrong-line { display: flex; align-items: flex-start; gap: var(--s2); margin: var(--s3) 0 0; padding: var(--s2) var(--s3); border-radius: var(--r3-rad);
              background: var(--red-kit, #C8202A); color: var(--c-paper-hi); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); }
.wrong-line[hidden] { display: none; }
.wl-mark { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--c-paper-hi); color: var(--red-kit, #C8202A); }
.wl-mark svg { width: 12px; height: 12px; }
.wl-t { min-width: 0; }
.wl-k { font-weight: var(--fw-body); }
.wl-en { white-space: nowrap; opacity: .9; }
@media (prefers-reduced-motion: no-preference) { .wrong-line:not([hidden]) { animation: fade 180ms ease-out; } }

/* ---- under the board: one outlined "How to play" (R3-2), "Give up" after the first guess (R3-6) ---- */
.under-board, .under-board:has(> .r-giveup) { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: var(--s3); margin: var(--s3) 0 0; }
.under-board > .btn-quiet { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s4);
  border: 1.5px solid rgba(251, 247, 236, .5); border-radius: var(--r3-rad); background: none; box-shadow: none; color: var(--c-paper-hi);
  font: var(--fw-body) 16px/1.4 var(--font-ui); text-decoration: none; }
.under-board > .btn-quiet:active, .under-board > .btn-quiet.is-pressed { translate: 0 1px; background: var(--r3-card); box-shadow: none; }
@media (hover: hover) { .under-board > .btn-quiet:hover { background: var(--r3-card); } }
.q-ico { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; font: 900 13px/1 var(--font-ui); }
.q-ico::before { content: "\061F"; }
html[lang="en"] .q-ico::before { content: "?"; }
.under-board > .r-giveup { flex: 0 0 auto; color: var(--c-paper-hi); }

/* ---- R3-11: "More ways to play": one swipe row of flat cards ---- */
.more { margin-top: var(--s6); }
.more-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s2); padding: 0; border: 0; }
/* round 6 (owner 2026-11-20, K6): the heading is bigger: Lalezar title size in cream (English: Cairo 800 at the title size) */
.more-head h2 { margin: 0; font: 400 28px/1.3 var(--font-display); padding-top: 3px; color: var(--c-on); letter-spacing: 0; text-transform: none; }
html[lang="en"] .more-head h2 { font: var(--fw-body) 22px/1.3 var(--font-ui); padding-top: 0; }
.more-all, .more-head .more-all { color: var(--c-paper-hi); font: var(--fw-body) 16px/1.5 var(--font-ui); }
.more-rail { list-style: none; margin: 0 calc(-1 * max(10px, var(--il))); padding: 2px max(10px, var(--il)) var(--s4); display: flex; gap: var(--s3);
             overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: max(10px, var(--il));
             scrollbar-width: thin; scrollbar-color: rgba(251, 247, 236, .3) transparent; -webkit-overflow-scrolling: touch; }
.more-rail.is-drag { scroll-snap-type: none; cursor: grabbing; }
.more-rail.is-drag a { pointer-events: none; }
.rail-item { flex: 0 0 auto; width: min(78%, 300px); scroll-snap-align: start; display: flex; }
.rail-item[data-grp="who"]    { --grp-c: var(--grp-who);    --grp-ink: var(--c-paper-hi); }
.rail-item[data-grp="career"] { --grp-c: var(--grp-career); --grp-ink: var(--c-ink); }
.rail-item[data-grp="mates"]  { --grp-c: var(--grp-mates);  --grp-ink: var(--c-paper-hi); }
.rail-item[data-grp="quick"]  { --grp-c: var(--grp-quick);  --grp-ink: var(--c-ink); }
/* round 6 (owner 2026-11-20, K8 = option 3 "colour cover, egg-white label", WIDE): each card (about 78 % of a phone, the
   next one peeks) is its catalog group's deep press ink (K12: --cov-who / career / mates / quick tokens) with the halftone, the glyph in a big tilted ringed stamp, and an
   egg-white label (ink rim + small drop) at the foot: the Lalezar name, the one line, and a red "العب / Play" pill (a game
   finished today: the lime tick on the cover and a green "نتيجتك / Your result" pill). Versus: the red cover, the yellow
   face disc, a yellow pill (K9: no "Live" tag). The home grid above is untouched. */
.rail-card { --cv: var(--cov-grid); --cv-ink: var(--cov-ink); position: relative; flex: 1 1 auto; display: flex; flex-direction: column; gap: 0; min-height: 0; padding: 10px; overflow: hidden;
             border: 2px solid var(--ink); border-radius: 16px; background: var(--cv); box-shadow: 0 4px 0 var(--ink); margin-bottom: 4px;
             color: var(--c-ink); text-decoration: none; -webkit-user-drag: none; user-select: none; transition: translate var(--t-press, 60ms); }
.rail-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0, 0, 0, .22) 1.1px, transparent 1.5px); background-size: 6px 6px; pointer-events: none; }
/* K12: the cover follows the catalog group (app.js data-grp on the item) */
.rail-item[data-grp="who"] .rail-card { --cv: var(--cov-who); }
.rail-item[data-grp="career"] .rail-card { --cv: var(--cov-career); }
.rail-item[data-grp="mates"] .rail-card { --cv: var(--cov-mates); }
.rail-item[data-grp="quick"] .rail-card { --cv: var(--cov-quick); }
.rail-card:active, .rail-card.is-pressed { translate: 0 2px; box-shadow: 0 2px 0 var(--ink); }
@media (hover: hover) { .rail-card:hover { filter: brightness(1.05); } }
.rail-card:focus-visible { outline: 3px solid var(--c-note); outline-offset: 2px; }
.rail-top { position: relative; display: grid; place-items: center; height: 108px; margin: 0 0 var(--s2); }
.rail-ico { position: relative; display: grid; place-items: center; width: 92px; height: 92px; color: var(--cv-ink); }
.rail-ico svg { position: relative; width: 44px; height: 44px; transform: rotate(-8deg); filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .35)); }
.rail-item:not(.rail-item--vs) .rail-ico::after { content: ""; position: absolute; top: 50%; left: 50%; box-sizing: border-box; width: 82px; height: 82px; margin: -41px 0 0 -41px; border-radius: 50%;
  border: 4px solid currentColor; outline: 2px solid currentColor; outline-offset: 4px; transform: rotate(-8deg); filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .4)); pointer-events: none; }
.rail-tick { position: absolute; top: 0; inset-inline-start: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--c-right) var(--tick) center / 70% no-repeat; box-shadow: inset 0 0 0 2px var(--ink); }
.rail-label { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px 12px; margin-bottom: 3px;
              border: 2px solid var(--ink); border-radius: 10px; background: var(--c-paper-hi); box-shadow: 0 3px 0 var(--ink); }
.rail-name { font: 400 26px/1.25 var(--font-display); padding-top: var(--s1); }
html[lang="en"] .rail-name { font: var(--fw-body) 19px/1.3 var(--font-ui); padding-top: 0; }
.rail-desc { font: var(--fw-meta) 15px/1.45 var(--font-ui); color: var(--c-meta); margin-bottom: var(--s2); }
.rail-play { margin-top: auto; padding: 2px 20px; border: 2px solid var(--ink); border-radius: 999px; background: var(--c-action, #0D1238); color: var(--c-paper-hi);
             font: var(--fw-body) 16px/1.5 var(--font-ui); box-shadow: 0 2px 0 var(--ink); }
.rail-card.is-done .rail-desc { color: var(--c-ink); }
.rail-card.is-done .rail-play { background: var(--c-right); color: var(--c-ink); }
.rail-card--vs { --cv: var(--red-kit, #C8202A); }
.rail-card--vs .rail-ico { width: 84px; height: 84px; border: 3px solid var(--ink); border-radius: 50%; background: var(--c-note); color: var(--c-ink); box-shadow: 3px 3px 0 var(--ink); }
.rail-card--vs .rail-ico svg { width: 48px; height: 48px; transform: none; filter: none; }
.rail-card--vs .rail-play { background: var(--c-note); color: var(--c-ink); }
.rail-live { position: absolute; top: 0; inset-inline-end: 0; display: inline-flex; align-items: center; gap: var(--s1); padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px;
             background: var(--navy-deep); color: var(--c-paper-hi); font: var(--fw-body) 14px/1.5 var(--font-ui); }
@media (hover: hover) and (pointer: fine) { .more-rail { cursor: grab; } }

/* ---- the back page, the reveal and the sheets on the same calm cards ---- */
.result .cover--back { border-radius: 16px; outline: 0; box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.result .cover--back::after { content: none; }
.reveal h2 { color: var(--c-paper-hi); font-size: var(--fs-title); }
.reveal details { border: 0; border-radius: 12px; box-shadow: none; }
.sheet-box { clip-path: none; border-radius: 20px 20px 0 0; padding-top: 28px; }
.sheet-box::after { content: none; }
.sheet-box::before { content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(26, 26, 26, .25); }
@media (min-width: 600px) { .sheet-box { border-radius: 20px; } }
/* the search sheet (R3-9): chips + "مين لعب للاتنين؟" + how many fit + "اسم اللاعب", a rounded input with a search glass */
#modal .ss-back { background: rgba(13, 18, 56, .35); }
/* round 6 (owner 2026-11-20, K1): the sheet is the calm blue page (sheet-search.css), light type; the field stays egg-white */
#modal .ss-panel { clip-path: none; border-radius: 20px 20px 0 0; padding-block-start: 22px; gap: var(--s2); background: var(--page-tex), var(--c-page); color: var(--c-on); }
#modal .ss-panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--c-line); }
@media (min-width: 700px) and (min-height: 560px) { #modal .ss-panel { border-radius: 20px; filter: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); } }
#modal .ss-kicker { display: none; }
#modal .ss-title, #modalTitle { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex-wrap: nowrap; }
.gs-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) 6px; margin-bottom: var(--s1); }
.gs-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--s3); border-radius: 999px; border: 1.5px solid var(--c-ink);
           background: var(--tile, var(--c-paper-hi)); color: var(--c-ink); font: var(--fw-body) var(--fs-meta)/1.3 var(--font-ui); }
.gs-chip[data-tone="dark"] { color: var(--c-paper-hi); }
.gs-plus { font: 900 16px/1 var(--font-ui); color: var(--c-on); }
.gs-q { font: var(--fw-body) var(--fs-title)/1.35 var(--font-ui); color: var(--c-on); }
.gs-n { font: var(--fw-meta) var(--fs-meta)/1.5 var(--font-ui); color: var(--c-on-soft); }
.gs-lbl { margin-top: var(--s2); font: var(--fw-body) var(--fs-meta)/1.5 var(--font-ui); color: var(--c-on); }
#modal .ss-close { min-width: var(--tap); width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 12px; background: var(--c-paper-lo); box-shadow: none; font-size: 0; color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='%231A1A1A' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center; background-size: 22px; background-repeat: no-repeat; }
#modal .ss-close:active, #modal .ss-close.is-pressed { translate: 0 1px; box-shadow: none; }
#modal .ss-input { border-radius: 12px; box-shadow: none; padding: 0 40px; font-size: var(--fs-body);   /* dir=auto: either side may be the start */
  background: var(--c-paper-hi) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='%234a3f2c' stroke-width='2.4'/%3E%3Cpath d='M15.5 15.5L20 20' stroke='%234a3f2c' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") left 12px center / 20px no-repeat; }
html[dir="rtl"] #modal .ss-input { background-position: right 12px center; }
#modal .ss-input::placeholder { font-weight: var(--fw-meta); font-size: 16px; }
@media (max-width: 359px) { #modal .ss-input::placeholder { font-size: var(--fs-meta); } }
#modal .ss-input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--c-wrong); }
#modal .ss-list { border-top: 1px solid var(--c-line); }
/* keyboard open: the two chips (the question itself) stay; the heading, the count and the field label step aside so the
   first suggestion stays above the keyboard */
#modal.is-kb .gs-lbl, #modal.is-kb .gs-q, #modal.is-kb .gs-n { display: none; }
#modal.is-kb .gs-chips { margin-bottom: 0; }
#modal.is-kb .ss-panel { padding-block-start: 12px; gap: 6px; }
#modal.is-kb .ss-panel::before { content: none; }

/* ---- desktop: the board column (Versus ticket, board, line, how to play, reveal) and the side column ---- */
@media (min-width: 1024px) {
  main.spread { grid-template-rows: auto auto auto auto 1fr; }
  .vs-ticket { grid-column: 1; grid-row: 1; margin-top: 0; }
  .cover--issue, .cover.cover--issue { grid-column: 1; grid-row: 2; padding: 0; box-shadow: none; }
  .cover--issue > .cover__rule { padding: 0; }
  .wrong-line { grid-column: 1; grid-row: 3; }
  .under-board { grid-column: 1; grid-row: 4; }
  .reveal { grid-column: 1; grid-row: 5; }
  .side { grid-column: 2; grid-row: 1 / span 5; }
  .more { margin: 0; background: none; padding: 0; box-shadow: none; }
  .more::after { content: none; }
  .more-head { border: 0; }
  .more-head h2 { color: var(--c-on); }
  .more-all { color: var(--c-paper-hi); }
  .more-rail { margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; }
  .issue-title { font-size: var(--fs-display); }
  .topbar .masthead { font-size: 48px; }
  .under-board .btn-quiet { min-height: 52px; }
}
/* the help sheet's step pictures follow the round-3 board: the navy "+" disc on a dashed square, and the guesses as dots */
.howto li:nth-child(1)::after { border: 1.5px dashed var(--ink-soft); border-radius: 10px; background: linear-gradient(var(--c-ink), var(--c-ink)) center / 18px 4px no-repeat,
  linear-gradient(var(--c-ink), var(--c-ink)) center / 4px 18px no-repeat, var(--c-paper-lo); }   /* K11: the "+" alone, no disc (as the board) */
.howto li:nth-child(3)::after { content: ""; width: 56px; height: 56px; border: 0; border-radius: 10px; box-shadow: none; transform: none; padding: 0;
  background: radial-gradient(circle, var(--c-note) 4px, transparent 4.6px) 0 50% / 14px 14px repeat-x, var(--navy); }

/* =====================================================================================================================
   ROUND 4 (owner 2026-11-19, ROUND4.md + OWNER CORRECTION): the home page in the calm look everywhere, not only the
   board. <body class="r-calm"> (the same opt-in as the game pages, kit.css part 2) puts the shared end screen
   (games/retro/end.css) on the blue: the back page loses its cream card. Sheets stay cream and rounded, de-boxed inside:
   no ink rules, hard shadows or ticket notches; soft rounded rows and tiles.
   ===================================================================================================================== */
.r-calm .result .cover--back { background: none; border-radius: 0; box-shadow: none; outline: 0; padding: 0; }
.r-calm .result .cover--back::before, .r-calm .result .cover--back::after { content: none; }
.r-calm .result .cover--back > .cover__rule { padding: 0; border: 0; }
.r-calm .result .cover { animation: none; }
/* the primary button (btn-print): navy-deep, rounded, no punched notches; the paper one = an outline */
.btn-print { border: 0; border-radius: var(--rad); box-shadow: 0 2px 0 rgba(0, 0, 0, .28); }
.btn-print::before, .btn-print::after, .btn-print:not(.btn-print--paper)::before, .btn-print:not(.btn-print--paper)::after { content: none; }
.btn-print:active, .btn-print.is-pressed { transform: none; translate: 0 1px; box-shadow: 0 1px 0 rgba(0, 0, 0, .28); }
.btn-print--paper { background: none; border: 1.5px solid var(--c-ink); box-shadow: none; }
.btn-print--paper:active, .btn-print--paper.is-pressed { box-shadow: none; background: var(--c-paper-lo); }
.sheet-box::after { content: none; }
/* the archive: rounded issue tiles, no ink rims or hard shadows; played = paper-lo, perfect = yellow, today = navy rim */
.archive-list li { border: 0; border-radius: 12px; box-shadow: none; background: var(--c-paper-hi); }
.archive-list li.done { background: var(--c-paper-lo); }
.archive-list li.current { outline: 2px solid var(--c-action); outline-offset: -2px; }
.archive-list .arch-month { border-bottom: 1px solid rgba(26, 26, 26, .15); }
/* the guide: the three steps as plain rows (no boxes), their pictures kept; settings as soft rows */
.howto li { background: none; border: 0; box-shadow: none; padding: var(--s1) 0; min-height: 0; }
.howto li + li { border-top: 1px solid rgba(26, 26, 26, .12); padding-top: var(--s3); }
.howto li::before { border: 0; box-shadow: none; }
.howto li:nth-child(2)::after { box-shadow: none; border-radius: 10px; }
.howto li:nth-child(3)::after { box-shadow: none; }
.help-example { border: 1.5px dashed rgba(26, 26, 26, .35); border-radius: 12px; background: none; }
.settings { border: 0; border-radius: var(--rad); background: var(--c-paper-hi); overflow: hidden; }
.setting + .setting { border-top: 1px solid rgba(26, 26, 26, .12); }
.seg { border: 0; border-radius: 12px; background: var(--c-paper-lo); padding: 3px; }
.seg-btn { border-radius: 9px; }
.seg-btn[aria-pressed="true"] { background: var(--c-action); }
.toggle { border: 0; border-radius: 999px; background: var(--c-paper-lo); }
.toggle::after { border-radius: 50%; top: 5px; inset-inline-start: 5px; }
.statrow > * { border-radius: 12px; }
.stat, .stat:nth-child(2) { border: 0; border-radius: 12px; background: var(--c-paper-hi); color: var(--c-ink); }
/* the archive's issue tiles (arch-issue): unplayed = a faint dashed tile, played = paper-hi, perfect = yellow, today = a navy rim */
.archive-list li.arch-issue { border: 1.5px dashed rgba(26, 26, 26, .25); border-radius: 12px; box-shadow: none; background: none; }
.archive-list li.arch-issue.started, .archive-list li.arch-issue.done { border: 0; box-shadow: none; background: var(--c-paper-hi); }
.archive-list li.arch-issue.perfect { border: 0; box-shadow: none; background: var(--c-note); }
.archive-list li.arch-issue.current { border: 2px solid var(--c-action); }
.archive-list .arch-month { border: 0; }
#stats.statrow { border: 0; }

/* GRID CELLS (owner 2026-11-21: "the boxes in the grid are different sizes"): the three answer rows have ONE fixed height,
   never set by what a cell holds. Phones: max(column width, 104 px) (104 = the tick row, two Arabic lines + three English
   lines at the 10 px floor and the rarity line: "Pierre-Emerick Aubameyang" at 320-360 px); landscape phones max(3/4 of the column, 96 px); desktop square (aspect-ratio above). A row's
   category panel and its three cells all take that height, so a long label or name never makes its row taller: the
   panel's art gives up room, and a name steps its font down inside the cell (retro.js fitCells). Nothing lands outside
   its cell (overflow clipped as the last guard). The column-header row keeps its own (stable) height. */
.grid tr + tr > td { overflow: hidden; }
@media (max-width: 1023px) {
  .grid tr + tr > th, .grid tr + tr > td { --cell-h: max(calc((100cqi - 3 * var(--gutter)) / 4), 104px); height: var(--cell-h); min-height: var(--cell-h); max-height: var(--cell-h); }
  /* the name starts right under the 16 px tick / cross disc (top 4 px), the rarity line right under the name */
  .grid td.ok, .grid td.bad { padding-top: 20px; }
  .grid td.ok .sub.tape { margin-top: 0; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .grid tr + tr > th, .grid tr + tr > td { --cell-h: max(calc((100cqi - 3 * var(--gutter)) / 4 * .75), 96px); }
}
/* fitCells' last resort when a name still does not fit at the 10 px floor: whole lines hidden from the end (a height of
   whole lines, no ellipsis, so no word is cut): the English line keeps its first line, the Arabic two */
.grid td.fit-clamp .r-dn__en { max-height: 1.25em; overflow: hidden; }
.grid td.fit-clamp .r-dn__ar { max-height: 2.5em; overflow: hidden; }
.grid td.fit-clamp .name:not(:has(.r-dn)) { max-height: 3.75em; overflow: hidden; }
