/* =========================================================
   Design tokens (source: Figma "pulapki-quiz")
   Swap values here to retheme the whole app.
   ========================================================= */

@font-face {
    font-family: 'Baloo 2';
    font-weight: 400 900;
    font-display: swap;
    src: url('/fonts/Baloo2.ttf') format('truetype');
}

@font-face {
    font-family: 'Poppins';
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/Poppins-SemiBold.ttf') format('truetype');
}

:root {
    --red: #e73044;
    --yellow: #efce00;
    --navy: #123159;
    --black: #0e0e10;
    --white: #ffffff;
    --grey: #6f6f74;
    --font-display: 'Baloo 2', 'Arial Black', sans-serif;
    --font-body: 'Poppins', 'Segoe UI', sans-serif;
    --radius-tile: 40px;
    --radius-capsule: 999px;
    --shadow-tile: 0 1px 25px 5px rgba(26, 28, 7, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--white);
    min-height: 100vh;
    background: var(--navy);
    transition: background 0.4s ease;
}

/* --- theme backgrounds, set on <body> by JS --- */

body.theme-red { background: var(--red); --theme-bg: var(--red); }
body.theme-yellow { background: var(--yellow); color: var(--navy); --theme-bg: var(--yellow); }
body.theme-navy { background: var(--navy); --theme-bg: var(--navy); }
body.theme-black { background: var(--black); --theme-bg: var(--black); }

.display {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

/* =========================================================
   Presentation stage (/present) - full-bleed 16:9
   ========================================================= */

.stage-full {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3vh 6vw;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.screen-title {
    font-size: clamp(2rem, 7vh, 4.6rem);
}

.screen-subtitle {
    font-size: clamp(1.1rem, 2.2vw, 1.8rem);
    line-height: 1.5;
    max-width: 42em;
}

.screen-subtitle p + p {
    margin-top: 0.4em;
}

/* decorative monkeys pinned to screen edges */

.monkey {
    position: absolute;
    pointer-events: none;
    user-select: none;
}

.monkey--left {
    left: -6vw;
    top: 50%;
    transform: translateY(-50%) rotate(12deg);
    width: 24vw;
}

.monkey--right {
    right: -6vw;
    top: 50%;
    transform: translateY(-50%) rotate(-12deg) scaleX(-1);
    width: 24vw;
}

.monkey--top {
    width: clamp(120px, 24vh, 320px);
    position: static;
    margin-top: -5vh;
    margin-bottom: 2vh;
}

.monkey img,
.monkey--top img,
.join-status-icon img {
    width: 100%;
    height: auto;
    display: block;
}

/* gentle, kid-friendly animations */

@keyframes monkey-bob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes monkey-spin {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}

@keyframes tile-grow {
    from { transform: scaleY(0.2); opacity: 0; }
    to { transform: scaleY(1); opacity: 1; }
}

@keyframes pop-in {
    0% { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.06); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes spin-around {
    to { transform: rotate(360deg); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-bob { animation: monkey-bob 2.4s ease-in-out infinite; }
.animate-wiggle { animation: monkey-spin 1.1s ease-in-out infinite; }
.animate-spin { animation: spin-around 1.8s linear infinite; }
.animate-pop { animation: pop-in 0.5s ease-out both; }

/* --- trap eyes: full-screen phase with a signature animation per trap --- */

.trap-eyes {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.trap-eyes img {
    width: min(52vw, 58vh);
    height: auto;
}

/* strach: a nervous tremble */
.trap-eyes--1 img {
    animation: eyes-tremble 2.2s ease-in-out both;
}

@keyframes eyes-tremble {
    0%, 100% { transform: scale(1); }
    20% { transform: scale(1.06) translateX(-8px); }
    40% { transform: scale(1.06) translateX(8px); }
    60% { transform: scale(1.03) translateX(-6px); }
    80% { transform: scale(1.05) translateX(6px); }
}

/* pośpiech: darts away like a comet */
.trap-eyes--2 img {
    animation: eyes-dash 2.3s ease-in both;
}

@keyframes eyes-dash {
    0% { transform: translateX(0); }
    55% { transform: translateX(-4vw); }
    100% { transform: translateX(115vw) rotate(8deg); }
}

/* polaryzacja: pulls to opposite sides */
.trap-eyes--3 img {
    animation: eyes-split 2.2s ease-in-out both;
}

@keyframes eyes-split {
    0%, 100% { transform: rotate(0); }
    30% { transform: rotate(-7deg) translateX(-2.5vw); }
    70% { transform: rotate(7deg) translateX(2.5vw); }
}

/* wyolbrzymianie: grows way past life size */
.trap-eyes--4 img {
    animation: eyes-grow 2.2s ease-out both;
}

@keyframes eyes-grow {
    0% { transform: scale(0.5); }
    70% { transform: scale(1.14); }
    100% { transform: scale(1.02); }
}

/* the trap's eyes sitting on the bottom edge of the definition screen */
.trap-peek {
    position: fixed;
    bottom: 2vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(22vw, 24vh);
    height: auto;
    pointer-events: none;
}

.result-content--trap {
    padding-bottom: 14vh;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    opacity: 0;
    animation: fade-in 0.6s ease 1.5s forwards;
}

/* phase 1 of the question result has no eyes intro to wait for */
.result-content--immediate {
    opacity: 1;
    animation: none;
}

.result-question-text {
    font-size: clamp(1.3rem, 2.4vw, 2.1rem);
    max-width: 30em;
    margin: 0.5vh 0 1vh;
}

/* Question-result charts are deliberately smaller than the group chart -
   the explanation text below is the star of this screen. */
.result-content .tiles {
    min-height: 34vh;
    margin-top: 1vh;
}

/* --- lobby --- */

.qr-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-tile);
    padding: 18px;
    margin: 2.5vh 0 2vh;
    animation: pop-in 0.5s ease-out both;
}

.qr-card img {
    display: block;
    width: min(30vh, 280px);
    height: auto;
}

.lobby-count {
    font-size: clamp(1.2rem, 2.4vw, 1.8rem);
}

/* --- station attract screen (Figma "start" series) --- */

.attract-title {
    margin-top: 2vh;
}


/* QR + START! in one big touchable capsule. */
.attract-capsule {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(24px, 4vw, 70px);
    margin: 3vh 0 1.5vh;
    padding: clamp(14px, 2.4vh, 26px) clamp(28px, 3.5vw, 64px);
    border-radius: 32px;
    box-shadow: var(--shadow-tile);
    position: relative;
    z-index: 2;
}

.attract-capsule--red {
    background: var(--red);
    color: var(--yellow);
}

.attract-capsule--navy {
    background: var(--navy);
    color: var(--yellow);
}

.attract-qr {
    display: block;
    background: var(--white);
    border-radius: 16px;
    padding: 10px;
    line-height: 0;
}

.attract-qr img {
    width: clamp(120px, 21vh, 220px);
    height: auto;
}

.attract-start-label {
    font-size: clamp(2.6rem, 9vh, 6rem);
    letter-spacing: 0.06em;
}

.attract-countdown {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3.6vh, 2.4rem);
    min-height: 1.3em;
    position: relative;
    z-index: 2;
}

/* corner monkeys + scattered question marks (decoration layer) */

.attract-monkey {
    position: fixed;
    width: clamp(220px, 30vh, 420px);
    height: auto;
    pointer-events: none;
    z-index: 1;
}

.attract-monkey--bottom-left {
    left: -3vw;
    bottom: -6vh;
}

.attract-monkey--bottom-right {
    right: -3vw;
    bottom: -6vh;
    transform: scaleX(-1);
}

.attract-monkey--top-right {
    right: -2vw;
    top: -5vh;
    transform: rotate(180deg);
}

.attract-qmark {
    position: fixed;
    pointer-events: none;
    z-index: 1;
}

.attract-qmark--left {
    left: 6vw;
    top: 10vh;
    width: clamp(70px, 12vh, 150px);
}

.attract-qmark--right {
    right: 3vw;
    bottom: 32vh;
    width: clamp(45px, 8vh, 100px);
}

.join-action {
    margin-top: 24px;
}

/* --- redesign v2: interludes and intro --- */

.intro-title {
    margin-bottom: 1vh;
    color: var(--yellow);
}

.intro-monkey {
    margin-top: 0;
}

.reflection-title {
    color: var(--yellow);
    max-width: 16em;
}

.chips--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3vh 2.5vw;
    width: min(88vw, 1500px);
    margin-top: 5vh;
    list-style: none;
}

.chips--grid .chip-item {
    font-size: clamp(1.1rem, 2.6vh, 1.8rem);
    font-weight: 600;
    padding: clamp(18px, 3.6vh, 34px) 24px;
    border-radius: var(--radius-capsule);
    box-shadow: var(--shadow-tile);
    text-align: center;
    animation: pop-in 0.5s ease-out both;
}

/* Small hint under the "co zaskoczyło" headline (tester feedback via Figma). */
.reflection-hint {
    margin-top: 3vh;
    font-size: clamp(1.1rem, 2.6vh, 1.7rem);
    font-weight: 600;
}

.reflection-monkey {
    position: fixed;
    width: clamp(180px, 26vh, 360px);
    height: auto;
    pointer-events: none;
}

.reflection-monkey--top-left {
    left: 4vw;
    top: 5vh;
}

.reflection-monkey--bottom-right {
    right: 5vw;
    bottom: 8vh;
}

/* half-face monkeys peeking from the screen edges (group results) */
.peek-monkey {
    position: fixed;
    top: 8vh;
    width: clamp(160px, 22vh, 320px);
    height: auto;
    pointer-events: none;
}

.peek-monkey--left {
    left: 0;
}

.peek-monkey--right {
    right: 0;
}

.join-action:disabled {
    opacity: 0.4;
}

.lobby-count strong {
    font-family: var(--font-display);
    font-size: 1.4em;
}

.lobby-code {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    letter-spacing: 0.35em;
    margin-top: 1vh;
}

.lobby-hint {
    margin-top: 1.5vh;
    opacity: 0.75;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
}

/* --- question screen --- */

.question-screen {
    width: 100%;
    max-width: 1500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
}

.progress-track {
    width: 100%;
    height: 26px;
    border-radius: var(--radius-capsule);
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

body.theme-yellow .progress-track {
    background: rgba(18, 49, 89, 0.15);
}

.progress-fill {
    height: 100%;
    width: 100%;
    border-radius: var(--radius-capsule);
    transition: width 0.1s linear;
}

.progress-label {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    margin-top: -1.5vh;
}

.question-text {
    font-size: clamp(1.8rem, 3.4vw, 3rem);
    font-weight: 600;
    max-width: 28em;
    margin: 1vh 0;
}

.capsules {
    list-style: none;
    width: 100%;
    display: grid;
    gap: 2.6vh;
}

.capsule {
    border-radius: var(--radius-capsule);
    padding: clamp(16px, 3vh, 30px) clamp(24px, 3vw, 48px);
    font-size: clamp(1.1rem, 2vw, 1.7rem);
    font-weight: 600;
    text-align: left;
    box-shadow: var(--shadow-tile);
}

/* --- result tiles (group + per-question) --- */

/* Tracks are equal height, so aligning columns at the TOP keeps the bars in
   line no matter how many lines a label below them takes. */
.tiles {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(24px, 5vw, 110px);
    min-height: 46vh;
    margin-top: 2vh;
}

.tile-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Full-scale grey track with a value pill growing from the bottom. */
.track {
    width: clamp(150px, 16vw, 310px);
    height: 46vh;
    border-radius: var(--radius-tile);
    background: rgba(255, 255, 255, 0.16);
    position: relative;
    overflow: hidden;
    transform-origin: bottom;
    animation: tile-grow 0.7s ease-out both;
}

body.theme-yellow .track {
    background: rgba(18, 49, 89, 0.16);
}

.track--question {
    width: clamp(120px, 12vw, 230px);
    height: 34vh;
}

.track-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-tile);
    box-shadow: var(--shadow-tile);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.2vw, 3.2rem);
    transition: height 0.6s ease;
}

.track-fill--slim {
    border-radius: 14px;
}

/* Percentage number hovering above a fill too short to contain it. */
.track-value {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.2vw, 3.2rem);
}

.track-fill--correct {
    outline: 6px solid var(--white);
    outline-offset: -6px;
}

/* A long caption ("wszyscy uczestnicy wystawy") wraps instead of widening
   its column, so the three bars keep equal spacing. */
.tile-label {
    margin-top: 2.4vh;
    font-size: clamp(1.2rem, 2.2vw, 2rem);
    font-weight: 600;
    max-width: clamp(150px, 16vw, 310px);
    text-align: center;
    text-wrap: balance;
}


/* The player renders as a white card on our navy stage (same language as
   the QR card) - its inside is cross-origin, so this frame is all we own. */
.classwise-frame {
    position: fixed;
    top: 13vh;
    left: 4vw;
    width: 92vw;
    height: 81vh;
    border: 0;
    border-radius: 28px;
    background: var(--white);
    box-shadow: var(--shadow-tile);
    z-index: 8;
}

/* Opaque cover over the player while it flashes its login/session check;
   same geometry as the frame, dropped once the quiz is delivered. */
#classwise-curtain {
    position: fixed;
    top: 13vh;
    left: 4vw;
    width: 92vw;
    height: 81vh;
    border-radius: 28px;
    background: var(--navy);
    box-shadow: var(--shadow-tile);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3vh;
}

#classwise-curtain img {
    width: clamp(90px, 16vh, 170px);
}

#classwise-curtain p {
    font-size: clamp(1.6rem, 4vh, 2.6rem);
}

.classwise-heading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 13vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 7;
}

.classwise-heading-monkey {
    height: 9vh;
    width: auto;
}

.classwise-heading-title {
    font-size: clamp(1.6rem, 5vh, 3rem);
}

/* Floating setup card at the player's top-right corner (over the harmless
   "Quiz: 1/1" chip); it never intercepts taps and fades out after a minute,
   so it cannot bother the pad panel or the running quiz for long. */
.classwise-guide {
    position: fixed;
    top: calc(13vh + 14px);
    right: calc(4vw + 14px);
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--navy);
    color: var(--white);
    border-radius: 24px;
    padding: 20px 30px;
    box-shadow: var(--shadow-tile);
    font-size: clamp(1.2rem, 2.8vh, 1.8rem);
    z-index: 9;
    pointer-events: none;
}

.classwise-guide img {
    width: clamp(60px, 10vh, 104px);
    height: auto;
}

.classwise-guide-title {
    font-size: clamp(1.3rem, 3.2vh, 2rem);
    color: var(--yellow);
}

.classwise-guide ol {
    margin: 0 0 0 1.2em;
    padding: 0;
    text-align: left;
}

/* status pill stays visible above the mounted player iframe */
#classwise-status {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;
    background: rgba(14, 14, 16, 0.78);
    color: var(--white);
    padding: 8px 20px;
    border-radius: var(--radius-capsule);
    font-size: 0.9rem;
    max-width: 90vw;
}

/* --- per-question result explanation --- */

.result-heading-small {
    font-size: clamp(1.2rem, 2vw, 1.9rem);
    font-weight: 600;
    letter-spacing: 0.06em;
}

.result-trap-name {
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    margin: 0.5vh 0 1vh;
}

/* Figma "wyniki 11": the tagline is the second-loudest element (45px vs 35px
   of the explanation) - a short bold takeaway, not a subtitle. */
.result-tagline {
    font-size: clamp(1.3rem, 2.3vw, 2.1rem);
    font-weight: 600;
    line-height: 1.5;
    /* Wide enough for the part before the dash to hold one line. */
    max-width: 34em;
    text-wrap: balance;
}

/* One centred line: "Prawidłowa odpowiedź to A: …" plus the JAK TO? capsule,
   which stays centred even when the sentence wraps. */
.result-explanation {
    margin-top: 3vh;
    max-width: 46em;
    text-align: center;
    font-size: clamp(1.15rem, 2.1vw, 1.7rem);
    line-height: 1.55;
    text-wrap: pretty;
}

.result-explanation .correct-answer {
    font-family: var(--font-display);
    font-size: 1.2em;
}

.result-explanation .source {
    display: block;
    opacity: 0.6;
    font-size: 0.85em;
    margin-top: 0.6em;
}

.answered-note {
    margin-top: 1.6vh;
    opacity: 0.7;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
}

/* --- reflection question chips (screen 8) --- */

.chips {
    list-style: none;
    display: grid;
    gap: 2vh;
    margin-top: 3.5vh;
    width: min(760px, 90%);
}

.chip-item {
    border-radius: var(--radius-capsule);
    padding: 2.2vh 3vw;
    font-weight: 600;
    font-size: clamp(1rem, 1.9vw, 1.5rem);
    box-shadow: var(--shadow-tile);
    border: 3px solid rgba(255, 255, 255, 0.55);
    animation: pop-in 0.5s ease-out both;
}

/* --- footer meta on present --- */

/* Centered so the ghost buttons own the bottom corners. */
.stage-meta {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 14px;
    font-size: 0.8rem;
    opacity: 0.45;
}

/* --- presentation toolbar --- */

.present-toolbar {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    opacity: 0.2;
    transition: opacity 0.2s ease;
    z-index: 20;
}

.present-toolbar:hover {
    opacity: 1;
}

.toolbar-button {
    appearance: none;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--white);
    border-radius: 10px;
    padding: 8px 14px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
}

.action-button {
    appearance: none;
    cursor: pointer;
    margin-top: 4vh;
    padding: 16px 38px;
    border: 0;
    border-radius: var(--radius-capsule);
    background: var(--yellow);
    color: var(--navy);
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.2vw, 1.9rem);
    box-shadow: var(--shadow-tile);
}

.action-button:hover {
    transform: scale(1.03);
}

/* Explicit touch pill (Figma: "Dalej za 10s") - visible, finger-sized. */
.next-button {
    appearance: none;
    cursor: pointer;
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: rgba(10, 22, 44, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
    border-radius: var(--radius-capsule);
    padding: 14px 26px;
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.9vh, 1.15rem);
    font-weight: 600;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    z-index: 20;
}

.next-button:hover {
    opacity: 1;
}

.next-arrow {
    font-size: 1rem;
}

.classwise-reload,
.next-button--left {
    right: auto;
    left: 16px;
}

.next-countdown {
    opacity: 0.8;
    font-weight: 400;
    margin-left: 6px;
}

/* --- station mode switcher: discreet corner control + panel --- */

#mode-switch-corner {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(14, 14, 16, 0.28);
    color: rgba(255, 255, 255, 0.75);
    font-size: 22px;
    line-height: 1;
    z-index: 12;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    opacity: 0.45;
}

/* Hold-progress ring: wipes in bottom-up over the 3-second hold. */
#mode-switch-corner.is-holding {
    opacity: 1;
}

#mode-switch-corner.is-holding::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 3px solid var(--yellow);
    animation: hold-progress 3s linear forwards;
}

@keyframes hold-progress {
    from { clip-path: inset(100% 0 0 0); }
    to { clip-path: inset(0); }
}

#mode-panel {
    position: fixed;
    inset: 0;
    background: rgba(14, 14, 16, 0.82);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-panel-card {
    color: var(--white);
    background: var(--navy);
    border-radius: var(--radius-tile);
    box-shadow: var(--shadow-tile);
    padding: 5vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3.5vh;
    max-width: min(90vw, 900px);
}

.mode-panel-title {
    color: var(--yellow);
    font-size: clamp(1.6rem, 4.4vh, 2.8rem);
    text-align: center;
}

.mode-panel-note {
    font-size: clamp(1.1rem, 2.6vh, 1.6rem);
    opacity: 0.85;
}

.mode-panel-options {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

#mode-panel .mode-option {
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(1.2rem, 3vh, 1.8rem);
    padding: 3.5vh 3vw;
    min-width: min(36vw, 340px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1vh;
    cursor: pointer;
}

#mode-panel .mode-option.is-active {
    border-color: var(--yellow);
    background: rgba(239, 206, 0, 0.14);
}

#mode-panel .mode-option--confirm {
    border-color: var(--yellow);
    background: var(--yellow);
    color: var(--navy);
}

#mode-panel .mode-option-note {
    font-size: clamp(0.9rem, 2vh, 1.2rem);
    font-weight: 400;
    opacity: 0.75;
}

.mode-panel-close {
    border: 0;
    border-radius: var(--radius-capsule);
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.4vh, 1.4rem);
    padding: 12px 34px;
    cursor: pointer;
}

/* Pad-mode idle warning: a tap anywhere keeps the mode. */
#group-idle-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 92vw;
    background: var(--red);
    color: var(--white);
    border-radius: var(--radius-capsule);
    box-shadow: var(--shadow-tile);
    padding: 14px 30px;
    font-size: clamp(1.1rem, 2.6vh, 1.6rem);
    font-weight: 600;
    text-align: center;
    z-index: 20;
}

.qr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 14, 16, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vh;
    padding: 24px;
    cursor: pointer;
    z-index: 30;
    text-align: center;
}

/* =========================================================
   Participant view (/join) - mobile first
   ========================================================= */

.join-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.join-content {
    width: 100%;
    max-width: 460px;
}

.join-question-text {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 14px 0 18px;
}

.join-capsules {
    display: grid;
    gap: 14px;
}

.button-capsule {
    appearance: none;
    border: none;
    cursor: pointer;
    width: 100%;
    border-radius: var(--radius-capsule);
    padding: 20px 24px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    box-shadow: var(--shadow-tile);
    transition: transform 0.08s ease, opacity 0.2s ease;
}

.button-capsule:active {
    transform: scale(0.97);
}

.button-capsule:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.button-capsule.is-selected {
    outline: 4px solid var(--white);
}

body.theme-yellow .button-capsule.is-selected {
    outline-color: var(--navy);
}

.join-progress {
    margin-bottom: 6px;
}

.join-progress .progress-track {
    height: 14px;
}

.join-progress .progress-label {
    margin-top: 8px;
    font-size: 1rem;
}

.join-status-icon {
    width: clamp(150px, 40vw, 220px);
    margin: 0 auto 20px;
}

.join-title {
    font-size: 1.7rem;
}

.join-message {
    margin-top: 10px;
    font-size: 1rem;
    opacity: 0.85;
    line-height: 1.5;
}

.join-notice {
    margin-top: 14px;
    min-height: 1.3em;
    font-size: 0.9rem;
}

.code-input {
    width: 100%;
    margin-top: 22px;
    padding: 16px 20px;
    border-radius: var(--radius-capsule);
    border: none;
    background: var(--white);
    color: var(--navy);
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.3em;
    text-align: center;
    text-transform: uppercase;
}

.code-input:focus {
    outline: 4px solid var(--yellow);
}

.button-primary {
    appearance: none;
    border: none;
    cursor: pointer;
    width: 100%;
    margin-top: 14px;
    border-radius: var(--radius-capsule);
    padding: 16px 24px;
    background: var(--yellow);
    color: var(--navy);
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-transform: uppercase;
    box-shadow: var(--shadow-tile);
}

.identity-note {
    margin-top: 18px;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* =========================================================
   Educator panel (/control) - on-brand, navy + white card
   ========================================================= */

.panel-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--navy);
}

.panel {
    width: 100%;
    max-width: 760px;
    background: var(--white);
    border-radius: 28px;
    box-shadow: var(--shadow-tile);
    padding: 40px 44px;
    color: var(--navy);
}

.panel__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.panel__header img {
    width: 56px;
    height: auto;
}

.panel h1 {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 1.7rem;
    color: var(--navy);
}

.panel .lead {
    color: #4c5a72;
    line-height: 1.5;
}

.panel a {
    color: var(--red);
    font-weight: 600;
}

.panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.panel__stat {
    background: var(--navy);
    color: var(--white);
    border-radius: 18px;
    padding: 16px 20px;
}

.panel__stat-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.panel__stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.panel__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.stored-session {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid #d9e4ec;
    border-radius: 14px;
    background: #f5f9fc;
}

.stored-session p {
    margin-top: 0;
}

.button {
    appearance: none;
    border: none;
    border-radius: var(--radius-capsule);
    padding: 15px 30px;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 1rem;
    cursor: pointer;
    background: var(--yellow);
    color: var(--navy);
    box-shadow: 0 2px 10px rgba(18, 49, 89, 0.25);
    transition: transform 0.05s ease, opacity 0.2s ease;
}

.button:active {
    transform: scale(0.98);
}

.button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.button--danger {
    background: var(--red);
    color: var(--white);
}

.mode-select {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.mode-option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 2px solid #d8dde6;
    border-radius: 16px;
    cursor: pointer;
    line-height: 1.35;
}

.mode-option:has(input:checked) {
    border-color: var(--navy);
    background: #f2f6fc;
}

.mode-option input {
    margin-top: 4px;
    accent-color: var(--navy);
}

.login-input {
    width: 100%;
    margin-top: 12px;
    padding: 15px 20px;
    border-radius: var(--radius-capsule);
    border: 2px solid #d8dde6;
    background: var(--white);
    color: var(--navy);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
}

.login-input:focus {
    outline: none;
    border-color: var(--navy);
}

.panel__message {
    margin-top: 16px;
    min-height: 1.4em;
    color: #4c5a72;
    font-weight: 600;
}

.panel__message--error {
    color: var(--red);
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .monkey--left,
    .monkey--right {
        display: none;
    }

    .tiles {
        gap: 16px;
        min-height: 34vh;
    }
}

/* --- 20.08 revisions: bare start screen, briefing intro, on-demand overlays --- */

/* Without the intro copy the capsule is the whole message: bigger QR (scan
   from 2 m), bigger START, centred under the title. */
.attract-capsule--hero {
    margin-top: 5vh;
    gap: clamp(32px, 5vw, 90px);
    padding: clamp(18px, 3vh, 34px) clamp(36px, 4.5vw, 84px);
}

.attract-capsule--hero .attract-qr img {
    width: clamp(170px, 30vh, 320px);
}

.attract-capsule--hero .attract-start-label {
    font-size: clamp(3rem, 11vh, 7.5rem);
}

/* Intro: the three-line briefing carries the screen on its own. */
.intro-briefing {
    margin-top: 4vh;
    font-size: clamp(1.6rem, 4.6vh, 3rem);
    font-weight: 600;
    line-height: 1.5;
    max-width: 30em;
}

.intro-briefing p + p {
    margin-top: 0.4em;
}

/* "JAK TO?" - a small capsule right after the correct answer. */
/* Always its own centred line, so the layout does not depend on how long
   the correct answer happens to be. */
.how-so-button {
    appearance: none;
    border: 0;
    border-radius: var(--radius-capsule);
    display: block;
    margin: 1.6vh auto 0;
    padding: 0.5em 1.6em;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05em;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: var(--shadow-tile);
    animation: how-so-pop 0.5s ease 1.2s both;
}

@keyframes how-so-pop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.screen-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 14, 16, 0.78);
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6vh 6vw;
}

/* The card is white on purpose (same family as the QR card): calm reading surface on every theme. */
.how-so-card {
    position: relative;
    background: var(--white);
    color: var(--navy);
    border-radius: var(--radius-tile);
    box-shadow: var(--shadow-tile);
    padding: clamp(28px, 5vh, 56px) clamp(32px, 5vw, 80px);
    max-width: min(88vw, 1250px);
    text-align: left;
}

.how-so-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
}

.how-so-eyebrow {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--red);
    font-size: clamp(1rem, 2.4vh, 1.5rem);
    margin-bottom: 1.2vh;
}

/* The hook question is the headline of the card, the answer follows below. */
.how-so-lead {
    font-size: clamp(1.4rem, 3.6vh, 2.5rem);
    font-weight: 700;
    line-height: 1.45;
    color: var(--red);
    margin-bottom: 1.6vh;
    text-wrap: pretty;
}

.how-so-text {
    font-size: clamp(1.2rem, 3.1vh, 2.1rem);
    font-weight: 500;
    line-height: 1.55;
    text-wrap: pretty;
}

.how-so-source {
    margin-top: 2vh;
    font-size: clamp(0.95rem, 2.2vh, 1.4rem);
    opacity: 0.6;
}

/* Phone flavour of the card: inline under the message, no overlay. */
.how-so-card--phone {
    margin: 16px 0 8px;
    padding: 18px 20px;
    border-radius: 24px;
    max-width: 100%;
}

.how-so-card--phone .how-so-eyebrow { font-size: 0.85rem; }
.how-so-card--phone .how-so-lead { font-size: 1.05rem; margin-bottom: 8px; }
.how-so-card--phone .how-so-text { font-size: 1rem; }
.how-so-card--phone .how-so-source { font-size: 0.85rem; margin-top: 10px; }

/* "Włącz video" - outlined capsule under the reflection hint. */
.video-button {
    appearance: none;
    margin-top: 4vh;
    border: 3px solid var(--white);
    border-radius: var(--radius-capsule);
    background: transparent;
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.2rem, 3vh, 2rem);
    letter-spacing: 0.04em;
    padding: 0.6em 1.8em;
    cursor: pointer;
}

.screen-overlay--video {
    background: var(--black);
    padding: 0;
}

.video-frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5vh;
    color: var(--white);
    text-align: center;
    padding: 6vh 6vw;
}

.video-monkey {
    width: clamp(120px, 22vh, 240px);
}

.video-title {
    font-size: clamp(2rem, 7vh, 4.5rem);
    color: var(--yellow);
}

.video-note {
    font-size: clamp(1.1rem, 2.8vh, 1.8rem);
    max-width: 28em;
    opacity: 0.85;
}

.video-close-button {
    margin-top: 2vh;
    border: 0;
    border-radius: var(--radius-capsule);
    background: var(--yellow);
    color: var(--navy);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(1rem, 2.6vh, 1.5rem);
    padding: 0.7em 2em;
    cursor: pointer;
}

/* =========================================================
   Web quiz (/web) - one visitor, their own phone or laptop
   ========================================================= */

/* The page is a single column: content grows, the action bar hugs the
   bottom edge. Mobile-first; the desktop rule at the end widens the column. */
.web-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

.web-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 28px 22px 0;
}

.web-loading {
    margin: auto;
    opacity: 0.7;
}

.web-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 18px;
    padding-bottom: 12px;
}

.web-stack--top {
    justify-content: flex-start;
    padding-top: 44px;
}

.web-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    padding: 4vh 0 3vh;
}

.web-monkey {
    width: clamp(140px, 40vw, 220px);
}

.web-monkey--hero {
    width: clamp(160px, 46vw, 250px);
}

.web-monkey img,
.web-eyes img {
    width: 100%;
    height: auto;
    display: block;
}

.web-title {
    font-size: clamp(1.7rem, 7.2vw, 2.5rem);
    line-height: 1.1;
    text-wrap: balance;
}

.web-title--hero {
    font-size: clamp(1.9rem, 8.4vw, 2.9rem);
}

.web-lead {
    font-size: clamp(1rem, 4.2vw, 1.15rem);
    line-height: 1.5;
    opacity: 0.88;
    max-width: 30em;
    text-wrap: pretty;
}

.web-eyebrow {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}

.web-briefing {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
    font-weight: 600;
    line-height: 1.45;
    text-wrap: pretty;
}

.web-briefing p + p {
    margin-top: 0.55em;
}

/* --- action bar --- */

.web-actions {
    position: sticky;
    bottom: 0;
    width: 100%;
    margin-top: auto;
    padding: 22px 0 calc(18px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(to bottom, transparent, var(--theme-bg) 30%);
    z-index: 2;
}

.web-button {
    appearance: none;
    border: 0;
    display: block;
    width: 100%;
    border-radius: var(--radius-capsule);
    padding: 18px 24px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.15rem, 4.8vw, 1.35rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-tile);
    cursor: pointer;
    transition: transform 0.08s ease, opacity 0.25s ease;
}

.web-button:active {
    transform: scale(0.97);
}

.web-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.web-button--yellow {
    background: var(--yellow);
    color: var(--navy);
}

.web-button--red {
    background: var(--red);
    color: var(--white);
}

.web-button--outline {
    background: transparent;
    border: 3px solid var(--white);
    color: var(--white);
    box-shadow: none;
}

body.theme-yellow .web-button--outline {
    border-color: var(--navy);
    color: var(--navy);
}

/* --- landing decorations --- */

.web-deco {
    position: fixed;
    pointer-events: none;
    user-select: none;
    z-index: -1;
}

.web-deco--qmark-left {
    left: -8vw;
    top: 4vh;
    width: 30vw;
    max-width: 200px;
}

.web-deco--qmark-right {
    right: -2vw;
    bottom: 24vh;
    width: 18vw;
    max-width: 120px;
}

/* --- question --- */

.web-question {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 0 24px;
}

.web-question-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.web-countdown {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
    min-width: 3ch;
    text-align: right;
}

.web-progress {
    height: 12px;
}

.web-question-text {
    font-size: clamp(1.3rem, 5.6vw, 1.8rem);
    font-weight: 600;
    line-height: 1.35;
    margin: 8px 0 6px;
    text-wrap: pretty;
}

.web-capsules {
    display: grid;
    gap: 12px;
}

.web-capsule {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px 15px 14px;
    font-size: clamp(1rem, 4.3vw, 1.15rem);
    line-height: 1.3;
}

.web-capsule-letter {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
}

.web-capsule-text {
    flex: 1;
    text-align: left;
}

.web-notice {
    min-height: 1.4em;
    font-size: 0.95rem;
    opacity: 0.85;
    text-align: center;
}

/* --- results chart, sideways --- */

.web-peek {
    position: fixed;
    top: 6px;
    width: clamp(80px, 20vw, 120px);
    height: auto;
    pointer-events: none;
    z-index: -1;
}

.web-peek--left {
    left: 0;
}

.web-peek--right {
    right: 0;
}

.web-score-line {
    font-size: 1.05rem;
    opacity: 0.9;
}

.web-score-line strong {
    font-family: var(--font-display);
    font-size: 1.35em;
}

.web-bars {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 6px;
}

.web-bar {
    width: 100%;
    animation: pop-in 0.5s ease-out both;
}

.web-bar-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: left;
}

.web-bar-track {
    position: relative;
    width: 100%;
    height: 54px;
    border-radius: var(--radius-capsule);
    background: rgba(255, 255, 255, 0.16);
}

.web-bar-fill {
    height: 100%;
    border-radius: var(--radius-capsule);
    box-shadow: var(--shadow-tile);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 16px;
    transition: width 0.6s ease;
}

.web-bar-fill--slim {
    border-radius: 14px;
}

.web-bar-value {
    font-size: 1.35rem;
    white-space: nowrap;
}

.web-bar-track > .web-bar-value {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

/* --- per-question result: own answer vs. the correct one --- */

.web-result {
    gap: 14px;
}

.web-question-text--result {
    font-size: clamp(1.15rem, 4.8vw, 1.45rem);
    margin: 0;
}

.web-result-options {
    list-style: none;
    width: 100%;
    display: grid;
    gap: 10px;
}

.web-result-option {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px 14px;
    border-radius: 26px;
    text-align: left;
    font-weight: 600;
    font-size: clamp(0.95rem, 4vw, 1.1rem);
    line-height: 1.3;
}

.web-result-option--own {
    outline: 3px solid var(--white);
    outline-offset: -3px;
}

body.theme-yellow .web-result-option--own {
    outline-color: var(--navy);
}

.web-tags {
    flex-basis: 100%;
    display: flex;
    gap: 8px;
    padding-left: 52px;
}

.web-tags:empty {
    display: none;
}

.web-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: var(--radius-capsule);
    background: rgba(0, 0, 0, 0.18);
}

.web-explanation {
    font-size: clamp(1rem, 4.3vw, 1.2rem);
    line-height: 1.5;
    text-align: center;
    margin-top: 4px;
    text-wrap: pretty;
}

.web-correct-answer {
    font-size: 1.15em;
}

.web-how-so {
    margin: 0 auto;
    animation: none;
    font-size: 1.05rem;
    padding: 0.55em 1.7em;
}

.web-how-so-card {
    width: 100%;
    margin: 4px 0 0;
}

#web-how-so-slot:empty {
    display: none;
}

/* --- trap reveal --- */

.web-trap {
    gap: 12px;
}

.web-eyes {
    width: min(72vw, 320px);
    margin-bottom: 10px;
}

/* The kiosk "dash" animation leaves the eyes off-screen (an interlude there);
   here the eyes stay on the screen, so they dart out and come back. */
.web-eyes.trap-eyes--2 img {
    animation: web-eyes-dash 2.4s ease-in-out both;
}

@keyframes web-eyes-dash {
    0% { transform: translateX(0); }
    35% { transform: translateX(-8vw); }
    70% { transform: translateX(45vw) rotate(6deg); }
    100% { transform: translateX(0) rotate(0); }
}

.web-trap-name {
    font-size: clamp(1.9rem, 8.6vw, 2.8rem);
    line-height: 1.05;
    text-wrap: balance;
}

.web-tagline {
    font-size: clamp(1.05rem, 4.6vw, 1.3rem);
    font-weight: 600;
    line-height: 1.45;
    text-wrap: balance;
}

.web-corner-monkey {
    position: fixed;
    width: clamp(110px, 30vw, 170px);
    height: auto;
    pointer-events: none;
    z-index: -1;
}

.web-corner-monkey--top-left {
    left: 2vw;
    top: 3vh;
}

.web-corner-monkey--bottom-right {
    right: 3vw;
    bottom: 16vh;
}

.web-video-button {
    margin-top: 4px;
    font-size: 1.1rem;
}

/* --- goodbye --- */

.web-score-capsule {
    background: var(--yellow);
    color: var(--navy);
    border-radius: var(--radius-capsule);
    padding: 10px 26px;
    font-size: 1.3rem;
}

/* The video overlay must own the viewport - no page scroll behind it. */
body.web-overlay-open {
    overflow: hidden;
}

/* --- desktop: a comfortable centred column instead of a stretched phone --- */

@media (min-width: 900px) {
    .web-content {
        max-width: 640px;
        padding: 56px 24px 0;
    }

    .web-actions {
        position: static;
        background: none;
        padding: 32px 0 48px;
    }

    .web-peek {
        top: 40px;
        width: 180px;
    }

    .web-corner-monkey {
        width: 220px;
    }

    .web-deco--qmark-left {
        width: 200px;
        left: 6vw;
    }

    .web-deco--qmark-right {
        width: 120px;
        right: 8vw;
    }
}

/* --- web: fixes after the first phone walkthrough --- */

/* Short screens sit in the middle of the viewport; long ones start at the
   top and scroll ("safe" keeps the overflow reachable). */
.web-question,
.web-stack--top {
    justify-content: safe center;
}

.web-countdown {
    text-transform: none;
}

/* Yellow theme (question 3): a yellow button would vanish into the page. */
body.theme-yellow .web-button--yellow {
    background: var(--navy);
    color: var(--white);
}

body.theme-yellow .web-score-capsule {
    background: var(--navy);
    color: var(--white);
}

.web-result-option--muted {
    background: rgba(255, 255, 255, 0.14);
}

body.theme-yellow .web-result-option--muted {
    background: rgba(18, 49, 89, 0.12);
}

body.theme-yellow .web-bar-track {
    background: rgba(18, 49, 89, 0.16);
}

/* --- web: fixes after the final review --- */

/* Comfortable thumb target for the small capsule. */
.web-how-so {
    min-height: 44px;
}

/* The card scrolls into view above the sticky action bar, not under it. */
.web-how-so-card {
    scroll-margin-bottom: 130px;
}

/* Landscape phones: the fixed decorations would sit behind the text column. */
@media (max-height: 480px) {
    .web-corner-monkey,
    .web-deco,
    .web-peek {
        display: none;
    }
}

/* This is a personal screen, not a TV: honour the reduced-motion setting. */
@media (prefers-reduced-motion: reduce) {
    .web-shell .animate-bob,
    .web-shell .animate-spin,
    .web-eyes img,
    .web-bar,
    .web-how-so {
        animation: none;
    }

    .web-bar-fill,
    .web-button,
    .progress-fill {
        transition: none;
    }
}

/* --- web on a monitor: one centred block, larger type, no bottom-pinned bar --- */

@media (min-width: 900px) {
    html.web-page {
        font-size: 18px;
    }

    .web-content {
        max-width: 720px;
        justify-content: center;
        padding: 40px 24px;
    }

    .web-hero,
    .web-stack,
    .web-question {
        flex: 0 0 auto;
    }

    .web-stack--top {
        padding-top: 0;
    }

    .web-actions {
        margin-top: 36px;
        padding: 0;
    }

    .web-button {
        max-width: 460px;
        margin: 0 auto;
    }

    .web-monkey {
        width: 200px;
    }

    .web-monkey--hero {
        width: 240px;
    }
}

@media (min-width: 1500px) {
    html.web-page {
        font-size: 20px;
    }

    .web-content {
        max-width: 800px;
    }
}

/* Bigger peeking monkeys on the results screen (tester's note: too small on a phone). */
.web-peek {
    width: clamp(110px, 28vw, 160px);
}

/* --- explainer film in the overlay (kiosk and /web) --- */

.video-frame--player {
    gap: 1.5vh;
    padding: 4vh 4vw;
}

.video-player {
    width: 100%;
    max-width: min(92vw, calc((100vh - 14vh) * 16 / 9));
    max-height: 82vh;
    aspect-ratio: 16 / 9;
    background: var(--black);
    border-radius: 24px;
    box-shadow: var(--shadow-tile);
    outline: none;
}

.video-close {
    z-index: 1;
}

.video-status {
    min-height: 1.4em;
    margin: 0;
}

/* Phones in portrait: the film spans the width, the close button stays reachable. */
@media (max-width: 600px) {
    .video-frame--player {
        padding: 70px 12px 24px;
        justify-content: flex-start;
    }

    .video-player {
        max-width: 100%;
        border-radius: 16px;
    }
}
