/* Test mode (quiz-test) on the phone. Colours and base type come from q.css; this file adds the test screens and
   the question graphics. Cards at least 56 px high, body text at least 16 px, layout from 320 px wide. */

.sp { display: flex; flex-direction: column; gap: 14px; }
.sp h1 { font-size: 30px; }
/* on the questions the progress count is the one yellow line at the top; the brand line steps back to grey */
main:has(.sp-top) > .eyebrow { color: var(--tekst3); }
.sp-lead { color: var(--tekst1); }
.sp-hint { font-size: 16px; color: var(--tekst3); }
.sp-start { min-height: 64px; font-size: 22px; font-weight: 800; background: var(--limonka); color: #07090d; margin-top: 4px; }

.sp-top { display: flex; align-items: center; gap: 12px; }
.sp-count { flex: none; color: var(--limonka); font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.sp-bar { flex: 1; height: 6px; border-radius: 3px; background: #3a3846; overflow: hidden; }
.sp-bar i { display: block; height: 100%; border-radius: 3px; background: var(--limonka); transition: width .3s ease; }

/* the join banner is a toast over the header, out of the flow: when it goes after 3 s nothing under the finger moves.
   A tap on it lands on the toast, never on a card scrolled under it (pointer-events: auto). */
.sp-banner { position: fixed; z-index: 5; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; max-width: 456px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--obwodka); border-radius: 14px; background: #2e2b3a; color: var(--tekst1); font-size: 16px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .55); pointer-events: auto; }
.sp-banner[hidden] { display: none; }
/* the toast and the network pill share the spot over the header: the pill wins, it carries the network state */
body:has(#net:not([hidden])) .sp-banner { display: none; }
.sp-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--pilka); box-shadow: 0 0 12px var(--pilka); }

/* the one highlighted word of a question (**word** in the copy), the stage draws it yellow too */
.sp-q .hl { background: none; color: var(--limonka, #ffcc00); }
.sp-q { font-family: var(--naglowek); font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--tekst1); }
@media (max-width: 350px) { .sp-q { font-size: 21px; } .sp h1 { font-size: 26px; } }
.sp-ex { margin-top: -6px; font-size: 16px; line-height: 1.4; color: var(--tekst3); }
.sp-not { font-size: 16px; line-height: 1.4; color: var(--tekst2); }
.sp-art { margin: 0; padding: 8px 6px; border-radius: 16px; background: var(--karta); }
.sp-art svg { display: block; width: 100%; height: auto; max-height: 150px; }
/* short screens (iPhone SE, Safari with its bars): a smaller picture, so more answer cards fit above the fold; below
   600 px no picture at all, since its labels would render at 5-6 px and the example under the question says the same */
@media (max-height: 700px) { .sp-art svg { max-height: 96px; } }
@media (max-height: 600px) { .sp-art { display: none; } }

.sp-options { display: flex; flex-direction: column; gap: 8px; }
.sp-opt {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 10px 16px;
  border: 1.5px solid var(--obwodka); border-radius: 14px; background: var(--opcja); color: var(--tekst1);
  text-align: left; font-size: 17px; font-weight: 600; line-height: 1.3; -webkit-tap-highlight-color: transparent;
  transition: border-color .12s ease, background-color .12s ease;
}
.sp-opt .sp-opt-hint { font-size: 16px; font-weight: 500; color: var(--tekst3); }
.sp-opt[aria-pressed="true"] { border-color: var(--limonka); background: rgba(255, 204, 0, .14); }
.sp-opt[aria-pressed="true"] .sp-opt-hint { color: var(--tekst2); }
.sp-opt:disabled { opacity: 1; }
.sp-back { align-self: flex-start; min-height: 44px; padding: 10px 14px 10px 0; background: none; color: var(--tekst2); font-size: 16px; font-weight: 600; }
.sp-back[hidden] { display: none; }
/* a quiet text button: a second person on the same phone, and the way back to the first result */
.sp-link { align-self: flex-start; min-height: 44px; padding: 10px 14px 10px 0; background: none; color: var(--tekst2); font-size: 16px; font-weight: 600; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.sp-sync { font-size: 16px; color: var(--tekst2); }
.sp-sync[hidden] { display: none; }
/* one network message at a time: while the fixed bar (#net in q.html) is up, the inline note says the same thing */
body:has(#net:not([hidden])) .sp-sync { display: none; }

.sp-result-head { color: var(--tekst1); font-size: 17px; font-weight: 600; }
.sp-level { display: flex; align-items: center; gap: 16px; }
.sp-level-number { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--pilka); color: #07090d; font-size: 44px; font-weight: 800; box-shadow: 0 0 28px var(--pilka); font-family: var(--naglowek); }
.sp .sp-level-name { margin: 0; font-size: 28px; line-height: 1.1; }
.sp-level-label { display: flex; align-items: flex-end; gap: 8px; color: var(--tekst2); font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
/* the stage's level badge: seven rising bars, the reached one in yellow */
.sp-steps { flex: none; display: block; }
/* the stairs of the projector on the first screens */
.sp-stage { margin: 4px 0 2px; }
.sp-stage svg { display: block; width: 100%; height: auto; max-height: 120px; }
/* With the stairs, Zaczynam ends 476-500 px from the top (WebKit, 320-430 px wide); without them about 110 px higher.
   Short screens drop the stairs so the button is never below the fold. A 320 px phone up to 560 px high (iPhone SE 1st
   gen: 460 px with Safari's bars, 548 px without) drops them whichever of the two heights iOS gives the query; wider
   phones only below 520 px, so an iPhone SE 2nd/3rd gen (553 px with the bars, button at 481 px) keeps them. */
@media (max-height: 519px), (max-width: 359px) and (max-height: 560px) { .sp-stage { display: none; } }
/* a sheet with no answer is no result: the ball without a number */
.sp-empty .sp-level-number { width: 44px; height: 44px; font-size: 0; }
.sp-illustration { width: 100%; aspect-ratio: 720 / 402; border-radius: 16px; background: var(--karta); object-fit: cover; }
.sp-illustration[hidden] { display: none; }
.sp-desc { color: var(--tekst1); font-size: 18px; line-height: 1.45; }
.sp-approx { font-size: 16px; color: var(--tekst3); }
.sp-pending { font-size: 16px; color: var(--tekst3); }
.sp-pending[hidden] { display: none; }

/* ---- question graphics: final state by default, motion only while the svg has .play ---- */
.qa text { font-family: Inter, system-ui, -apple-system, sans-serif; }
.qa .a-out { opacity: 0; }
.qa .a-pop, .qa .a-grow { transform-box: fill-box; }
.qa .a-pop { transform-origin: center; }
.qa .a-grow { transform-origin: left center; }
.qa.play .a-in { animation: qa-in .45s ease-out var(--d, 0s) both; }
.qa.play .a-pop { animation: qa-pop .4s cubic-bezier(.3, 1.6, .5, 1) var(--d, 0s) both; }
.qa.play .a-grow { animation: qa-grow .5s ease-out var(--d, 0s) both; }
.qa.play .a-out { animation: qa-out .35s ease-in var(--d, 0s) both; }
.qa.play .a-draw { stroke-dasharray: 1; animation: qa-draw .5s ease-out var(--d, 0s) both; }
.qa.play .a-move { animation: qa-move 1.2s ease-in-out var(--d, 0s) both; }
@keyframes qa-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes qa-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes qa-grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes qa-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes qa-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes qa-move { from { transform: translate(var(--fx, 0), var(--fy, 0)); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .qa.play * { animation: none !important; }
  .sp-bar i, .sp-opt { transition: none; }
}

/* ---- paced mode (quiz-p1 .. quiz-p11, po-kolei-view.js): the letter of every card, as on the stage ---- */
.pk-row { display: flex; align-items: flex-start; gap: 12px; }
.pk-letter { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -1px; border: 1.5px solid rgba(255, 204, 0, .6); border-radius: 50%; background: rgba(255, 204, 0, .12); color: var(--limonka); font-size: 14px; font-weight: 800; line-height: 1; }
.pk-icon { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--tekst1); opacity: .85; }
.pk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pk-head .eyebrow { margin: 0; }
.pk-mark { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 12px; border: 1.5px solid rgba(255, 255, 255, .18); border-radius: 999px; color: var(--tekst2); font-size: 14px; font-weight: 700; }
.pk-mark-shape { display: block; }
/* one example from life per level, under the approximate line (4.10.2026) */
.sp-example { color: var(--tekst2); font-size: 16px; line-height: 1.45; }
.sp-banner-mark { flex: none; display: block; }
/* the join banner on the start screen: at the bottom, so the line next to the symbol at the top stays in view */
.sp-banner.pk-banner-low { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); }
/* on the screens with the dots the network pill covers the row of dots only, in two small lines at most, never the room
   bar or the question (review of PR 3); the dots wait under it, Wstecz and Dalej at the bottom stay free */
body:has(.pk-page) .net { top: max(4px, env(safe-area-inset-top)); max-height: 40px; padding: 3px 10px; gap: 8px; overflow: hidden; font-size: 12.5px; line-height: 1.2; }
body:has(.pk-page) .net::before { width: 8px; height: 8px; }

/* ---- paced mode with the navigation (6.10.2026, quiz-odpowiadanie-design.md): the question, its example, every card,
   Wstecz and Dalej on one screen without scrolling, from 320 x 568 up. The page is as tall as the window (dvh, so the
   browser bars are out), the bar sticks to the bottom, and po-kolei-view.js fit() steps data-fit up from 0 until the
   content fits (fewer pixels per line, tighter cards, no icons). ---- */
body:has(.pk-page) { padding: max(8px, env(safe-area-inset-top)) 12px 0; }
body:has(.pk-page):has(#net:not([hidden])) { padding-bottom: 0; }
.pk-page { display: flex; flex-direction: column; min-height: calc(100vh - max(8px, env(safe-area-inset-top))); min-height: calc(100dvh - max(8px, env(safe-area-inset-top))); }
.pk-main { flex: none; display: flex; flex-direction: column; gap: var(--pk-gap, 10px); padding-bottom: 8px; }

/* one row: 11 dots and the player's small mark (no brand line); the row bleeds into the side padding for wider dots */
.pk-top { display: flex; align-items: flex-start; gap: 4px; margin: 0 -6px; }
.pk-dots { flex: 1 1 auto; min-width: 0; display: flex; }
.pk-dot { flex: 1 1 0; min-width: 0; height: 40px; padding: 3px 0 0; border-radius: 8px; background: none; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; -webkit-tap-highlight-color: transparent; }
.pk-dot:disabled { opacity: 1; cursor: default; }
.pk-dot i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--obwodka); background: var(--opcja); color: var(--tekst2); font-style: normal; font-size: 12px; font-weight: 800; line-height: 1; }
.pk-dot.is-done i { background: var(--limonka); border-color: var(--limonka); color: #07090d; }
.pk-dot.is-here i { box-shadow: 0 0 0 2px var(--tlo), 0 0 0 3.5px var(--tekst1); }
.pk-dot.is-later i { background: none; border-color: #3a3846; color: #5d5a6e; }
.pk-dot b { visibility: hidden; font-size: 8.5px; font-weight: 800; letter-spacing: .5px; line-height: 1; color: var(--akcent); }
.pk-dot.is-stage b { visibility: visible; }
@media (max-width: 359px) { .pk-dot i { width: 21px; height: 21px; font-size: 11px; } .pk-dot b { font-size: 7.5px; letter-spacing: .2px; } }
.pk-chip { flex: none; display: grid; place-items: center; width: 30px; height: 27px; margin-top: 2px; border: 1.5px solid rgba(255, 255, 255, .18); border-radius: 9px; }
.pk-chip svg { display: block; }
.pk-chip-ball { width: 14px; height: 14px; border-radius: 50%; background: var(--pilka); }

/* where the room is, for a phone that is not there (no button) */
.pk-room { display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 10px; border: 1px solid var(--obwodka); border-radius: 10px; background: #2e2b3a; color: var(--tekst1); font-size: 15px; font-weight: 600; line-height: 1.25; }
.pk-room svg { flex: none; color: var(--akcent); }
.pk-room[hidden] { display: none; }
/* fit() measures with the bar shown, so the step never changes when it comes or goes */
.pk-measure .pk-room[hidden] { display: flex; visibility: hidden; }

.pk-page .sp-q { font-size: var(--pk-q, 22px); line-height: 1.18; }
.pk-page .sp-ex { margin-top: -4px; font-size: var(--pk-ex, 15px); line-height: 1.35; }
.pk-page .sp-not { font-size: var(--pk-ex, 15px); line-height: 1.35; }
.pk-options { gap: var(--pk-opt-gap, 6px); }
.pk-page .pk-opt { min-height: var(--pk-opt-h, 46px); padding: var(--pk-opt-pad, 6px 12px); border-radius: 12px; font-size: var(--pk-opt, 16px); line-height: var(--pk-lh, 1.25); }
.pk-page .pk-row { gap: 10px; }
.pk-page .pk-letter { width: var(--pk-letter, 24px); height: var(--pk-letter, 24px); margin-top: 0; font-size: 13px; }
.pk-page .pk-icon { width: 20px; height: 20px; margin-top: 1px; }
.pk-page[data-fit="1"] { --pk-q: 20px; --pk-ex: 14px; --pk-opt: 15.5px; --pk-opt-h: 44px; --pk-opt-pad: 5px 11px; --pk-gap: 8px; --pk-opt-gap: 5px; }
.pk-page[data-fit="2"] { --pk-q: 19px; --pk-ex: 13.5px; --pk-opt: 15px; --pk-opt-h: 42px; --pk-opt-pad: 4px 10px; --pk-gap: 7px; --pk-opt-gap: 5px; --pk-lh: 1.22; }
.pk-page[data-fit="3"] { --pk-q: 18px; --pk-ex: 13px; --pk-opt: 14.5px; --pk-opt-h: 40px; --pk-opt-pad: 4px 10px; --pk-gap: 6px; --pk-opt-gap: 4px; --pk-lh: 1.2; }
.pk-page[data-fit="4"] { --pk-q: 17px; --pk-ex: 12.5px; --pk-opt: 14px; --pk-opt-h: 38px; --pk-opt-pad: 3px 9px; --pk-gap: 5px; --pk-opt-gap: 4px; --pk-lh: 1.18; --pk-letter: 22px; }
.pk-page[data-fit="5"] { --pk-q: 16px; --pk-ex: 12px; --pk-opt: 13.5px; --pk-opt-h: 36px; --pk-opt-pad: 2px 8px; --pk-gap: 4px; --pk-opt-gap: 3px; --pk-lh: 1.15; --pk-letter: 20px; }
/* from step 3 the icons go: the label gets their width back, so long labels take fewer lines */
.pk-page[data-fit="3"] .pk-icon, .pk-page[data-fit="4"] .pk-icon, .pk-page[data-fit="5"] .pk-icon { display: none; }

/* Wstecz and Dalej stuck to the bottom of the window, the saved line over them */
.pk-bar { position: sticky; bottom: 0; z-index: 2; margin: auto -12px 0; padding: 4px 12px max(6px, env(safe-area-inset-bottom)); background: var(--tlo); border-top: 1px solid #34313f; }
/* the line over Wstecz and Dalej: "Wylosuj inny symbol" until the first answer, then the saved line */
.pk-line { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.pk-line .pk-status { flex: 1 1 auto; min-width: 0; }
.pk-reroll { flex: none; display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 4px 0; padding: 6px 16px 6px 10px; border: 1.5px solid var(--obwodka); border-radius: 14px; background: var(--opcja); color: var(--tekst1); font-size: 16px; font-weight: 700; -webkit-tap-highlight-color: transparent; }
.pk-reroll[hidden] { display: none; }
.pk-reroll:disabled { opacity: .6; }
.pk-reroll-mark { flex: none; display: block; }
.sp .pk-reroll { align-self: flex-start; }
.pk-reroll-note[hidden] { display: none; }
.pk-status { min-height: 20px; margin: 0; overflow: hidden; color: var(--tekst2); font-size: 14px; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; }
.pk-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.pk-back { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px 8px 2px; background: none; color: var(--tekst2); font-size: 17px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
/* no Wstecz on P1: its place stays, so Dalej and the line next to it never jump */
.pk-back[hidden] { display: flex; visibility: hidden; }
.pk-next { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 20px; border: 1.5px solid var(--obwodka); border-radius: 14px; background: var(--opcja); color: var(--tekst1); font-size: 18px; font-weight: 800; -webkit-tap-highlight-color: transparent; }
.pk-next.is-go { background: var(--limonka); border-color: var(--limonka); color: #07090d; }
.pk-next[hidden], .pk-wait[hidden] { display: none; }
.pk-wait { display: -webkit-box; max-width: 64%; margin: 0 0 0 auto; overflow: hidden; color: var(--tekst3); font-size: 13.5px; line-height: 1.3; text-align: right; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

/* the stairs screen (decision Q5 D): the player alone on its level, no picture, no room, no number in a circle */
.pk-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 14px 14px; border-radius: 18px; background: var(--karta); }
.pk-card .sp-level-label { margin-bottom: 8px; font-size: 14px; color: var(--tekst1); }
.pk-card .sp-level-name { margin: 0; font-size: 30px; line-height: 1.1; }
.pk-stairs { display: block; width: 100%; height: auto; }
.pk-rise { display: flex; align-items: center; gap: 8px; color: var(--tekst1); font-size: 16px; font-weight: 600; line-height: 1.3; }
.pk-rise svg { flex: none; color: var(--limonka); }
.pk-result .sp-level-name { margin: 0; font-size: 28px; line-height: 1.1; }
