/* QuizzMe preview: flatter, calmer, and built to feel like a real pub-quiz tool. */
:root {
    --ink: #20211f;
    --muted: #666761;
    --line: #d9d9d1;
    --paper: #f5f3ec;
    --white: #ffffff;
    --navy: #232b55;
    --blue: #3f55b5;
    --yellow: #f2c94c;
    --yellow-deep: #d9a900;
    --green: #16845f;
    --coral: #d85b55;
    --shadow: none;
    --game-shadow: none;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.button,
button,
input,
textarea,
select {
    border-radius: 6px;
}

.button {
    box-shadow: none;
    font-weight: 700;
}

.button-primary,
.button-primary:hover {
    border-color: #d6aa23;
    background: var(--yellow);
    box-shadow: none;
    color: #211f17;
}

.button-primary:hover {
    background: #e9bb35;
}

.button-dark,
.button-dark:hover {
    background: var(--navy);
    color: #fff;
}

.button-outline {
    border-color: var(--line);
    background: #fff;
}

.button-ghost,
.button-ghost:hover {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    backdrop-filter: none;
}

.workspace-card,
.round-editor,
.suggestion-library,
.suggestion-card,
.mode-option,
.settings-section,
.people-table-card {
    border-color: var(--line);
    border-radius: 8px;
    box-shadow: none;
}

/* Home */
.home-page,
.home-hero {
    min-height: 100svh;
    background: var(--paper);
    color: var(--ink);
}

.home-hero {
    background-image: none;
}

.home-hero::before {
    background: transparent;
}

.home-hero::after { display: none; }

.home-header {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    border-bottom: 1px solid var(--line);
    background: transparent;
}

.home-header .wordmark {
    width: 104px;
    height: 72px;
}

.home-nav > a:not(.button) {
    color: var(--ink);
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
    align-items: center;
    gap: clamp(42px, 6vw, 92px);
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.home-copy {
    width: 100%;
}

.home-copy h1 {
    max-width: 620px;
    color: var(--ink);
    font-size: clamp(3.25rem, 5vw, 4.9rem);
    letter-spacing: -0.055em;
    line-height: 0.98;
    text-shadow: none;
}

.home-kicker,
.home-intro {
    color: var(--muted);
}

.home-kicker {
    letter-spacing: 0.03em;
    text-transform: none;
}

.home-intro {
    max-width: 580px;
    font-size: 1.08rem;
    line-height: 1.65;
}

.hero-join {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
}

.hero-join > label,
.hero-join > label strong {
    color: var(--ink);
}

.home-flow {
    width: min(1180px, calc(100% - 48px));
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
}

.home-flow > div {
    border-right-color: var(--line);
}

.home-flow > div > span {
    border-color: #ddc669;
    background: #fff6cf;
    color: #745c00;
}

.home-flow strong {
    color: var(--ink);
}

.home-flow small {
    color: var(--muted);
}

.home-demo {
    overflow: hidden;
    border: 1px solid #151b3d;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
}

.home-demo-top,
.home-demo-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
}

.home-demo-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    background: #1b2145;
}

.home-demo-top span {
    color: #f5d157;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-demo-top strong {
    font-size: 0.86rem;
    letter-spacing: 0.07em;
}

.home-demo > p,
.home-demo > h2 {
    margin-right: 24px;
    margin-left: 24px;
}

.home-demo > p {
    margin-top: 28px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    font-weight: 700;
}

.home-demo > h2 {
    max-width: 410px;
    margin-top: 0;
    margin-bottom: 26px;
    font-size: clamp(1.55rem, 2.2vw, 2.2rem);
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.home-demo-answers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 24px 28px;
}

.home-demo-answers span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    font-weight: 700;
}

.home-demo-answers b {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 4px;
    background: #fff;
    color: var(--navy);
    font-size: 0.72rem;
}

.home-demo-answers span:nth-child(1) { border-left: 4px solid #ef625d; }
.home-demo-answers span:nth-child(2) { border-left: 4px solid #4f7bd9; }
.home-demo-answers span:nth-child(3) { border-left: 4px solid #e5bd35; }
.home-demo-answers span:nth-child(4) { border-left: 4px solid #3eaa7a; }

.home-demo-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.72rem;
    font-weight: 700;
}

/* Public auth */
.public-shell {
    background: var(--paper);
}

.public-header {
    background: transparent;
}

.auth-grid {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
}

.auth-context {
    background: #ebe8dd;
}

.auth-context h1 {
    max-width: 590px;
    font-size: clamp(2.5rem, 4vw, 4.2rem);
    letter-spacing: -0.05em;
    line-height: 1;
}

.auth-context-list > div {
    border-color: #d2cfc4;
}

/* Host controls */
.host-app {
    background: #f4f3ee;
}

.host-sidebar {
    border-right: 0;
    background: var(--navy);
}

.host-nav button,
.host-nav button:hover {
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.72);
}

.host-nav button.active {
    background: #fff;
    box-shadow: none;
    color: var(--navy);
}

.sidebar-session {
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.host-topbar {
    border-bottom-color: var(--line);
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
}

.host-content {
    max-width: 1320px;
    margin: 0 auto;
}

.workspace-heading h1 {
    letter-spacing: -0.04em;
}

.section-label {
    color: var(--blue);
    letter-spacing: 0.035em;
}

.save-state i,
.status-dot {
    box-shadow: none;
}

.host-invite-card {
    border: 0;
    border-radius: 8px;
    background: var(--navy);
    box-shadow: none;
}

.host-invite-card::after,
.tv-content::before,
.player-join::before {
    display: none;
}

.host-qr-frame {
    border-radius: 8px;
    box-shadow: none;
}

.generator-band {
    border: 1px solid #ddd4ae;
    border-radius: 8px;
    background: #fff8d9;
    box-shadow: none;
}

.generator-chip {
    border: 1px solid #dfcf88;
    border-radius: 4px;
    background: #fff;
    color: #68540d;
    letter-spacing: 0;
    text-transform: none;
}

.generator-assurance {
    color: #706b57;
}

.suggestion-library.open {
    background: #fff;
}

.suggestion-library-icon {
    border-radius: 6px;
}

.answer-edit,
.question-editor,
.quiz-title-row,
.round-header {
    box-shadow: none;
}

[aria-invalid="true"] {
    border-color: #ba3b35 !important;
    box-shadow: 0 0 0 3px rgba(186, 59, 53, 0.12) !important;
}

.field-error {
    display: block;
    margin-top: 6px;
    color: #9f302c;
    font-size: 0.72rem;
    font-weight: 700;
}

/* TV: plain, high-contrast and readable across a room */
.tv-stage {
    grid-template-rows: minmax(0, 1fr);
    background: #f6f5ef;
    color: var(--ink);
}

.tv-header,
.tv-footer {
    background: #fff;
}

.tv-content {
    background: #f6f5ef;
}

.tv-announcement {
    top: 24px;
    width: min(1180px, calc(100% - 80px));
    padding: 22px 36px;
    border: 3px solid #171d3d;
    border-radius: 10px;
    background: #f5cc45;
    color: #17150d;
    box-shadow: 0 10px 0 rgba(23, 29, 61, 0.18);
    font-size: clamp(1.5rem, 2.4vw, 2.6rem);
    font-weight: 900;
    line-height: 1.15;
}

.tv-lobby,
.tv-question,
.tv-reveal,
.tv-break-layout,
.tv-leaderboard-layout {
    position: relative;
    z-index: 1;
}

.tv-qr,
.joiner-rail > div,
.tv-answer,
.answer-results > div,
.tv-leaderboard-rows > div {
    border-color: var(--line);
    border-radius: 8px;
    box-shadow: none;
}

.tv-qr {
    background: #fff;
}

.tv-reveal {
    grid-template-columns: minmax(0, 0.9fr) minmax(620px, 1.25fr);
    gap: 5vw;
    padding: 44px 6vw;
}

.reveal-answer h1 {
    font-size: clamp(4rem, 5vw, 6rem);
}

.reveal-answer > p:last-child {
    max-width: 700px;
    font-size: 1.35rem;
    line-height: 1.5;
}

.answer-results {
    gap: 16px;
}

.answer-results > div {
    min-height: 74px;
    grid-template-columns: minmax(220px, 0.8fr) minmax(180px, 1fr) 54px;
    padding: 18px 20px;
    font-size: 1.25rem;
}

.answer-results > div > span b {
    width: 38px;
    height: 38px;
}

/* Player phone */
.player-page {
    background: #e9e8e2;
}

.player-controller {
    border-color: #d7d7cf;
    border-radius: 10px;
    box-shadow: none;
}

.player-join {
    background: #f8f7f2;
}

.connection-badge.ready i {
    background: #6d7482;
}

.phone-answer {
    border-radius: 8px;
    box-shadow: none;
}

.phone-answer.selected {
    box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--navy);
}

.answer-confirm-bar {
    box-shadow: none;
}

.player-leave-action {
    color: #b52e2e !important;
    font-weight: 800;
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
}

.player-leave-action:hover,
.player-leave-action:focus-visible {
    color: #8f1f1f !important;
}

@media (max-width: 900px) {
    .home-hero-inner {
        grid-template-columns: 1fr;
    }

    .home-copy {
        width: 100%;
    }

    .home-copy h1 {
        font-size: clamp(2.8rem, 11vw, 4.4rem);
    }

    .home-intro {
        max-width: 620px;
    }

    .home-demo {
        width: min(100%, 620px);
    }
}

@media (max-width: 700px) {
    .home-header,
    .home-hero-inner,
    .home-flow {
        width: min(100% - 28px, 1180px);
    }

    .home-copy h1 {
        font-size: clamp(2.65rem, 12vw, 3.6rem);
        line-height: 1;
    }

    .home-demo {
        display: none;
    }

    .home-primary-actions {
        display: grid;
    }

    .home-flow {
        border-radius: 6px;
    }

    .home-flow > div {
        min-height: 74px;
    }

    .auth-grid,
    .generator-band,
    .suggestion-library {
        border-radius: 6px;
    }

    .auth-context h1 {
        font-size: 2.5rem;
    }

    .player-controller {
        border: 0;
        border-radius: 0;
    }

    .room-checklist-card > .button {
        width: auto;
    }
}

/* Quizmaster: mobile-first control room with an auto-hiding drawer */
.host-app { display: block; min-height: 100svh; background: #f3f4f0; }
.host-workspace { width: 100%; }
.host-sidebar {
    position: fixed; z-index: 120; inset: 0 auto 0 0; display: flex !important;
    width: min(84vw, 310px); height: 100svh; padding: 18px;
    border-right: 1px solid #dcded7; box-shadow: 20px 0 50px rgba(24, 28, 24, .18);
    transform: translateX(-105%); transition: transform 220ms cubic-bezier(.22, .8, .24, 1);
}
.host-app.nav-open .host-sidebar { transform: translateX(0); }
.host-nav-backdrop {
    position: fixed; z-index: 110; inset: 0; display: block; visibility: hidden;
    border: 0; background: rgba(16, 20, 18, .46); opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
}
.host-app.nav-open .host-nav-backdrop { visibility: visible; opacity: 1; }
.host-sidebar-heading, .host-topbar-leading { display: flex; align-items: center; }
.host-sidebar-heading { justify-content: space-between; margin-bottom: 22px; }
.host-brand { padding: 0; }
.host-brand .wordmark { width: 120px; height: auto; }
.host-sidebar .wordmark { filter: brightness(0) invert(1); }
.host-nav-close, .host-menu-button {
    display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px;
    border: 1px solid #d9dcd4; border-radius: 9px; background: #fff; color: var(--ink);
}
.host-nav-close { font-size: 1.8rem; line-height: 1; }
.host-menu-button { gap: 4px; padding: 11px; }
.host-menu-button span { display: block; width: 20px; height: 2px; background: currentColor; }
.host-nav button { min-height: 52px; font-size: .95rem; }
.sidebar-session { margin-top: auto; border: 1px solid #dfdfd7; border-radius: 10px; background: #f7f6ef; }
.sidebar-session strong { color: #171d3d; font-size: 2rem; letter-spacing: .08em; }
.sidebar-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 10px 0; color: #fff; font-size: .82rem; }
.sidebar-account .plain-action { color: #f5cc45; }
.host-topbar { min-height: 64px; padding: 8px 12px; }
.host-topbar-leading { min-width: 0; gap: 10px; }
.host-session-status, .host-session-status > div { min-width: 0; }
.host-session-status strong { overflow: hidden; display: block; max-width: 42vw; text-overflow: ellipsis; white-space: nowrap; }
.host-top-actions .button { min-height: 42px; padding: 0 12px; font-size: .75rem; }
.host-top-actions { display: flex !important; }
.host-top-actions .button { display: inline-flex !important; }
.host-presentation-bar { display: grid; gap: 10px; padding: 12px; border-bottom: 1px solid #dfe1da; background: #fff; }
.host-pin-card {
    display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 86px;
    padding: 12px 16px; border: 2px solid #171d3d; border-radius: 10px;
    background: #f5cc45; color: #17150d;
}
.host-pin-card span { align-self: end; font-size: .66rem; font-weight: 900; letter-spacing: .13em; }
.host-pin-card strong { grid-row: 1 / 3; grid-column: 2; font-size: clamp(2rem, 11vw, 3.3rem); letter-spacing: .08em; line-height: 1; }
.host-pin-card button { justify-self: start; padding: 0; background: transparent; color: #453b12; font-size: .76rem; font-weight: 850; text-decoration: underline; }
.display-toggle-group, .audience-theme-control {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px;
    padding: 10px; border: 1px solid #dfe1da; border-radius: 10px; background: #fafaf7;
}
.display-toggle-group > span, .audience-theme-control > span {
    grid-column: 1 / -1; color: #666b64; font-size: .67rem; font-weight: 900;
    letter-spacing: .08em; text-transform: uppercase;
}
.presentation-toggle, .audience-theme-control button {
    min-height: 42px; padding: 7px 9px; border: 1px solid #d6d8d1; border-radius: 7px;
    background: #fff; color: #343833; font-size: .72rem; font-weight: 850;
}
.presentation-toggle.active, .audience-theme-control button.active { border-color: #171d3d; background: #171d3d; color: #fff; }
.host-content { width: 100%; padding: 20px 12px 42px; }
.workspace-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
.workspace-heading h1 { font-size: clamp(1.75rem, 8vw, 2.65rem); line-height: 1.02; }
.heading-actions { width: 100%; flex-wrap: wrap; }
.heading-actions .button { flex: 1 1 145px; }
.workspace-card, .host-invite-card { border: 1px solid #dedfd8; border-radius: 10px; box-shadow: 0 4px 16px rgba(24, 28, 24, .05); }
.host-invite-card { color: #fff; }
.host-invite-card .host-lobby-pin { color: #f5cc45; }
.host-invite-card .host-invite-copy h2 { color: #fff; }
.host-invite-card .host-invite-copy .section-label,
.host-invite-card .host-invite-copy > p:last-of-type { color: rgba(255, 255, 255, .72); }

@media (min-width: 720px) {
    .host-presentation-bar { grid-template-columns: minmax(250px, .8fr) minmax(300px, 1.1fr) minmax(250px, .9fr); padding: 12px 20px; }
    .host-pin-card { min-height: 74px; }
    .host-pin-card strong { font-size: 2.35rem; }
    .host-content { width: min(1320px, calc(100% - 40px)); padding: 28px 0 52px; margin: 0 auto; }
    .workspace-heading { align-items: flex-end; flex-direction: row; }
    .heading-actions { width: auto; }
}

/* Audience overlays, motion and selectable day/night presentation */
.tv-join-overlays {
    position: fixed; z-index: 55; right: 28px; bottom: 26px; display: flex;
    align-items: stretch; gap: 12px; animation: audience-pop-in 420ms cubic-bezier(.2, .9, .2, 1) both;
}
.tv-pin-overlay, .tv-qr-overlay {
    display: grid; place-items: center; border: 3px solid #171d3d; border-radius: 12px;
    background: #f5cc45; color: #17150d; box-shadow: 0 10px 0 rgba(23, 29, 61, .2);
}
.tv-pin-overlay { min-width: 310px; padding: 16px 24px; }
.tv-pin-overlay span, .tv-qr-overlay span { font-size: .75rem; font-weight: 900; letter-spacing: .12em; }
.tv-pin-overlay strong { font-size: 3.4rem; letter-spacing: .1em; line-height: 1; }
.tv-qr-overlay { padding: 10px; background: #fff; }
.tv-qr-overlay img { width: 118px; height: 118px; }
.audience-night.tv-stage, .audience-night .tv-content, .audience-night.player-page { background: #050817 !important; color: #f6f8ff !important; }
.audience-night .tv-content, .audience-night .player-controller, .audience-night .player-main,
.audience-night .player-identity, .audience-night .player-footer, .audience-night .player-join,
.audience-night .player-team-summary, .audience-night .player-board, .audience-night .player-locked,
.audience-night .player-waiting, .audience-night .player-result {
    border-color: rgba(95, 235, 255, .25) !important; background: #090f25 !important; color: #f6f8ff !important;
}
.audience-night h1, .audience-night h2, .audience-night strong, .audience-night .tv-kicker, .audience-night .section-label { color: #fff !important; }
.audience-night .tv-kicker, .audience-night .section-label, .audience-night .player-score, .audience-night .phase-pill {
    color: #63f3ff !important; text-shadow: 0 0 18px rgba(99, 243, 255, .58);
}
.audience-night .tv-answer, .audience-night .answer-results > div, .audience-night .tv-leaderboard-rows > div,
.audience-night .leaderboard-rows > div, .audience-night input, .audience-night select {
    border-color: rgba(99, 243, 255, .3) !important; background: #101936 !important; color: #f8f9ff !important;
    box-shadow: 0 0 22px rgba(79, 225, 255, .06);
}
.audience-night .tv-answer.correct, .audience-night .answer-results > div.correct {
    border-color: #61ffb0 !important; background: rgba(30, 224, 132, .12) !important;
    box-shadow: 0 0 25px rgba(54, 255, 164, .14);
}
.audience-night .pin-display { border-color: rgba(99, 243, 255, .45); background: #101936; box-shadow: 0 0 28px rgba(99, 243, 255, .12); }
.audience-night .pin-display span { color: #63f3ff; }
.audience-night .pin-display strong { color: #fff !important; text-shadow: 0 0 20px rgba(99, 243, 255, .45); }
.audience-night .phone-answer { box-shadow: 0 0 20px rgba(91, 229, 255, .14); }
.audience-night .player-footer, .audience-night .player-identity { border-color: rgba(99, 243, 255, .18) !important; }
.audience-motion { animation: audience-breathe 2.3s ease-in-out infinite; }
.break-wave { display: flex; height: 54px; align-items: center; gap: 8px; margin-top: 24px; }
.break-wave i { width: 9px; height: 22px; border-radius: 6px; background: #3154d8; animation: break-wave 1s ease-in-out infinite alternate; }
.audience-night .break-wave i { background: #63f3ff; box-shadow: 0 0 15px rgba(99, 243, 255, .7); }
.break-wave i:nth-child(2) { animation-delay: 120ms; }
.break-wave i:nth-child(3) { animation-delay: 240ms; }
.break-wave i:nth-child(4) { animation-delay: 360ms; }
.break-wave i:nth-child(5) { animation-delay: 480ms; }
.motion-orbit { display: block; width: 48px; height: 48px; margin: 22px auto 0; border: 5px solid rgba(49, 84, 216, .2); border-top-color: #3154d8; border-radius: 50%; animation: orbit-spin 900ms linear infinite; }
@keyframes audience-pop-in { from { opacity: 0; transform: translateY(45px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes audience-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
@keyframes break-wave { from { height: 14px; opacity: .5; } to { height: 52px; opacity: 1; } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .audience-motion, .break-wave i, .motion-orbit, .tv-join-overlays { animation: none !important; }
}

/* Join approval and short-lived player profile images. */
.profile-image-field > span { float: right; color: var(--muted); font-weight: 600; }
.profile-image-field input[type="file"] { padding: 10px; background: #fff; }
.profile-image-field small, .field-note { display: block; margin-top: 7px; color: var(--muted); line-height: 1.45; }
.approval-queue { margin-bottom: 18px; border: 2px solid #e8ad23 !important; background: #fff9e9; }
.approval-list { display: grid; gap: 10px; }
.approval-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid #d9c588; background: #fff; }
.approval-avatar, .player-initial, .initial { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: 0 0 auto; background: #141b2d; color: #fff; font-weight: 900; }
.approval-name { min-width: 0; display: grid; gap: 3px; }
.approval-name strong { font-size: 1.05rem; }
.approval-name span { color: var(--muted); font-size: .86rem; }
.approval-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.player-approval-waiting { min-height: min(620px, 86vh); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 28px 18px; }
.player-approval-waiting .approval-avatar { width: 96px; height: 96px; font-size: 2.2rem; border: 4px solid #fff; box-shadow: 0 0 0 3px #e8ad23; }
.player-approval-waiting h1, .player-approval-waiting p { max-width: 430px; margin: 0; }
.approval-rejected { border-top: 8px solid #c93434; }
.announcement-form { grid-template-columns: minmax(0, 1fr) auto auto; }

@media (max-width: 620px) {
    .approval-row { grid-template-columns: 48px minmax(0, 1fr); }
    .approval-actions { grid-column: 1 / -1; justify-content: stretch; }
    .approval-actions .button { flex: 1; }
    .announcement-form { grid-template-columns: 1fr; }
    .announcement-form .button { width: 100%; }
}

/* Live display legibility, protected join strip and celebrations. */
.tv-stage.has-join-overlays { grid-template-rows: minmax(0, 1fr) auto; }
.tv-stage.has-join-overlays .tv-join-overlays {
    position: relative; z-index: 55; right: auto; bottom: auto; grid-row: 2;
    width: 100%; min-height: 154px; padding: 10px 24px 16px; margin: 0;
    justify-content: flex-end; align-items: center; background: inherit; box-sizing: border-box;
}
.tv-stage.has-join-overlays .tv-pin-overlay { min-height: 126px; }
.tv-stage.has-join-overlays .tv-qr-overlay img { width: 100px; height: 100px; }
.enable-display-sound {
    position: absolute; z-index: 80; top: 18px; right: 20px; padding: 10px 15px;
    border: 2px solid #171d3d; border-radius: 7px; background: #171d3d; color: #fff;
    font: inherit; font-size: .82rem; font-weight: 900; letter-spacing: .04em; cursor: pointer;
}
.enable-display-sound:focus-visible { outline: 4px solid #f5cc45; outline-offset: 3px; }

.extra-time-control { display: flex; align-items: flex-end; gap: 8px; margin: 0; }
.extra-time-control label { display: grid; gap: 4px; color: #596074; font-size: .72rem; font-weight: 850; }
.extra-time-control input {
    width: 92px; min-height: 42px; padding: 7px 10px; border: 2px solid #ccd2df;
    border-radius: 6px; background: #fff; color: #171d3d; font: inherit; font-size: 1rem; font-weight: 900;
}
.extra-time-control input:focus { border-color: #3658c7; outline: 3px solid rgba(54, 88, 199, .16); }
.room-timing-note { align-content: center; padding: 10px 12px; border: 2px solid #dbe0ea; border-radius: 6px; background: #f7f8fb; }
.room-timing-note strong { color: #171d3d; }
.room-timing-note small { color: #687086; font-weight: 650; }

.answer-confirm-backdrop {
    position: fixed; inset: 0; z-index: 180; display: grid; align-items: end;
    padding: 16px; background: rgba(15, 20, 41, .72); backdrop-filter: blur(5px);
}
.answer-confirm-modal {
    width: min(100%, 520px); max-height: calc(100dvh - 32px); margin: 0 auto; padding: 20px;
    overflow-y: auto; border: 3px solid #171d3d; border-radius: 16px 16px 10px 10px;
    background: #fffdf8; box-shadow: 0 -18px 50px rgba(12, 17, 38, .28); text-align: center;
}
.answer-confirm-countdown {
    display: grid; width: 112px; height: 112px; place-content: center; margin: 0 auto 16px;
    border: 8px solid #198754; border-radius: 50%; background: #e8f8ef; color: #11663e;
    box-shadow: 0 0 0 8px rgba(25, 135, 84, .12);
}
.answer-confirm-countdown strong { font-size: 3.2rem; line-height: .85; }
.answer-confirm-countdown span { margin-top: 9px; font-size: .62rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.answer-confirm-modal h2 { margin: 5px 0 14px; font-size: clamp(1.8rem, 8vw, 2.6rem); }
.answer-confirm-choice {
    display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 15px;
    border: 3px solid #171d3d; border-radius: 9px; color: #fff; text-align: left; font-size: 1.1rem; font-weight: 900;
}
.answer-confirm-choice b { display: grid; width: 48px; height: 48px; place-content: center; border: 2px solid currentColor; border-radius: 7px; font-size: 1.5rem; }
.answer-confirm-choice.answer-0 { background: var(--tv-blue); }
.answer-confirm-choice.answer-1 { background: var(--tv-teal); }
.answer-confirm-choice.answer-2 { background: var(--tv-red); }
.answer-confirm-choice.answer-3 { background: var(--tv-yellow); color: #171d3d; }
.answer-lock-now, .answer-cancel {
    width: 100%; min-height: 72px; border: 3px solid #171d3d; border-radius: 9px;
    font: inherit; font-size: 1.08rem; font-weight: 950; cursor: pointer;
}
.answer-lock-now { margin-bottom: 10px; background: #198754; color: #fff; }
.answer-cancel { display: flex; align-items: center; justify-content: center; gap: 12px; background: #c9343f; color: #fff; }
.answer-cancel b { font-size: 2.5rem; line-height: .7; }
.answer-lock-now:focus-visible, .answer-cancel:focus-visible { outline: 4px solid #f7d252; outline-offset: 3px; }

.captain-team-panel {
    margin: 1rem; padding: 1rem; border: 3px solid #22263a;
    background: #fff4cf; box-shadow: 5px 5px 0 #22263a;
}
.captain-team-panel h2 { margin: .1rem 0; }
.captain-team-panel small { color: #555b70; }
.captain-member-list { display: grid; gap: .65rem; margin-top: .85rem; }
.captain-member-row {
    display: grid; grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center; gap: .65rem; padding: .55rem;
    border: 2px solid #22263a; background: #fff;
}
.captain-member-avatar { width: 42px; height: 42px; }
.captain-member-row button {
    min-height: 42px; padding: .5rem .75rem; border: 2px solid #9f1839;
    background: #ffdfdf; color: #7c102d; font-weight: 900;
}
.captain-empty-team { margin: 0; color: #656b80; }
.majority-rule {
    padding: .8rem; border-left: 5px solid #08a677;
    background: #dffff4; color: #174d3d; font-weight: 800;
}
.vote-totals > div {
    display: grid; grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center; gap: .65rem; padding: .7rem;
    border: 2px solid #22263a; background: #fff;
}

.host-answer-list .answer-0 { border-left: 9px solid var(--tv-blue); background: #e8f3ff; }
.host-answer-list .answer-1 { border-left: 9px solid var(--tv-teal); background: #ddfff6; }
.host-answer-list .answer-2 { border-left: 9px solid var(--tv-red); background: #ffe7e9; }
.host-answer-list .answer-3 { border-left: 9px solid #e2ad00; background: #fff5c2; }
.host-answer-list > div b { border: 2px solid currentColor; background: #fff; }
.workspace-heading { padding: 16px; border-left: 9px solid #6c5ce7; background: #f0edff; }
.host-topbar { border-bottom: 5px solid #ffd43b; }
.ready-quiz-library {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 1.2fr);
    gap: 22px; align-items: center; margin-bottom: 20px; padding: 22px;
    border: 3px solid #272343; background: #dffff4; box-shadow: 7px 7px 0 #00a884;
}
.ready-quiz-library h2 { margin: .35rem 0; color: #272343; }
.ready-quiz-library p { margin: 0; color: #48516b; }
.ready-quiz-library form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.tv-break-layout { grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 2vw; }
.break-message { padding: 2vw; border: 3px solid #272343; background: #ffd166; color: #272343; box-shadow: 10px 10px 0 #272343; }
.break-message h1 { color: #272343; }
.break-trivia { align-self: stretch; padding: 2.2vw; border: 3px solid #fff; background: #6c5ce7; color: #fff; box-shadow: 10px 10px 0 #00a884; }
.break-trivia > span { display: inline-block; padding: .4rem .75rem; background: #ffd43b; color: #272343; font-weight: 950; text-transform: uppercase; }
.break-trivia p { margin: 2rem 0 .35rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.break-trivia h2 { margin: 0 0 1rem; font-size: clamp(2rem, 3.5vw, 4.4rem); color: #fff; }
.break-trivia div { font-size: clamp(1.15rem, 1.8vw, 2rem); line-height: 1.4; }
.leader-avatar, .question-winner-avatar, .podium-avatar { object-fit: cover; border-radius: 50%; background: #fff; }
.leader-avatar { width: 52px; height: 52px; border: 3px solid #272343; }
.question-winner-avatar { width: 62px; height: 62px; border: 3px solid #fff; }
.podium-avatar { width: clamp(70px, 7vw, 120px); height: clamp(70px, 7vw, 120px); margin: .4rem auto; border: 5px solid #fff; box-shadow: 0 0 0 3px #272343; }
.tv-leader-rows > div, .player-leader-rows > div { grid-template-columns: 42px 52px minmax(0, 1fr) auto auto; }
.question-winner-rows > div { grid-template-columns: 48px 62px minmax(0, 1fr) auto auto; }
@media (max-width: 1050px) {
    .ready-quiz-library, .ready-quiz-library form { grid-template-columns: 1fr; }
    .tv-break-layout { grid-template-columns: 1fr 1fr; }
    .break-trivia { grid-column: 1 / -1; }
}

.tv-timer-stack { display: grid; justify-items: center; gap: 9px; }
.extra-time-added {
    padding: 7px 14px; border: 2px solid #171d3d; border-radius: 999px;
    background: #f7d252; color: #171d3d; font-size: .78rem; font-weight: 950;
    letter-spacing: .05em; text-transform: uppercase;
}
.tv-timer.extra-time {
    border-color: #e45a4f; background: #fff3ed;
    box-shadow: 0 0 0 9px rgba(228, 90, 79, .13), 0 16px 34px rgba(23, 29, 61, .14);
}
.tv-timer.extra-time strong { color: #c83f38; }
.tv-timer.extra-time span { color: #c83f38; font-weight: 950; letter-spacing: .12em; }
.audience-night .tv-timer.extra-time {
    border-color: #ff7c70; background: #271d31;
    box-shadow: 0 0 0 9px rgba(255, 124, 112, .18), 0 0 38px rgba(255, 124, 112, .26);
}
.audience-night .tv-timer.extra-time strong,
.audience-night .tv-timer.extra-time span { color: #ff9b91; }

@media (max-width: 720px) {
    .extra-time-control { width: 100%; align-items: stretch; }
    .extra-time-control label { flex: 1; }
    .extra-time-control input { width: 100%; }
}

.audience-night .tv-answer.answer-0 { background: var(--tv-blue) !important; }
.audience-night .tv-answer.answer-1 { background: var(--tv-teal) !important; }
.audience-night .tv-answer.answer-2 { background: var(--tv-red) !important; }
.audience-night .tv-answer.answer-3 { background: var(--tv-yellow) !important; color: #17130a !important; }

.countdown-screen .countdown-number {
    display: grid; width: 280px; height: 280px; margin: 20px auto 0; place-items: center;
    border: 14px solid #f5cc45; border-radius: 50%; background: #171d3d; color: #fff;
    font-size: clamp(12rem, 20vw, 16rem); line-height: 1; box-shadow: 0 0 0 12px rgba(245, 204, 69, .2), 0 22px 60px rgba(23, 29, 61, .3);
    animation: countdown-pulse 900ms ease-in-out infinite alternate;
}
.audience-night .countdown-screen .countdown-number { border-color: #63f3ff; box-shadow: 0 0 0 12px rgba(99, 243, 255, .12), 0 0 70px rgba(99, 243, 255, .35); }

.question-winners-layout { align-items: center; }
.winner-screen-timer { display: inline-grid; grid-template-columns: auto auto; align-items: end; gap: 9px; margin-top: 24px; padding: 10px 16px; border: 3px solid #171d3d; background: #f5cc45; color: #17150d; }
.winner-screen-timer strong { font-size: 2.6rem; line-height: .9; }
.winner-screen-timer span { font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.question-winner-rows { display: grid; gap: 9px; }
.question-winner-rows > div { display: grid; grid-template-columns: 52px minmax(0, 1fr) 95px 130px; align-items: center; gap: 14px; padding: 13px 18px; border: 2px solid #171d3d; background: #fff; color: #171d3d; }
.question-winner-rows > div.is-first { border-width: 4px; background: #f5cc45; transform: scale(1.025); }
.question-winner-rows b { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: #171d3d; color: #fff; font-size: 1.25rem; }
.question-winner-rows span { font-size: 1.35rem; font-weight: 900; }
.question-winner-rows small { font-weight: 800; }
.question-winner-rows strong { text-align: right; font-size: 1.25rem; }
.audience-night .question-winner-rows > div { border-color: #63f3ff; background: #101936; color: #fff; }
.audience-night .question-winner-rows > div.is-first { background: #16314a; box-shadow: 0 0 26px rgba(99, 243, 255, .24); }
.confetti i { left: calc(var(--x) * 1%) !important; opacity: .9; }

@keyframes countdown-pulse { from { transform: scale(.96); } to { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) {
    .countdown-screen .countdown-number { animation: none !important; }
}

/* Quizmaster simple mode: four obvious steps, compact room tools, approvals everywhere. */
.host-app { background: #faf9f6; color: #111; }
.host-workspace { min-width: 0; }
.host-topbar {
    position: relative; z-index: 30; display: flex; min-height: 66px; padding: 10px 16px;
    border-bottom: 1px solid #dedbd6; background: #fff;
}
.host-topbar .host-brand { display: inline-flex; flex: 0 0 auto; }
.host-topbar .host-brand .wordmark { width: 108px; height: auto; }
.host-topbar-leading { min-width: 0; gap: 14px; }
.host-session-status { padding-left: 14px; border-left: 1px solid #dedbd6; }
.host-top-actions { align-items: center; gap: 10px; }
.host-top-actions .button { border-radius: 4px; }
.host-top-actions #logoutHost { color: #626260; }

.host-primary-nav {
    position: sticky; z-index: 40; top: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%; padding: 8px max(12px, calc((100% - 860px) / 2));
    border-bottom: 1px solid #dedbd6; background: rgba(255, 255, 255, .97);
}
.host-primary-nav button {
    display: flex; min-width: 0; min-height: 48px; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 12px; border: 0; border-radius: 4px; background: transparent; color: #626260;
    font: inherit; font-size: .9rem; font-weight: 750; cursor: pointer;
}
.host-primary-nav button:hover { background: #faf9f6; color: #111; }
.host-primary-nav button.active { background: #111; color: #fff; }
.host-step-number {
    display: inline-grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center;
    border: 1px solid currentColor; border-radius: 50%; font-size: .72rem;
}

.host-room-tools { border-bottom: 1px solid #dedbd6; background: #fff; }
.host-room-tools > summary { list-style: none; cursor: pointer; }
.host-room-tools > summary::-webkit-details-marker { display: none; }
.host-pin-card {
    display: grid; grid-template-columns: auto auto 1fr auto; min-height: 58px; align-items: center; gap: 10px;
    width: min(860px, calc(100% - 24px)); padding: 9px 14px; margin: 0 auto;
    border: 0; border-radius: 0; background: #fff; color: #111;
}
.host-pin-card span { align-self: center; color: #626260; font-size: .68rem; }
.host-pin-card strong {
    grid-row: auto; grid-column: auto; color: #0007cb; font-size: 1.65rem; letter-spacing: .09em;
}
.host-pin-card small { color: #7b7b78; font-size: .76rem; }
.host-pin-card::after { content: '⌄'; color: #626260; font-size: 1.2rem; transition: transform 160ms ease; }
.host-room-tools[open] .host-pin-card::after { transform: rotate(180deg); }
.host-presentation-bar {
    display: grid; grid-template-columns: auto minmax(280px, 1fr) minmax(220px, .7fr); gap: 10px;
    width: min(860px, calc(100% - 24px)); padding: 0 0 14px; margin: 0 auto;
    border: 0; background: #fff;
}
.host-presentation-bar > .button { align-self: end; border-radius: 4px; }
.display-toggle-group, .audience-theme-control { border-radius: 6px; background: #faf9f6; }
.presentation-toggle, .audience-theme-control button { border-radius: 4px; }

.global-approval-queue {
    position: relative; z-index: 35; width: min(860px, calc(100% - 24px)); padding: 12px; margin: 12px auto 0;
    border: 3px solid #ff5600; border-radius: 8px; background: #fff4ed;
}
.global-approval-queue > header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 10px;
}
.global-approval-queue > header > div { display: flex; align-items: center; gap: 9px; }
.global-approval-queue > header strong { font-size: 1.08rem; }
.global-approval-queue > header > span { color: #626260; font-size: .8rem; }
.pending-pulse {
    display: block; width: 12px; height: 12px; border-radius: 50%; background: #ff5600;
    box-shadow: 0 0 0 5px rgba(255, 86, 0, .16); animation: pending-pulse 1.35s ease-in-out infinite;
}
.global-approval-queue .approval-list { max-height: 280px; overflow: auto; }
.global-approval-queue .approval-row { border-color: #dedbd6; border-radius: 6px; }
.global-approval-queue .button { border-radius: 4px; }
.global-approval-queue .button-primary { border-color: #111; background: #111; color: #fff !important; }
.global-approval-queue .button-outline { background: #fff; color: #c41c1c; }

@keyframes pending-pulse { 50% { transform: scale(.72); opacity: .62; } }

@media (max-width: 620px) {
    .host-topbar { min-height: 58px; padding: 7px 10px; }
    .host-topbar .host-brand .wordmark { width: 88px; }
    .host-session-status { display: none; }
    .host-top-actions { gap: 8px; }
    .host-top-actions #logoutHost { display: inline-flex; min-height: 44px; align-items: center; }
    .host-top-actions .button { min-height: 38px; padding: 0 10px; font-size: .72rem; }
    .host-primary-nav {
        position: fixed; inset: auto 0 0; z-index: 100; padding: 6px max(5px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left));
        border-top: 1px solid #dedbd6; border-bottom: 0; box-shadow: 0 -4px 18px rgba(17, 17, 17, .07);
    }
    .host-primary-nav button { min-height: 54px; flex-direction: column; gap: 3px; padding: 5px 2px; font-size: .7rem; }
    .host-primary-nav button.active { background: #111; }
    .host-step-number { width: 21px; height: 21px; flex-basis: 21px; font-size: .64rem; }
    .host-content { padding-bottom: 100px; }
    .host-pin-card { grid-template-columns: auto auto 1fr auto; min-height: 54px; padding: 8px 10px; }
    .host-pin-card strong { font-size: 1.4rem; }
    .host-pin-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .host-presentation-bar { grid-template-columns: 1fr; }
    .host-presentation-bar > .button { width: 100%; }
    .global-approval-queue { padding: 10px; margin-top: 10px; }
    .global-approval-queue > header { align-items: flex-start; flex-direction: column; gap: 4px; }
    .global-approval-queue .approval-list { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pending-pulse { animation: none; }
}

/* Keep quiz authoring calm: scan question titles, open only the one being edited. */
details.question-editor { display: block; padding: 0; }
.question-editor > summary { list-style: none; }
.question-editor > summary::-webkit-details-marker { display: none; }
.question-editor-summary {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center;
    min-height: 62px; padding: 12px 18px; cursor: pointer;
}
.question-editor-summary:hover { background: #faf9f6; }
.question-editor-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.question-editor-summary .question-number { margin: 0; }
.question-edit-label { color: #0007cb; font-size: 0; font-weight: 800; }
.question-edit-label::after { content: 'Edit'; font-size: .8rem; }
.question-editor[open] .question-editor-summary { border-bottom: 1px solid #dedbd6; background: #faf9f6; }
.question-editor[open] .question-edit-label::after { content: 'Close'; }
.question-editor-body { padding: 18px 20px 22px 64px; }

@media (max-width: 620px) {
    .question-editor-summary { min-height: 58px; padding: 10px 14px; }
    .question-editor-summary strong { font-size: .9rem; }
    .question-editor-body { padding: 15px 14px 18px; }
}

/* Captain mobile navigation and animated full-team management screen. */
.player-team-nav {
    min-height: 38px; padding: 7px 13px; border: 2px solid #171d3d; border-radius: 5px;
    background: #f5cc45; color: #171d3d; font: inherit; font-size: .78rem; font-weight: 950; cursor: pointer;
}
.captain-team-screen {
    position: fixed; z-index: 250; inset: 0; overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: max(24px, env(safe-area-inset-bottom)); background: #faf9f6; color: #111;
    animation: captain-screen-in 300ms cubic-bezier(.2, .82, .25, 1) both;
}
.captain-team-header {
    position: sticky; z-index: 2; top: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center; gap: 12px; min-height: 76px; padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    border-bottom: 1px solid #dedbd6; background: rgba(255, 255, 255, .97);
}
.captain-team-header > button {
    display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid #dedbd6;
    border-radius: 50%; background: #fff; color: #111; font-size: 1.35rem; cursor: pointer;
}
.captain-team-header .section-label { margin: 0 0 2px; color: #0007cb; }
.captain-team-header h1 { margin: 0; overflow: hidden; font-size: 1.35rem; text-overflow: ellipsis; white-space: nowrap; }
.captain-team-header > span { padding: 6px 8px; border-radius: 4px; background: #eeeaff; color: #0007cb; font-size: .72rem; font-weight: 850; }
.captain-team-intro { display: grid; gap: 4px; padding: 22px 16px 12px; }
.captain-team-intro strong { font-size: 1.25rem; }
.captain-team-intro span { color: #626260; font-size: .86rem; }
.captain-team-screen .captain-member-list { display: grid; gap: 10px; padding: 0 14px; margin: 0; }
.captain-team-screen .captain-member-row {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 11px;
    padding: 14px; border: 1px solid #dedbd6; border-radius: 8px; background: #fff;
}
.captain-team-screen .captain-member-avatar { width: 48px; height: 48px; }
.captain-member-name { min-width: 0; display: grid; gap: 3px; }
.captain-member-name strong { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.captain-member-name span { width: max-content; padding: 2px 6px; border-radius: 3px; background: #eeeaff; color: #0007cb; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.captain-member-stats { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.captain-member-stats span { display: flex; align-items: baseline; gap: 5px; padding: 9px 10px; border-radius: 5px; font-size: .74rem; font-weight: 800; }
.captain-member-stats strong { font-size: 1.15rem; }
.captain-member-stats .is-correct { background: #e2f8ed; color: #087345; }
.captain-member-stats .is-incorrect { background: #ffe9e8; color: #a31e2d; }
.captain-team-screen .captain-member-row > button {
    grid-column: 2 / -1; justify-self: start; min-width: 112px; min-height: 38px; padding: 6px 12px;
    border: 1px solid #c41c1c; border-radius: 4px; background: #fff; color: #a31e2d;
    font-size: .8rem; font-weight: 850; white-space: nowrap; cursor: pointer;
}
.audience-night .captain-team-screen { background: #050817; color: #fff; }
.audience-night .captain-team-header, .audience-night .captain-member-row { border-color: rgba(99, 243, 255, .24); background: #090f25; }
.audience-night .captain-team-header > button { border-color: rgba(99, 243, 255, .24); background: #101936; color: #fff; }

@keyframes captain-screen-in {
    from { opacity: .4; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 380px) {
    .player-footer > span { display: none; }
    .captain-team-screen .captain-member-row { grid-template-columns: 44px minmax(0, 1fr); }
    .captain-team-screen .captain-member-row > button { grid-column: 1 / -1; width: 100%; }
    .captain-member-stats { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .captain-team-screen { animation: none; }
}

/* Guided Quizmaster journey, audience themes and device-local sound control. */
.host-primary-nav.guided-progress-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.host-primary-nav.guided-progress-nav button { font-size: .78rem; }
.pending-start-note { color: #a34100 !important; font-weight: 850; }

.audience-day.tv-stage,
.audience-day.player-page {
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 216, 77, .2), transparent 28%),
        radial-gradient(circle at 88% 90%, rgba(36, 94, 234, .12), transparent 32%),
        linear-gradient(145deg, #f7fbff, #fffdf4 68%);
    color: #101828;
}
.audience-day .tv-content,
.audience-day .player-main,
.audience-day .player-controller,
.audience-day .player-identity,
.audience-day .player-footer,
.audience-day .player-join,
.audience-day .player-team-summary,
.audience-day .player-board,
.audience-day .player-waiting,
.audience-day .player-locked,
.audience-day .player-result {
    border-color: #d7e2ec;
    background-color: rgba(255, 255, 255, .94);
    color: #101828;
}
.audience-day .tv-kicker,
.audience-day .section-label { color: #245eea; }
.audience-day .pin-display,
.audience-day .tv-qr,
.audience-day .answer-results > div,
.audience-day .tv-leader-rows > div {
    border-color: #d7e2ec;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 45px rgba(39, 72, 110, .12);
}
.audience-day .pin-display strong { color: #245eea; }
.audience-day .tv-timer { background: rgba(255, 255, 255, .86); box-shadow: 0 0 0 8px rgba(36, 94, 234, .07); }

.audience-night.tv-stage,
.audience-night.player-page { background: #030611 !important; }
.audience-night .tv-content,
.audience-night .player-main,
.audience-night .player-controller,
.audience-night .player-identity,
.audience-night .player-footer,
.audience-night .player-join,
.audience-night .player-team-summary,
.audience-night .player-board,
.audience-night .player-waiting,
.audience-night .player-locked,
.audience-night .player-result {
    border-color: rgba(99, 243, 255, .22) !important;
    background-color: #081127 !important;
    color: #f7fbff !important;
}
.audience-night .answer-results > div,
.audience-night .tv-leader-rows > div { background: #101c3c !important; }
.audience-night .tv-qr,
.audience-night .tv-qr-overlay { background: #fff !important; color: #101828 !important; box-shadow: 0 0 28px rgba(99, 243, 255, .16); }

.tv-show-controls { position: fixed; z-index: 90; top: 16px; right: 18px; }
.sound-toggle {
    display: inline-flex; min-height: 42px; align-items: center; gap: 8px; padding: 8px 12px;
    border: 1px solid #cdd6e4; border-radius: 999px; background: rgba(255, 255, 255, .94);
    color: #334155; font: inherit; font-size: .75rem; font-weight: 850; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); cursor: pointer;
}
.sound-toggle i { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.sound-toggle.is-on i { background: #20a464; box-shadow: 0 0 0 4px rgba(32, 164, 100, .14); }
.sound-toggle:focus-visible { outline: 3px solid #245eea; outline-offset: 2px; }
.player-footer .sound-toggle { min-height: 34px; padding: 5px 9px; box-shadow: none; }
.audience-night .sound-toggle { border-color: rgba(99, 243, 255, .3); background: #101c3c; color: #f7fbff; }

@media (max-width: 620px) {
    .host-primary-nav.guided-progress-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .host-primary-nav.guided-progress-nav button { min-height: 50px; font-size: .58rem; }
    .setup-progress span { font-size: .62rem; text-align: center; }
    .player-footer { gap: 6px; }
    .player-footer .sound-toggle span { display: none; }
}
