/* The main screen, the windows and the splash of Zoongo - the approved sketches of plan stage 5 (docs/plan/look/screens/,
   LOOK_PLAN section 3) on the studio UI kit's window frame (base.css .modal, theme src/theme/ui-theme.css). Windows are cream
   enamel plaques (spec 06 ART-25); on the phone the sheets come from the bottom and are as tall as their content (spec 05 UI-35),
   on the computer every window is 480 px wide. Minimums: phone text >= 16 px, labels >= 14, targets >= 48; computer labels
   >= 18, targets >= 52 (UI-32, UI-33). Game classes only (z*, scoped) - the kit's .btn, .row, .field, .tile stay the kit's. */
:root { --enamel: radial-gradient(130% 100% at 30% 0%, #fdf0d6, #f1d6a6 70%, #e4bf84);
  --enamel-rim: inset 0 0 0 3px #2d2340, inset 0 0 0 6px #e9c48a, inset 0 8px 16px rgba(255,255,255,.35), 4px 4px 0 #1d1630, 0 16px 30px rgba(20,10,40,.45);
  --red: linear-gradient(180deg, #b84c36, #a8402c 55%, #8a2e20); }
.scene { position: fixed; inset: 0; }
svg.zi { width: 28px; height: 28px; fill: currentColor; flex: none; display: block; }
.zbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 16px; border-radius: 10px;
  font: 700 19px/1.1 var(--font-text); color: var(--ink); background: var(--chip); box-shadow: inset 0 0 0 2.5px #2d2340, 3px 3px 0 #2d2340; cursor: pointer; text-align: center; }
.zbtn:active { transform: translateY(2px); box-shadow: inset 0 0 0 2.5px #2d2340, 1px 1px 0 #2d2340; }
.zbtn.primary { background: var(--bingo); color: var(--bingo-ink); font: 700 24px/1 var(--font-head); letter-spacing: .03em; text-transform: uppercase; box-shadow: var(--bingo-shadow); min-height: 64px; }
.zbtn.primary small { display: block; font: 600 15px/1.2 var(--font-text); text-transform: none; letter-spacing: 0; opacity: .95; margin-top: 4px; }
.zbtn.danger { background: var(--red); color: #fdf0d8; }
/* the gloss lightens the top of the red too: the cream letters keep the outline of the emerald ones (contrast by the frame, decision 42) */
.zbtn.danger:not(.link) { text-shadow: 2px 2px 0 #2d2340, -1px -1px 0 #2d2340, 1px -1px 0 #2d2340, -1px 1px 0 #2d2340; }
.zbtn.link { min-height: 48px; background: none; box-shadow: none; text-decoration: underline; font-size: 16px; font-weight: 600; color: var(--ink); }
/* the gloss of the buttons (decisions No 19, stand B2; No 20 - every button, not the playing pieces): a light band near the top,
   almost the full width, fading softly downward; its own layer under the letters, over the colour. The pieces - cells, balls, the
   column letters, mini cards - and the tiles, switches, toggles, links and crosses stay flat */
.bingo, .zbtn:not(.link), .icon-btn, .zm .sq { position: relative; z-index: 0; }
.bingo::after, .zbtn:not(.link)::after, .icon-btn::after, .zm .sq::after { content: ''; position: absolute; z-index: -1; left: 6px; right: 6px; top: 5px; height: 62%;
  border-radius: 7px 7px 0 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.40) 0%, rgba(255,255,255,.26) 30%, rgba(255,255,255,.08) 70%, rgba(255,255,255,0) 100%); }
.zbtn:focus-visible, .zm button:focus-visible, .zw button:focus-visible, .zw input:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.plaque { background: var(--enamel); box-shadow: var(--enamel-rim); border-radius: 14px; padding: 18px 18px 16px; color: var(--ink); }
/* the bar's outline is a ring of 2.5 px like the buttons' (a border of 2.5 px was rounded to 2 by the screen - decision 36) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: 10px; padding: 2.5px; box-shadow: inset 0 0 0 2.5px #2d2340, 3px 3px 0 #2d2340; overflow: hidden; background: #f6e3bf; }
.seg button:first-child { border-radius: 7.5px 0 0 7.5px; } .seg button:last-child { border-radius: 0 7.5px 7.5px 0; }
.seg button { position: relative; z-index: 0; display: grid; place-items: center; min-height: 48px; font: 700 17px/1 var(--font-text); color: var(--ink); border-left: 2px solid #2d2340; cursor: pointer;
  background: linear-gradient(180deg, #fbefd6, #f6e3bf 55%, #ecd3a6); }
.seg button:first-child { border-left: 0; }
/* the segments are buttons too (decision 27): the gloss of the buttons; the chosen value is a soft emerald chip inside its
   segment - a thin outline, a blurred shadow, a weak diffused gloss, cream letters with a soft dark outline */
.seg button:not(.on)::after { content: ''; position: absolute; z-index: -1; left: 5px; right: 5px; top: 4px; height: 62%; border-radius: 6px 6px 0 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.40) 0%, rgba(255,255,255,.26) 30%, rgba(255,255,255,.08) 70%, rgba(255,255,255,0) 100%); }
.seg button.on { color: #fdf0d8; text-shadow: 1px 1px 0 rgba(29,22,48,.75), 0 0 3px rgba(29,22,48,.7), 1px 2px 3px rgba(29,22,48,.45); }
.seg button.on::before { content: ''; position: absolute; z-index: -2; inset: 4px 5px 6px 4px; border-radius: 10px; background: linear-gradient(180deg, #3d8160, #2f6a4a 55%, #1d4530);
  box-shadow: inset 0 0 0 1.5px rgba(45,35,64,.85), 1px 2px 5px rgba(29,22,48,.45), 0 1px 1px rgba(29,22,48,.35); }
.seg button.on::after { content: ''; position: absolute; z-index: -1; left: 10px; right: 11px; top: 7px; height: 52%; border-radius: 8px 8px 50% 50% / 8px 8px 30% 30%; pointer-events: none; filter: blur(1px);
  background: linear-gradient(180deg, rgba(255,255,255,.26) 0%, rgba(255,255,255,.17) 30%, rgba(255,255,255,.05) 70%, rgba(255,255,255,0) 100%); }
/* the text on the buttons and plates has the volume of the buttons too (decision 27): a light shadow right-down, as the light
   comes from the top left; the cream letters on emerald keep their own outline (more specific rules) */
.zbtn:not(.link), .seg button:not(.on), .zm .ztile span, .icon-btn .lbl, .zm .player .who, .pattern span { text-shadow: 1px 1px 1px rgba(45,35,64,.32); }
/* dark letters on the orange buttons and the player plate: the shadow counts as their ground (contrast by the frame, 05 UI-36) -
   the lightest one there */
.zbtn.primary, .zw-result .zbtn[data-act="home"], .zm .player .who { text-shadow: 1px 1px 0 rgba(45,35,64,.14); }
.zbadge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #2f6a4a; color: #fdf0d8; box-shadow: inset 0 0 0 2px #2d2340, 2px 2px 0 #2d2340; flex: none; }
.zbadge svg { width: 28px; height: 28px; fill: currentColor; display: block; }
.rankline { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 17px; font-weight: 700; text-align: left; }

/* ---------- main ---------- */
.zm { position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px)); gap: 12px; overflow-y: auto; color: var(--ink); font-family: var(--font-text); }
.zm .col { display: contents; }
.zm .topline { order: 1; display: flex; align-items: center; justify-content: space-between; }
.zm .player { order: 2; } .zm .invite { order: 3; } .zm .preset { order: 4; } .zm .play-btn { order: 5; } .zm .grow { order: 6; flex: 1; } .zm .chips { order: 7; }
.zm .logo { display: flex; align-items: center; gap: 8px; font: 700 44px/1 var(--font-head); letter-spacing: .04em; color: #fdf0d8; text-shadow: 3px 3px 0 #2d2340; }
.zm .logo .parrot, .pk-splash .parrot { width: 56px; height: 56px; }
.zm .parrot .portrait, .pk-splash .parrot .portrait { --frames: 5; --i: 4; background-image: url("../../../assets/generated/portraits/parrot.webp"); }
.zm .sq { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; background: var(--chip); box-shadow: inset 0 0 0 2.5px #2d2340, 3px 3px 0 #2d2340; color: var(--ink); }
.zm .player { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; cursor: pointer; }
.zm .player .who { flex: 1; min-width: 0; } .zm .player b { display: block; font: 700 21px/1.15 var(--font-head); overflow-wrap: anywhere; }
.zm .player .who > span { display: block; font-size: 16px; color: #5a3f2a; font-weight: 600; margin-top: 2px; }
.zm .player .chev { color: #5a3f2a; transform: rotate(180deg); }
.zm .preset { padding: 12px 14px 14px; }
.zm h3 { margin: 4px 0 8px; font: 700 18px/1 var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: #5a3f2a; }
.zm .preset h3 + .tiles, .zm .preset .seg { margin-bottom: 10px; }
.zm .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zm .tilew { position: relative; display: grid; }
.zm .ztile { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 10px 4px 8px; min-height: 48px; border-radius: 10px; background: #f6e3bf; box-shadow: inset 0 0 0 2px rgba(45,35,64,.5); font: 700 15px/1.15 var(--font-text); text-align: center; color: #2d2340; cursor: pointer; }
.zm .ztile svg { width: 46px; height: 46px; display: block; } .zm .ztile.on { background: #fffaf0; box-shadow: inset 0 0 0 3px #2d2340, 3px 3px 0 #2d2340; }
.zm .new, .new-pic { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 8px; border-radius: 12px; font: 700 14px/1 var(--font-text); color: #24182f; background: #ffd166; box-shadow: inset 0 0 0 1.5px #2d2340; }
.zm .new { position: absolute; top: -12px; right: -6px; z-index: 2; }
.new-pic { padding: 3px 8px; }
.nx { display: grid; place-items: center; width: 24px; height: 24px; margin: -6px -2px -6px 0; color: #24182f; cursor: pointer; }
.nx svg.zi { width: 16px; height: 16px; }
.zm .nx::after { content: ""; position: absolute; inset: -12px -6px; } /* the touch area of the small cross >= 48 px */
.zm .nx { position: relative; }
.zm .chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zm .chips .zbtn { min-height: 64px; flex-direction: column; gap: 4px; font-size: 15px; padding: 6px 4px; }
.zm .invite { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; font: 700 17px/1.2 var(--font-text); }
.zm .invite .zbtn { width: auto; min-height: 48px; font-size: 16px; padding: 4px 14px; }
.zm .invite .nx { width: 40px; height: 40px; margin: 0; border-radius: 9px; background: var(--red); color: #fdf0d8; box-shadow: inset 0 0 0 2.5px #2d2340, 2px 2px 0 #2d2340; }
.zm .invite .nx svg.zi { width: 20px; height: 20px; } .zm .invite .nx::after { inset: -4px; } /* the red cross of the windows (decision 30); 48 px to touch */
@media (min-width: 900px) {
  .zm { flex-direction: row; padding: 28px 40px; gap: 32px; align-items: stretch; overflow: hidden; }
  .zm .col { display: flex; flex-direction: column; gap: 16px; } .zm .col > * { order: 0; } .zm .left { width: 440px; } .zm .right { flex: 1; max-width: 640px; margin-left: auto; justify-content: center; }
  .zm .logo { font-size: 64px; } .zm .logo .parrot { width: 80px; height: 80px; }
  .zm .player .who > span { font-size: 18px; } .seg button { font-size: 19px; min-height: 52px; } .zm .new { font-size: 18px; } .zm .ztile { font-size: 18px; }
  .zm .ztile svg { width: 64px; height: 64px; } .zbtn { font-size: 20px; min-height: 56px; } .zm .h3, .zm h3 { font-size: 20px; }
  .zbtn.primary { font-size: 30px; min-height: 80px; } .zbtn.primary small { font-size: 18px; } .zm .chips .zbtn { font-size: 18px; flex-direction: row; min-height: 60px; }
  .zm .sq { width: 56px; height: 56px; } .zm .invite { font-size: 19px; }
}

/* ---------- windows (the kit's .modal frame) ---------- */
.zw .modal__scrim { background: rgba(20,10,40,.45); }
.zw-pause .modal__scrim { background: rgba(20,10,40,.40); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.zw { padding: 14px; }
.zw .modal__win { max-width: min(480px, 100%); max-height: calc(100% - 8px); background: var(--enamel); box-shadow: var(--enamel-rim); border-radius: 14px; color: var(--ink); font-family: var(--font-text); }
.zw.modal--popup .modal__win { animation: zw-rise .28s cubic-bezier(.2,.9,.25,1.18) both; } /* windows rise 280 ms (spec 07 VFX-24) */
@keyframes zw-rise { 0% { transform: translateY(12%); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.zw .modal__body { display: block; padding: 18px 18px 16px; position: relative; }
.zw h2 { margin: 0 0 4px; font: 700 30px/1.05 var(--font-head); text-transform: uppercase; letter-spacing: .02em; }
.zw h3 { margin: 14px 0 8px; font: 700 18px/1 var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: #5a3f2a; }
.zw p { margin: 6px 0; font-size: 17px; line-height: 1.35; }
.zw .zx + h2, .zw .zx ~ .lose-head + h2 { padding-right: 58px; }
.zw .stack { display: grid; gap: 10px; margin-top: 14px; }
.zw .zx { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--red); box-shadow: inset 0 0 0 2.5px #2d2340, 2px 2px 0 #2d2340; color: #fdf0d8; cursor: pointer; }
/* the cross is red (polish 2); its yellow ring only for the keyboard (html.kbd - winkit.js), not after a tap that opened the window */
.zw .zx:focus-visible { outline: none; }
html.kbd .zw .zx:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
/* the cross is 36 px to see (40 on a computer) (it ran over the language pill of the settings) and 48 px to touch (05 UI-32), like the small cross of the main */
.zw .zx::before { content: ''; position: absolute; inset: -6px; }
.zw .ribbon { display: inline-block; margin: 6px 4px 2px; padding: 6px 16px; font: 700 18px/1 var(--font-head); text-transform: uppercase; color: #24182f; background: #ffd166;
  box-shadow: inset 0 0 0 2px #2d2340, 3px 3px 0 #2d2340; clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); }
.zw .stats { font: 600 19px/1.3 var(--font-text); }
.zw .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the phone sheets: from the bottom, as tall as the content (spec 05 UI-35) */
@media (max-width: 899px) {
  .zw.zw-sheet { padding: 0; align-items: flex-end; }
  .zw.zw-sheet .modal__win { max-width: none; width: 100%; max-height: calc(100% - 32px); border-radius: 18px 18px 0 0; }
  .zw.zw-sheet .modal__body { overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 900px) { .zw p, .zw .srow { font-size: 20px; } .zw .zbtn { min-height: 56px; } .seg button { min-height: 52px; } .zw .zx { width: 40px; height: 40px; } }
/* result */
.zw-result .modal__body { text-align: center; }
.zw-result.is-win h2 { font-size: 36px; }
.zw-result .rankline { justify-content: center; }
.zw-result .small { font-size: 18px; min-height: 48px; margin: 0; }
/* the result buttons: "Play again" dark emerald (the palette accent, like "Next" of the lesson), "Main" takes the orange;
   "Continue" of the end-the-game question is the same emerald - orange over red read as one (decision 42) */
.zw-result .zbtn[data-act="again"], .zw-exit .zbtn[data-act="continue"] { background: linear-gradient(180deg, #3d8160, #2f6a4a 55%, #1d4530); color: #fdf0d8;
  text-shadow: 2px 2px 0 #2d2340, -1px -1px 0 #2d2340, 1px -1px 0 #2d2340, -1px 1px 0 #2d2340; } /* the gloss lightens the top: the letters keep an outline (contrast by the frame, 05 UI-36) */
.zw-result .zbtn[data-act="home"] { background: var(--bingo); color: var(--bingo-ink); }
/* the lose window (decision 29): the title under the portrait has no cross beside it - no room kept on the right, centred, below
   the board's shadow; "you could have made it" a step lower; the rhythm below as in the win window */
.zw-result.is-lose .lose-head + h2 { padding-right: 0; margin-top: 26px; text-align: center; }
.zw-result.is-lose .stats { margin-top: 8px; } .zw-result.is-lose .could { margin-top: 14px; }
.zw-result.is-lose .rankline { margin-top: 18px; } .zw-result.is-lose .stack { margin-top: 18px; }
.zw-result .guest + .small { margin-top: 0; }
/* the win title and its line start at one left edge (the title keeps its room for the cross on the right) */
.zw-result.is-win h2, .zw-result.is-win .stats { text-align: left; }
/* the guest line: plain text, only "Set a name" is the link (underlined, 48 px to touch) */
/* the two bottom lines: one size (18 px) and one height (48 px), no extra gap between them */
.zw-result .guest { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 6px; min-height: 48px; margin: 14px 0 0; font: 600 18px/1.3 var(--font-text); color: var(--ink); }
.zw-result .stack { gap: 16px; } /* a wider gap between "Play again" and "Main" */
/* an even rhythm from the top down: the title, its line, the rank, the buttons (owner: the top looked squeezed against the bottom) */
.zw-result.is-win h2 { margin-bottom: 12px; } .zw-result .rankline { margin-top: 18px; } .zw-result .stack { margin-top: 18px; }
.zw-result .guest .zbtn.link { width: auto; min-height: 48px; padding: 0; font: inherit; }
.lose-head { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 4px 0 10px; }
.lose-head .bot { width: 96px; } .lose-head .face { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; box-shadow: var(--chip-shadow), 0 0 0 4px #ffd166; }
.lose-head .portrait { --frames: 4; transform: scale(1.12) translateY(4%); }
.bmini { padding: 10px; display: grid; grid-template-columns: repeat(5, 16px); gap: 5px; border-radius: 10px; background: var(--card); box-shadow: var(--card-shadow); }
.bmini i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(253,240,216,.6); }
.bmini i.on { background: #8a6a48; box-shadow: none; } .bmini i.lit { background: #e2603f; box-shadow: 0 0 0 2px #2d2340; } .bmini i.x:not(.lit) { background: #2d2340; }
/* statistics */
.zw .rk { flex: 1; } .zw .rk small { display: block; font-size: 15px; font-weight: 600; margin-top: 4px; }
.zw .bar { height: 14px; margin-top: 6px; border-radius: 7px; background: #e2c9a0; box-shadow: inset 0 0 0 2px #2d2340; overflow: hidden; } .zw .bar i { display: block; height: 100%; background: #2f6a4a; }
.zw table.st { width: 100%; border-collapse: collapse; font-size: 16px; margin-top: 12px; }
.zw table.st th { text-align: right; font: 700 15px/1.2 var(--font-text); color: #5a3f2a; padding: 6px 4px; }
.zw table.st td { padding: 8px 4px; border-top: 2px dashed rgba(45,35,64,.25); font-weight: 600; } .zw table.st td svg { width: 28px; height: 28px; display: block; }
.zw table.st td.n { font: 700 20px/1 var(--font-num); text-align: right; } .zw table.st td.never { font-size: 16px; color: #5a3f2a; text-align: left; }
.zw .note { font-size: 15px; }
/* settings */
.zw .val::before { content: ''; position: absolute; inset: -4px 0; }
/* the rows of the settings (decision 33): a step off the left edge, 19 px, a line fading out to both sides instead of the dashes */
.zw .srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 4px 0 10px; background: linear-gradient(90deg, rgba(45,35,64,0), rgba(45,35,64,.32) 22%, rgba(45,35,64,.32) 78%, rgba(45,35,64,0)) bottom / 100% 2px no-repeat; font-size: 19px; font-weight: 600; }
.zw .srow:last-child { background: none; } .zw .srow small { display: block; font-size: 16px; color: #5a3f2a; }
.zw .tog { width: 58px; height: 48px; position: relative; flex: none; cursor: pointer; }
.zw .tog::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 32px; border-radius: 16px; background: #c9b394; box-shadow: inset 0 0 0 2.5px #2d2340, 3px 3px 0 #2d2340; }
/* the toggle track and its knob have the buttons shadow (polish 2, stand toggles variant B) */
.zw .tog::after { content: ""; position: absolute; top: 12px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fdf0d8; box-shadow: inset 0 0 0 2px #2d2340, 2px 2px 0 #2d2340; transition: left .15s; }
.zw .tog.on::before { background: #2f6a4a; } .zw .tog.on::after { left: 30px; }
.zw .val { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 168px; min-height: 40px; padding: 0 8px 0 12px; transform: translateY(-4px); /* lower than the cross and off the dashed line; 48 px to touch below */ font: 700 18px/1 var(--font-text); color: #5a3f2a; border-radius: 10px; box-shadow: inset 0 0 0 2.5px #2d2340, 3px 3px 0 #2d2340; cursor: pointer; }
/* the language pill presses like the buttons (polish 2): the same outline and the right-bottom shadow */
.zw .val:active { transform: translate(2px, -2px); box-shadow: inset 0 0 0 2.5px #2d2340, 1px 1px 0 #2d2340; }
/* name */
.zw .field { display: flex; min-height: 56px; margin-top: 10px; border-radius: 10px; background: #fffaf0; box-shadow: inset 0 0 0 2.5px #2d2340, inset 0 3px 6px rgba(0,0,0,.12); }
.zw .field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 14px; font: 600 20px/1 var(--font-text); color: var(--ink); outline: none; -webkit-user-select: text; user-select: text; }
.zw .hint { font-size: 15px; color: #5a3f2a; text-align: right; margin-top: 4px; min-height: 18px; }
.zw .zbtn:disabled { opacity: .55; cursor: default; }
/* help and the marks */
.zw .pats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.zw .pats span { display: grid; justify-items: center; gap: 4px; font: 700 15px/1.15 var(--font-text); text-align: center; } .zw .pats svg { width: 46px; height: 46px; display: block; }
/* the marks rows like the settings rows (decision 39): a line fading out to both sides instead of the dashes, in the middle
   between two icons - 5 px above it and 5 px under it (the 2 px line sits in the 7 px bottom padding); no line under the last row */
.marks-list { display: grid; gap: 0; font-size: 16px; line-height: 1.25; }
.marks-list > div { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 10px; padding: 5px 0 7px;
  background: linear-gradient(90deg, rgba(45,35,64,0), rgba(45,35,64,.32) 22%, rgba(45,35,64,.32) 78%, rgba(45,35,64,0)) bottom / 100% 2px no-repeat; }
.marks-list > div:last-child { background: none; }
.mk { width: 58px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: #f6e3bf; box-shadow: inset 0 0 0 1.5px rgba(45,35,64,.4); font: 700 15px/1 var(--font-num); position: relative; overflow: hidden; }
.mk svg { width: 30px; height: 30px; display: block; fill: currentColor; } .mk .zbadge { width: 30px; height: 30px; } .mk .zbadge svg { width: 22px; height: 22px; }
.mk .need { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--need); color: var(--need-ink); }
.mk .need.near { background: #ffd166; color: #24182f; box-shadow: inset 0 0 0 1.5px #2d2340; }
.mk .miss { color: #a8402c; }
.mk .mdots { display: grid; grid-template-columns: repeat(3, 7px); gap: 3px; } .mk .mdots i { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(45,35,64,.5); } .mk .mdots i.on { background: #e2603f; box-shadow: none; }
.mk .feather-pic { font: 700 9px/1 var(--font-text); padding: 3px; border-radius: 4px; background: #fdf0d8; box-shadow: inset 0 0 0 1px #2d2340; }
.mk .cool-pic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 3px solid #2d2340; border-right-color: transparent; }
.mk .ready-pic { font: 700 11px/1 var(--font-head); padding: 5px 4px; border-radius: 5px; background: var(--bingo); color: var(--bingo-ink); box-shadow: 0 0 0 3px rgba(255,209,102,.6); }
.mk .tab-pic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; background: var(--hab); background-image: linear-gradient(rgba(0,0,0,.38), rgba(0,0,0,.38)), var(--hab-tex); color: #fdf0d8; font: 700 18px/1 var(--font-head); text-shadow: 1px 1px 0 #2d2340; }
.mk .new-pic { font-size: 11px; padding: 3px 5px; }
.mk .free-pic { font: 700 13px/1 var(--font-head); letter-spacing: .03em; color: #24182f; }

/* the language plate leads to the window of languages: the name, then a chevron (decision 33) */
.zw .val .vname { flex: 1; text-align: left; } .zw .val .chev { display: grid; color: #5a3f2a; transform: rotate(180deg); } .zw .val .chev svg.zi { width: 16px; height: 16px; }
/* the window of languages: a row of 48 px for each language by its own name, the current one bold with an emerald check */
.zw .langs { display: grid; margin-top: 8px; max-height: min(60vh, 560px); overflow-y: auto; }
.zw .langs button { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 10px; font: 600 19px/1.2 var(--font-text); color: var(--ink); text-align: left; cursor: pointer; background: linear-gradient(90deg, rgba(45,35,64,0), rgba(45,35,64,.32) 22%, rgba(45,35,64,.32) 78%, rgba(45,35,64,0)) bottom / 100% 2px no-repeat; }
.zw .langs button:last-child { background: none; } .zw .langs button.on { font-weight: 800; }
.zw .langs .ok { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 16px; color: #fdf0d8; background: linear-gradient(180deg, #3d8160, #2f6a4a 55%, #1d4530); box-shadow: inset 0 0 0 1.5px rgba(45,35,64,.85); }

/* the pause (decision 36): its heading a step in, like the words in the bar below; the texts of the buttons start at one line,
   their icons left of it */
.zw-pause h3 { padding-left: 10px; }
.zw-pause .stack > .zbtn:not(.primary) { justify-content: flex-start; padding-left: calc(50% - 52px); }
.zw-pause .stack > .zbtn:not(.primary) svg.zi { margin-left: -38px; }
/* the lesson's result: a note instead of the rank bar (decision 36) */
.zw-result .lesson-note { margin: 18px 0 0; font: 600 17px/1.35 var(--font-text); color: #5a3f2a; text-align: center; }
/* the name window: the rule on the left, the count on the right (decision 36) */
.zw-name .hint { display: flex; justify-content: space-between; gap: 10px; font: 600 15px/1.3 var(--font-text); color: #5a3f2a; margin-top: 6px; }

/* the sheet of all balls (spec 05 UI-14) */
.zw .balls5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px 8px; margin-top: 10px; }
.zw .balls5 .hd { font: 700 22px/1 var(--font-head); text-align: center; color: #fdf0d8; padding: 6px 0; border-radius: 6px; background: var(--hab); background-image: linear-gradient(rgba(0,0,0,.38), rgba(0,0,0,.38)), var(--hab-tex); box-shadow: inset 0 0 0 2px #2d2340; text-shadow: 2px 2px 0 #2d2340, -1px -1px 0 #2d2340, 1px -1px 0 #2d2340, -1px 1px 0 #2d2340; /* outlined: the polar stripes stay light under small letters (UI-36) */ }
.zw .balls5 .b { height: 28px; display: grid; place-items: center; border-radius: 14px; font: 700 16px/1 var(--font-num); color: #5a3f2a; box-shadow: inset 0 0 0 1.5px rgba(45,35,64,.35), 2px 2px 0 rgba(45,35,64,.32); }
.zw .balls5 .b.on { background: color-mix(in srgb, var(--hab) 55%, #fff4de); color: #24182f; box-shadow: inset 0 0 0 2px #2d2340, 2px 2px 0 rgba(45,35,64,.65); }
/* the current ball: the red ring right on its dark rim, 2 px (it was 3 px with a gap) */
.zw .balls5 .b.now { box-shadow: inset 0 0 0 2px #2d2340, 0 0 0 2px #e2603f, 2px 2px 0 2px rgba(45,35,64,.45); }
/* the letters on one plate (decision 28): a soft violet see-through rounded bar under the first row, the headers close together on it */
.zw .balls5 { position: relative; }
.zw .balls5::before { content: ''; position: absolute; z-index: 0; left: -5px; right: -5px; top: -5px; height: calc(22px + 12px + 10px); border-radius: 12px; background: rgba(122,92,168,.28); box-shadow: none; } /* a soft see-through violet (decision 28) */
.zw .balls5 .hd { position: relative; z-index: 1; margin: 0 -2px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px rgba(253,240,216,.18); }
.zw .balls5 .hd:first-child { border-radius: 9px 5px 5px 9px; } .zw .balls5 .hd:nth-child(5) { border-radius: 5px 9px 9px 5px; }
.zw .balls5 .b:nth-child(-n+10) { margin-top: 6px; }
.board[role="button"] { cursor: pointer; }
.board:focus-visible { outline: 3px solid #ffd166; outline-offset: 3px; border-radius: 12px; }
.zw-result .could { font-size: 16px; color: #5a3f2a; }

/* the move between the main screen and the play (spec 07 VFX-26): the panels come in fading with a 12 px shift in 300 ms; the
   scene is its own layer and stays; "reduce motion" - no move */
.zm, .zg { animation: screen-in .3s ease-out backwards; }
@keyframes screen-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- the kit's splash (spec 05 UI-40) ---------- */
.pk-splash { position: fixed; inset: 0; z-index: 300; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--page); animation: zs-in var(--pk-splash-ms, 1200ms) ease both; }
.pk-splash b { font: 700 56px/1 var(--font-head); letter-spacing: .05em; color: #fdf0d8; text-shadow: 3px 3px 0 #2d2340; }
.pk-splash .parrot { width: 96px; height: 96px; }
.pk-splash-out { opacity: 0; transition: opacity .18s; }
.pk-still { animation: none; }
@keyframes zs-in { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 1; } }
/* the game's splash (intro.js, decision 23): the logo video - 540 x 480, the parrot of the logo is 405 px of it, so the box is
   sized for a 150 px parrot; its edges fade into the page colour (the video background is the same colour); the name has a white
   25 % outline 4 px outside the letters */
.zg-intro:not(.pk-still) { animation: zs-in .9s ease both; }
.zg-intro .logo-box { position: relative; width: 200px; height: 178px; }
.zg-intro .logo-video, .zg-intro .logo-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: center / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 6%, #000 94%, transparent); mask-composite: intersect; }
.zg-intro b { paint-order: stroke fill; -webkit-text-stroke: 8px rgba(255,255,255,.25); }

/* ---------- the lesson (spec 04 ONB-03, ONB-04; 07 VFX-29): the dim outside the target, the spotlight moving in 300 ms, the step
   card rising 8 px; the card is never over the target (top or bottom, away from it); the field stays playable under it ---------- */
.lesson { position: fixed; inset: 0; z-index: 90; pointer-events: none; } /* above the finale layers, below the windows (100) */
.lesson [hidden] { display: none !important; }
.lesson.off, .lesson.hold .lcard { visibility: hidden; }
.lesson.hold .spot, .lesson.hold .dim { visibility: hidden; }
.lesson .dim { position: fixed; inset: 0; background: rgba(20,10,40,var(--dim, .55)); }
.lesson.between .lcard, .lesson.between .spot { visibility: hidden; } /* between two steps: a ball flies, no card yet (decision 34) */
/* a cell the lesson step asks to touch (decision 32): a light warm face (the number stays dark), a gold ring, a soft pulse */
.cell.l-touch { background: radial-gradient(circle at 50% 40%, #fffbe9, #ffe6a3 70%, #f8d27a) !important; filter: none !important; z-index: 5;
  outline: 3px solid #ffd166; outline-offset: 5px; border-radius: 12px; animation: l-touch 1.1s ease-in-out infinite; }
/* the gold frame a step off the cell, like the frame of the rivals (decision 35); the glow breathes */
@keyframes l-touch { 0%, 100% { box-shadow: 0 0 14px 8px rgba(255,209,102,.35); } 50% { box-shadow: 0 0 26px 12px rgba(255,209,102,.6); } }
.lesson .spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 3px #ffd166, 0 0 18px 4px rgba(255,209,102,.55);
}
.lesson .spot.moving { transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease; }
.lesson .lcard { position: fixed; left: 16px; width: calc(100vw - 32px); top: calc(76px + env(safe-area-inset-top, 0px)); /* placed by lesson.js place() */ pointer-events: auto; padding: 14px 16px 12px;
  border-radius: 14px; background: var(--enamel); box-shadow: var(--enamel-rim); color: var(--ink); font-family: var(--font-text); }
.lesson .lcard.rise { animation: lesson-rise .3s ease-out both; }
@keyframes lesson-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* the card of a step (decisions No 18, stand variant C): "Step N of 8" on a lilac pill with a violet rim; two buttons of one kind
   share the width - "Skip" orange, "Next" deep emerald (the game's accent); a lone button sits in the middle at half the width */
.lesson .lstep { display: inline-block; padding: 6px 12px 5px; border-radius: 999px; background: #e7dbf3; box-shadow: inset 0 0 0 2px #3a2552;
  font: 700 14px/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; color: #3a2552; }
.lesson .ltext { margin: 8px 0 10px; font: 600 17px/1.35 var(--font-text); }
.lesson .lbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lesson .lbtns:has([hidden]) { grid-template-columns: minmax(0, 1fr); width: calc(50% - 5px); margin: 0 auto; }
.lesson .lbtns .zbtn { width: 100%; min-height: 52px; padding: 6px 10px; font: 700 20px/1 var(--font-head); letter-spacing: .03em; text-transform: uppercase;
  box-shadow: inset 0 0 0 3px #2d2340, inset 0 3px 0 rgba(255,255,255,.3), 3px 3px 0 #2d2340; }
.lesson .lbtns .lskip { background: var(--bingo); color: var(--bingo-ink); }
.lesson .lbtns .lnext { background: linear-gradient(180deg, #3d8160, #2f6a4a 55%, #1d4530); color: #fdf0d8; }
@media (min-width: 900px) {
  .lesson .lcard { width: var(--card-w, 380px); }
  .lesson .ltext { font-size: 20px; } .lesson .lstep { font-size: 18px; }
}

/* ---------- the finale beats 2 and 4 (spec 07 VFX-20): the line's animals run out of their cells; light crosses the card ---------- */
.runners { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.runner { position: fixed; color: #2d2340; animation: run-out 1.2s cubic-bezier(.3,.1,.6,1) var(--dl, 0ms) both; }
.runner svg { width: 100%; height: 100%; fill: currentColor; filter: drop-shadow(2px 2px 0 rgba(253,240,216,.9)); }
@keyframes run-out { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 15% { opacity: 1; transform: translate(0, -18px) scale(1.15); }
  100% { transform: translate(calc(var(--dir, 1) * 60vw), -40px) scale(1.1); opacity: 0; } }
.light .card.focus { overflow: hidden; }
.light .card.focus::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 35%, rgba(255,226,160,.55) 50%, transparent 65%); background-size: 260% 100%; animation: light-sweep .9s ease-in-out both; }
@keyframes light-sweep { from { background-position: 120% 0; } to { background-position: -20% 0; } }

/* "Reduce motion" chosen in the game's settings (spec 05 UI-27; 07 VFX-32) - the same as the system's: no flights, particles,
   squashes and breathing; the states stay (colour, stamp, glow) */
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after { animation: none !important; transition: none !important; }

/* the result's moments (spec 07 VFX-22): the rank bar fills in 600 ms, "New record!" - a ribbon of 1 200 ms, a new rank - a badge
   with rays for 900 ms after the record's ribbon */
.zw-result .bar i { width: var(--to, 0%); animation: bar-fill .6s ease-out .3s both; }
@keyframes bar-fill { from { width: 0; } to { width: var(--to, 0%); } }
.zw-result .ribbon.record { animation: ribbon-in 1.2s cubic-bezier(.2,.9,.25,1.18) .2s both; }
@keyframes ribbon-in { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 25% { transform: scale(1.12) rotate(2deg); opacity: 1; } 45% { transform: scale(1); } 100% { transform: scale(1); } }
.zw-result .ribbon.rank-new { position: relative; animation: rank-in .9s ease-out .2s both; }
.zw-result .ribbon.rank-new.after { animation-delay: 1.4s; }
.zw-result .ribbon.rank-new::before { content: ""; position: absolute; inset: -18px; z-index: -1; background: var(--rays); border-radius: 50%; animation: rank-rays .9s ease-out .2s both; opacity: 0; }
.zw-result .ribbon.rank-new.after::before { animation-delay: 1.4s; }
@keyframes rank-in { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }
@keyframes rank-rays { 0% { opacity: 0; transform: rotate(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: rotate(40deg); } }
