:root {
    --bg-ink: #04104f;
    --bg-royal: #0a2d8f;
    --bg-glow: #1f5cff;
    --card-surface: rgba(255, 255, 255, 0.07);
    --card-border: rgba(255, 255, 255, 0.22);
    --card-strong: rgba(255, 255, 255, 0.1);
    --text-main: #f7f9ff;
    --text-soft: rgba(247, 249, 255, 0.78);
    --text-muted: rgba(247, 249, 255, 0.58);
    --team-red: #f23d53;
    --team-blue: #57b7ff;
    --team-gold: #f8c65f;
    --shadow-deep: 0 22px 70px rgba(0, 8, 44, 0.45);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --font-sans: "Montserrat", "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
    --turn-accent: #f8c65f;
    --turn-accent-rgb: 248, 198, 95;
    --turn-wash: rgba(248, 198, 95, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #010622;
    color: var(--text-main);
    font-family: var(--font-sans);
}

body {
    min-height: 100dvh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: #010622 url('PictureSlam-bg.png') center / cover no-repeat;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell {
    min-height: 100dvh;
    position: relative;
    z-index: 1;
}

.boot-screen,
.app-page {
    min-height: 100dvh;
    padding:
        calc(env(safe-area-inset-top) + 20px)
        18px
        calc(env(safe-area-inset-bottom) + 24px);
}

.boot-screen {
    display: grid;
    place-items: center;
    gap: 14px;
    text-align: center;
}

.boot-logo,
.hero-logo {
    width: min(78vw, 300px);
    filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.28));
}

.boot-copy {
    margin: 0;
    color: var(--text-soft);
    font-size: 1rem;
}

.app-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.app-page-results,
.app-page-setup {
    justify-content: center;
}

.app-page-landing {
    justify-content: space-between;
    padding-top: calc(env(safe-area-inset-top) + 40px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 32px);
    gap: 0;
}

.app-page-game.is-live-focus {
    padding-top: calc(env(safe-area-inset-top) + 10px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 14px);
}

.app-page-game.turn-red {
    --turn-accent: var(--team-red);
    --turn-accent-rgb: 242, 61, 83;
    --turn-wash: rgba(242, 61, 83, 0.16);
}

.app-page-game.turn-blue {
    --turn-accent: var(--team-blue);
    --turn-accent-rgb: 87, 183, 255;
    --turn-wash: rgba(87, 183, 255, 0.16);
}

.hero-panel,
.page-shell,
.page-card,
.phase-card,
.scoreboard-card {
    width: min(100%, 760px);
}

.hero-panel,
.page-card,
.phase-card,
.scoreboard-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(2, 8, 48, 0.88);
    box-shadow: var(--shadow-deep);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.hero-panel {
    padding: 32px 24px;
    display: grid;
    gap: 28px;
}

.hero-copy,
.page-header {
    display: grid;
    gap: 12px;
}

.page-header {
    position: relative;
    isolation: isolate;
    padding: 12px 0 14px;
}

.page-header::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -18px -18px -10px;
    background:
        linear-gradient(90deg, rgba(1, 6, 34, 0.76), rgba(1, 6, 34, 0.52) 58%, rgba(1, 6, 34, 0.08)),
        radial-gradient(circle at 18% 40%, rgba(1, 6, 34, 0.62), transparent 62%);
    filter: blur(10px);
    pointer-events: none;
}

.page-header h1 {
    text-shadow:
        0 2px 2px rgba(1, 6, 34, 0.62),
        0 10px 28px rgba(1, 6, 34, 0.58);
}

.eyebrow,
.host-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.76rem;
    color: var(--team-gold);
    font-weight: 700;
}

h1,
h2 {
    margin: 0;
    line-height: 0.96;
    letter-spacing: -0.04em;
}

h1 {
    font-size: clamp(2.6rem, 9vw, 4.8rem);
}

h2 {
    font-size: clamp(2rem, 7vw, 3rem);
}

p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.hero-actions,
.action-row,
.upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 52px;
    border-radius: 999px;
    padding: 0 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    color: #ffffff;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
    transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
    cursor: wait;
    opacity: 0.62;
    transform: none;
    box-shadow: none;
}

.primary-btn {
    background: linear-gradient(135deg, #ff5a63, #ff8d52);
    color: white;
    box-shadow: 0 14px 28px rgba(242, 61, 83, 0.32);
}

.primary-btn-wide {
    width: 100%;
    justify-content: center;
}

.secondary-btn {
    background: rgba(2, 8, 48, 0.82);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.38);
}

.ghost-btn {
    background: rgba(2, 8, 48, 0.72);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ghost-btn-danger {
    color: #ffd0d6;
}

.secondary-btn.is-disabled {
    pointer-events: none;
    background: rgba(2, 8, 48, 0.35);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.45);
}

.page-shell {
    display: grid;
    gap: 18px;
}

.page-card,
.phase-card {
    padding: 22px;
    display: grid;
    gap: 18px;
}

.app-page-game .phase-card,
.app-page-game .scoreboard-card {
    border-color: rgba(var(--turn-accent-rgb), 0.28);
}

.app-page-game.turn-red:not(.is-live-focus),
.app-page-game.turn-blue:not(.is-live-focus) {
    background:
        radial-gradient(circle at top, rgba(var(--turn-accent-rgb), 0.3), transparent 30%);
}

.team-grid,
.meta-grid,
.stat-row,
.score-summary-grid {
    display: grid;
    gap: 14px;
}

.team-grid,
.meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-row,
.score-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-card {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--card-strong);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.field-card-compact {
    padding: 12px 14px;
}

.field-label,
.stat-label {
    font-size: 0.84rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
}

.field-input {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
    outline: none;
}

select.field-input {
    appearance: none;
}

.inline-alert {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(242, 61, 83, 0.16);
    color: #ffd8dd;
    border: 1px solid rgba(242, 61, 83, 0.34);
}

.host-tools {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(3, 13, 57, 0.74);
    border: 1px dashed rgba(255, 255, 255, 0.22);
}

.host-tools-copy {
    display: grid;
    gap: 8px;
}

.surprise-list {
    display: grid;
    gap: 12px;
}

.surprise-card {
    display: grid;
    gap: 12px;
    grid-template-columns: 100px 1fr;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.07);
}

.surprise-thumb {
    width: 100px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 14px;
}

.surprise-fields {
    display: grid;
    gap: 10px;
}

.surprise-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.empty-copy,
.support-copy {
    color: var(--text-muted);
}

.form-stack {
    display: grid;
    gap: 14px;
}

.preset-row,
.score-choice-grid,
.phase-topline,
.phase-chip-row,
.overlay-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.preset-row {
    gap: 8px;
}

.score-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 12px;
}

.score-choice-grid.is-count-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.preset-chip,
.score-choice-card,
.progress-chip,
.mini-stat {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.preset-chip {
    min-height: 42px;
    min-width: 42px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.preset-chip.is-active {
    background: rgba(var(--turn-accent-rgb), 0.16);
    color: var(--text-main);
    border-color: rgba(var(--turn-accent-rgb), 0.56);
    box-shadow: 0 10px 22px rgba(var(--turn-accent-rgb), 0.16);
}

.score-choice-card {
    min-height: 104px;
    padding: 14px 12px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: grid;
    gap: 8px;
    place-items: center;
    text-align: center;
}

.score-choice-card.is-none {
    grid-column: 1 / -1;
    min-height: 64px;
}

.score-choice-card.is-none .score-choice-number {
    font-size: 1.35rem;
    line-height: 1;
}

.score-choice-card.is-active {
    background:
        linear-gradient(145deg, rgba(var(--turn-accent-rgb), 0.3), rgba(var(--turn-accent-rgb), 0.1)),
        rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(var(--turn-accent-rgb), 0.82);
    box-shadow: 0 18px 34px rgba(var(--turn-accent-rgb), 0.18);
}

.score-choice-card.is-disabled,
.score-choice-card:disabled {
    cursor: not-allowed;
    opacity: 0.38;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.score-choice-card.is-disabled .score-choice-answer,
.score-choice-card:disabled .score-choice-answer {
    color: rgba(255, 255, 255, 0.42);
}

.score-choice-number {
    font-size: clamp(2.1rem, 9vw, 3.3rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.score-choice-answer {
    min-height: 1.2em;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: none;
}

.score-choice-card.is-active .score-choice-answer {
    color: var(--text-main);
}

.progress-chip,
.mini-stat {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
}

.progress-chip {
    background: rgba(var(--turn-accent-rgb), 0.12);
    border: 1px solid rgba(var(--turn-accent-rgb), 0.34);
    color: var(--text-main);
}

.progress-chip.is-overlay {
    background: rgba(1, 8, 38, 0.52);
    border-color: rgba(255, 255, 255, 0.22);
}

.mini-stat {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-soft);
}

.score-preview {
    min-height: 112px;
    align-content: center;
}

.turn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(var(--turn-accent-rgb), 0.36), rgba(var(--turn-accent-rgb), 0.14));
    color: var(--text-main);
    border: 1px solid rgba(var(--turn-accent-rgb), 0.82);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 10px 24px rgba(var(--turn-accent-rgb), 0.18);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

.turn-badge-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.turn-badge.is-short {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.84rem;
}

.game-header-compact {
    width: min(100%, 760px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 6px 0 14px;
}

.game-header-compact.is-live-focus {
    padding-bottom: 8px;
}

.game-header-tools {
    grid-column: 1;
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.game-header-logo {
    grid-column: 2;
    justify-self: center;
    width: clamp(86px, 18vw, 124px);
    flex-shrink: 0;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.22));
}

.game-header-round {
    grid-column: auto;
    justify-self: start;
    text-align: left;
    display: grid;
    justify-items: start;
    gap: 6px;
    position: relative;
    isolation: isolate;
}

.game-header-round .eyebrow {
    margin: 0;
    text-shadow:
        0 2px 2px rgba(1, 6, 34, 0.72),
        0 8px 18px rgba(1, 6, 34, 0.78);
}

.game-header-round::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -14px -22px -10px -18px;
    background:
        linear-gradient(90deg, rgba(1, 6, 34, 0.72), rgba(1, 6, 34, 0.4) 62%, rgba(1, 6, 34, 0)),
        radial-gradient(circle at 18% 42%, rgba(1, 6, 34, 0.58), transparent 68%);
    filter: blur(9px);
    pointer-events: none;
}

.game-header-scores {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.game-quit-btn {
    grid-column: 3;
    justify-self: end;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(2, 8, 48, 0.72);
    color: #ffffff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.game-quit-btn:hover,
.game-quit-btn:focus-visible {
    border-color: rgba(var(--turn-accent-rgb), 0.64);
    outline: none;
}

.game-audio-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(2, 8, 48, 0.76);
    color: #fff;
    cursor: pointer;
}

.game-audio-btn:hover,
.game-audio-btn:focus-visible {
    border-color: rgba(var(--turn-accent-rgb), 0.68);
    outline: none;
}

.audio-icon { width: 22px; height: 22px; fill: currentColor; }
.audio-icon-off { display: none; }
.game-audio-btn.is-muted .audio-icon-on { display: none; }
.game-audio-btn.is-muted .audio-icon-off { display: block; }

.score-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    border: 1px solid transparent;
}

.score-chip-red {
    background: rgba(242, 61, 83, 0.16);
    color: var(--team-red);
    border-color: rgba(242, 61, 83, 0.28);
}

.score-chip-blue {
    background: rgba(87, 183, 255, 0.16);
    color: var(--team-blue);
    border-color: rgba(87, 183, 255, 0.28);
}

.score-chip-sep {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.score-chip-paper {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.app-page-game .primary-btn {
    background: linear-gradient(135deg, rgba(var(--turn-accent-rgb), 1), rgba(var(--turn-accent-rgb), 0.85));
    box-shadow: 0 14px 28px rgba(var(--turn-accent-rgb), 0.35);
    color: #ffffff;
}

.app-page-game .secondary-btn {
    background: rgba(var(--turn-accent-rgb), 0.52);
    border-color: rgba(var(--turn-accent-rgb), 0.7);
    color: #ffffff;
}

.app-page-game .ghost-btn {
    background: rgba(2, 8, 48, 0.72);
    border-color: rgba(var(--turn-accent-rgb), 0.4);
    color: #ffffff;
}

.phase-card h2 {
    font-size: clamp(2.2rem, 8vw, 3.6rem);
}

.phase-subtitle {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.5;
    font-size: 0.95rem;
}

.header-meta {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.round-strip {
    width: min(100%, 760px);
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 14px;
    scrollbar-width: none;
}

.round-strip::-webkit-scrollbar {
    display: none;
}

.round-pill {
    padding: 10px 14px;
    border-radius: 999px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-muted);
    font-weight: 700;
}

.round-pill.is-active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.scoreboard-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
    margin-bottom: 14px;
}

.manual-score-banner {
    margin-bottom: 14px;
}

.team-score {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
}

.team-score strong,
.summary-team strong {
    font-size: clamp(1.9rem, 7vw, 2.8rem);
    letter-spacing: -0.04em;
}

.team-score.is-red {
    border: 1px solid rgba(242, 61, 83, 0.36);
}

.team-score.is-blue {
    border: 1px solid rgba(87, 183, 255, 0.36);
}

.game-main {
    width: min(100%, 760px);
}

.game-main.is-live-focus,
.game-main.is-reveal-focus {
    width: 100%;
    display: grid;
    justify-items: center;
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.support-panel,
.callout-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-md);
    background:
        linear-gradient(160deg, rgba(var(--turn-accent-rgb), 0.12), rgba(255, 255, 255, 0.03)),
        rgba(2, 8, 48, 0.7);
    border: 1px solid rgba(var(--turn-accent-rgb), 0.24);
}

.support-panel strong,
.callout-card strong {
    font-size: 1.4rem;
    letter-spacing: -0.03em;
}

.settings-card {
    display: grid;
    gap: 12px;
}

.setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.setting-row-warning {
    background: rgba(248, 198, 95, 0.12);
    border-color: rgba(248, 198, 95, 0.32);
}

.setting-row-version {
    background: rgba(255, 255, 255, 0.035);
}

.setting-row strong {
    display: block;
    margin-top: 4px;
    font-size: 1.08rem;
}

.setting-copy {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.setting-select {
    width: auto;
    min-width: 168px;
    padding: 10px 34px 10px 14px;
    border-radius: 999px;
    background: rgba(2, 8, 48, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.26);
}

.timer-board {
    position: relative;
    display: grid;
    place-items: center;
    width: min(72vw, 360px);
    aspect-ratio: 1;
    margin: 4px auto;
    filter: drop-shadow(0 16px 34px rgba(var(--turn-accent-rgb), 0.18));
}

.timer-board[data-action] {
    cursor: pointer;
    touch-action: manipulation;
}

.timer-svg {
    grid-area: 1 / 1;
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    overflow: visible;
}

.timer-track,
.timer-progress {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}

.timer-track {
    stroke: rgba(var(--turn-accent-rgb), 0.2);
}

.timer-progress {
    stroke: var(--turn-accent);
    transition: stroke 0.2s ease;
}

.timer-board.is-warning .timer-progress {
    stroke: #ffb54a;
}

.timer-board.is-urgent .timer-progress {
    stroke: #ffffff;
}

.timer-face {
    position: relative;
    grid-area: 1 / 1;
    width: 70%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 6vw, 52px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.44), rgba(0, 0, 0, 0.18));
    border: 1px solid rgba(var(--turn-accent-rgb), 0.3);
    box-shadow: inset 0 0 0 1px rgba(var(--turn-accent-rgb), 0.1);
}

.timer-value {
    font-size: clamp(2.2rem, 10vw, 4.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.timer-status {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    font-weight: 700;
}

.phase-focus-header {
    display: grid;
    gap: 10px;
    justify-items: center;
    text-align: center;
}

.phase-focus-header .eyebrow {
    text-shadow:
        0 2px 2px rgba(1, 6, 34, 0.72),
        0 8px 18px rgba(1, 6, 34, 0.76);
}

.phase-focus-header h2 {
    max-width: 10ch;
}

.phase-card-timer {
    gap: 22px;
}

.phase-card-reveal {
    gap: 16px;
}

.app-page-game.is-reveal-focus .phase-card {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.app-page-game.is-timer-focus .phase-card-timer {
    min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: stretch;
    padding: 24px 20px;
    overflow: hidden;
}

.app-page-game.is-live-focus .action-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.app-page-game.is-live-focus .action-row > button {
    width: 100%;
    min-height: 56px;
}

.app-page-game.is-timer-focus .timer-board {
    width: min(78vw, 46dvh, 360px);
    max-width: 100%;
    align-self: center;
    justify-self: center;
}

.app-page-game.is-reveal-focus .phase-card-reveal {
    gap: 14px;
    align-content: start;
}

.app-page-game.is-reveal-focus .phase-card-team-handoff {
    min-height: min(620px, calc(100dvh - 150px));
    place-items: center;
    align-content: center;
    grid-template-rows: 1fr auto;
    padding: clamp(28px, 7vw, 56px);
    text-align: center;
    background:
        radial-gradient(circle at 50% 38%, rgba(var(--turn-accent-rgb), 0.3), transparent 35%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
        rgba(2, 8, 48, 0.9);
    border: 1px solid rgba(var(--turn-accent-rgb), 0.34);
    box-shadow: var(--shadow-deep);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.team-handoff-copy {
    display: grid;
    place-items: center;
    gap: clamp(14px, 3dvh, 24px);
}

.team-handoff-copy .eyebrow {
    color: var(--turn-accent);
    font-size: clamp(0.9rem, 3vw, 1.15rem);
}

.team-handoff-copy h2 {
    max-width: 12ch;
    color: #ffffff;
    font-size: clamp(3rem, 12vw, 6rem);
    line-height: 0.98;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.phase-card-team-handoff .primary-btn {
    width: min(100%, 440px);
}


.reveal-shell {
    position: relative;
    width: min(100%, calc(min(84dvh, 1040px) * 0.75));
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    border-radius: calc(var(--radius-lg) + 4px);
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(var(--turn-accent-rgb), 0.22), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 2px solid rgba(var(--turn-accent-rgb), 0.48);
    box-shadow: var(--shadow-deep);
}

.reveal-overlay {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px;
    pointer-events: none;
}

.reveal-overlay-top {
    top: 0;
    flex-direction: column;
    align-items: stretch;
    background: linear-gradient(180deg, rgba(1, 8, 38, 0.85) 0%, rgba(1, 8, 38, 0.5) 65%, rgba(1, 8, 38, 0) 100%);
}


.reveal-overlay-start {
    top: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 36px;
    padding: 80px 28px 40px;
    pointer-events: all;
    background: linear-gradient(180deg, rgba(1, 8, 38, 0.55) 0%, rgba(1, 8, 38, 0.2) 40%, rgba(1, 8, 38, 0.55) 100%);
}

.reveal-overlay-asset-state {
    top: 0;
    bottom: 0;
    z-index: 3;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 96px 28px 40px;
    pointer-events: all;
    color: #ffffff;
    text-align: center;
    background: rgba(1, 8, 38, 0.78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.reveal-overlay-asset-state .primary-btn {
    width: min(100%, 260px);
}

.reveal-error-code {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.start-reveal-btn {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(10, 18, 60, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    touch-action: manipulation;
    width: min(180px, 48vw, 48dvh);
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.start-reveal-btn:hover {
    background: rgba(20, 32, 90, 0.85);
    transform: scale(1.06);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.start-reveal-btn:disabled {
    cursor: wait;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(10, 18, 60, 0.58);
    border-color: rgba(255, 255, 255, 0.18);
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.start-reveal-btn:active {
    transform: scale(0.96);
}

.start-reveal-btn svg {
    width: 52px;
    height: 52px;
    margin-left: 6px; /* optical centre for play triangle */
}

.start-reveal-btn {
    font-size: 1.1rem;
}

.reveal-load-state {
    margin: -20px 0 0;
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
}

.reveal-overlay-top .eyebrow {
    color: white;
}

.reveal-overlay-top .reveal-question {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 10px 0 0;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.reveal-question.reveal-question--intro {
    font-size: 2.8rem;
    margin: 0;
    text-align: center;
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0,0,0,0.9);
    max-width: 340px;
}

.reveal-question.reveal-question--settle {
    /* no animation — instant reposition on reveal start */
}

.reveal-score-live {
    margin-left: auto;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
    text-align: right;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
    white-space: nowrap;
}


.app-page-game.is-reveal-focus .reveal-shell {
    box-shadow:
        0 22px 70px rgba(0, 8, 44, 0.45),
        0 0 0 1px rgba(var(--turn-accent-rgb), 0.1),
        0 0 44px rgba(var(--turn-accent-rgb), 0.24);
}

.reveal-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #050e3a;
    cursor: pointer;
    touch-action: manipulation;
}

.reveal-question {
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.5rem;
    color: #fff;
}

.reveal-footer {
    width: min(100%, 460px);
    margin: 0 auto;
    display: grid;
    gap: 12px;
}

.reveal-result {
    width: min(100%, 420px);
    margin: 0 auto;
    padding: clamp(14px, 4vw, 20px);
    border: 2px solid rgba(var(--turn-accent-rgb), 0.7);
    border-radius: 999px;
    color: #fff;
    font-size: clamp(1rem, 5vw, 1.25rem);
    line-height: 1.2;
    text-align: center;
    background: linear-gradient(135deg, rgba(8, 20, 74, 0.96), rgba(var(--turn-accent-rgb), 0.48));
    box-shadow: 0 12px 30px rgba(1, 8, 38, 0.35);
}

.reveal-result--correct {
    border-color: rgba(107, 240, 166, 0.92);
    background: linear-gradient(135deg, rgba(13, 77, 62, 0.96), rgba(38, 159, 105, 0.86));
}

.reveal-result--incorrect,
.reveal-result--time-up {
    border-color: rgba(255, 188, 104, 0.92);
    background: linear-gradient(135deg, rgba(106, 47, 32, 0.96), rgba(170, 87, 38, 0.86));
}

.judgement-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.judgement-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 12px;
    border-radius: 16px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    color: #ffffff;
}

.judgement-btn:hover {
    transform: translateY(-2px);
}

.judgement-btn:active {
    transform: scale(0.96);
}

.judgement-btn svg {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.judgement-btn--correct {
    background: linear-gradient(145deg, #1db954, #0d8f3e);
    box-shadow: 0 8px 24px rgba(29, 185, 84, 0.35);
}

.judgement-btn--incorrect {
    background: linear-gradient(145deg, #e8354a, #b01f31);
    box-shadow: 0 8px 24px rgba(232, 53, 74, 0.35);
}

.image-attribution {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: center;
}

.app-page-results {
    position: relative;
    justify-content: center;
    overflow: hidden;
}

.results-shell {
    position: relative;
    z-index: 1;
}

.winner-card {
    position: relative;
    width: min(100%, 760px);
    min-height: min(760px, calc(100dvh - 72px));
    padding: clamp(22px, 4vw, 36px);
    display: grid;
    align-content: center;
    justify-items: center;
    gap: clamp(18px, 4dvh, 34px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 50% 16%, rgba(248, 198, 95, 0.34), transparent 30%),
        radial-gradient(circle at 18% 72%, rgba(242, 61, 83, 0.24), transparent 34%),
        radial-gradient(circle at 82% 76%, rgba(87, 183, 255, 0.24), transparent 34%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
        rgba(2, 8, 48, 0.8);
    box-shadow: var(--shadow-deep);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    text-align: center;
}

.winner-card .winner-confetti {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.winner-card > :not(.winner-confetti) {
    position: relative;
    z-index: 1;
}

.winner-card::before,
.winner-card::after {
    content: "";
    position: absolute;
    inset: auto;
    border-radius: 999px;
    pointer-events: none;
}

.winner-card::before {
    width: 280px;
    height: 280px;
    top: -120px;
    right: -80px;
    background: rgba(248, 198, 95, 0.12);
}

.winner-card::after {
    width: 180px;
    height: 180px;
    bottom: -70px;
    left: -50px;
    background: rgba(255, 255, 255, 0.08);
}

.winner-stage {
    position: relative;
    width: min(100%, 520px);
    min-height: clamp(220px, 38dvh, 340px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    justify-items: center;
    gap: 14px;
}

.winner-stage-manual {
    grid-template-columns: 1fr;
}

.winner-orbit {
    position: absolute;
    inset: 8% 15% 4%;
    border: 2px solid rgba(248, 198, 95, 0.32);
    border-radius: 50%;
    transform: rotate(-8deg);
}

.winner-portrait {
    position: relative;
    z-index: 1;
    width: min(180px, 36vw);
    margin: 0;
    display: grid;
    gap: 10px;
    justify-items: center;
    opacity: 0.72;
    transform: translateY(16px) scale(0.86);
}

.winner-portrait.is-winner {
    width: min(250px, 52vw);
    opacity: 1;
    transform: translateY(0) scale(1);
}

.winner-portrait img,
.winner-portrait-fallback {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.82);
    object-fit: cover;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.32),
        0 0 0 10px rgba(248, 198, 95, 0.12);
}

.winner-portrait.is-winner img,
.winner-portrait.is-winner .winner-portrait-fallback {
    border-color: var(--team-gold);
    box-shadow:
        0 26px 60px rgba(0, 0, 0, 0.38),
        0 0 0 12px rgba(248, 198, 95, 0.18),
        0 0 60px rgba(248, 198, 95, 0.3);
}

.winner-portrait-fallback,
.winner-manual-emblem {
    display: grid;
    place-items: center;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
        rgba(2, 8, 48, 0.8);
    color: #ffffff;
    font-size: clamp(4rem, 18vw, 7rem);
    font-weight: 800;
}

.winner-portrait-red .winner-portrait-fallback {
    background: linear-gradient(145deg, rgba(242, 61, 83, 0.9), rgba(242, 61, 83, 0.42));
}

.winner-portrait-blue .winner-portrait-fallback {
    background: linear-gradient(145deg, rgba(87, 183, 255, 0.9), rgba(87, 183, 255, 0.42));
}

.winner-portrait figcaption {
    max-width: 16ch;
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.05;
    text-wrap: balance;
}

.winner-portrait.is-winner figcaption {
    font-size: clamp(1.2rem, 4vw, 1.7rem);
}

.winner-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    justify-items: center;
}

.winner-copy h1 {
    font-size: clamp(3rem, 12vw, 6.2rem);
    color: #ffffff;
    text-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.winner-copy p {
    max-width: 44rem;
    color: rgba(247, 249, 255, 0.84);
    font-weight: 700;
}

.winner-card .action-row {
    position: relative;
    z-index: 1;
    justify-content: center;
}

.winner-manual-emblem {
    width: min(230px, 54vw);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 5px solid var(--team-gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

.winner-confetti {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.winner-confetti span {
    position: absolute;
    top: -12%;
    left: var(--x);
    width: 10px;
    height: 18px;
    border-radius: 3px;
    background: hsl(var(--hue), 88%, 62%);
    opacity: 0.9;
    transform: rotate(calc(var(--hue) * 1deg));
    animation: confetti-fall var(--dur) linear infinite;
    animation-delay: var(--delay);
}

@keyframes confetti-fall {
    0% {
        translate: 0 -10dvh;
        rotate: 0deg;
    }
    100% {
        translate: var(--drift) 118dvh;
        rotate: 720deg;
    }
}

.summary-team,
.breakdown-row {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.results-breakdown {
    display: grid;
    gap: 10px;
}

.breakdown-key {
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
}

.breakdown-row span {
    color: var(--text-soft);
}

.app-page-error .page-card {
    text-align: center;
}

@media (max-width: 720px) {
    .boot-screen,
    .app-page {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero-panel,
    .page-card,
    .phase-card,
    .scoreboard-card {
        border-radius: 24px;
    }

    .team-grid,
    .meta-grid,
    .stat-row,
    .score-summary-grid,
    .scoreboard-card {
        grid-template-columns: 1fr;
    }

    .compact-grid {
        grid-template-columns: 1fr;
    }

    .surprise-card {
        grid-template-columns: 1fr;
    }

    .surprise-thumb {
        width: 100%;
    }

    .reveal-topline {
        flex-direction: column;
        align-items: flex-start;
    }

    .phase-topline {
        align-items: flex-start;
    }

    .app-page-game.is-live-focus {
        padding-top: calc(env(safe-area-inset-top) + 8px);
        padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
    }

    .app-page-game.is-live-focus .game-quit-btn {
        grid-column: 3;
        justify-self: end;
    }

    .app-page-game.is-reveal-focus .phase-card-team-handoff {
        min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 88px);
        padding: 24px 20px;
    }

    .app-page-game.is-timer-focus .phase-card-timer {
        min-height: auto;
        height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 78px);
        gap: 14px;
        padding: 16px 14px;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .app-page-game.is-timer-focus .phase-focus-header {
        gap: 8px;
    }

    .app-page-game.is-timer-focus .phase-card h2 {
        font-size: clamp(2.25rem, 11vw, 3rem);
    }

    .app-page-game.is-timer-focus .timer-board {
        width: min(74vw, 36dvh, 320px);
        align-self: start;
        margin: clamp(8px, 3dvh, 28px) auto 0;
    }

    .app-page-game.is-timer-focus .timer-value {
        font-size: clamp(2rem, 9vw, 3.2rem);
    }

    .app-page-game.is-timer-focus .action-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .app-page-game.is-timer-focus .action-row > button {
        min-height: 50px;
        padding: 0 14px;
    }

    .app-page-game.is-timer-focus .action-row > button:only-child {
        grid-column: 1 / -1;
        width: min(100%, 420px);
        justify-self: center;
    }

    .app-page-game.is-reveal-focus .reveal-shell {
        border-radius: 22px;
        width: min(100%, calc((100dvh - 156px) * 0.75));
    }

    .app-page-game.is-reveal-focus .reveal-canvas {
        height: 100%;
    }

    .app-page-game.is-reveal-focus .reveal-overlay {
        padding: 14px;
    }


    .app-page-game.is-reveal-focus .ghost-btn {
        min-height: 46px;
        padding: 0 18px;
    }

    .reveal-footer {
        width: 100%;
    }
}

@media (max-width: 420px) and (max-height: 700px) {
    .app-page-game.is-reveal-focus .phase-card-reveal {
        gap: 10px;
    }

    .app-page-game.is-reveal-focus .reveal-shell {
        width: min(100%, calc((100dvh - 168px) * 0.75));
    }

    .app-page-game.is-reveal-focus .phase-card-reveal.is-reveal-frozen .reveal-shell {
        width: min(100%, calc((100dvh - 242px) * 0.75));
    }

    .app-page-game.is-reveal-focus .phase-card-reveal.is-reveal-result .reveal-shell {
        width: min(100%, calc((100dvh - 274px) * 0.75));
    }

    .phase-card-reveal.is-reveal-result .reveal-footer {
        gap: 8px;
    }

    .phase-card-reveal.is-reveal-result .callout-card {
        gap: 3px;
        padding: 10px 12px;
    }

    .phase-card-reveal.is-reveal-result .reveal-result {
        padding: 12px;
    }

    .app-page-game.is-reveal-focus .reveal-overlay {
        padding: 12px;
    }

    .app-page-game.is-reveal-focus .reveal-overlay-start {
        justify-content: flex-start;
        gap: 18px;
        padding: 92px 18px 22px;
    }

    .reveal-question.reveal-question--intro {
        max-width: 280px;
        font-size: clamp(1.9rem, 10vw, 2rem);
        line-height: 1.08;
    }

    .start-reveal-btn {
        width: min(148px, 44vw, 34dvh);
        gap: 8px;
        font-size: 0.96rem;
    }

    .start-reveal-btn svg {
        width: 42px;
        height: 42px;
    }

    .reveal-overlay-top .reveal-question {
        margin-top: 8px;
        font-size: clamp(1.15rem, 7vw, 1.45rem);
    }

    .reveal-score-live {
        font-size: 0.9rem;
    }

    .phase-card-reveal.is-reveal-frozen .reveal-footer {
        gap: 10px;
    }

    .phase-card-reveal.is-reveal-frozen .reveal-guess-prompt {
        gap: 4px;
        padding: 12px;
    }

    .phase-card-reveal.is-reveal-frozen .reveal-guess-prompt strong {
        font-size: 1.1rem;
    }

    .phase-card-reveal.is-reveal-frozen .reveal-guess-prompt .support-copy {
        display: none;
    }

    .phase-card-reveal.is-reveal-frozen .action-row > button {
        min-height: 50px;
    }
}

@media (max-width: 375px) {
    .phase-card-reveal.is-reveal-result .reveal-result {
        font-size: 0.96rem;
        padding-inline: 10px;
    }
}

/* ─── Landing screen ──────────────────────────────────────── */

@keyframes landingLogoIn {
    from {
        opacity: 0;
        transform: translateY(-28px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes landingBodyIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-logo-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0 12px;
    animation: landingLogoIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.05s;
}

.landing-logo-wrap .hero-logo {
    width: min(80vw, 320px);
    filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.36));
}

.landing-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: min(100%, 480px);
    animation: landingBodyIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.2s;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.landing-actions .primary-btn {
    width: 100%;
    flex: 1 0 100%;
}

.landing-actions .secondary-btn {
    width: 100%;
    flex: 1 0 100%;
}

.landing-actions .ghost-btn {
    flex: 1 1 160px;
    font-size: 0.88rem;
    min-height: 44px;
}

/* ─── Rules modal ─────────────────────────────────────────── */

.rules-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 8, 44, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.rules-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.rules-modal {
    width: min(100%, 520px);
    max-height: 82dvh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
        rgba(4, 16, 79, 0.92);
    box-shadow: var(--shadow-deep);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.rules-overlay:not(.is-open) .rules-modal {
    transform: translateY(16px);
}

.rules-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.rules-modal-title {
    font-size: clamp(1.4rem, 5vw, 1.9rem);
}

.rules-close-btn {
    font-size: 1rem;
    min-height: 40px;
    padding: 0 14px;
    opacity: 0.7;
}

.rules-close-btn:hover {
    opacity: 1;
}

.rules-modal-body {
    overflow-y: auto;
    padding: 8px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 0;
    -webkit-overflow-scrolling: touch;
}

.rules-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--card-border);
}

.rules-section:last-child {
    border-bottom: none;
}

.rules-section-heading {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--team-gold);
}

.rules-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-soft);
}

/* ─── Setup screen team cards ─────────────────────────────── */

.setup-teams {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.setup-team-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
        rgba(4, 16, 79, 0.72);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.setup-team-red {
    border-color: rgba(242, 61, 83, 0.3);
    background:
        linear-gradient(160deg, rgba(242, 61, 83, 0.12), rgba(242, 61, 83, 0.04)),
        rgba(4, 16, 79, 0.78);
}

.setup-team-blue {
    border-color: rgba(87, 183, 255, 0.3);
    background:
        linear-gradient(160deg, rgba(87, 183, 255, 0.12), rgba(87, 183, 255, 0.04)),
        rgba(4, 16, 79, 0.78);
}

.setup-team-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setup-team-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.setup-team-red .setup-team-dot {
    background: var(--team-red);
    box-shadow: 0 0 8px rgba(242, 61, 83, 0.6);
}

.setup-team-blue .setup-team-dot {
    background: var(--team-blue);
    box-shadow: 0 0 8px rgba(87, 183, 255, 0.6);
}

.setup-team-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.setup-selfie-upload .upload-row {
    display: grid;
    grid-template-columns: 1fr;
}

.setup-selfie-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.34);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
        rgba(2, 8, 48, 0.76);
    color: white;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 12px 22px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.setup-selfie-cta:hover,
.setup-selfie-cta:focus-within {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 14px 26px rgba(0, 0, 0, 0.26);
}

.setup-team-red .setup-selfie-cta {
    border-color: rgba(242, 61, 83, 0.52);
    background:
        linear-gradient(135deg, rgba(242, 61, 83, 0.36), rgba(242, 61, 83, 0.12)),
        rgba(2, 8, 48, 0.82);
}

.setup-team-blue .setup-selfie-cta {
    border-color: rgba(87, 183, 255, 0.52);
    background:
        linear-gradient(135deg, rgba(87, 183, 255, 0.34), rgba(87, 183, 255, 0.12)),
        rgba(2, 8, 48, 0.82);
}

.setup-team-card .field-card {
    padding: 12px 14px;
}

.setup-selfie-preview-wrap {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.setup-selfie-preview {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.setup-selfie-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.75rem;
    min-height: 32px;
    padding: 0 10px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

@media (max-width: 480px) {
    .game-header-compact {
        grid-template-columns: minmax(38px, 1fr) auto minmax(38px, 1fr);
        gap: 6px;
    }

    .game-header-tools { display: contents; }
    .game-audio-btn { grid-column: 1; grid-row: 1; width: 38px; height: 38px; flex-basis: 38px; }
    .game-header-logo { grid-row: 1; }
    .game-quit-btn { grid-row: 1; }
    .game-header-round { grid-column: 1 / -1; grid-row: 2; margin-top: 4px; }

    .setup-teams {
        grid-template-columns: 1fr;
    }

    .setting-row {
        grid-template-columns: 1fr;
    }

    .setting-select {
        width: 100%;
        min-width: 0;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ─── Debug ────────────────────────────────────────────────────────── */

.debug-badge {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    background: #f0b429;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: none;
    text-transform: uppercase;
}

.app-page-game .debug-badge {
    top: calc(env(safe-area-inset-top) + 62px);
}

.debug-panel {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border: 2px dashed #f0b429;
    border-radius: 8px;
    background: rgba(240, 180, 41, 0.06);
}

.debug-panel-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f0b429;
    margin: 0 0 0.75rem;
}

.debug-asset-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 2px dashed #f0b429;
    border-radius: 8px;
    background: rgba(240, 180, 41, 0.06);
}

.debug-asset-toolbar .debug-panel-label {
    margin: 0;
}

.debug-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.debug-asset-card {
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(2, 8, 48, 0.78);
}

.debug-asset-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 11;
    background: #020617;
}

.debug-asset-meta {
    display: grid;
    gap: 0.35rem;
    padding: 0.85rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.debug-asset-meta strong {
    color: var(--text-main);
    font-size: 0.98rem;
}

.debug-asset-meta code {
    overflow-wrap: anywhere;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
}

.debug-asset-status {
    justify-self: start;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.62rem;
}

.debug-asset-status[data-status="ready"] {
    background: rgba(68, 196, 103, 0.2);
    color: #8dffad;
}

.debug-asset-status[data-status="error"] {
    background: rgba(242, 61, 83, 0.22);
    color: #ffd4dd;
}

@media (max-width: 700px) {
    .debug-asset-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
}
