/* =====================================================================
   DESIGN TOKENS & RESET GLOBAL (CSS NATIF 100 % AUTONOME)
   ===================================================================== */
:root {
    --bg-main: #0b0f19;
    --bg-card: #131a2e;
    --bg-interactive: #1e293b;
    --bg-input: #080c14;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --border-subtle: rgba(148, 163, 184, 0.2);
    --border-strong: rgba(148, 163, 184, 0.38);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;
    --shadow-card: 0 18px 40px rgba(2, 6, 23, 0.65);
    --shadow-btn: 0 6px 0 rgba(2, 6, 23, 0.7);
    --soft-cyan: #67e8f9;
    --soft-emerald: #6ee7b7;
    --soft-purple: #ddd6fe;
    --soft-amber: #fde68a;
    --soft-rose: #fecdd3;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

body {
    background-image:
        radial-gradient(circle at 12% 8%, rgba(139, 92, 246, 0.16), transparent 38%),
        radial-gradient(circle at 88% 12%, rgba(6, 182, 212, 0.14), transparent 38%),
        radial-gradient(circle at 50% 96%, rgba(244, 63, 94, 0.1), transparent 45%);
}

.hidden {
    display: none !important;
}

/* =====================================================================
   BARRE SUPÉRIEURE & CONTENEUR PRINCIPAL
   ===================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.brand-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.brand-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    font-size: 1.2rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    font-weight: 700;
    border: 1px solid var(--border-strong);
    background: var(--bg-interactive);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease;
}

.status-pill:hover {
    transform: translateY(-1px);
    border-color: var(--accent-cyan);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-amber);
}

.status-pill.cloud-active {
    border-color: rgba(16, 185, 129, 0.65);
    background: rgba(16, 185, 129, 0.16);
    color: var(--soft-emerald);
}

.status-pill.cloud-active .status-dot {
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.app-shell {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 22px 16px 52px;
}

/* =====================================================================
   COMPOSANTS GÉNÉRIQUES (CARTES, BOUTONS, CHAMPS)
   ===================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.card-sub {
    background: var(--bg-interactive);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    min-height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.98rem;
    font-weight: 800;
    cursor: pointer;
    color: var(--text-primary);
    background: var(--bg-interactive);
    transition: transform 0.12s ease, filter 0.15s ease, border-color 0.2s ease;
    text-decoration: none;
}

.btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(2px);
}

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

.btn-cyan {
    background: linear-gradient(135deg, #0891b2, #0284c7);
    border-color: rgba(103, 232, 249, 0.45);
    box-shadow: var(--shadow-btn);
}

.btn-purple {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    border-color: rgba(196, 181, 253, 0.45);
    box-shadow: var(--shadow-btn);
}

.btn-emerald {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: rgba(110, 231, 183, 0.45);
    color: #ffffff;
    box-shadow: var(--shadow-btn);
}

.btn-amber {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border-color: rgba(253, 230, 138, 0.45);
    color: #0b0f19;
    box-shadow: var(--shadow-btn);
}

.btn-rose {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    border-color: rgba(253, 164, 175, 0.45);
    color: #ffffff;
}

.btn-ghost {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 13px;
    min-height: 38px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 24px;
    min-height: 56px;
    font-size: 1.1rem;
}

.input, .select, .textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.96rem;
    font-family: inherit;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.22);
}

.label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* =====================================================================
   1. ÉCRAN D'ACCUEIL
   ===================================================================== */
.hero {
    text-align: center;
    padding: 20px 12px 30px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    background: rgba(139, 92, 246, 0.16);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: var(--soft-purple);
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero-title {
    margin: 0;
    font-size: clamp(2.1rem, 5.5vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-gradient {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-rose));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    max-width: 700px;
    margin: 14px auto 0;
    color: var(--text-secondary);
    font-size: 1.02rem;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 12px;
}

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

.entry-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-card);
    transition: transform 0.18s ease, border-color 0.2s ease;
}

.entry-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
}

.entry-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.35);
    margin-bottom: 14px;
}

.entry-card.purple .entry-icon {
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(139, 92, 246, 0.38);
}

.entry-card.amber .entry-icon {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.38);
}

.entry-title {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 900;
}

.entry-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.94rem;
}

/* =====================================================================
   2. VUE HÔTE (ÉCRAN TV AUTONOME GOOGLE TV / TV BRO)
   ===================================================================== */
.tv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.room-code-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    padding: 12px 20px;
}

.room-code-value {
    font-size: clamp(2rem, 4.5vw, 2.9rem);
    font-weight: 900;
    letter-spacing: 0.16em;
    color: var(--accent-cyan);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.lobby-layout {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 22px;
}

@media (max-width: 920px) {
    .lobby-layout {
        grid-template-columns: 1fr;
    }
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.player-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-interactive);
    border: 1px solid var(--border-strong);
    font-weight: 800;
    font-size: 1.02rem;
}

.player-avatar {
    font-size: 1.6rem;
    line-height: 1;
}

.qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: #ffffff;
    color: #0b0f19;
    margin-bottom: 16px;
}

.qr-img {
    width: 190px;
    height: 190px;
    object-fit: contain;
    border-radius: 8px;
}

.qr-url-text {
    font-size: 0.78rem;
    color: #1e293b;
    word-break: break-all;
    text-align: center;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Plateau Question / Blindtest TV */
.q-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 18px;
}

.q-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 800;
    background: rgba(6, 182, 212, 0.18);
    color: var(--soft-cyan);
}

.tag-purple {
    background: rgba(139, 92, 246, 0.22);
    color: var(--soft-purple);
}

.tag-rose {
    background: rgba(244, 63, 94, 0.22);
    color: var(--soft-rose);
}

.timer-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    background: #070a12;
    border: 2px solid var(--accent-rose);
}

.timer-value {
    font-size: 2.2rem;
    font-weight: 900;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #ffffff;
}

/* Scène Blindtest Deezer TV */
.blindtest-stage {
    background: linear-gradient(135deg, #161f38, #27173d);
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 18px;
}

.blindtest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
}

.blindtest-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vinyl-box {
    position: relative;
    width: 118px;
    height: 118px;
    flex-shrink: 0;
}

.vinyl-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at center, #f59e0b 0 18px, #1e293b 19px 23px, #080c14 24px 44px, #1e293b 45px 47px, #080c14 48px 100%);
    border: 3px solid #475569;
    animation: spinVinyl 4.5s linear infinite;
}

.vinyl-disc.paused {
    animation-play-state: paused;
}

.album-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 3px solid var(--accent-amber);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

@keyframes spinVinyl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.equalizer {
    display: inline-flex;
    align-items: flex-end;
    gap: 5px;
    height: 46px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(8, 12, 20, 0.8);
    border: 1px solid var(--border-subtle);
}

.eq-bar {
    width: 6px;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(to top, var(--accent-purple), var(--accent-rose), var(--accent-cyan));
    transform-origin: bottom;
    animation: eqBounce 0.6s ease-in-out infinite;
}

.equalizer.paused .eq-bar {
    animation-play-state: paused;
    transform: scaleY(0.2);
}

@keyframes eqBounce {
    0%, 100% { transform: scaleY(0.25); }
    50% { transform: scaleY(1); }
}

.q-prompt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 26px 22px;
    text-align: center;
    margin-bottom: 18px;
}

.q-prompt-text {
    margin: 0;
    font-size: clamp(1.45rem, 3.6vw, 2.5rem);
    font-weight: 900;
    line-height: 1.25;
}

.tv-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 740px) {
    .tv-options-grid {
        grid-template-columns: 1fr;
    }
}

.tv-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.22);
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tv-opt-0 { background: linear-gradient(135deg, #be123c, #f43f5e); }
.tv-opt-1 { background: linear-gradient(135deg, #0369a1, #06b6d4); }
.tv-opt-2 { background: linear-gradient(135deg, #b45309, #f59e0b); }
.tv-opt-3 { background: linear-gradient(135deg, #047857, #10b981); }

.tv-option.correct {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: #ffffff;
    transform: scale(1.02);
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.6);
}

.tv-option.dimmed {
    opacity: 0.34;
    background: var(--bg-interactive);
}

.tv-shape {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.32);
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* Révélation + Mini-classement automatique */
.reveal-banner {
    margin-top: 20px;
    background: var(--bg-card);
    border: 2px solid var(--accent-emerald);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

.mini-lb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.mini-lb-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-interactive);
    border: 1px solid var(--border-strong);
    font-weight: 800;
}

.mini-lb-item.leader {
    border-color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.16);
}

.auto-progress-wrap {
    margin-top: 16px;
}

.auto-progress-track {
    width: 100%;
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    overflow: hidden;
    margin-top: 8px;
}

.auto-progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    transition: width 0.1s linear;
}

/* Podium Final */
.podium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
    margin: 24px 0;
}

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

.podium-card {
    background: var(--bg-interactive);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 22px 16px;
    text-align: center;
}

.podium-card.rank-1 {
    border-color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.16);
    padding-top: 32px;
}

/* =====================================================================
   3. VUE JOUEUR (SMARTPHONE)
   ===================================================================== */
.player-wrap {
    max-width: 540px;
    margin: 0 auto;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.avatar-choice {
    padding: 9px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    font-size: 1.4rem;
    cursor: pointer;
}

.avatar-choice.selected {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.22);
}

.player-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    margin-bottom: 14px;
}

.ctrl-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

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

.ctrl-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 78px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
}

/* =====================================================================
   4. ÉDITEUR DE BASE DE QUESTIONS
   ===================================================================== */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 22px;
    align-items: start;
}

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

.type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.type-btn {
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
}

.type-btn.active-qcm {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent-cyan);
    color: #ffffff;
}

.type-btn.active-bt {
    background: rgba(139, 92, 246, 0.24);
    border-color: var(--accent-purple);
    color: #ffffff;
}

.deezer-box {
    margin-top: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.38);
}

.deezer-results {
    max-height: 230px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.deezer-track-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
}

.option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.q-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 74vh;
    overflow-y: auto;
    padding-right: 4px;
}

/* =====================================================================
   MODALES & TOASTS (SANS ALERT NI CONFIRM)
   ===================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(2, 6, 23, 0.84);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    max-height: 90vh;
    overflow-y: auto;
}

.toast-container {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 370px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-interactive);
    border: 1px solid var(--accent-cyan);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: var(--shadow-card);
}

.toast.success { border-color: var(--accent-emerald); }
.toast.error { border-color: var(--accent-rose); }
.toast.warning { border-color: var(--accent-amber); }

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-secondary); }
.small { font-size: 0.86rem; }

/* =====================================================================
   AJOUTS SITE JEUX.OLAF.OVH : TUILES FAÇON APP STORE, NAVIGATION
   ===================================================================== */
a { color: inherit; }
a.btn { text-decoration: none; }
.brand-btn { text-decoration: none; }

.section-title {
    margin: 30px 0 14px;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

.game-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    border-radius: 28px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}
.game-tile:hover, .game-tile:focus-visible {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 26px 50px rgba(2, 6, 23, 0.75);
    outline: none;
}
.game-tile:focus-visible { box-shadow: 0 0 0 4px var(--accent-cyan), 0 26px 50px rgba(2, 6, 23, 0.75); }
.game-tile.quizparty { background: linear-gradient(140deg, #0891b2 0%, #6d28d9 100%); }
.game-tile.blindtest { background: linear-gradient(140deg, #e11d48 0%, #7c3aed 100%); }
.game-tile.soon { background: linear-gradient(140deg, #334155 0%, #1e293b 100%); cursor: default; opacity: 0.75; }
.game-tile.soon:hover { transform: none; }

.game-tile-art {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
    padding: 18px 0 0;
}
.game-tile-body {
    padding: 18px 22px 22px;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.55) 100%);
}
.game-tile-kicker {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.game-tile-title { margin: 2px 0 4px; font-size: 1.9rem; font-weight: 900; }
.game-tile-desc { margin: 0 0 14px; font-size: 0.95rem; opacity: 0.92; }
.game-tile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-white { background: #ffffff; color: #0b0f19; }
.btn-glass { background: rgba(255, 255, 255, 0.18); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.quick-tile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.quick-tile:hover, .quick-tile:focus-visible { transform: translateY(-2px); border-color: var(--accent-cyan); outline: none; }
.quick-tile .icon { font-size: 2.4rem; }
.quick-tile strong { display: block; font-size: 1.1rem; }
.quick-tile span.small { color: var(--text-secondary); }

.scores-list { display: grid; gap: 8px; }
.score-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-interactive); font-size: 0.9rem; }

.tv-pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 26px; margin-top: 20px; }
.tv-pick-grid .game-tile { min-height: 340px; }

.conn-banner {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    background: #7f1d1d; color: #fff; padding: 8px 16px; border-radius: var(--radius-pill);
    font-weight: 800; font-size: 0.85rem; z-index: 60; box-shadow: var(--shadow-card);
}
.player-chip .kick { margin-left: auto; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1rem; }
.player-chip.offline { opacity: 0.5; }
.gain { color: var(--accent-emerald); font-weight: 900; margin-left: 6px; }

.solo-option.correct { background: var(--accent-emerald) !important; }
.solo-option.wrong { background: #475569 !important; opacity: 0.7; }

@media (max-width: 640px) {
    .game-tile { min-height: 250px; }
    .game-tile-art { font-size: 4.5rem; }
    .game-tile-title { font-size: 1.6rem; }
}

.countdown-big {
    font-size: clamp(8rem, 30vw, 16rem);
    font-weight: 900;
    line-height: 1;
    margin: 4vh 0 2vh;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-rose));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: cd-pop 1s ease-out infinite;
}
@keyframes cd-pop { 0% { transform: scale(1.25); opacity: 1; } 30% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.95); opacity: 1; } }
.tv-option.clickable { cursor: pointer; }
.tv-option.clickable:hover { filter: brightness(1.15); transform: translateY(-2px); }
.tv-option.picked { outline: 4px solid #fff; }
.game-tile-actions .btn { padding-left: 14px; padding-right: 14px; }

/* Classement animé */
.lb-board { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; margin-top: 12px; }
.lb-card {
    position: relative; width: 150px; padding: 14px 10px 12px; border-radius: var(--radius-md);
    background: var(--bg-interactive); border: 2px solid var(--border-subtle); text-align: center;
    will-change: transform;
}
.lb-card.leader { border-color: var(--accent-amber); box-shadow: 0 0 22px rgba(245, 158, 11, 0.35); }
.lb-card.me { border-color: var(--accent-cyan); }
.lb-rank {
    position: absolute; top: -10px; left: -8px; width: 30px; height: 30px; border-radius: 50%;
    background: var(--accent-purple); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.lb-card.leader .lb-rank { background: var(--accent-amber); color: #0b0f19; }
.lb-avatar { font-size: 2rem; }
.lb-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-score { font-size: 1.35rem; font-weight: 900; color: var(--accent-cyan); transition: transform 0.3s; }
.lb-card.summed .lb-score { transform: scale(1.15); }
.lb-gain {
    position: absolute; top: -12px; right: -8px; padding: 2px 9px; border-radius: var(--radius-pill);
    background: var(--accent-emerald); color: #fff; font-weight: 900; font-size: 0.9rem;
    opacity: 0; transform: scale(0.4); transition: opacity 0.3s, transform 0.35s cubic-bezier(.3,1.6,.5,1);
}
.lb-gain.zero { background: #475569; }
.lb-card.show-gain .lb-gain { opacity: 1; transform: scale(1); }
@media (max-width: 640px) {
    .lb-board { gap: 10px; }
    .lb-card { width: calc(33.33% - 7px); padding: 12px 6px 8px; }
    .lb-avatar { font-size: 1.5rem; }
    .lb-score { font-size: 1.05rem; }
    .lb-name { font-size: 0.8rem; }
}

/* Bouton pour débloquer le son */
.sound-overlay {
    position: fixed; inset: 0; z-index: 80; border: none; cursor: pointer;
    background: rgba(2, 6, 23, 0.82); color: #fff; font-size: 5rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.sound-overlay span { font-size: 1.4rem; font-weight: 900; }

/* Pendant le classement : il remplace l'énoncé et les choix de réponse */
.revealing .q-prompt-card, .revealing .tv-options-grid, .revealing #btn-skip { display: none; }
.revealing .blindtest-stage { padding-top: 12px; padding-bottom: 12px; }
.revealing .reveal-banner { margin-top: 14px; }
.reveal-answer { font-size: 1.5rem; font-weight: 900; color: var(--accent-emerald); }

/* Grand classement de gauche (1er) à droite (dernier), grosses têtes emoji */
.lb-board.big { flex-wrap: nowrap; gap: 18px; justify-content: center; padding: 26px 12px 6px; overflow: hidden; }
.lb-board.big .lb-card { flex: 1 1 0; max-width: 240px; min-width: 0; padding: 22px 10px 18px; border-radius: var(--radius-lg); }
.lb-board.big .lb-avatar { font-size: clamp(2.6rem, 6vw, 6rem); line-height: 1.1; }
.lb-board.big .lb-name { font-size: clamp(0.85rem, 1.6vw, 1.5rem); margin-top: 6px; }
.lb-board.big .lb-score { font-size: clamp(1.1rem, 2.6vw, 2.6rem); }
.lb-board.big .lb-rank { width: clamp(28px, 3vw, 46px); height: clamp(28px, 3vw, 46px); font-size: clamp(0.9rem, 1.6vw, 1.5rem); top: -14px; left: -10px; }
.lb-board.big .lb-gain { font-size: clamp(0.8rem, 1.5vw, 1.4rem); padding: 3px 12px; top: -16px; right: -10px; }
@media (max-width: 640px) {
    .lb-board.big { gap: 8px; padding-top: 20px; }
    .lb-board.big .lb-card { padding: 14px 4px 10px; border-radius: var(--radius-md); }
    .lb-board.big .lb-gain { padding: 1px 6px; right: -4px; }
    .lb-board.big .lb-rank { left: -4px; }
}

/* Réponses en direct sous la question */
.live-answers { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.live-chip {
    display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: var(--radius-pill);
    background: var(--bg-card); border: 2px solid var(--border-subtle); font-weight: 800; font-size: 1.15rem;
    transition: border-color 0.2s, background 0.2s;
}
.live-chip .live-avatar { font-size: 1.8rem; line-height: 1; }
.live-chip.wait { opacity: 0.6; }
.live-chip.good { border-color: var(--accent-emerald); background: rgba(16, 185, 129, 0.16); animation: chip-pop 0.35s ease-out; }
.live-chip.bad { border-color: var(--accent-rose); background: rgba(244, 63, 94, 0.16); animation: chip-pop 0.35s ease-out; }
@keyframes chip-pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.live-answers.small-chips .live-chip { font-size: 0.85rem; padding: 4px 10px 4px 6px; gap: 6px; }
.live-answers.small-chips .live-avatar { font-size: 1.2rem; }

/* Écran TV : tout tient sur un écran, sans défilement */
html.tv-fit, html.tv-fit body { overflow: hidden; height: 100%; }
html.tv-fit .app-shell { max-width: 1440px; padding-top: 14px; padding-bottom: 10px; }
html.tv-fit .q-hud { padding-top: 10px; padding-bottom: 10px; }
html.tv-fit .q-prompt-card { padding-top: 16px; padding-bottom: 16px; }
html.tv-fit .tv-pick-grid .game-tile { min-height: 300px; }

.join-box { display: flex; align-items: center; gap: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle); }
.join-box .qr-panel { padding: 10px; flex-shrink: 0; }
.join-url { font-size: 1.5rem; font-weight: 900; color: #fff; word-break: break-all; }
.join-box .room-code-value { font-size: 3.6rem; line-height: 1; }
@media (max-width: 640px) { .join-box { flex-direction: column; text-align: center; } .join-url { font-size: 1.1rem; } }
html.tv-fit, html.tv-fit body { min-height: 0; }
html.tv-fit .mt-3 { margin-top: 12px; }
html.tv-fit .mt-4 { margin-top: 16px; }
html.tv-fit .card { padding-top: 20px; padding-bottom: 20px; }
html.tv-fit .tv-header { margin-bottom: 12px; }

/* =====================================================================
   Nouveaux jeux : Vrai ou Faux, Devine l'emoji, Estimations, Qui de nous ?
   ===================================================================== */
.game-tile.vraifaux   { background: linear-gradient(140deg, #059669 0%, #be123c 100%); }
.game-tile.emoji      { background: linear-gradient(140deg, #f59e0b 0%, #db2777 100%); }
.game-tile.estimation { background: linear-gradient(140deg, #2563eb 0%, #0d9488 100%); }
.game-tile.quidenous  { background: linear-gradient(140deg, #9333ea 0%, #f97316 100%); }

.tv-option.vf-true  { background: linear-gradient(135deg, #047857, #10b981); }
.tv-option.vf-false { background: linear-gradient(135deg, #be123c, #f43f5e); }
.tv-option .opt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-options-grid.vote { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tv-options-grid.vote .tv-option { padding: 14px; font-size: 1.15rem; }
.tv-options-grid.vote .tv-shape { background: none; font-size: 2rem; width: auto; }
.tv-options-grid.number { grid-template-columns: 1fr; }
@media (max-width: 740px) { .tv-options-grid.vote { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.q-prompt-text.emoji-prompt { font-size: clamp(3rem, 8vw, 6.5rem); letter-spacing: 0.08em; line-height: 1.15; }
.emoji-prompt-sm { font-size: 2.6rem !important; letter-spacing: 0.06em; text-align: center; }
.q-hint { margin-top: 8px; color: var(--text-secondary); font-weight: 800; font-size: 1.1rem; }

.num-form { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.num-input { max-width: 340px; font-size: 1.6rem; font-weight: 900; text-align: center; padding: 14px; }
.num-unit { font-size: 1.3rem; font-weight: 800; color: var(--text-secondary); }
.num-wait { text-align: center; font-size: 1.6rem; font-weight: 900; padding: 22px; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px dashed var(--border-strong); }
.ctrl-grid.single { grid-template-columns: 1fr; }
.ctrl-grid.single .num-input { max-width: none; flex: 1 1 100%; }
.ctrl-grid.single .num-form .btn { flex: 1 1 100%; }

.guess-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.guess-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--bg-interactive); border: 2px solid var(--border-subtle); font-weight: 800; font-size: 1.1rem; }
.guess-chip span { font-size: 1.5rem; line-height: 1; }
.guess-chip.best { border-color: var(--accent-emerald); background: rgba(16, 185, 129, 0.18); }

.live-chip.done { border-color: var(--accent-cyan); background: rgba(6, 182, 212, 0.14); animation: chip-pop 0.35s ease-out; }

/* Sélecteur de jeu du salon : 6 jeux sur 3 colonnes */
.type-toggle.games3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.type-toggle.games3 .type-btn { padding: 9px 6px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Choix du jeu sur la TV : 6 tuiles sur 3 colonnes */
.tv-pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .tv-pick-grid { grid-template-columns: 1fr; } }
html.tv-fit #step-pick .hero { padding-top: 6px; }
html.tv-fit #step-pick .hero-title { font-size: 2.4rem; margin: 0; }
html.tv-fit #step-pick .hero-subtitle { margin: 4px auto 0; text-align: center; }
html.tv-fit .tv-pick-grid { margin-top: 12px; gap: 18px; }
html.tv-fit .tv-pick-grid .game-tile { min-height: 0; height: 330px; }
html.tv-fit .tv-pick-grid .game-tile-art { font-size: 4rem; }

/* =====================================================================
   Barre du haut façon meteo.olaf.ovh : capsule « verre » flottante,
   logo arrondi, titre en dégradé, onglets segmentés, boutons ronds.
   ===================================================================== */
.topbar {
    position: sticky; top: 10px; z-index: 45;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    margin: 12px 16px 0; padding: 10px 18px; border-radius: 24px; border: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(20px) saturate(200%) brightness(1.06); -webkit-backdrop-filter: blur(20px) saturate(200%);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.topbar::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 42%); opacity: 0.45;
}
.topbar > * { position: relative; z-index: 1; }
.topbar .brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-primary); min-width: 0; }
.topbar .logo {
    width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
    display: inline-grid; place-items: center; font-size: 1.6rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.45);
}
.topbar .brand-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.topbar .t-main {
    font-size: 1.34rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap;
    background: linear-gradient(90deg, #ffffff, #c4b5fd 55%, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.6));
}
.topbar .t-sub { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: #e2e8f0; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); white-space: nowrap; }
.topbar .tabs {
    display: inline-flex; gap: 6px; padding: 5px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(12px);
}
.topbar .tab {
    display: inline-flex; align-items: center; gap: 4px; padding: 9px 18px; border-radius: 12px;
    font-size: 0.9rem; font-weight: 700; color: #f1f5f9; text-decoration: none; white-space: nowrap;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); transition: background 0.15s;
}
.topbar .tab:hover:not(.active) { background: rgba(255, 255, 255, 0.14); }
.topbar .tab.active { color: #fff; font-weight: 800; background: linear-gradient(135deg, #a78bfa, var(--accent-purple)); box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35); }
.topbar-right { display: inline-flex; align-items: center; gap: 10px; min-width: 46px; justify-content: flex-end; }
.icon-btn {
    width: 42px; height: 42px; border-radius: 12px; border: none; cursor: pointer;
    display: inline-grid; place-items: center; font-size: 1.25rem; font-weight: 700; color: #fff; text-decoration: none;
    background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(14px);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.22); }
.stop-btn {
    height: 42px; padding: 0 16px; border-radius: 12px; border: none; cursor: pointer;
    font-weight: 900; font-size: 0.95rem; color: #fff;
    background: linear-gradient(135deg, #fb7185, var(--accent-rose)); box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}
.stop-btn:hover { filter: brightness(1.1); }
@media (max-width: 760px) {
    .topbar { margin: 8px 8px 0; top: 6px; border-radius: 20px; padding: 8px 10px; gap: 8px; }
    .topbar .logo { width: 38px; height: 38px; font-size: 1.3rem; border-radius: 11px; }
    .topbar .t-main { font-size: 1.05rem; }
    .topbar .t-sub { font-size: 0.68rem; letter-spacing: 0.12em; }
    .topbar .tabs { order: 3; width: 100%; justify-content: space-between; }
    .topbar .tab { flex: 1; justify-content: center; padding: 8px 6px; font-size: 1.05rem; }
    .topbar .tab .lbl { display: none; }
}
.live-chip.abandon { opacity: 0.45; text-decoration: line-through; border-style: dashed; }
.lb-card.abandoned { opacity: 0.5; filter: grayscale(0.8); }
.lb-abandon { font-size: 0.75em; font-weight: 900; color: var(--accent-rose); }
.lb-board.big .lb-abandon { font-size: clamp(0.7rem, 1.1vw, 1.1rem); }

/* =====================================================================
   Jeux de géographie : carte de France
   ===================================================================== */
.game-tile.villes       { background: linear-gradient(140deg, #16a34a 0%, #0369a1 100%); }
.game-tile.departements { background: linear-gradient(140deg, #0ea5e9 0%, #4f46e5 100%); }
.game-tile.geo        { background: linear-gradient(140deg, #16a34a 0%, #0369a1 100%); }
.game-tile.justeprix  { background: linear-gradient(140deg, #ca8a04 0%, #dc2626 100%); }
.game-tile.petitbac   { background: linear-gradient(140deg, #0d9488 0%, #c026d3 100%); }
.fm-svg { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.fm-svg.pickable { cursor: crosshair; }
.fm-dep { fill: #1e3a5f; stroke: #7dd3fc; stroke-opacity: 0.45; stroke-width: 1.4; stroke-linejoin: round; transition: fill 0.2s; }
.fm-svg.pickable .fm-dep:hover { fill: #24476f; }
.fm-dep.hl { fill: #059669; stroke: #a7f3d0; stroke-opacity: 1; stroke-width: 2.5; }
.fm-line { stroke: #fde68a; stroke-width: 2.5; stroke-dasharray: 8 6; opacity: 0.8; }
.fm-pin circle { fill: rgba(15, 23, 42, 0.85); stroke: #fff; stroke-width: 2.5; }
.fm-pin.me circle { stroke: var(--accent-cyan); stroke-width: 4; }
.fm-pin text, .fm-target text { font-size: 30px; text-anchor: middle; }
.fm-target .halo { fill: rgba(16, 185, 129, 0.35); stroke: #34d399; stroke-width: 3; animation: fm-pulse 1.2s ease-in-out infinite; }
.fm-pending circle { fill: var(--accent-rose); stroke: #fff; stroke-width: 3; }
.fm-pending .ring { fill: none; stroke: var(--accent-rose); stroke-width: 3; opacity: 0.6; }
@keyframes fm-pulse { 50% { opacity: 0.45; } }

.map-wrap { background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.12), transparent 70%), var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 10px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.map-layout .map-wrap { height: 640px; }
.map-side { display: flex; flex-direction: column; justify-content: center; gap: 16px; text-align: center; }
.map-place { font-size: clamp(2.2rem, 4.6vw, 4.4rem); font-weight: 900; line-height: 1.1; }
.map-hint { color: var(--text-secondary); font-weight: 800; font-size: 1.2rem; }
.map-side .live-answers { margin-top: 0; }
.map-confirm { display: flex; gap: 10px; justify-content: center; }
.dist-list { display: grid; gap: 8px; text-align: left; }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: var(--radius-md); background: var(--bg-interactive); font-weight: 800; font-size: 1.2rem; }
.dist-row .av { font-size: 1.7rem; line-height: 1; }
.dist-row .km { margin-left: auto; color: var(--accent-amber); }
.dist-row .pts { color: var(--accent-emerald); min-width: 70px; text-align: right; }
.dist-row.best { outline: 2px solid var(--accent-emerald); }
.tv-options-grid.map { display: block; }
.revealing.map-phase .tv-options-grid.map { display: block; }
.revealing.map-phase .reveal-banner .lb-board, .revealing.map-phase .reveal-banner #reveal-extra { display: none; }
.phone-map { height: auto; aspect-ratio: 1033 / 988; padding: 4px; }
.phone-map-actions { display: flex; gap: 10px; margin-top: 10px; }
.phone-map-actions .btn { flex: 1; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } .map-layout .map-wrap { height: auto; aspect-ratio: 1033 / 988; } }
.solo-map { max-width: 620px; margin: 0 auto; width: 100%; }
.solo-map-actions { max-width: 620px; margin: 10px auto 0; width: 100%; }
.q-prompt-text.map-place, #ctrl-text.map-place { font-size: clamp(1.8rem, 5vw, 3rem) !important; text-align: center; line-height: 1.15; }
/* 8 jeux : 4 colonnes */
.tv-pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tv-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tv-pick-grid { grid-template-columns: 1fr; } }
html.tv-fit .tv-pick-grid .game-tile { height: 330px; }
html.tv-fit .tv-pick-grid .game-tile-art { font-size: 3.4rem; }
html.tv-fit .tv-pick-grid .game-tile-desc { font-size: 0.86rem; }
.type-toggle.games3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.revealing:not(.map-phase) .tv-options-grid.map { display: none; }
.revealing.map-phase .reveal-banner { display: none; }
html.tv-fit .map-layout .map-wrap { height: 610px; }
.lb-gain.neg { background: var(--accent-rose); }
.dist-row .pts.neg { color: var(--accent-rose); }
.gain.neg { color: var(--accent-rose); }
/* Seul / À plusieurs / Avec la TV : toujours sur une ligne, la taille s'adapte */
.game-tile-actions { flex-wrap: wrap; gap: 8px; }
.game-tile-actions .btn { flex: 1 1 auto; min-width: 0; justify-content: center; white-space: nowrap; padding: 10px 6px; font-size: clamp(0.72rem, 0.9vw + 0.35rem, 0.95rem); }
@media (max-width: 400px) { .game-tile-actions { gap: 6px; } .game-tile-actions .btn { padding: 9px 4px; font-size: 0.74rem; } }
/* Records */
.record-box { display: inline-block; text-align: center; padding: 12px 18px; border-radius: var(--radius-md); background: var(--bg-interactive); border: 1px solid var(--border-strong); font-weight: 800; line-height: 1.4; }
.record-box.is-record { border-color: var(--accent-amber); background: rgba(245, 158, 11, 0.14); }
.record-box .muted, .record-box .small { color: var(--text-secondary); font-weight: 700; }
.podium-records { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.record-line { display: flex; align-items: center; gap: 10px; }
.record-line .av { font-size: 1.8rem; }
.record-line .record-box { padding: 8px 12px; font-size: 0.9rem; text-align: left; }
.lb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lb-tabs button { border: 1px solid var(--border-strong); background: var(--bg-interactive); color: var(--text-primary); border-radius: var(--radius-pill); padding: 7px 14px; font-weight: 800; cursor: pointer; }
.lb-tabs button.active { background: linear-gradient(135deg, #a78bfa, var(--accent-purple)); border-color: transparent; }
.best-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-interactive); font-weight: 800; }
.best-row .r { width: 36px; text-align: center; font-size: 1.1rem; }
.best-row .av { font-size: 1.5rem; }
.best-row .s { margin-left: auto; color: var(--accent-cyan); }

/* Salon : jeu choisi + « Changer de jeu », catégories et manches en grosses cases (TV) */
.change-game-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 1.15rem; padding: 14px 18px; }
.change-game-btn #lobby-game-name { font-weight: 900; font-size: 1.3rem; }
.change-game-btn .cg-action { font-weight: 800; opacity: .9; white-space: nowrap; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 300px; overflow-y: auto; padding: 4px; margin: -4px; }
.count-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.count-grid.two { grid-template-columns: 1fr 1fr; }
.cat-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 8px; border-radius: 16px;
  border: 2px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--text-primary); font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; text-align: center; line-height: 1.15; }
.cat-tile:hover, .cat-tile:focus-visible { border-color: rgba(167,139,250,.8); background: rgba(167,139,250,.16); outline: none; transform: translateY(-1px); }
.cat-tile.active { border-color: #a78bfa; background: linear-gradient(135deg, rgba(167,139,250,.45), rgba(139,92,246,.35)); box-shadow: 0 4px 16px rgba(139,92,246,.35); }
.cat-tile .cat-n { font-size: .78rem; font-weight: 700; opacity: .7; }
html.tv-fit .cat-grid { max-height: 250px; }
html.tv-fit .cat-tile { min-height: 58px; font-size: 1.05rem; }
.cat-grid.pb { grid-template-columns: repeat(4, 1fr); gap: 7px; max-height: none; }
.cat-grid.pb .cat-tile { min-height: 44px; padding: 6px; font-size: .92rem; border-radius: 12px; }
html.tv-fit .cat-grid.pb { max-height: none; }
html.tv-fit .cat-grid.pb .cat-tile { min-height: 46px; font-size: .95rem; }
@media (max-width: 640px) { .count-grid { grid-template-columns: repeat(3, 1fr); } .cat-grid, .cat-grid.pb { grid-template-columns: repeat(2, 1fr); } }

/* Géographie : thématiques (relief, fleuves) et mise en page « à trouver | carte | points » */
.fm-outline { fill: none; stroke: #e2e8f0; stroke-width: 3; stroke-opacity: .55; stroke-linejoin: round; }
.fm-land { fill: #f1efe4; }
.theme-fleuves .fm-outline { stroke: #93c5fd; stroke-opacity: .8; }
.fm-net path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fm-net .n0 { stroke: #60a5fa; stroke-width: .7; opacity: .75; }
.fm-net .n1 { stroke: #3b82f6; stroke-width: 1.2; }
.fm-net .n2 { stroke: #2563eb; stroke-width: 2; }
.fm-net .fm-river { stroke: #1d4ed8; stroke-width: 2.4; }
.fm-river-hl-glow { fill: none; stroke: #fde047; stroke-width: 14; stroke-opacity: .45; stroke-linecap: round; stroke-linejoin: round; }
.fm-river-hl { fill: none; stroke: #ef4444; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.theme-villes .fm-pin circle, .theme-fleuves .fm-pin circle { fill: rgba(15, 23, 42, .78); }

.geo-layout { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(0, 2.3fr) minmax(210px, 1.1fr); gap: 18px; align-items: stretch; }
.geo-left, .geo-right { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-width: 0; }
.geo-left { text-align: center; }
.geo-left .map-place { font-size: clamp(1.7rem, 3vw, 3rem); word-break: break-word; }
.geo-map { min-width: 0; }
.geo-map .map-wrap { height: 640px; padding: 6px; }
.geo-right .live-answers { margin-top: 0; }
.geo-comment { font-size: 1.5rem; font-weight: 900; text-align: center; }
.geo-answer { font-weight: 800; color: var(--text-secondary); text-align: center; }
.geo-pts { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg-interactive); border: 1px solid var(--border-strong); }
.gp-row { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.gp-row strong { color: var(--accent-emerald); }
.gp-row strong.neg, .gp-row.total strong.neg { color: var(--accent-rose); }
.gp-row.total { border-top: 1px solid var(--border-strong); padding-top: 6px; font-size: 1.2rem; }
.gp-note { color: var(--accent-rose); font-weight: 700; font-size: .9rem; }
.dist-row .pts small { display: block; font-size: .72rem; color: var(--text-secondary); font-weight: 700; }
/* solo et téléphone */
.geo-layout.compact .geo-map .map-wrap { height: auto; aspect-ratio: 1033 / 988; max-height: 72vh; margin: 0 auto; }
@media (max-width: 900px) {
  .geo-layout { grid-template-columns: 1fr; gap: 10px; }
  .geo-left { order: 0; } .geo-map { order: 1; } .geo-right { order: 2; }
  .geo-left .map-place { font-size: clamp(1.5rem, 7vw, 2.2rem); }
  .geo-map .map-wrap { height: auto; aspect-ratio: 1033 / 988; }
}
html.tv-fit .geo-map .map-wrap { height: 610px; }

/* Petit Bac */
.pb-topline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pb-topline .stop-btn { margin-left: auto; }
.pb-root { text-align: center; }
.pb-head { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pb-letter { width: 220px; height: 220px; margin: 18px auto; border-radius: 40px; display: grid; place-items: center; font-size: 9rem; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, #a78bfa, #7c3aed); color: #fff; box-shadow: 0 18px 50px rgba(124, 58, 237, .45); }
.pb-letter.idle { background: rgba(255,255,255,.06); color: var(--text-secondary); box-shadow: none; border: 3px dashed rgba(255,255,255,.2); }
.pb-letter.rolling { animation: pb-shake .18s infinite; }
.pb-letter.final { animation: pb-pop .5s ease-out; }
.pb-letter.small-l { width: 140px; height: 140px; font-size: 6rem; border-radius: 28px; margin: 6px auto 14px; }
@keyframes pb-shake { 50% { transform: rotate(-4deg) scale(1.03); } }
@keyframes pb-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.pb-sub { color: var(--text-secondary); font-weight: 700; margin: 8px 0 14px; }
.pb-big-btn { min-width: min(100%, 360px); font-size: 1.3rem; margin: 10px auto; display: inline-flex; justify-content: center; }
.pb-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0; }
.pb-chip { padding: 8px 14px; border-radius: 999px; background: var(--bg-interactive); border: 1px solid var(--border-strong); font-weight: 800; }
.pb-chip.ok { border-color: var(--accent-emerald); color: var(--soft-emerald); }
.pb-chip.dry { border-color: var(--accent-amber); }
.pb-cats-line, .pb-cats-big { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.pb-cats-line span, .pb-cats-big span { padding: 6px 12px; border-radius: 12px; background: rgba(167,139,250,.15); font-weight: 700; }
.pb-cats-big span { font-size: 1.4rem; padding: 12px 18px; }
.pb-form { display: grid; gap: 10px; max-width: 560px; margin: 0 auto; text-align: left; }
.pb-field { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; align-items: center; gap: 10px; font-weight: 800; }
.pb-field .input { font-size: 1.15rem; }
.pb-input.bad { border-color: var(--accent-amber); background: rgba(245,158,11,.08); }
.pb-form .pb-big-btn { width: 100%; margin-top: 6px; }
.pb-dry-btn { width: 100%; }
.pb-dry-btn.on { border-color: var(--accent-amber); color: var(--soft-amber); }
.pb-rev-head { margin-bottom: 10px; }
.pb-cat-count { color: var(--text-secondary); font-weight: 800; }
.pb-title { margin: 4px 0 12px; font-size: 2.4rem; font-weight: 900; }
.pb-cards { position: relative; padding: 8px 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 12px; }
.pb-card { padding: 14px; border-radius: 18px; background: var(--bg-card); border: 2px solid var(--border-strong); display: flex; flex-direction: column; gap: 6px; transition: transform .2s; }
.pb-card.current { transform: scale(1.03); box-shadow: 0 10px 30px rgba(124,58,237,.35); border-color: #a78bfa; }
.pb-card .who { font-weight: 800; color: var(--text-secondary); }
.pb-card .ans { font-size: 1.9rem; font-weight: 900; word-break: break-word; }
.pb-card .ans .badge { font-size: 1.3rem; }
.pb-card .why { font-size: .88rem; color: var(--text-secondary); min-height: 1.1em; }
.pb-card.hidden-card .ans { color: var(--text-secondary); opacity: .5; font-size: 2.6rem; }
.pb-card.st-valid { border-color: rgba(16,185,129,.7); }
.pb-card.st-invalid { border-color: rgba(244,63,94,.7); }
.pb-card.st-invalid .ans { text-decoration: line-through; text-decoration-thickness: 3px; opacity: .8; }
.pb-card.st-doubt { border-color: rgba(245,158,11,.7); }
.pb-empty { font-size: 2.4rem; }
.pb-link { font-size: .85rem; color: var(--accent-cyan); word-break: break-word; }
.pb-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pb-mini { border: 1px solid var(--border-strong); background: var(--bg-interactive); color: var(--text-primary); border-radius: 10px; padding: 6px 10px; font: inherit; font-weight: 800; cursor: pointer; }
.pb-mini.on.ok { background: rgba(16,185,129,.3); border-color: var(--accent-emerald); }
.pb-mini.on.ko { background: rgba(244,63,94,.3); border-color: var(--accent-rose); }
.pb-scores { display: grid; gap: 8px; max-width: 620px; margin: 0 auto 10px; }
.pb-score-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; background: var(--bg-interactive); font-weight: 800; font-size: 1.2rem; }
.pb-score-row .r { width: 28px; color: var(--text-secondary); }
.pb-score-row .av { font-size: 1.6rem; }
.pb-score-row .g { margin-left: auto; color: var(--accent-emerald); }
.pb-score-row .t { min-width: 90px; text-align: right; }
.pb-root.phone .pb-letter { width: 150px; height: 150px; font-size: 6rem; }
.pb-root.phone .pb-letter.small-l { width: 90px; height: 90px; font-size: 3.6rem; }
.pb-root.phone .pb-title { font-size: 1.7rem; }
.pb-root.phone .pb-cards { grid-template-columns: 1fr; }
.pb-root.phone .pb-card .ans { font-size: 1.5rem; }
@media (max-width: 520px) { .pb-field { grid-template-columns: 1fr; gap: 4px; } }
html.tv-fit #step-pb { overflow: visible; }
html.tv-fit .pb-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Géographie : décompte à la place du nom, score total toujours visible */
.geo-cd { font-size: 6rem !important; font-weight: 900; line-height: 1; text-align: center;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-rose)); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: cd-pop 1s ease-out infinite; }
#ctrl-text.geo-cd { font-size: 4rem !important; }
.geo-scores { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(15,23,42,.55); border: 1px solid var(--border-strong); }
.geo-scores-title { font-size: .8rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.geo-score-row { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; padding: 3px 0; }
.geo-score-row.me { color: var(--accent-cyan); }
.geo-score-row strong { white-space: nowrap; }
.pb-suspense { text-align: center; padding: 10px 0 4px; }
.pb-suspense-emoji { font-size: 5rem; animation: cd-pop 1s ease-out infinite; }
/* Mode solo : avatars plus compacts, catégories en cases */
.avatar-picker.compact { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.avatar-picker.compact .avatar-choice { padding: 5px; font-size: 1.15rem; }
.cat-grid.solo { max-height: none; }
#solo-count-grid { grid-template-columns: repeat(4, 1fr); }

/* =====================================================================
   Sélecteur de thème (barre du haut)
   ===================================================================== */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, 0.10); backdrop-filter: blur(12px); }
.theme-switch button { width: 34px; height: 34px; border: none; border-radius: 9px; background: transparent; cursor: pointer; font-size: 1.05rem; line-height: 1; opacity: .55; transition: background .15s, opacity .15s; }
.theme-switch button:hover { opacity: .9; }
.theme-switch button.on { opacity: 1; background: rgba(255, 255, 255, 0.22); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
@media (max-width: 760px) { .theme-switch { padding: 0; background: transparent !important; } .theme-switch button { width: 38px; height: 38px; font-size: 1.1rem; } .theme-switch button:not(.on) { display: none; } }

/* =====================================================================
   MODE CLAIR
   ===================================================================== */
html[data-theme="light"] {
    color-scheme: light;
    --bg-main: #eef2f8;
    --bg-card: #ffffff;
    --bg-interactive: #e8edf5;
    --bg-input: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #526079;
    --accent-cyan: #0891b2;
    --accent-amber: #d97706;
    --border-subtle: rgba(71, 85, 105, 0.16);
    --border-strong: rgba(71, 85, 105, 0.30);
    --shadow-card: 0 14px 34px rgba(15, 23, 42, 0.10);
    --shadow-btn: 0 5px 0 rgba(15, 23, 42, 0.16);
    --soft-cyan: #0e7490;
    --soft-emerald: #047857;
    --soft-purple: #6d28d9;
    --soft-amber: #b45309;
    --soft-rose: #be123c;
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] body {
    background-image:
        radial-gradient(circle at 12% 8%, rgba(139, 92, 246, 0.14), transparent 38%),
        radial-gradient(circle at 88% 12%, rgba(6, 182, 212, 0.14), transparent 38%),
        radial-gradient(circle at 50% 96%, rgba(244, 63, 94, 0.08), transparent 45%);
}
/* barre du haut */
html[data-theme="light"] .topbar { background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.6)); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), inset 0 1px 0 #fff; }
html[data-theme="light"] .topbar .t-main { background-image: linear-gradient(90deg, #4c1d95, #7c3aed 55%, #0891b2); filter: none; }
html[data-theme="light"] .topbar .t-sub { color: #475569; text-shadow: none; }
html[data-theme="light"] .topbar .tabs { background: rgba(15, 23, 42, 0.06); }
html[data-theme="light"] .topbar .tab { color: #1e293b; text-shadow: none; }
html[data-theme="light"] .topbar .tab:hover:not(.active) { background: rgba(15, 23, 42, 0.07); }
html[data-theme="light"] .topbar .tab.active { color: #fff; }
html[data-theme="light"] .icon-btn { color: #1e293b; background: rgba(15, 23, 42, 0.07); }
html[data-theme="light"] .icon-btn:hover { background: rgba(15, 23, 42, 0.13); }
html[data-theme="light"] .theme-switch { background: rgba(15, 23, 42, 0.06); }
html[data-theme="light"] .theme-switch button.on { background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .15); }
/* surfaces sombres codées en dur */
html[data-theme="light"] .timer-box { background: #fff; }
html[data-theme="light"] .timer-value { color: #0f172a; }
html[data-theme="light"] .join-url { color: #0f172a; }
html[data-theme="light"] .geo-scores { background: rgba(255, 255, 255, 0.75); }
html[data-theme="light"] .countdown-overlay, html[data-theme="light"] .cd-overlay { background: rgba(238, 242, 248, 0.85); color: #0f172a; }
html[data-theme="light"] .toast { color: #fff; }
html[data-theme="light"] .btn-ghost { background: rgba(255, 255, 255, 0.85); }
html[data-theme="light"] .blindtest-stage { background: linear-gradient(135deg, #ede9fe, #e0f2fe); }
html[data-theme="light"] .equalizer { background: rgba(255, 255, 255, 0.8); }
html[data-theme="light"] .modal-backdrop { background: rgba(15, 23, 42, 0.45); }
html[data-theme="light"] .change-game-btn { background: linear-gradient(135deg, #ede9fe, #e0f2fe); color: #3b0764; border: 1px solid rgba(124, 58, 237, 0.35); }
html[data-theme="light"] .cat-tile { border-color: rgba(71, 85, 105, 0.22); background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06); }
html[data-theme="light"] .cat-tile:hover, html[data-theme="light"] .cat-tile:focus-visible { background: #f5f3ff; }
html[data-theme="light"] .cat-tile.active { background: linear-gradient(135deg, #ddd6fe, #c4b5fd); color: #2e1065; border-color: #8b5cf6; }
html[data-theme="light"] .pb-letter.idle { background: #fff; border-color: rgba(71, 85, 105, 0.3); }
html[data-theme="light"] .brand-btn:hover { background: rgba(15, 23, 42, 0.06); }
/* TV : tous les jeux tiennent sur un seul écran (5 colonnes × 2 rangées) */
html.tv-fit .tv-pick-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
html.tv-fit .tv-pick-grid .game-tile { height: 300px; }
html.tv-fit .tv-pick-grid .game-tile-art { font-size: 3rem; padding: 14px 0 4px; min-height: 0; }
html.tv-fit .tv-pick-grid .game-tile-body { padding: 12px 16px 16px; }
html.tv-fit .tv-pick-grid .game-tile-title { font-size: 1.45rem; }
html.tv-fit .tv-pick-grid .game-tile-kicker { font-size: .66rem; }
html.tv-fit .tv-pick-grid .game-tile-desc { font-size: .8rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
html.tv-fit #step-pick .hero-title { font-size: 2.1rem; }

/* =====================================================================
   Pendant une partie : l'écran de jeu tient exactement dans la hauteur de l'écran
   (téléphone : rejoindre ; solo : sur téléphone). La barre du haut reste au-dessus.
   ===================================================================== */
.pb-fields { display: grid; gap: 10px; }
html.playing .topbar { position: relative; top: 0; }
html.playing body:has(.player-wrap) .app-shell { padding-top: 8px; padding-bottom: 8px; }
html.playing .player-wrap > :not(.hidden):not(.p-menu-btn) { height: calc(100svh - 16px); display: flex; flex-direction: column; overflow: hidden; margin: 0; box-sizing: border-box; }
html.playing #step-countdown { justify-content: center; }
html.playing #step-ctrl .player-hud { margin-bottom: 8px; flex-shrink: 0; padding: 8px 14px; }
html.playing #step-ctrl > .card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; margin: 0; padding: 14px; }
html.playing #ctrl-meta, html.playing #ctrl-text, html.playing #ctrl-done { flex-shrink: 0; }
html.playing #ctrl-text { margin-bottom: 10px !important; }
html.playing #ctrl-text.geo-cd { font-size: 3rem !important; }
html.playing #ctrl-grid { flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); gap: 10px; }
html.playing #ctrl-grid .ctrl-btn { min-height: 0; height: 100%; padding: 10px 14px; overflow: hidden; }
html.playing #ctrl-grid.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.playing #ctrl-grid.many .ctrl-btn { font-size: .9rem; gap: 8px; padding: 6px 8px; }
html.playing #ctrl-grid.single { display: flex; flex-direction: column; grid-auto-rows: auto; }
html.playing #ctrl-grid.single .phone-map { flex: 1; min-height: 0; aspect-ratio: auto; display: flex; align-items: center; justify-content: center; }
html.playing #ctrl-grid.single .phone-map svg { max-width: 100%; max-height: 100%; width: auto; height: 100%; }
html.playing #ctrl-grid .map-hint { flex-shrink: 0; font-size: 1rem; margin-bottom: 6px; }
html.playing #ctrl-live { flex-shrink: 0; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin-top: 8px !important; padding-bottom: 2px; }
html.playing #ctrl-live .live-chip { flex-shrink: 0; }
html.playing #step-result:has(#res-board.hidden) { justify-content: center; }
html.playing #step-result { padding: 14px; justify-content: flex-start; }
html.playing #step-result > * { flex-shrink: 0; }
html.playing #res-emoji { font-size: 2.2rem !important; }
html.playing #res-title { font-size: 1.25rem !important; margin: 4px 0 2px !important; }
html.playing #res-detail { margin-bottom: 8px !important; }
html.playing #res-map { flex: 1 1 0; min-height: 0; aspect-ratio: auto; margin-top: 8px !important; display: flex; align-items: center; justify-content: center; }
html.playing #res-map svg { max-width: 100%; max-height: 100%; width: auto; height: 100%; }
html.playing #res-board { flex: 1 1 auto; min-height: 0; overflow: hidden; margin-top: 12px !important; }
html.playing #res-map:not(.hidden) ~ #res-board { flex: 0 1 auto; }
html.playing #res-pb-continue { margin-top: 10px !important; }
html.playing #step-pb { padding: 12px; }
html.playing #ppb-root { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
html.playing #ppb-root > * { flex-shrink: 0; }
html.playing #ppb-root .pb-write, html.playing #ppb-root .pb-form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
html.playing #ppb-root .pb-write { gap: 8px; }
html.playing #ppb-root .pb-letter.small-l { width: 64px; height: 64px; font-size: 2.6rem; flex-shrink: 0; margin: 0 auto; }
html.playing #ppb-root .pb-form { gap: 8px; width: 100%; }
html.playing #ppb-root .pb-fields { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 2px 6px; align-content: start; }
html.playing #ppb-root .pb-form > button, html.playing #ppb-root .pb-chips { flex-shrink: 0; }
html.playing #ppb-root .pb-chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin-top: 4px; padding-bottom: 2px; }
html.playing #ppb-root .pb-chip { flex-shrink: 0; font-size: .8rem; }
html.playing #ppb-root .pb-cards, html.playing #ppb-root .pb-scores { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
html.playing #ppb-root .pb-cats-line { max-height: 30%; overflow: hidden; }

/* Mode solo sur téléphone */
@media (max-width: 760px) {
  html.playing body:has(#step-play) .app-shell { padding-top: 8px; padding-bottom: 8px; }
  html.playing #step-play:not(.hidden), html.playing main > #step-countdown:not(.hidden) { height: calc(100svh - 16px); display: flex; flex-direction: column; overflow: hidden; padding-top: 0 !important; }
  html.playing main > #step-countdown:not(.hidden) { justify-content: center; }
  html.playing #step-play > * { flex-shrink: 0; margin-bottom: 8px; }
  html.playing #step-play .q-hud { padding: 6px 10px; flex-wrap: nowrap; gap: 6px; }
  html.playing #step-play .q-hud .tag { padding: 4px 9px; font-size: .78rem; white-space: nowrap; }
  html.playing #step-play .q-badges { gap: 6px; min-width: 0; overflow: hidden; }
  html.playing #step-play .timer-box { padding: 2px 10px; gap: 4px; border-width: 2px; }
  html.playing #step-play .timer-box .small { display: none; }
  html.playing #step-play .timer-value { font-size: 1.4rem; }
  html.playing #step-play .q-prompt-card { padding: 12px; }
  html.playing #step-play .q-prompt-text { font-size: 1.15rem; }
  html.playing #p-grid { flex: 1 1 auto; min-height: 0; grid-auto-rows: minmax(0, 1fr); gap: 10px; }
  html.playing #p-grid .ctrl-btn { min-height: 0; height: 100%; padding: 10px 14px; overflow: hidden; }
  html.playing #p-grid.single { display: flex; flex-direction: column; }
  html.playing #p-grid .geo-layout.compact { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
  html.playing #p-grid .geo-left { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; flex-shrink: 0; }
  html.playing #p-grid .geo-left .map-hint { font-size: .9rem; }
  html.playing #p-grid .geo-left .map-place { font-size: 1.5rem; }
  html.playing #p-grid .geo-left .map-place.geo-cd { font-size: 2.6rem !important; }
  html.playing #p-grid .geo-map { flex: 1 1 auto; min-height: 0; }
  html.playing #p-grid .geo-map .map-wrap { height: 100%; max-height: none; aspect-ratio: auto; display: flex; align-items: center; justify-content: center; }
  html.playing #p-grid .geo-map svg { max-width: 100%; max-height: 100%; width: auto; height: 100%; }
  html.playing #p-grid .geo-right { flex-shrink: 0; max-height: 34%; overflow: hidden; justify-content: flex-start; gap: 6px; font-size: .9rem; }
  html.playing #p-grid .geo-right .geo-scores { margin-top: 4px; padding: 6px 10px; }
  html.playing #p-feedback { margin-top: 0 !important; }
}
/* TV : les listes (réponses, scores) ne poussent jamais la carte hors de l'écran */
html.tv-fit .geo-left, html.tv-fit .geo-right { max-height: 610px; overflow: hidden; }
html.tv-fit .countdown-big { font-size: 13rem; margin: 2vh 0 1vh; }

/* =====================================================================
   TV : QR code plus grand, barre du haut cachée en partie, blindtest et textes plus grands
   ===================================================================== */
html.tv-fit .join-box .qr-panel { padding: 12px; }
html.tv-fit .join-box .qr-img { width: 330px; height: 330px; }
html.tv-fit .join-box .room-code-value { font-size: 5rem; }
html.tv-game .topbar { display: none; }
html.tv-game.tv-fit .app-shell { padding-top: 18px; }
html.tv-fit #bt-stage { padding: 22px 28px; }
html.tv-fit #bt-stage .vinyl-box { width: 230px; height: 230px; }
html.tv-fit #bt-stage .vinyl-disc { background: radial-gradient(circle at center, #f59e0b 0 34px, #1e293b 35px 42px, #080c14 43px 82px, #1e293b 83px 87px, #080c14 88px 100%); }
html.tv-fit #bt-stage .blindtest-left { gap: 30px; }
html.tv-fit #bt-title { font-size: 2.6rem !important; line-height: 1.15; }
html.tv-fit #bt-artist { font-size: 1.5rem !important; }
html.tv-fit #bt-status { font-size: 1.05rem; }
html.tv-fit .q-prompt-text { font-size: 3rem; }
html.tv-fit .tv-option { font-size: 1.75rem; padding: 26px 24px; }
html.tv-fit .tv-option .tv-shape { width: 58px; height: 58px; font-size: 1.6rem; }
html.tv-fit .tv-options-grid { gap: 20px; }
html.tv-fit .tv-options-grid.vote .tv-option { font-size: 1.45rem; padding: 18px; }
html.tv-fit .live-answers .live-chip { font-size: 1.2rem; }
html.tv-fit #q-hint { font-size: 1.4rem; }
.big-next { font-size: 2.2rem !important; font-weight: 900; color: var(--text-primary) !important; }

/* Filtres en cases (admin) et réglages sur le téléphone */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { border: 1px solid var(--border-subtle, rgba(255,255,255,.15)); background: var(--bg-card-sub, rgba(255,255,255,.05)); color: inherit; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.filter-chip.active { background: var(--accent-purple, #8b5cf6); border-color: transparent; color: #fff; }
.wait-settings { margin-top: 14px; text-align: left; }
.wait-settings .label { text-align: left; }
.geo-next { margin-bottom: 6px; font-weight: 900; font-size: 1.15rem; color: var(--accent-amber); }

/* ===== Écran TV (/tv) : grosse barre du haut simplifiée, sélection visible à la télécommande ===== */
html.tv-page.tv-fit .topbar { padding: 20px 30px; gap: 24px; flex-wrap: nowrap; border-radius: 32px; }
html.tv-page.tv-fit .topbar .logo { width: 84px; height: 84px; font-size: 3rem; border-radius: 22px; }
html.tv-page.tv-fit .topbar .brand { gap: 18px; }
html.tv-page.tv-fit .topbar .t-main { font-size: 2.4rem; }
html.tv-page.tv-fit .topbar .t-sub { font-size: 1.15rem; }
html.tv-page.tv-fit .topbar .tab:not([data-nav="tv"]) { display: none; }
html.tv-page.tv-fit .topbar .tabs { padding: 6px; border-radius: 18px; }
html.tv-page.tv-fit .topbar .tab { font-size: 1.7rem; padding: 14px 30px; border-radius: 14px; }
html.tv-page.tv-fit .topbar-right { gap: 14px; }
html.tv-page.tv-fit .topbar .icon-btn { width: 80px; height: 80px; font-size: 2.4rem; border-radius: 20px; }
html.tv-page.tv-fit .theme-switch { padding: 0; background: transparent; }
html.tv-page.tv-fit .theme-switch button:not(.on) { display: none; }
html.tv-page.tv-fit .theme-switch button { width: 80px; height: 80px; font-size: 2.3rem; border-radius: 20px; opacity: 1; background: rgba(255,255,255,.12); }
html.tv-page :is(button, a, [tabindex="0"], input):focus { outline: 5px solid var(--accent-cyan); outline-offset: 4px; }
html.tv-page .game-tile:focus { box-shadow: 0 0 0 6px var(--accent-cyan), 0 26px 50px rgba(2, 6, 23, 0.75); transform: translateY(-4px) scale(1.02); outline: none; }
html.tv-page .cat-tile:focus { border-color: var(--accent-cyan); }
/* page de choix : descriptions courtes, gros émojis et titres */
html.tv-page.tv-fit .tv-pick-grid .game-tile-art { font-size: 6.2rem; padding-top: 10px; }
html.tv-page.tv-fit .tv-pick-grid .game-tile-body { padding: 12px 18px 18px; }
html.tv-page.tv-fit .tv-pick-grid .game-tile-title { font-size: 2.15rem; line-height: 1.05; margin: 2px 0 6px; }
html.tv-page.tv-fit .tv-pick-grid .game-tile-desc { font-size: 1.15rem; font-weight: 700; margin: 0; line-height: 1.25; }
html.tv-page.tv-fit .tv-pick-grid .game-tile-kicker { font-size: .85rem; }
/* beaucoup de catégories (Blind test) : toutes visibles d’\un coup, sans défilement */
html.tv-fit .cat-grid.many { max-height: none; overflow: visible; grid-template-columns: repeat(4, 1fr); gap: 6px; }
html.tv-fit .cat-grid.many .cat-tile { min-height: 0; padding: 5px 4px; font-size: .82rem; border-radius: 10px; gap: 0; }
html.tv-fit .cat-grid.many .cat-tile .cat-n { font-size: .68rem; }
/* décompte 3-2-1 énorme */
html.tv-fit #step-countdown { padding-top: 2vh !important; }
html.tv-fit #step-countdown .countdown-big { font-size: 30rem; margin: 0; line-height: .95; }
html.tv-fit .geo-left .geo-cd { font-size: 13rem !important; }
/* commentaires sur les scores */
.tv-quips { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.tv-quip { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; background: var(--bg-interactive); font-size: 1.3rem; font-weight: 600; animation: quipIn .5s ease both; animation-delay: 2.6s; }
.tv-quip + .tv-quip { animation-delay: 3.4s; }
.tv-quip .av { font-size: 1.8rem; }
.tv-quip strong { color: var(--accent-amber); }
@keyframes quipIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.podium-quip { margin-top: 10px; font-size: 1rem; font-style: italic; opacity: .9; }
.podium-quip strong, .rest-quip strong { color: var(--accent-amber); }
.rest-quip { display: block; font-size: .85rem; font-style: italic; opacity: .85; margin-top: 2px; }

/* ===== TV : textes du salon bien plus gros, pas de nombre de questions ===== */
html.tv-page .cat-tile .cat-n { display: none; }
html.tv-page.tv-fit #step-lobby .label { font-size: 1.25rem; letter-spacing: .06em; margin-bottom: 8px; }
html.tv-page.tv-fit #step-lobby .join-url { font-size: 2.3rem; }
html.tv-page.tv-fit #step-lobby .join-box .room-code-value { font-size: 7rem; }
html.tv-page.tv-fit #step-lobby h2 { font-size: 2.1rem !important; }
html.tv-page.tv-fit #step-lobby .player-chip { font-size: 1.5rem; padding: 10px 16px; }
html.tv-page.tv-fit #step-lobby .player-chip .player-avatar { font-size: 2rem; }
html.tv-page.tv-fit #step-lobby .players-grid .text-muted { font-size: 1.3rem; }
html.tv-page.tv-fit #step-lobby .btn-sm { font-size: 1.3rem; padding: 10px 18px; }
html.tv-page.tv-fit #step-lobby .change-game-btn { font-size: 1.5rem; padding: 16px 22px; }
html.tv-page.tv-fit #step-lobby .change-game-btn #lobby-game-name { font-size: 2rem; }
html.tv-page.tv-fit #step-lobby .cat-tile { font-size: 1.55rem; min-height: 72px; }
html.tv-page.tv-fit #step-lobby #count-grid .cat-tile { font-size: 2rem; }
html.tv-page.tv-fit #step-lobby #audio-grid .cat-tile { font-size: 1.3rem; }
html.tv-page.tv-fit #step-lobby .cat-grid.many .cat-tile { font-size: 1.2rem; min-height: 52px; padding: 4px; }
html.tv-page.tv-fit #step-lobby .cat-grid.pb .cat-tile { font-size: 1.15rem; min-height: 50px; }
html.tv-page.tv-fit #step-lobby .btn-lg { font-size: 2rem; padding: 20px; }
html.tv-page.tv-fit #step-lobby .small { font-size: 1.2rem; }
html.tv-page.tv-fit .lobby-layout:has(.cat-grid.many) { grid-template-columns: 1fr 1.25fr; }
/* ===== TV : chaque écran de jeu occupe toute la hauteur ===== */
html.tv-game.tv-fit .app-shell { padding-top: 14px; padding-bottom: 0; }
html.tv-page.tv-fit #step-countdown:not(.hidden) { display: flex; flex-direction: column; align-items: center; justify-content: center; height: calc(var(--tvh) - 28px); padding-top: 0 !important; box-sizing: border-box; }
html.tv-page.tv-fit #step-question:not(.hidden) { display: flex; flex-direction: column; min-height: calc(var(--tvh) - 28px); box-sizing: border-box; }
html.tv-fit #step-question:not(.revealing) #options-grid:not(.map) { flex: 1; grid-auto-rows: 1fr; align-content: stretch; }
html.tv-fit #step-question:not(.revealing) #options-grid:not(.map) .tv-option { font-size: 2.3rem; }
html.tv-fit #step-question.revealing .reveal-banner { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
html.tv-fit #step-question.revealing .reveal-banner.hidden { display: none; }
html.tv-fit .q-hud .hud-right { display: flex; align-items: center; gap: 14px; }
.hud-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html.tv-fit .q-hud .tag { font-size: 1.2rem; padding: 8px 16px; }
html.tv-fit .q-hud .small { font-size: 1.2rem; }
html.tv-fit #next-text { font-size: 1.5rem; }
html.tv-fit #step-question.revealing .lb-board.big .lb-name { font-size: 1.6rem; }
html.tv-fit #step-question.revealing .lb-board.big .lb-score { font-size: 2.4rem; }
html.tv-fit .tv-quip { font-size: 1.6rem; }
/* Blind test : le titre et l’\artiste en très gros à côté de la pochette */
html.tv-fit #bt-title { font-size: 3.2rem !important; }
html.tv-fit #bt-artist { font-size: 3rem !important; font-weight: 900 !important; line-height: 1.1; }
html.tv-fit #bt-status { font-size: 1.3rem; padding: 8px 16px; }
/* ===== TV : podium en grand ===== */
html.tv-page.tv-fit #step-podium:not(.hidden) { min-height: calc(var(--tvh) - 28px); box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
html.tv-fit #step-podium h2 { font-size: 3.6rem !important; }
html.tv-fit #step-podium > div:first-child { font-size: 5rem !important; }
html.tv-fit .podium-card > div:nth-child(1) { font-size: 4.5rem !important; }
html.tv-fit .podium-card > div:nth-child(2) { font-size: 5rem !important; margin: 6px 0 !important; }
html.tv-fit .podium-card > div:nth-child(3) { font-size: 2.4rem !important; }
html.tv-fit .podium-card > div:nth-child(4) { font-size: 1.9rem !important; font-weight: 900; color: var(--accent-cyan); }
html.tv-fit .podium-card .podium-quip { font-size: 1.45rem; }
html.tv-fit #podium-rest { max-width: 1100px !important; }
html.tv-fit #podium-rest .score-row { font-size: 1.6rem; padding: 14px 20px; }
html.tv-fit #podium-rest .rest-quip { font-size: 1.25rem; }
html.tv-fit #step-podium .btn-lg { font-size: 1.8rem; padding: 18px 30px; }
html.tv-fit .podium-records { font-size: 1.3rem; }

/* ===== Téléphone : pas de barre du haut en partie, classement de haut en bas, commentaires ===== */
html.playing .topbar, html.no-topbar .topbar { display: none; }
.lb-board.big.vertical { flex-direction: column; flex-wrap: nowrap; gap: 8px; padding: 12px 6px 4px; align-items: stretch; overflow-y: auto; }
.lb-board.big.vertical .lb-card { width: auto; max-width: none; flex: 0 0 auto; display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: 10px; padding: 8px 14px 8px 30px; text-align: left; border-radius: 16px; }
.lb-board.big.vertical .lb-rank { top: 50%; left: 6px; transform: translateY(-50%); width: 24px; height: 24px; font-size: .85rem; }
.lb-board.big.vertical .lb-avatar { font-size: 1.9rem !important; line-height: 1; }
.lb-board.big.vertical .lb-name { font-size: 1.05rem !important; }
.lb-board.big.vertical .lb-score { font-size: 1.3rem !important; }
.lb-board.big.vertical .lb-gain { top: 50%; right: 70px; transform: translateY(-50%) scale(.4); }
.lb-board.big.vertical .lb-card.show-gain .lb-gain { transform: translateY(-50%) scale(1); }
.lb-board.big.vertical .lb-abandon { display: none; }
.phone-quip { margin: 10px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--bg-interactive); font-size: 1rem; font-weight: 600; font-style: italic; }
.phone-quip strong { color: var(--accent-amber); font-style: normal; }
.final-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; text-align: left; overflow-y: auto; min-height: 0; }
.final-row { display: grid; grid-template-columns: 2.2rem 2.2rem 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: var(--bg-interactive); border: 2px solid transparent; }
.final-row.me { border-color: var(--accent-cyan); }
.final-row .fr-rank { font-size: 1.4rem; font-weight: 900; text-align: center; }
.final-row .fr-av { font-size: 1.7rem; }
.final-row .fr-body { display: flex; flex-direction: column; min-width: 0; }
.final-row .fr-quip { font-size: .82rem; font-style: italic; opacity: .85; }
.final-row .fr-quip strong { color: var(--accent-amber); }
.final-row .fr-score { font-weight: 900; color: var(--accent-cyan); font-size: 1.15rem; }
html.playing #res-final { flex: 1 1 auto; }
html.playing #res-quip { flex-shrink: 0; }
html.tv-page.tv-fit #step-lobby .players-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
html.tv-page.tv-fit #step-lobby .player-chip > div:nth-child(2) { flex: 1; }
html.tv-page.tv-fit #step-lobby .player-chip .text-muted { font-size: 1rem !important; }
html.tv-fit #step-question:not(.revealing) #bt-artist { font-size: 2.2rem !important; }
html.playing #res-map:not(.hidden) ~ #res-board { max-height: 36%; overflow-y: auto; }
html.playing #res-map:not(.hidden) { min-height: 140px; }
.lb-board.big.vertical { overflow-anchor: none; }
html.playing #res-map:not(.hidden) ~ #res-board .lb-card { padding-top: 4px; padding-bottom: 4px; }
html.playing #res-map:not(.hidden) ~ #res-board .lb-avatar { font-size: 1.4rem !important; }
html.tv-page .cat-tile:focus { outline: 5px solid var(--accent-cyan); outline-offset: -5px; }
html.tv-page.tv-fit .lobby-layout:has(.cat-grid.many) { grid-template-columns: 1fr 1.5fr; }
html.tv-page.tv-fit #step-lobby:has(.cat-grid.many) .join-box .qr-img { width: 280px; height: 280px; }
html.tv-page.tv-fit #step-lobby:has(.cat-grid.many) .room-code-value { font-size: 5.5rem; }
html.tv-page.tv-fit .cat-grid.many { grid-template-columns: repeat(6, 1fr); }
html.tv-page.tv-fit #step-lobby:has(.cat-grid.many) #count-grid .cat-tile, html.tv-page.tv-fit #step-lobby:has(.cat-grid.many) #audio-grid .cat-tile { min-height: 54px; padding: 6px; }
html.tv-page.tv-fit #step-lobby:has(.cat-grid.many) .mt-3 { margin-top: 10px; }
html.tv-page.tv-fit #step-lobby:has(.cat-grid.many) .btn-lg { padding: 14px; }
html.tv-page.tv-fit #step-lobby .cat-grid.many .cat-tile { font-size: 1.12rem; min-height: 52px; }

/* Téléphone : petit bouton de menu discret (barre du haut cachée) */
.p-menu-btn { display: none; position: fixed; top: 4px; right: 4px; z-index: 60; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-primary); font-size: 1.1rem; font-weight: 900; line-height: 1; opacity: .75; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
html.no-topbar .p-menu-btn { display: grid; place-items: center; }
.p-menu { position: fixed; top: 40px; right: 8px; left: 8px; max-width: 360px; margin-left: auto; z-index: 61; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: var(--bg-card); border: 1px solid var(--border-strong); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.p-menu.hidden { display: none; }
.p-menu .btn { width: 100%; }
.p-menu-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.p-menu-themes button { padding: 10px 4px; border-radius: 12px; border: 2px solid var(--border-subtle); background: var(--bg-interactive); color: var(--text-primary); font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; }
.p-menu-themes button.on { border-color: var(--accent-purple); background: rgba(139,92,246,.25); }
html.no-topbar .player-hud { padding-right: 48px !important; }
html.no-topbar #step-play .q-hud { padding-right: 44px !important; }
.player-wrap { position: relative; }
.p-menu-btn.in-wrap { position: absolute; top: 10px; right: 9px; }
/* Salon TV : toujours toute la largeur de l’écran, quel que soit le jeu */
html.tv-fit .app-shell:has(> #step-lobby:not(.hidden)) { max-width: calc(var(--tvw) - 48px); }
html.tv-fit .cat-grid.many { max-height: none; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
html.tv-page.tv-fit .cat-grid.many { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
/* Ordinateur : la manette du téléphone est agrandie à la taille de l’écran */
html.desk body:has(.player-wrap) .player-wrap { zoom: var(--pz, 1); }
html.desk.playing .player-wrap > :not(.hidden):not(.p-menu-btn) { height: calc((100svh - 16px) / var(--pz, 1)); }
html.desk body:has(.player-wrap) .player-wrap { max-width: min(980px, calc((100vw - 40px) / var(--pz, 1))); }
html.desk #ctrl-grid .ctrl-btn { font-size: 1.35rem; }
html.desk #ctrl-text { font-size: 1.6rem; }

/* TV : l'icône TV bien au centre de la barre du haut */
html.tv-page.tv-fit .topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
html.tv-page.tv-fit .topbar .tabs { justify-self: center; }
html.tv-page.tv-fit .topbar-right { justify-self: end; }
/* Solo sur ordinateur : réglages sur deux colonnes, à la taille de l'écran */
html.desk-setup main.app-shell { max-width: var(--sw, 900px) !important; }
html.desk-setup #step-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); column-gap: 32px; align-items: start; }
html.desk-setup #step-setup .setup-col > .mt-3:first-child { margin-top: 0; }
html.desk-setup #step-setup .cat-grid { max-height: none; overflow: visible; }
html.desk-setup #step-setup .avatar-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* Multijoueurs : « Vous jouez depuis cet écran » passe à gauche pour équilibrer les deux colonnes */
html.tv-fit .lobby-layout #host-play-box.moved { margin-top: 16px; }
html.tv-game .topbar { display: none !important; }

/* Choix d'un autre jeu sans fermer le salon */
.pick-back-row { display: flex; justify-content: center; margin-top: 14px; }
.pick-back-row .btn.hidden { display: none; }

/* ===== Réponses en très gros (TV et multijoueurs) ===== */
.reveal-banner > .row-between { flex-wrap: wrap; gap: 6px 20px; }
.reveal-answer { font-size: 2.4rem; line-height: 1.15; }
html.tv-fit .reveal-answer { font-size: 3.6rem; flex: 1 1 100%; text-align: center; order: 2; }
html.tv-fit .reveal-banner > .row-between #next-text { order: 1; margin-left: auto; }
html.tv-page.tv-fit .reveal-answer { font-size: 4.8rem; }
html.tv-fit .guess-chip { font-size: 1.35rem; padding: 8px 16px; }
html.tv-fit #step-question.revealing #bt-title { font-size: 4rem !important; line-height: 1.1; }
html.tv-fit #step-question.revealing #bt-artist { font-size: 3.4rem !important; }
html.tv-page.tv-fit #step-question.revealing #bt-title { font-size: 5rem !important; }
html.tv-page.tv-fit #step-question.revealing #bt-artist { font-size: 4.2rem !important; }
html.tv-fit #step-question.revealing #bt-status { font-size: 1.4rem; }
html.tv-fit .btn-sm { font-size: 1.05rem; }
html.tv-fit .q-hud .stop-btn { font-size: 1.15rem; }

/* ===== Messages (toasts) : grands, lisibles en clair comme en sombre ===== */
.toast-container { left: 50%; right: auto; transform: translateX(-50%); bottom: 28px; max-width: min(92vw, 900px); width: max-content; align-items: center; }
.toast {
    font-size: clamp(1.05rem, 2vw, 1.9rem); line-height: 1.3; padding: 16px 26px; text-align: center;
    background: #1e293b; color: #f8fafc; border-width: 3px; border-radius: 18px;
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.45);
}
html[data-theme="light"] .toast { background: #ffffff; color: #0f172a; box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25); }
.toast.error { border-color: var(--accent-rose); }

/* ===== Transitions douces entre écrans et pages ===== */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes step-in { from { opacity: 0; transform: translateY(14px) scale(.992); } to { opacity: 1; transform: none; } }
main.app-shell { animation: page-in .38s cubic-bezier(.2, .7, .2, 1) both; }
.step-in { animation: step-in .36s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { main.app-shell, .step-in { animation: none; } }

/* ===== Pause ===== */
.pause-btn, .music-btn {
  border: 1px solid var(--border-subtle); background: var(--bg-interactive); color: var(--text-primary);
  border-radius: 999px; font-weight: 900; cursor: pointer; font-size: .95rem; padding: 8px 16px; line-height: 1.2;
}
.music-btn { padding: 8px 12px; font-size: 1.1rem; }
.music-btn.off { opacity: .6; }
.pause-btn:hover, .music-btn:hover { border-color: var(--accent-cyan); }
.pause-btn.hidden { display: none; }
.game-ctrls { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pb-topline .pause-btn, .pb-topline .music-btn { margin-left: 4px; }
html.tv-fit .pause-btn { font-size: 1.15rem; padding: 10px 20px; }
html.tv-fit .music-btn { font-size: 1.35rem; padding: 8px 14px; }
.pause-overlay {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.pause-overlay.on { opacity: 1; pointer-events: auto; }
html[data-theme="light"] .pause-overlay { background: rgba(241, 245, 249, .78); }
.pause-box { text-align: center; padding: 30px 40px; border-radius: 28px; background: var(--bg-card); border: 2px solid var(--accent-cyan); box-shadow: 0 30px 80px rgba(2, 6, 23, .45); transform: scale(.94); transition: transform .25s ease; max-width: 92vw; }
.pause-overlay.on .pause-box { transform: none; }
.pause-icon { font-size: clamp(3rem, 9vw, 7rem); line-height: 1; }
.pause-title { font-size: clamp(2rem, 6vw, 5rem); font-weight: 900; margin: 6px 0; }
.pause-by { font-size: clamp(1rem, 2vw, 1.6rem); color: var(--text-secondary); margin-bottom: 18px; font-weight: 700; }
.pause-resume { font-size: clamp(1.1rem, 2.2vw, 2rem) !important; padding: 14px 34px !important; }

/* ===== Barème des points ===== */
.rules-box { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--bg-interactive); border: 1px solid var(--border-subtle); text-align: left; }
.rules-title { font-weight: 900; font-size: 1rem; margin-bottom: 6px; }
.rules-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rules-list li { display: grid; grid-template-columns: 1.6em 1fr auto; gap: 8px; align-items: baseline; font-size: .92rem; }
.rules-list .r-what { font-weight: 800; }
.rules-list .r-pts { color: var(--accent-cyan); font-weight: 800; text-align: right; }
@media (max-width: 520px) { .rules-list li { grid-template-columns: 1.6em 1fr; } .rules-list .r-pts { grid-column: 2; text-align: left; } }
html.tv-fit #lobby-rules .rules-list li { font-size: 1.05rem; }
html.tv-page.tv-fit #lobby-rules .rules-title { font-size: 1.25rem; }
html.tv-page.tv-fit #lobby-rules .rules-list li { font-size: 1.2rem; }
.pause-btn.hud-pause { padding: 4px 10px; font-size: 1rem; }

/* ===== Synchro du son ===== */
.avsync { z-index: 130; }
.avsync-digit { font-size: clamp(6rem, 18vw, 12rem); font-weight: 900; line-height: 1; color: var(--accent-cyan); animation: cd-pop 1s ease-out; margin: 6px 0 14px; }
.avsync-row { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.avsync-val { min-width: 130px; font-size: clamp(1.4rem, 2.6vw, 2.2rem); font-weight: 900; }
/* TV : chiffre du 3-2-1 en couleur pleine (plus léger à afficher pour les TV peu puissantes) */
html.tv-page .countdown-big, html.tv-page .geo-cd { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent-cyan); }

/* ===== Réponses des joueurs en grand ===== */
.guess-chip.wrong { border-color: var(--accent-rose); background: rgba(244, 63, 94, 0.14); }
.guess-chip.none { opacity: .7; }
html.tv-fit .guess-list { gap: 14px; }
html.tv-fit .guess-chip { font-size: 1.7rem; padding: 10px 20px; }
html.tv-fit .guess-chip span { font-size: 2.2rem; }
html.tv-page.tv-fit .guess-chip { font-size: 2rem; padding: 12px 24px; }
html.tv-page.tv-fit .guess-chip span { font-size: 2.6rem; }
/* TV peu puissantes : pas de flou derrière la pause (coûteux à afficher) */
html.tv-page .pause-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(2, 6, 23, .88); }
html.tv-page[data-theme="light"] .pause-overlay { background: rgba(241, 245, 249, .93); }

/* ===== Géographie : consigne en très gros, carte la plus grande possible, réponses lisibles ===== */
html.tv-fit .geo-layout { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; }
html.tv-fit .geo-map .map-wrap { height: var(--geoh, 610px); width: auto; aspect-ratio: 1033 / 988; }
html.tv-fit .geo-left, html.tv-fit .geo-right { max-height: var(--geoh, 610px); }
html.tv-fit #step-question.revealing.map-phase .reveal-banner { display: none; }
html.tv-fit .geo-left .map-place { word-break: normal; overflow-wrap: break-word; hyphens: manual; }
html.tv-fit .geo-left .map-place.long { font-size: clamp(2rem, 3vw, 3.2rem) !important; }
html.tv-fit .geo-left .map-place.xlong { font-size: clamp(1.7rem, 2.4vw, 2.6rem) !important; }
html.tv-fit .geo-left .map-hint { font-size: 1.8rem; line-height: 1.2; }
html.tv-fit .geo-left .map-place { font-size: clamp(2.6rem, 4.2vw, 4.4rem); line-height: 1.08; }
html.tv-page.tv-fit .geo-left .map-hint { font-size: 2.1rem; }
html.tv-page.tv-fit .geo-left .map-place { font-size: 4.8rem; }
.fm-line { stroke-width: 2; opacity: .55; }
.fm-dot { fill: #f43f5e; stroke: #fff; stroke-width: 3; }
.fm-dot.me { fill: var(--accent-cyan); }
.fm-arrow-bg { stroke: rgba(15, 23, 42, .75); stroke-width: 8; stroke-linecap: round; }
.fm-arrow { stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.fm-arrow-head { fill: #fff; stroke: rgba(15, 23, 42, .75); stroke-width: 1; }
.fm-pin circle { fill: rgba(15, 23, 42, .88); stroke: #fff; stroke-width: 4; }
.fm-pin.me circle { stroke: var(--accent-cyan); stroke-width: 5; }
.fm-pin text.emo { font-size: 62px; text-anchor: middle; }
.fm-pin text.nm { font-size: 26px; font-weight: 900; text-anchor: middle; fill: #fff; stroke: #0f172a; stroke-width: 5px; paint-order: stroke; }
.dist-row .km { white-space: nowrap; }
.dist-row .pts small { white-space: nowrap; }
/* Panneau musique */
.music-panel { z-index: 128; }
.mp-bars { display: flex; align-items: flex-end; gap: 5px; min-width: 220px; justify-content: center; }
.mp-bars span { width: 14px; border-radius: 4px; background: var(--border-strong); }
.mp-bars span:nth-child(n) { height: 14px; }
.mp-bars span:nth-child(2) { height: 18px; } .mp-bars span:nth-child(3) { height: 22px; } .mp-bars span:nth-child(4) { height: 26px; }
.mp-bars span:nth-child(5) { height: 30px; } .mp-bars span:nth-child(6) { height: 34px; } .mp-bars span:nth-child(7) { height: 38px; }
.mp-bars span:nth-child(8) { height: 42px; } .mp-bars span:nth-child(9) { height: 46px; } .mp-bars span:nth-child(10) { height: 50px; }
.mp-bars span.on { background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple)); }
.mp-bars b { margin-left: 10px; font-size: 1.3rem; min-width: 80px; }
.close-room { white-space: nowrap; }
/* ⚙️ Paramètres */
.settings-panel { z-index: 126; }
.settings-box { text-align: left; min-width: min(92vw, 620px); }
.settings-box .pause-title { text-align: center; margin-bottom: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-weight: 800; font-size: clamp(1rem, 1.6vw, 1.35rem); flex-wrap: wrap; }
.set-themes { display: flex; gap: 6px; flex-wrap: wrap; }
.set-themes .btn.on { border-color: var(--accent-cyan); background: rgba(6, 182, 212, .18); }
.settings-box .avsync-row { margin-top: 16px; }
html.tv-page.tv-fit #btn-settings { width: 80px; height: 80px; font-size: 2.3rem; border-radius: 20px; }
/* Géographie : bonne réponse = gros pin rouge */
.fm-target .pin-body { fill: #e11d48; stroke: #fff; stroke-width: 4; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
.fm-target .pin-hole { fill: #fff; }
.fm-target .pin-shadow { fill: rgba(0,0,0,.35); }
/* TV : 3-2-1 sans animation continue (moins de travail d'affichage pour les TV Android) */
html.tv-page .countdown-big, html.tv-page .geo-cd { animation: none !important; }
