:root {
    --studio-blue: #0a2f8a;
    --studio-blue-deep: #041a52;
    --studio-cyan: #00e8d0;
    --studio-magenta: #ff2d7a;
    --studio-orange: #ff7a18;
    --gold: #ffd200;
    --gold-chrome: #fff1a0;
    --gold-deep: #c99200;
    --accent: var(--gold);
    --accent-soft: var(--gold-chrome);
    --accent-rgb: 255, 210, 0;
    --ink: #fff8e7;
    --cream: #fff4d6;
    --muted: #9ec0ff;
    --danger: #ff2a2a;
    --ok: #2dff9a;
    --warn: #ffb020;
    --panel: rgba(8, 28, 90, 0.82);
    --line: rgba(255, 210, 0, 0.55);
    --font-display: "Bungee", sans-serif;
    --font-marquee: "Limelight", serif;
    --font-body: "Nunito", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--studio-blue-deep);
}

body {
    transition: background-color 0.45s ease;
}

/* ——— Décor studio TV 80s ——— */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 120%, #1c4fb8 0%, transparent 55%),
        linear-gradient(180deg, #06206e 0%, #0a2f8a 40%, #041543 100%);
}

.studio-sunburst {
    position: absolute;
    left: 50%;
    top: 42%;
    width: 160vmax;
    height: 160vmax;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255, 210, 0, 0.18) 0deg 8deg,
        rgba(0, 232, 208, 0.08) 8deg 16deg,
        rgba(255, 45, 122, 0.1) 16deg 24deg,
        transparent 24deg 32deg
    );
    animation: sunspin 48s linear infinite;
    opacity: 0.85;
    mask-image: radial-gradient(circle, #000 0%, transparent 68%);
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 68%);
}

body.has-team-accent .studio-sunburst {
    background: repeating-conic-gradient(
        from 0deg,
        rgba(var(--accent-rgb), 0.32) 0deg 10deg,
        rgba(255, 255, 255, 0.06) 10deg 20deg,
        transparent 20deg 30deg
    );
}

.studio-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 12% 18%, #fff 0 2px, transparent 3px),
        radial-gradient(circle at 78% 12%, var(--gold) 0 2px, transparent 3px),
        radial-gradient(circle at 88% 38%, #fff 0 1.5px, transparent 3px),
        radial-gradient(circle at 22% 62%, var(--studio-cyan) 0 2px, transparent 3px),
        radial-gradient(circle at 64% 72%, var(--studio-magenta) 0 2px, transparent 3px),
        radial-gradient(circle at 40% 28%, #fff 0 1px, transparent 2px);
    animation: twinkle 2.8s ease-in-out infinite alternate;
}

.studio-curtains {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(120, 0, 40, 0.55) 0%, transparent 18%, transparent 82%, rgba(120, 0, 40, 0.55) 100%),
        repeating-linear-gradient(
            90deg,
            transparent 0 18px,
            rgba(0, 0, 0, 0.08) 18px 20px
        );
    pointer-events: none;
}

.studio-floor {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 28vh;
    background:
        repeating-linear-gradient(
            90deg,
            #0c2266 0 40px,
            #12308a 40px 80px
        ),
        linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
    transform: perspective(400px) rotateX(48deg);
    transform-origin: bottom center;
    opacity: 0.55;
}

/* ——— Header marquee ——— */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 4px solid var(--gold);
    background:
        repeating-linear-gradient(
            90deg,
            #091f6e 0 14px,
            #0d2a8a 14px 28px
        );
    box-shadow: inset 0 -3px 0 var(--studio-magenta);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 3vw, 1.55rem);
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
    color: var(--gold);
    text-shadow:
        0 2px 0 var(--gold-deep),
        0 0 12px rgba(255, 210, 0, 0.45);
}

.brand-star {
    width: 0.85rem;
    height: 0.85rem;
    background: var(--studio-cyan);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: starpop 1.6s ease-in-out infinite alternate;
}

.brand-star:last-child {
    background: var(--studio-magenta);
    animation-delay: 0.4s;
}

.site-header nav {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.site-header nav a {
    color: var(--cream);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.65rem;
    border: 2px solid rgba(255, 210, 0, 0.35);
    background: rgba(0, 0, 0, 0.25);
}

.site-header nav a:hover {
    color: #041543;
    background: var(--gold);
    border-color: var(--gold-chrome);
}

.container {
    width: min(1100px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1.5rem 0 3.5rem;
}

/* ——— Layout live (partie démarrée) : 1 écran desktop ——— */
body.game-page.is-live {
    overflow: hidden;
}

body.game-page.is-live .site-header {
    padding: 0.4rem 0.85rem;
}

body.game-page.is-live .site-header .brand {
    font-size: 1.05rem;
}

body.game-page.is-live .site-header nav a {
    padding: 0.25rem 0.45rem;
    font-size: 0.72rem;
}

body.game-page.is-live .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.45rem 0.75rem 0.55rem;
    height: calc(100vh - 3.1rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.game-page.is-live .flash {
    margin: 0 0 0.35rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    flex: 0 0 auto;
}

body.game-page.is-live .game-shell.is-live {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.45rem;
}

.play-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.35rem 0.65rem;
    border: 3px solid var(--studio-cyan);
    background: rgba(0, 0, 0, 0.4);
    flex: 0 0 auto;
}

.play-topbar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}

.play-topbar-meta .status-pill {
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
}

.play-topbar-meta .pot,
.play-topbar-meta .play-round {
    margin: 0;
    font-size: 0.9rem;
}

.play-you {
    margin: 0;
    font-size: 0.8rem;
}

.play-topbar-turn {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.55rem;
    text-align: center;
}

.play-topbar-turn .turn-spotlight-label {
    font-size: 0.7rem;
}

.play-topbar-turn .turn-spotlight-team {
    font-size: 1rem;
}

.play-topbar-turn .turn-spotlight-player {
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
}

.play-topbar-hud {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.play-topbar-hud .strikes {
    margin: 0;
}

.play-topbar-hud .x {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 1rem;
}

.play-topbar-hud .timer {
    margin: 0;
    padding: 0.2rem 0.5rem;
    min-width: 3.5rem;
    flex-direction: row;
    gap: 0.3rem;
}

.play-topbar-hud .timer-value {
    font-size: 1.15rem;
}

.play-topbar-hud .timer-label {
    font-size: 0.65rem;
}

.play-arena {
    display: grid;
    grid-template-columns: minmax(160px, 20vw) minmax(0, 1fr) minmax(160px, 20vw);
    gap: 0.75rem;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
}

.play-center {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    min-height: 0;
}

body.game-page.is-live .play-arena .team-card {
    padding: 0.65rem 0.55rem 0.75rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
}

body.game-page.is-live .play-arena .team-card h2 {
    font-size: clamp(0.95rem, 1.8vw, 1.25rem);
}

body.game-page.is-live .play-arena .score {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin: 0.15rem 0 0.35rem;
}

body.game-page.is-live .play-arena .players {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1 1 auto;
}

body.game-page.is-live .play-arena .player-row {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.35rem;
    padding: 0.45rem 0.35rem;
    border: 2px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.22);
}

body.game-page.is-live .play-arena .player-avatar {
    width: clamp(2.6rem, 5vw, 3.8rem);
    height: clamp(2.6rem, 5vw, 3.8rem);
    max-width: 3.8rem;
    max-height: 3.8rem;
    object-fit: cover;
    border-width: 3px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

body.game-page.is-live .play-arena .player-avatar.is-empty {
    font-size: clamp(1.15rem, 2.6vw, 1.7rem);
}

body.game-page.is-live .play-arena .player-name {
    font-weight: 800;
    font-size: clamp(0.85rem, 1.5vw, 1.05rem);
    text-align: center;
    line-height: 1.15;
}

body.game-page.is-live .play-arena .player-row.is-turn {
    padding: 0.5rem 0.4rem;
    border-width: 3px;
    opacity: 1;
    filter: none;
    z-index: 1;
}

body.game-page.is-live .play-arena .player-row.is-turn .player-avatar {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(var(--team-color-rgb), 0.55);
    transform: scale(1.06);
}

body.game-page.is-live .play-arena .player-row.is-dimmed {
    opacity: 0.28;
    filter: grayscale(0.9) brightness(0.65);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

body.game-page.is-live .play-arena .player-row.is-dimmed .player-avatar {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.25);
}

body.game-page.is-live .play-arena .player-row.is-dimmed .player-name {
    color: rgba(201, 215, 255, 0.55);
}

body.game-page.is-live .play-arena .team-card.is-control {
    transform: none;
}

body.game-page.is-live .question-banner {
    padding: 0.45rem 0.7rem;
    border-block-width: 3px;
    flex: 0 0 auto;
}

body.game-page.is-live .question {
    margin: 0;
    font-size: clamp(1rem, 2.2vw, 1.45rem);
    line-height: 1.2;
}

body.game-page.is-live .turn-hint {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
}

body.game-page.is-live .board {
    flex: 1 1 auto;
    min-height: 0;
    gap: 0.28rem;
    padding: 0.4rem;
    overflow: auto;
}

body.game-page.is-live .board-panel {
    padding: 0.38rem 0.6rem;
    gap: 0.45rem;
}

body.game-page.is-live .board-row .rank {
    font-size: 1.05rem;
}

body.game-page.is-live .board-row .pct {
    font-size: 1.15rem;
}

body.game-page.is-live .board-row .label {
    font-size: 0.92rem;
}

body.game-page.is-live .faceoff-intro {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.9rem 1rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.game-page.is-live .faceoff-intro-title {
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
    margin: 0.25rem 0 0.5rem;
}

body.game-page.is-live .faceoff-intro-rule {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
}

body.game-page.is-live .countdown-value {
    font-size: clamp(2.8rem, 8vw, 4.5rem);
}

body.game-page.is-live .countdown-display {
    margin-top: 0.75rem;
}

body.game-page.is-live .game-actions {
    margin-top: 0;
    gap: 0.45rem;
    flex: 0 0 auto;
    padding: 0.15rem 0 0.25rem;
    max-height: min(34vh, 22rem);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
}

body.game-page.is-live .answer-form {
    width: min(920px, 100%);
    gap: 0.55rem;
}

body.game-page.is-live .answer-form.is-hero {
    padding: 0.55rem 0.7rem;
    border: 3px solid var(--gold);
    background: rgba(4, 21, 67, 0.92);
    box-shadow: 0 0 0 3px rgba(255, 210, 0, 0.22), 0 10px 28px rgba(0, 0, 0, 0.45);
}

body.game-page.is-live .answer-hero-row {
    display: flex;
    gap: 0.55rem;
    width: 100%;
    align-items: stretch;
}

body.game-page.is-live .answer-form input[type="text"] {
    flex: 1 1 auto;
    min-height: 2.8rem;
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 800;
    padding: 0.55rem 0.85rem;
    border-width: 3px;
    border-color: rgba(255, 210, 0, 0.65);
    background: rgba(255, 255, 255, 0.96);
    color: #041543;
}

body.game-page.is-live .answer-form input[type="text"]::placeholder {
    color: rgba(4, 21, 67, 0.45);
    font-weight: 700;
}

body.game-page.is-live .answer-submit {
    flex: 0 0 auto;
    min-width: 8rem;
    font-size: 1.05rem;
    padding: 0.75rem 1.25rem;
}

body.game-page.is-live .btn {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
}

body.game-page.is-live .pass-turn {
    font-size: 0.95rem;
    margin-top: 0.15rem;
}

body.game-page.is-live .waiting-turn {
    font-size: 1rem;
    margin: 0;
}

body.game-page.is-live .winner-banner {
    padding: 0.85rem;
}

body.game-page.is-live .winner-banner h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

@media (max-width: 900px) {
    body.game-page.is-live {
        overflow: auto;
    }

    body.game-page.is-live .container {
        height: auto;
        min-height: calc(100vh - 3.1rem);
        overflow: visible;
    }

    body.game-page.is-live .game-shell.is-live {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .play-topbar {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .play-topbar-meta,
    .play-topbar-hud {
        justify-content: center;
    }

    .play-arena {
        grid-template-columns: 1fr;
    }

    body.game-page.is-live .play-arena .team-card {
        max-height: none;
    }

    body.game-page.is-live .play-arena .players {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
        gap: 0.5rem;
    }

    body.game-page.is-live .answer-hero-row {
        flex-direction: column;
    }

    body.game-page.is-live .answer-submit {
        width: 100%;
        min-height: 3.2rem;
    }
}

/* ——— Hero landing ——— */
.page-home .container {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 5rem);
}

.hero {
    width: 100%;
    text-align: center;
    padding: 2rem 0.5rem 3rem;
    animation: rise 0.8s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.hero-brand {
    margin: 0;
    line-height: 0.92;
}

.hero-brand-line {
    display: block;
    font-family: var(--font-marquee);
    font-size: clamp(3rem, 14vw, 7.5rem);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow:
        0 3px 0 #8a6200,
        0 6px 0 #5c4100,
        0 0 24px rgba(255, 210, 0, 0.55),
        0 0 2px #fff;
    animation: brandshine 2.4s ease-in-out infinite alternate;
}

.hero-brand-line--big {
    font-size: clamp(3.6rem, 18vw, 9rem);
    color: #fff4a8;
}

.hero-lead {
    max-width: 28rem;
    margin: 1.1rem auto 1.75rem;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 800;
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.hero-actions {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ——— Buttons kitsch ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.4rem;
    border: 3px solid #fff4a8;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(180deg, #ffe566 0%, var(--gold) 45%, var(--gold-deep) 100%);
    color: #4a2d00;
    box-shadow: 0 4px 0 #7a5200;
}

.btn-ghost {
    background: linear-gradient(180deg, #1a4db8, #0a2a7a);
    color: var(--gold-chrome);
    border-color: var(--studio-cyan);
    box-shadow: 0 4px 0 #04205a;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

/* ——— Panels / forms ——— */
.panel {
    background:
        linear-gradient(180deg, rgba(18, 55, 150, 0.92), rgba(6, 24, 80, 0.95));
    border: 4px solid var(--gold);
    outline: 3px solid var(--studio-magenta);
    outline-offset: 3px;
    padding: 1.35rem 1.25rem;
    animation: rise 0.5s ease-out;
    box-shadow: inset 0 0 0 2px rgba(0, 232, 208, 0.35);
}

.panel.narrow { max-width: 440px; margin-inline: auto; }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel h1 {
    font-family: var(--font-display);
    letter-spacing: 0.03em;
    margin: 0 0 0.5rem;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--gold);
    text-transform: uppercase;
    text-shadow: 0 2px 0 #6b4a00;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.form-grid {
    display: grid;
    gap: 1.25rem;
}

.full-width { grid-column: 1 / -1; }

.timer-settings {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.timer-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
}

.timer-toggle input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--gold);
}

.mode-switch, .side-picker {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.mode-label {
    margin: 0;
    font-weight: 800;
    color: var(--gold-chrome);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mode-option {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 3px solid rgba(255, 210, 0, 0.35);
    background: rgba(0, 0, 0, 0.22);
    cursor: pointer;
    margin: 0;
}

.mode-option input { margin-top: 0.2rem; }

.mode-option span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mode-option small { color: var(--muted); font-weight: 600; }

.mode-option:has(input:checked) {
    border-color: var(--gold);
    background: rgba(255, 210, 0, 0.16);
    box-shadow: inset 0 0 0 2px var(--studio-cyan);
}

.side-picker {
    flex-direction: row;
    flex-wrap: wrap;
}

.side-picker .mode-option { flex: 1 1 140px; }

.join-member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.65rem;
}

.join-member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.28);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: center;
    transition: border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.join-member-card:hover:not(:disabled) {
    border-color: var(--gold);
    transform: translateY(-1px);
}

.join-member-card.is-selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(232, 185, 35, 0.35);
}

.join-member-card.is-taken,
.join-member-card:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.join-member-name {
    font-weight: 800;
    font-size: 0.9rem;
}

.join-member-taken {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 800;
}

fieldset {
    border: 3px solid rgba(0, 232, 208, 0.45);
    padding: 1rem;
    background: rgba(0, 0, 0, 0.18);
}

legend {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 0.95rem;
    padding: 0 0.4rem;
    text-transform: uppercase;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

input, textarea {
    font: inherit;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    padding: 0.7rem 0.85rem;
    border: 3px solid rgba(255, 210, 0, 0.4);
    background: #03123f;
    color: var(--ink);
}

input[type="color"] {
    width: 3rem;
    height: 2.5rem;
    padding: 0.15rem;
    cursor: pointer;
}

.color-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.color-swatch {
    width: 1.6rem;
    height: 1.6rem;
    border: 2px solid #fff;
    background: var(--swatch);
    cursor: pointer;
    padding: 0;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.color-swatch:hover { transform: scale(1.15); }

.code-input {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 1.4rem;
    text-align: center;
    font-family: var(--font-display);
    color: var(--gold);
}

.stack { display: flex; flex-direction: column; gap: 0.75rem; }

.flash {
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    font-weight: 800;
    border: 3px solid;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.flash-success { background: rgba(45, 255, 154, 0.15); border-color: var(--ok); color: var(--ok); }
.flash-error { background: rgba(255, 42, 42, 0.18); border-color: var(--danger); color: #ffb4b4; }
.flash-warning { background: rgba(255, 176, 32, 0.18); border-color: var(--warn); color: var(--gold-chrome); }

/* ——— Game shell ——— */
.game-shell { display: flex; flex-direction: column; gap: 1.1rem; }

.lobby-banner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem;
    border: 4px solid var(--gold);
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 45, 122, 0.12) 0 12px,
            rgba(0, 232, 208, 0.1) 12px 24px
        ),
        rgba(4, 22, 80, 0.85);
    box-shadow: inset 0 0 0 3px var(--studio-cyan);
}

.share-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 0.75rem;
    padding: 1rem 1.25rem;
    border: 3px dashed var(--gold);
    background: rgba(0, 0, 0, 0.35);
    width: min(640px, 100%);
}

.share-qr {
    background: #fff;
    padding: 0.5rem;
    border: 4px solid var(--studio-magenta);
    line-height: 0;
}

.share-qr img, .share-qr canvas { display: block; }

.share-link-block {
    flex: 1 1 220px;
    text-align: left;
}

.share-title {
    margin: 0 0 0.2rem;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
    font-size: 1.15rem;
    color: var(--gold);
    text-transform: uppercase;
}

.share-link-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.share-link-input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}

.share-copied {
    margin: 0.4rem 0 0;
    color: var(--ok);
    font-weight: 800;
    font-size: 0.9rem;
}

.share-copied.is-hidden { display: none; }

.you-are {
    margin: 0;
    color: var(--cream);
    font-weight: 800;
    text-transform: uppercase;
}

.turn-spotlight {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem 0.75rem;
    padding: 0.75rem 1.1rem;
    border: 4px solid var(--team-color, var(--gold));
    background:
        linear-gradient(90deg, rgba(var(--team-color-rgb), 0.35), rgba(0, 0, 0, 0.55), rgba(var(--team-color-rgb), 0.35));
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.2),
        0 0 28px rgba(var(--team-color-rgb), 0.55);
    animation: turnspotlight 1.1s ease-in-out infinite alternate;
    text-align: center;
}

.turn-spotlight-label {
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--cream);
    opacity: 0.9;
}

.turn-spotlight-team {
    font-family: var(--font-display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: clamp(1.15rem, 3.5vw, 1.55rem);
    color: var(--team-color, var(--gold));
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}

.turn-spotlight-player {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border: 2px solid #fff;
    background: var(--team-color, var(--gold));
    color: #041543;
    font-family: var(--font-display);
    font-size: clamp(1rem, 3vw, 1.25rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    animation: playerpulse 0.9s ease-in-out infinite alternate;
}

.turn-spotlight-you {
    font-weight: 900;
    text-transform: uppercase;
    color: var(--gold-chrome);
    letter-spacing: 0.05em;
}

.scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.85rem;
    align-items: stretch;
}

@media (max-width: 700px) {
    .scoreboard { grid-template-columns: 1fr; }
}

.team-card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(20, 60, 160, 0.95), rgba(6, 20, 70, 0.98));
    border: 4px solid var(--team-color, var(--gold));
    padding: 1rem 1.1rem;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.team-color-dot {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-bottom: 0.25rem;
    background: var(--team-color, var(--accent));
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    box-shadow: 0 0 0 2px #fff;
}

.team-turn-badge {
    position: absolute;
    top: 0.55rem;
    right: -0.15rem;
    padding: 0.28rem 0.7rem;
    background: var(--team-color, var(--gold));
    color: #041543;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 2px solid #fff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
    animation: badgepop 1s ease-in-out infinite alternate;
}

.team-card.is-control {
    z-index: 1;
    transform: scale(1.04);
    border-width: 5px;
    box-shadow:
        inset 0 0 0 3px #fff,
        0 0 0 5px rgba(var(--team-color-rgb, var(--accent-rgb)), 0.55),
        0 0 32px rgba(var(--team-color-rgb, var(--accent-rgb)), 0.65);
    animation: controlpulse 1.05s ease-in-out infinite alternate;
}

.team-card.is-waiting {
    opacity: 0.48;
    filter: grayscale(0.35) brightness(0.85);
    transform: scale(0.97);
}

.team-card h2 {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: 0.03em;
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    color: var(--cream);
    text-transform: uppercase;
}

.score {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 8vw, 3.4rem);
    margin: 0.15rem 0;
    color: var(--gold);
    line-height: 1;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}

.players {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.player-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    margin: 0.3rem 0;
    padding: 0.2rem 0.35rem;
    border-radius: 0;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.player-row.is-benched {
    opacity: 0.45;
}

.player-row.is-dimmed {
    opacity: 0.34;
    filter: grayscale(0.8) brightness(0.72);
}

.player-row.is-dimmed .player-avatar {
    box-shadow: none;
}

.players.has-highlight .player-row.is-turn {
    opacity: 1;
    filter: none;
}

.player-bench-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.1rem 0.35rem;
}

.player-name { display: inline-block; }

.players .is-turn {
    color: #041543;
    font-weight: 900;
    text-transform: uppercase;
    background: var(--team-color, var(--gold));
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(var(--team-color-rgb), 0.45);
    padding: 0.35rem 0.55rem;
    animation: playerpulse 0.85s ease-in-out infinite alternate;
}

.player-avatar {
    width: 1.7rem;
    height: 1.7rem;
    max-width: 100%;
    object-fit: cover;
    border: 2px solid #fff;
    flex: 0 0 auto;
}

.player-avatar.is-empty {
    display: grid;
    place-items: center;
    background: rgba(var(--team-color-rgb, 232, 185, 35), 0.35);
    font-weight: 900;
    font-size: 0.75em;
    color: #fff;
}

.manual-team-fields.is-locked {
    opacity: 0.45;
    pointer-events: none;
}

.catalog-team-preview.is-hidden { display: none; }

.catalog-preview-card {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 3px solid var(--family-color, var(--gold));
    background: rgba(0, 0, 0, 0.28);
}

.catalog-preview-name {
    font-family: var(--font-display);
    color: var(--family-color, var(--gold));
    margin: 0 0 0.35rem;
}

.catalog-pick-hint {
    margin: 0 0 0.65rem;
}

.catalog-member-pick label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    text-transform: none;
    font-size: 0.95rem;
    letter-spacing: normal;
    cursor: pointer;
}

.catalog-member-pick input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--family-color, var(--gold));
}

.catalog-pick-list li {
    list-style: none;
}

.family-catalog-select {
    width: 100%;
}

.player-turn-badge {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    background: #041543;
    color: var(--gold-chrome);
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    border: 1px solid #fff;
}

.switch-team-form { display: inline; margin: 0; }

.btn-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--studio-cyan);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover { color: var(--gold); }

.switch-self-form { margin: 0.35rem 0 0; }

.game-chat {
    margin-top: 0.25rem;
    padding: 1rem 1.1rem;
    border: 3px solid var(--studio-cyan);
    background: rgba(4, 22, 80, 0.9);
    width: min(720px, 100%);
    align-self: center;
}

.chat-title {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold);
    font-size: 1.1rem;
}

.chat-hint { margin: 0.2rem 0 0.65rem; }

.chat-log {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
    background: rgba(0, 0, 0, 0.35);
    border: 2px dashed rgba(255, 215, 0, 0.35);
    margin-bottom: 0.75rem;
}

.chat-msg {
    font-size: 0.92rem;
    line-height: 1.35;
    color: var(--cream);
}

.chat-msg.is-host .chat-author { color: var(--studio-magenta); }

.chat-author {
    color: var(--studio-cyan);
    margin-right: 0.4rem;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.chat-body { word-break: break-word; }

.chat-form {
    display: flex;
    gap: 0.5rem;
}

.chat-form input {
    flex: 1 1 auto;
    min-width: 0;
}

.match-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
    min-width: 140px;
    padding: 0.5rem;
    border: 3px solid var(--studio-cyan);
    background: rgba(0, 0, 0, 0.35);
}

.code-pill, .status-pill {
    margin: 0;
    padding: 0.4rem 0.75rem;
    border: 3px solid var(--gold);
    background: #041543;
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gold-chrome);
}

.status-pill {
    border-color: var(--studio-magenta);
    color: #ffc0d8;
}

.pot {
    margin: 0.25rem 0 0;
    font-weight: 800;
    text-transform: uppercase;
}

.strikes {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.strikes.is-hidden { display: none; }

.x {
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border: 3px solid rgba(255, 255, 255, 0.25);
    color: transparent;
    font-family: var(--font-display);
    font-size: 1.3rem;
    background: rgba(0, 0, 0, 0.35);
}

.x.is-on {
    color: #fff;
    border-color: #fff;
    background: var(--danger);
    text-shadow: 0 0 8px #fff;
    animation: xslam 0.35s cubic-bezier(0.2, 1.4, 0.3, 1);
}

.timer {
    margin-top: 0.55rem;
    padding: 0.45rem 0.8rem;
    border: 3px solid var(--gold);
    background: #120020;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5rem;
}

.timer.is-hidden { display: none; }

.timer-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    line-height: 1;
    color: var(--studio-cyan);
}

.timer-label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 800;
}

.timer.is-urgent {
    border-color: var(--danger);
    background: #3a0000;
    animation: pulse 0.55s ease-in-out infinite;
}

.timer.is-urgent .timer-value { color: var(--danger); }

.question-banner {
    text-align: center;
    padding: 1.15rem 1rem;
    border-block: 4px solid var(--gold);
    background:
        linear-gradient(90deg, var(--studio-magenta), transparent 30%, transparent 70%, var(--studio-cyan)),
        linear-gradient(180deg, #0c2a8a, #06185e);
}

.faceoff-intro {
    text-align: center;
    padding: 1.75rem 1.25rem;
    border: 5px solid var(--gold);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(232, 185, 35, 0.25), transparent 55%),
        linear-gradient(180deg, #0c2a8a, #06185e);
    box-shadow: inset 0 0 0 3px var(--studio-magenta);
    animation: faceoff-intro-in 0.45s ease-out;
}

.faceoff-intro-kicker {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-chrome);
}

.faceoff-intro-title {
    margin: 0.4rem 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.faceoff-intro-rule {
    margin: 0 auto;
    max-width: 34rem;
    font-size: clamp(1.05rem, 2.8vw, 1.25rem);
    line-height: 1.45;
    color: #e8f0ff;
    font-weight: 700;
}

.countdown-display {
    margin-top: 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.countdown-value {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    line-height: 1;
    color: var(--gold-chrome);
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
    animation: countdown-pop 0.35s ease-out;
}

.countdown-value.is-urgent {
    color: var(--danger);
    animation: pulse 0.55s ease-in-out infinite;
}

.countdown-label {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.answer-player-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    color: var(--gold-chrome);
}

.answer-player-select {
    width: 100%;
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.75rem;
    border: 3px solid var(--gold);
    background: #06185e;
    color: #fff;
    font: inherit;
    font-weight: 700;
}

.answer-duelist-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: 0.65rem;
    width: 100%;
    margin: 0 0 0.75rem;
}

.answer-duelist-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.7rem 0.55rem 0.65rem;
    border: 3px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.answer-duelist-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.answer-duelist-avatar {
    width: clamp(3rem, 8vw, 4rem);
    height: clamp(3rem, 8vw, 4rem);
    max-width: 4rem;
    max-height: 4rem;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
    flex: 0 0 auto;
}

.answer-duelist-avatar.is-empty {
    display: grid;
    place-items: center;
    background: rgba(var(--team-color-rgb), 0.45);
    font-weight: 900;
    font-size: 1.25rem;
    color: #fff;
}

.answer-duelist-name {
    font-weight: 900;
    font-size: 0.9rem;
    color: #fff;
    line-height: 1.15;
}

.answer-duelist-team {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--team-color, var(--gold));
}

.answer-duelist-card:hover {
    border-color: rgba(var(--team-color-rgb), 0.75);
    transform: translateY(-2px);
}

.answer-duelist-card:has(.answer-duelist-input:checked),
.answer-duelist-card:has(.answer-duelist-input:focus-visible) {
    border-color: var(--team-color, var(--gold));
    background: rgba(var(--team-color-rgb), 0.22);
    box-shadow:
        inset 0 0 0 2px #fff,
        0 0 0 3px rgba(var(--team-color-rgb), 0.55);
}

body.game-page.is-live .answer-duelist-picker {
    margin-bottom: 0.45rem;
    gap: 0.45rem;
    grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
    max-width: 28rem;
    margin-inline: auto;
}

body.game-page.is-live .answer-duelist-card {
    padding: 0.45rem 0.4rem 0.4rem;
}

body.game-page.is-live .answer-duelist-avatar {
    width: 3rem;
    height: 3rem;
    max-width: 3rem;
    max-height: 3rem;
}

@keyframes faceoff-intro-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes countdown-pop {
    from { transform: scale(1.25); opacity: 0.5; }
    to { transform: scale(1); opacity: 1; }
}

.question-banner.has-turn {
    border-block-color: var(--team-color, var(--gold));
    box-shadow: inset 0 0 0 3px rgba(var(--team-color-rgb), 0.45);
}

.question {
    font-size: clamp(1.15rem, 3.2vw, 1.7rem);
    font-weight: 800;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.turn-hint {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
    margin: 0.85rem 0 0;
    padding: 0.45rem 0.9rem;
    color: #041543;
    background: var(--team-color, var(--gold-chrome));
    border: 3px solid #fff;
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: 0 0 0 3px rgba(var(--team-color-rgb, 232, 185, 35), 0.4);
    animation: playerpulse 1s ease-in-out infinite alternate;
}

.turn-hint-family {
    font-weight: 900;
}

.turn-hint-sep { opacity: 0.7; }

.turn-hint-you {
    margin-left: 0.15rem;
    padding: 0.1rem 0.4rem;
    background: #041543;
    color: var(--gold-chrome);
    border: 1px solid #fff;
    font-size: 0.75rem;
}

.board {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.75rem;
    border: 5px solid var(--gold);
    background:
        repeating-linear-gradient(
            0deg,
            #03103a 0 28px,
            #06184f 28px 56px
        );
    box-shadow: inset 0 0 0 3px var(--studio-magenta);
    perspective: 900px;
}

.board-row {
    perspective: 900px;
}

.board-panel {
    display: grid;
    grid-template-columns: 2.6rem 1fr 3.6rem;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    background: linear-gradient(180deg, #1a3f9e, #0b2268);
    border: 3px solid #6ea0ff;
    transform-origin: center center;
    backface-visibility: hidden;
}

.board-row.is-revealed .board-panel {
    border-color: var(--gold);
    background: linear-gradient(180deg, #5a4300, #2a1d00);
}

.board-row.is-flipping .board-panel {
    animation: boardFlip 0.75s cubic-bezier(0.18, 0.9, 0.22, 1) both;
}

.board-row .rank {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--gold);
    text-shadow: 0 2px 0 #000;
}

.board-row .label {
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #eaf2ff;
}

.board-row.is-revealed .label {
    color: var(--gold-chrome);
}

.board-row .pct {
    text-align: right;
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: var(--studio-cyan);
}

.strike-fx {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    pointer-events: none;
    background: rgba(4, 8, 28, 0.45);
}

.strike-fx[hidden] {
    display: none !important;
}

.strike-fx.is-on {
    animation: strikeFxBg 0.85s ease-out both;
}

.strike-fx-x {
    font-size: min(42vw, 38vh);
    line-height: 1;
    font-weight: 900;
    color: #ff1a1a;
    text-shadow:
        0 6px 0 #7a0000,
        0 0 36px rgba(255, 30, 30, 0.85);
    -webkit-text-stroke: 8px #fff;
    paint-order: stroke fill;
    animation: strikeFxPop 0.85s cubic-bezier(0.15, 1.2, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .board-row.is-flipping .board-panel,
    .strike-fx.is-on,
    .strike-fx-x {
        animation: none;
    }
}

.game-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 0.35rem;
}

.answer-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: min(640px, 100%);
    justify-content: center;
}

.answer-form input[type="text"] { flex: 1 1 220px; }

.pass-turn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    color: #c9d7ff;
    user-select: none;
}

.pass-turn input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--danger, #ff2a2a);
    cursor: pointer;
}

.clarify {
    width: 100%;
    text-align: center;
    color: var(--warn);
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
}

.waiting-turn {
    font-size: 1.15rem;
    color: var(--gold-chrome);
    text-align: center;
    font-family: var(--font-display);
    text-transform: uppercase;
}

.winner-banner {
    text-align: center;
    padding: 1.5rem;
    border: 5px solid var(--gold);
    outline: 3px solid var(--studio-magenta);
    outline-offset: 4px;
    background:
        repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,210,0,0.2) 0 10deg, transparent 10deg 20deg),
        #0a246e;
}

.winner-banner h2 {
    font-family: var(--font-marquee);
    font-size: clamp(2rem, 8vw, 3.2rem);
    color: var(--gold);
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    text-shadow: 0 3px 0 #6b4a00;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid rgba(255, 210, 0, 0.25);
}

.table a { color: var(--gold-chrome); font-weight: 800; }

.table-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

.answer-list { line-height: 1.7; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

@media (min-width: 800px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-grid > label:not(.party-only),
    .form-grid > button,
    .form-grid > .full-width,
    .form-grid > .mode-switch {
        grid-column: 1 / -1;
    }
}

@keyframes sunspin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes twinkle {
    from { opacity: 0.55; }
    to { opacity: 1; }
}

@keyframes brandshine {
    from {
        filter: brightness(1);
        transform: scale(1);
    }
    to {
        filter: brightness(1.12);
        transform: scale(1.015);
    }
}

@keyframes starpop {
    from { transform: scale(0.85) rotate(0deg); opacity: 0.7; }
    to { transform: scale(1.15) rotate(18deg); opacity: 1; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes boardflash {
    0% { filter: brightness(2.2); transform: scaleX(0.96); }
    100% { filter: none; transform: none; }
}

@keyframes boardFlip {
    0% {
        transform: rotateX(-92deg) scaleY(0.85);
        filter: brightness(0.35);
        box-shadow: 0 18px 0 rgba(0, 0, 0, 0.45);
    }
    55% {
        transform: rotateX(8deg) scaleY(1.02);
        filter: brightness(1.55);
        box-shadow: 0 0 28px rgba(255, 214, 90, 0.55);
    }
    100% {
        transform: rotateX(0) scaleY(1);
        filter: brightness(1);
        box-shadow: none;
    }
}

@keyframes strikeFxPop {
    0% {
        transform: scale(0.2) rotate(-18deg);
        opacity: 0;
    }
    18% {
        transform: scale(1.25) rotate(4deg);
        opacity: 1;
    }
    55% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.85) rotate(0deg);
        opacity: 0;
    }
}

@keyframes strikeFxBg {
    0%, 55% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes xslam {
    from { transform: scale(1.6) rotate(-12deg); }
    to { transform: scale(1) rotate(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes controlpulse {
    from { filter: brightness(1); }
    to { filter: brightness(1.18); }
}

@keyframes playerpulse {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.04); filter: brightness(1.12); }
}

@keyframes turnspotlight {
    from { filter: brightness(1); }
    to { filter: brightness(1.14); }
}

@keyframes badgepop {
    from { transform: translateX(0) scale(1); }
    to { transform: translateX(-2px) scale(1.06); }
}

.import-doc {
    margin-top: 1.25rem;
}

.import-doc-title {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--gold);
    text-transform: uppercase;
}

.import-doc h3 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--studio-cyan);
}

.import-doc-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 960px) {
    .import-doc-grid {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }
}

.import-doc-table {
    font-size: 0.9rem;
}

.import-doc-table code {
    color: var(--gold-chrome);
    font-size: 0.85em;
}

.import-doc-tips {
    margin: 0.85rem 0 0;
    padding-left: 1.1rem;
    color: var(--cream);
    line-height: 1.55;
}

.import-doc-example-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.import-doc-code {
    margin: 0;
    padding: 0.85rem 1rem;
    overflow: auto;
    max-height: 28rem;
    border: 3px solid var(--studio-cyan);
    background: #041543;
    color: #e8f0ff;
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre;
}

.import-doc-code code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ——— Admin familles ——— */
.stack-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.form-actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
}

.family-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.family-admin-card {
    border: 4px solid var(--family-color, var(--gold));
    background: rgba(4, 22, 80, 0.9);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.family-admin-card-head h2 {
    margin: 0.25rem 0 0;
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-transform: uppercase;
    color: var(--gold-chrome);
}

.family-admin-swatch {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    background: var(--family-color, var(--gold));
    border: 2px solid #fff;
}

.family-admin-members {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.family-admin-members li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
}

.family-member-avatar {
    width: 2.4rem;
    height: 2.4rem;
    object-fit: cover;
    border: 2px solid #fff;
    background: #041543;
    flex: 0 0 auto;
}

.family-member-avatar.is-empty,
.family-member-avatar.is-preview.is-empty {
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    color: var(--gold);
    font-size: 1rem;
}

.family-member-avatar.is-preview {
    width: 4.5rem;
    height: 4.5rem;
}

.family-members-title {
    margin: 1.5rem 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--gold);
    text-transform: uppercase;
}

.family-member-slots {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 800px) {
    .family-member-slots {
        grid-template-columns: 1fr 1fr;
    }
}

.family-member-slot {
    margin: 0;
    padding: 0.85rem;
    border: 3px solid rgba(255, 210, 0, 0.35);
    background: rgba(0, 0, 0, 0.28);
}

.family-member-slot legend {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--studio-cyan);
    padding: 0 0.35rem;
}

.family-member-slot-body {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.family-member-photo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.family-photo-btn { cursor: pointer; }

.family-member-name {
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.family-form-meta {
    margin-bottom: 0.5rem;
}

.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.color-preset {
    width: 1.6rem;
    height: 1.6rem;
    border: 2px solid #fff;
    cursor: pointer;
    padding: 0;
}

.theme-section-title {
    margin: 1.25rem 0 0.35rem;
    font-family: var(--font-display);
    color: var(--gold);
    font-size: 1.05rem;
    text-transform: uppercase;
}

.theme-active-toggle {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.95rem;
}

.theme-active-toggle input {
    width: 1.1rem;
    height: 1.1rem;
}

.theme-answer-slots,
.theme-ambiguous-slots {
    display: grid;
    gap: 0.75rem;
}

.theme-answer-slot,
.theme-ambiguous-slot {
    margin: 0;
}

.theme-answer-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
}

.theme-answer-percent {
    min-width: 5rem;
}

@media (max-width: 640px) {
    .theme-answer-row {
        grid-template-columns: 1fr;
    }
}

.theme-category-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .theme-category-fields {
        grid-template-columns: 1fr;
    }
}

.theme-category-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border: 1px solid rgba(232, 185, 35, 0.55);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.question-category {
    margin: 0 0 0.35rem;
}

/* ——— Création partie (wizard) ——— */
.create-page .container { max-width: 720px; }

.create-wizard {
    max-width: 640px;
    margin-inline: auto;
    overflow: hidden;
}

.create-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.create-brand {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    color: var(--gold-chrome);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
    animation: create-brand-in 0.55s ease both;
}

.create-progress {
    display: flex;
    gap: 0.45rem;
}

.create-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.create-dot.is-on {
    background: var(--gold);
    border-color: #fff;
}

.create-dot.is-current {
    transform: scale(1.25);
}

.create-step {
    animation: create-step-in 0.35s ease both;
}

.create-title {
    margin: 0 0 1.1rem;
    text-align: center;
    font-size: clamp(1.35rem, 4.5vw, 1.75rem);
}

.create-hint {
    text-align: center;
    margin: -0.5rem 0 1rem;
    font-size: 0.9rem;
}

.create-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.create-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 1.15rem 0.75rem 1rem;
    border: 3px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.28);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: center;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.create-choice strong {
    font-family: var(--font-display);
    font-size: 0.95rem;
    text-transform: uppercase;
    color: var(--gold-chrome);
}

.create-choice > span:last-child {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.create-choice:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 210, 0, 0.55);
}

.create-choice.is-selected {
    border-color: var(--gold);
    background: rgba(255, 210, 0, 0.12);
    box-shadow: 0 0 0 2px rgba(255, 210, 0, 0.25);
}

.create-choice-visual {
    width: 4.5rem;
    height: 3.2rem;
    display: grid;
    place-items: center;
    margin-bottom: 0.25rem;
}

.create-ico-tv {
    width: 3.2rem;
    height: 2.1rem;
    border: 3px solid var(--studio-cyan);
    background: rgba(0, 232, 208, 0.15);
    position: relative;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.create-ico-tv::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.45rem;
    width: 1.4rem;
    height: 0.35rem;
    transform: translateX(-50%);
    background: var(--studio-cyan);
}

.create-ico-phones {
    display: flex;
    gap: 0.35rem;
    align-items: flex-end;
}

.create-ico-phones::before,
.create-ico-phones::after {
    content: "";
    width: 1.05rem;
    border: 3px solid var(--studio-magenta);
    background: rgba(255, 45, 122, 0.18);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.create-ico-phones::before { height: 1.7rem; }
.create-ico-phones::after { height: 2.05rem; }

.create-family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.75rem;
}

.create-fam-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.9rem 0.55rem;
    border: 3px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.28);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: center;
    min-height: 8.5rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.create-fam-card strong {
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--gold-chrome);
    line-height: 1.2;
}

.create-fam-card > span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.create-fam-card:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--fam-color, var(--gold));
}

.create-fam-card.is-selected {
    border-color: var(--fam-color, var(--gold));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--fam-color, var(--gold)) 40%, transparent);
}

.create-fam-card.is-disabled,
.create-fam-card:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.create-fam-swatch {
    width: 100%;
    height: 0.35rem;
    background: var(--fam-color, var(--gold));
}

.create-fam-avatars {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
}

.create-fam-avatar,
.create-member-avatar {
    width: 2.1rem;
    height: 2.1rem;
    object-fit: cover;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, 0.12);
}

.create-fam-avatar.is-empty,
.create-member-avatar.is-empty {
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.create-manual {
    margin-top: 1rem;
    padding: 0.85rem;
    border: 3px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.22);
}

.create-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.35rem 0 0.75rem;
}

.create-swatch {
    width: 1.7rem;
    height: 1.7rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: var(--swatch);
    cursor: pointer;
    padding: 0;
}

.create-swatch.is-on {
    border-color: #fff;
    outline: 2px solid var(--gold);
}

.create-members-wrap {
    display: grid;
    gap: 1.1rem;
}

.create-members-block h2 {
    margin: 0 0 0.55rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--fam-color, var(--gold));
    text-transform: uppercase;
}

.create-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: 0.55rem;
}

.create-member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.4rem;
    border: 2px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    font-size: 0.85rem;
    opacity: 0.4;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.create-member-card.is-on {
    opacity: 1;
    border-color: var(--fam-color, var(--gold));
    transform: translateY(-1px);
}

.create-summary {
    text-align: center;
    margin-bottom: 1.25rem;
}

.create-sum-mode {
    font-family: var(--font-display);
    color: var(--studio-cyan);
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.create-sum-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.create-sum-team {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.95rem;
    color: var(--gold-chrome);
}

.create-sum-dot {
    width: 0.85rem;
    height: 0.85rem;
    background: var(--fam-color, var(--gold));
    border: 2px solid #fff;
}

.create-sum-vs {
    font-family: var(--font-marquee);
    color: var(--studio-magenta);
    font-size: 1.1rem;
}

.create-settings {
    margin-bottom: 1.25rem;
}

.create-settings-label {
    margin: 0.75rem 0 0.4rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.create-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.create-chip {
    min-width: 3.2rem;
    padding: 0.55rem 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.create-chip.is-on {
    border-color: var(--gold);
    background: rgba(255, 210, 0, 0.18);
    color: var(--gold-chrome);
}

.create-nav {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1.35rem;
    flex-wrap: wrap;
}

@keyframes create-brand-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

@keyframes create-step-in {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
    .create-choice-grid {
        grid-template-columns: 1fr;
    }
}
