        :root {
            --bg:      #0D0D0D;
            --bg-card: #1A1A1A;
            --accent:  #E8C97A;
            --accent-d:#C9AB5A;
            --text:    #F0EBE0;
            --muted:   #666666;
            --border:  #2A2A2A;
            --green:   #4CAF78;
            --red:     #E05555;
            --sat: env(safe-area-inset-top, 0px);
            --sab: env(safe-area-inset-bottom, 0px);
            --sal: env(safe-area-inset-left, 0px);
            --sar: env(safe-area-inset-right, 0px);
        }

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

        button, [class*="btn-"] { text-transform: uppercase; touch-action: manipulation; }

        body {
            font-family: 'Outfit', system-ui, sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100dvh;
            user-select: none;
            -webkit-user-select: none;
            scrollbar-width: none;
        }
        body::-webkit-scrollbar { display: none; }

        #app-shell {
            width: 100%;
            min-height: 100dvh;
            background: var(--bg);
            position: relative;
            overflow-x: hidden;
        }

        /* ── Overlay identité ── */

        .identity-hero {
            position: relative;
            overflow: hidden;
            flex-shrink: 0;
            width: 100%;
            background: #000;
            border-bottom: 1px solid rgba(255,255,255,0.07);
        }

        .identity-hero-bg { display: none; }

        .identity-hero-deco {
            position: absolute; top: -10px; right: -10px;
            font-size: 9rem; opacity: 0.15; pointer-events: none;
            filter: blur(3px); user-select: none; line-height: 1;
            transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
        }

        .identity-hero-content {
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: calc(clamp(12px, 2vh, 18px) + env(safe-area-inset-top, 0px)) 18px clamp(20px, 3vh, 32px);
            gap: clamp(8px, 1.5vh, 14px);
        }

        .identity-preview {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .identity-avatar-preview {
            font-size: clamp(2.8rem, 6vh, 4.2rem);
            line-height: 1;
            filter: drop-shadow(0 4px 24px rgba(232,201,122,0.3));
            transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
        }

        .identity-hero-title {
            font-family: 'Outfit', sans-serif;
            font-size: 1.9rem;
            font-weight: 800;
            color: #fff;
            text-align: center;
            letter-spacing: -0.03em;
        }

        .identity-hero-sub {
            font-size: 0.8rem;
            color: rgba(255,255,255,0.35);
            text-align: center;
        }

        .identity-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
            background: #000;
        }

        .identity-fields {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 20px 16px 12px;
            scrollbar-width: none;
        }
        .identity-fields::-webkit-scrollbar { display: none; }

        .identity-cta {
            flex-shrink: 0;
            padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
            background: #000;
            border-top: 1px solid rgba(255,255,255,0.07);
        }

        #join-screen .option-section {
            margin-bottom: 20px;
        }

        #join-screen .option-section:last-of-type {
            margin-bottom: 8px;
        }

        /* ── Utilitaires partagés ── */

        .hidden { display: none !important; }

        .screen { display: none; }
        .screen.active { display: block; }

        .page-header {
            padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--border);
            background: var(--bg);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .hub-logo {
            font-family: 'Outfit', sans-serif;
            font-size: 1.3rem;
            font-weight: 800;
            color: var(--text);
        }

        .user-chip {
            display: flex;
            align-items: center;
            gap: 7px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 100px;
            padding: 0 12px 0 8px;
            height: 34px;
            font-size: 0.82rem;
            font-weight: 500;
            color: var(--text);
        }

        .header-pill-btn {
            display: flex; align-items: center; justify-content: center;
            height: 34px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 100px;
            padding: 0 14px;
            font-size: 1rem;
            cursor: pointer;
            font-family: 'Outfit', sans-serif;
            color: var(--text);
        }

        .online-count-pill {
            display: inline-flex; align-items: center; gap: 5px;
            background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.25);
            border-radius: 100px; padding: 2px 9px 2px 7px;
            font-size: 0.72rem; font-weight: 700; color: #4ade80;
            font-variant-numeric: tabular-nums;
        }
        .online-count-pill::before {
            content: ''; display: inline-block;
            width: 6px; height: 6px; border-radius: 50%;
            background: #4ade80; box-shadow: 0 0 5px #4ade80aa;
            flex-shrink: 0;
        }

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

        .btn-back {
            display: flex;
            align-items: center;
            gap: 6px;
            background: none;
            border: none;
            color: var(--muted);
            font-size: 0.88rem;
            font-family: 'Outfit', sans-serif;
            cursor: pointer;
            padding: 6px 0;
            transition: color 0.15s;
            width: auto;
            margin: 0;
        }

        .btn-back:hover { color: var(--text); }

        .btn-primary {
            width: 100%;
            padding: 14px;
            border-radius: 10px;
            border: none;
            background: var(--accent);
            color: #0D0D0D;
            font-size: 1rem;
            font-weight: 700;
            font-family: 'Outfit', sans-serif;
            cursor: pointer;
            transition: background 0.2s, transform 0.1s;
            letter-spacing: 0.01em;
        }

        .btn-primary:hover { background: var(--accent-d); }
        .btn-primary:active { transform: scale(0.98); }
        .btn-primary:disabled { background: var(--border); color: var(--muted); cursor: default; transform: none; }

        .field-label {
            display: block;
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--muted);
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        /* ────────────────────────────────
           ÉCRAN PSEUDO
        ──────────────────────────────── */
        #join-screen {
            display: flex;
            flex-direction: column;
            align-items: stretch;
        }

        /* ── Auth screen (email / magic link) ── */
        #auth-screen {
            position: fixed; inset: 0; z-index: 300;
            background: #000;
            display: flex; flex-direction: column;
            align-items: stretch; overflow: hidden;
            height: 100dvh; max-height: 100dvh;
        }
        #auth-screen.hidden { display: none; }
        /* Masquer l'auth immédiatement si session détectée en localStorage */
        .has-session #auth-screen:not(.force-show) { display: none; }

        /* ── Splash screen ── */
        #splash-screen {
            position: fixed; inset: 0; z-index: 400;
            background: var(--bg);
            display: flex; flex-direction: column;
            align-items: center; justify-content: center; gap: 20px;
            transition: opacity 0.3s ease;
        }
        #splash-screen.fade-out { opacity: 0; pointer-events: none; }
        #splash-screen.gone { display: none; }
        .splash-logo { font-size: 2.8rem; font-weight: 800; font-family: 'Outfit', sans-serif; letter-spacing: -0.03em; color: var(--text); }
        .splash-spinner {
            width: 28px; height: 28px; border-radius: 50%;
            border: 2.5px solid var(--border);
            border-top-color: var(--accent);
            animation: spin 0.7s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .auth-hero {
            position: relative; overflow: hidden;
            flex-shrink: 0; width: 100%;
            background: #000;
            border-bottom: 1px solid rgba(255,255,255,0.07);
        }
        .auth-hero-deco {
            position: absolute; top: -10px; right: -10px;
            font-size: 9rem; opacity: 0.08; pointer-events: none;
            filter: blur(4px); user-select: none; line-height: 1;
        }
        .auth-hero-content {
            position: relative;
            display: flex; flex-direction: column; align-items: center;
            gap: 10px;
            padding: calc(clamp(28px, 5vh, 52px) + env(safe-area-inset-top, 0px)) 20px clamp(24px, 4vh, 40px);
        }
        .auth-app-name {
            font-family: 'Outfit', sans-serif;
            font-size: 2.4rem; font-weight: 800;
            color: var(--accent); letter-spacing: -0.04em; line-height: 1;
        }
        .auth-app-tagline {
            font-size: 0.88rem; color: rgba(255,255,255,0.4);
            text-align: center; margin-bottom: 4px;
        }
        .auth-game-chips {
            display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
        }
        .auth-game-chip {
            display: inline-flex; align-items: center; gap: 4px;
            background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
            border-radius: 100px; padding: 4px 10px;
            font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.45);
        }
        .auth-step-title {
            font-family: 'Outfit', sans-serif;
            font-size: 1.3rem; font-weight: 800;
            color: #fff; text-align: center; margin-top: 6px; letter-spacing: -0.02em;
        }
        .auth-step-sub {
            font-size: 0.82rem; color: rgba(255,255,255,0.4);
            text-align: center; line-height: 1.5;
        }
        .auth-body {
            flex: 1; display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 0px));
            background: #000;
            gap: 0;
        }
        .auth-box {
            width: 100%; max-width: 360px;
            display: flex; flex-direction: column; gap: 12px;
        }
        .auth-field-label {
            font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.1em; color: rgba(255,255,255,0.4); margin-bottom: 2px;
        }
        .auth-hint {
            font-size: 0.75rem; color: rgba(255,255,255,0.3);
            text-align: center; line-height: 1.5;
        }
        .auth-divider {
            width: 100%; height: 1px;
            background: rgba(255,255,255,0.07); margin: 4px 0;
        }
        .auth-error {
            font-size: 0.82rem; color: #ff6b6b;
            text-align: center; display: none; margin: 0;
        }

        .logo {
            font-family: 'Outfit', sans-serif;
            font-size: 2.8rem;
            font-weight: 800;
            color: var(--text);
            margin-bottom: 6px;
            letter-spacing: -0.5px;
        }

        .tagline {
            color: var(--muted);
            font-size: 0.9rem;
            margin-bottom: 44px;
            text-align: center;
        }

        .join-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 18px;
            padding: 32px 28px;
            width: 100%;
        }

        .join-card h2 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.35rem;
            font-weight: 700;
            margin-bottom: 4px;
            color: var(--text);
        }

        .join-card > p {
            color: var(--muted);
            font-size: 0.82rem;
            margin-bottom: 24px;
        }

        .avatar-grid {
            display: grid;
            grid-template-rows: repeat(3, clamp(40px, 13vw, 52px));
            grid-auto-flow: column;
            grid-auto-columns: clamp(40px, 13vw, 52px);
            gap: clamp(4px, 0.8vh, 7px);
            overflow-x: auto;
            overflow-y: visible;
            scrollbar-width: none;
            -ms-overflow-style: none;
            margin-bottom: 0;
            padding: 3px 2px;
        }
        .avatar-grid::-webkit-scrollbar { display: none; }

        .avatar-btn {
            width: 100%;
            aspect-ratio: 1;
            border-radius: 12px;
            border: 2px solid transparent;
            background: var(--bg-card);
            font-size: clamp(1rem, 2.5vh, 1.4rem);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
            padding: 0;
            margin: 0;
        }

        .avatar-btn:hover { background: var(--border); transform: scale(1.08); }
        .avatar-btn.selected {
            border-color: var(--accent);
            background: rgba(232,201,122,0.12);
            transform: scale(1.08);
            box-shadow: 0 0 0 1px var(--accent);
        }

        input[type="text"] {
            width: 100%;
            padding: 12px 14px;
            border-radius: 10px;
            border: 1.5px solid var(--border);
            background: var(--bg);
            color: var(--text);
            font-size: 1rem;
            font-family: 'Outfit', sans-serif;
            outline: none;
            transition: border-color 0.2s;
            margin-bottom: 16px;
        }

        input[type="text"]:focus { border-color: var(--accent); }
        input[type="text"]::placeholder { color: var(--muted); }
        input[type="email"] {
            width: 100%; box-sizing: border-box;
            padding: 12px 14px;
            border-radius: 10px;
            border: 1.5px solid var(--border);
            background: var(--bg);
            color: var(--text);
            font-size: 1rem;
            font-family: 'Outfit', sans-serif;
            outline: none;
            transition: border-color 0.2s;
            -webkit-appearance: none;
            appearance: none;
        }
        input[type="email"]:focus { border-color: var(--accent); }
        input[type="email"]::placeholder { color: var(--muted); }

        /* ────────────────────────────────
           HUB
        ──────────────────────────────── */
        #hub-screen { flex-direction: column; }
        #hub-screen .hub-content { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

        .hub-content {
            padding: 28px 16px 0;
        }

        /* ── Profil ── */
        #profile-screen {
            position: fixed;
            inset: 0;
            z-index: 150;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            overflow-y: auto;
            background: #000;
        }
        .profile-hero {
            background: #000;
            border-bottom: 1px solid rgba(255,255,255,0.07);
            flex-shrink: 0; position: relative; overflow: hidden;
        }
        .profile-hero-deco {
            position: absolute; top: -10px; right: -10px;
            font-size: 9rem; opacity: 0.2; pointer-events: none;
            filter: blur(3px); user-select: none;
        }
        .profile-hero-inner {
            position: relative;
            padding: calc(env(safe-area-inset-top,0px) + 16px) 20px 32px;
        }
        .profile-back-row { margin-bottom: 20px; }
        .profile-hero-center {
            display: flex; flex-direction: column; align-items: center;
            text-align: center; gap: 8px;
        }
        .profile-avatar-big { font-size: 3.6rem; line-height: 1; }
        .profile-username { font-size: 1.9rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; }
        .profile-hero-sub { font-size: 0.8rem; color: rgba(255,255,255,0.35); }
        .profile-edit-btn {
            font-size: 0.75rem; font-weight: 600; color: rgba(255,255,255,0.5);
            background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.12);
            border-radius: 100px; padding: 6px 18px; cursor: pointer;
            font-family: 'Outfit', sans-serif; margin-top: 6px;
            transition: background 0.15s;
        }
        .profile-edit-btn:hover { background: rgba(255,255,255,0.1); }
        .profile-body { padding: 20px 16px calc(env(safe-area-inset-bottom,0px) + 28px); display: flex; flex-direction: column; gap: 10px; background: #000; }
        .profile-section-title {
            font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em;
            text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 8px;
        }
        .profile-wr-overall {
            background: rgba(232,201,122,0.06);
            border: 1.5px solid rgba(232,201,122,0.2);
            border-radius: 16px; padding: 20px 22px;
            display: flex; align-items: center; justify-content: space-between; gap: 16px;
        }
        .profile-wr-overall-left { display: flex; flex-direction: column; gap: 4px; }
        .profile-wr-overall-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.4); }
        .profile-wr-overall-sub { font-size: 0.78rem; color: rgba(255,255,255,0.3); }
        .profile-wr-overall-pct { font-size: 3rem; font-weight: 800; color: var(--accent); line-height: 1; }
        .profile-stats-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
        }
        .profile-stat-card {
            background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.08);
            border-radius: 14px; padding: 14px 16px;
            display: flex; flex-direction: column; gap: 8px;
        }
        .profile-stat-header { display: flex; align-items: center; gap: 6px; }
        .profile-stat-icon { font-size: 1.1rem; }
        .profile-stat-label { font-size: 0.72rem; color: rgba(255,255,255,0.4); font-weight: 600; }
        .profile-stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
        .profile-stat-wr { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; }
        .profile-stat-wins { font-size: 0.82rem; font-weight: 700; color: var(--accent); }
        .profile-stat-sub { font-size: 0.68rem; color: rgba(255,255,255,0.3); }
        .profile-stat-footer { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
        .profile-stat-rank {
            font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.35);
            letter-spacing: 0.02em;
        }
        .profile-summary-row {
            display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
        }
        .profile-summary-card {
            background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.08);
            border-radius: 16px; padding: 18px 16px;
            display: flex; flex-direction: column; align-items: center; gap: 4px;
        }
        .profile-summary-wins {
            background: rgba(232,201,122,0.06); border-color: rgba(232,201,122,0.18);
        }
        .profile-summary-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 4px; }
        .profile-summary-value {
            font-size: 2rem; font-weight: 800; color: #fff; line-height: 1;
            font-variant-numeric: tabular-nums;
        }
        .profile-summary-wins .profile-summary-value { color: var(--accent); }
        .profile-summary-label {
            font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
            letter-spacing: 0.1em; color: rgba(255,255,255,0.35);
        }
        .profile-summary-rank {
            font-size: 0.78rem; font-weight: 700; color: rgba(232,201,122,0.6);
            margin-top: 2px;
        }

        /* ── Leaderboard global ── */
        #lb-global-screen {
            position: fixed; inset: 0; z-index: 150;
            flex-direction: column; align-items: stretch;
            overflow: hidden; background: var(--bg);
        }
        .lb-global-hero {
            background: linear-gradient(160deg, #0d001f 0%, #1a0533 50%, #0f1a3a 100%);
            flex-shrink: 0;
            position: relative;
            overflow: hidden;
        }
        .lb-global-hero-deco {
            position: absolute; top: -20px; right: -10px;
            font-size: 8rem; opacity: 0.08; pointer-events: none;
            filter: blur(2px); user-select: none;
        }
        .lb-global-hero-inner {
            position: relative;
            padding: calc(env(safe-area-inset-top,0px) + 16px) 20px 0;
        }
        .lb-global-back-row {
            margin-bottom: 20px;
        }
        .lb-global-center {
            display: flex; flex-direction: column; align-items: center;
            text-align: center; gap: 6px; margin-bottom: 28px;
        }
        .lb-global-icon { font-size: 2.8rem; line-height: 1; }
        .lb-global-title { font-size: 1.6rem; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
        .lb-global-sub { font-size: 0.8rem; color: rgba(255,255,255,0.4); }
        .lb-tabs {
            display: flex; gap: 6px; overflow-x: auto;
            scrollbar-width: none; padding: 0 20px;
        }
        .lb-tabs::-webkit-scrollbar { display: none; }
        .lb-tab {
            flex-shrink: 0;
            padding: 10px 16px; font-size: 0.82rem; font-weight: 600;
            color: rgba(255,255,255,0.4); background: none; border: none;
            font-family: 'Outfit', sans-serif; transition: all 0.15s;
            white-space: nowrap;
        }
        .lb-tab.active { color: #fff; border-bottom-color: var(--accent); }
        .lb-global-body {
            flex: 1; overflow-y: auto;
            padding: 16px 16px calc(env(safe-area-inset-bottom,0px) + 24px);
        }
        .lb-row-global {
            display: flex; align-items: center; gap: 14px;
            padding: 14px 16px; border-radius: 16px;
            margin-bottom: 10px; background: var(--bg-card);
            border: 1px solid var(--border);
        }
        .lb-row-global.lb-me { border-color: var(--accent); background: rgba(232,201,122,0.06); }
        .lb-row-global.lb-top1 { background: rgba(255,215,0,0.07); border-color: rgba(255,215,0,0.25); }
        .lb-row-global.lb-top2 { background: rgba(192,192,192,0.06); border-color: rgba(192,192,192,0.2); }
        .lb-row-global.lb-top3 { background: rgba(205,127,50,0.06); border-color: rgba(205,127,50,0.2); }
        .lb-rank { font-size: 1.1rem; font-weight: 800; min-width: 30px; text-align: center; flex-shrink: 0; }
        .lb-avatar-g { font-size: 1.5rem; flex-shrink: 0; }
        .lb-info { flex: 1; min-width: 0; }
        .lb-name { font-size: 0.92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
        .lb-me-badge { font-size: 0.6rem; font-weight: 800; color: var(--accent); background: rgba(232,201,122,0.15); border-radius: 100px; padding: 2px 7px; letter-spacing: 0.05em; text-transform: uppercase; flex-shrink: 0; }
        .lb-detail { font-size: 0.72rem; color: var(--muted); margin-top: 1px; }
        .lb-wr-col { text-align: right; flex-shrink: 0; }
        .lb-wr-pct { font-size: 1.25rem; font-weight: 800; color: var(--text); }
        .lb-wr-wins { font-size: 0.72rem; color: var(--muted); }
        .lb-empty { text-align: center; color: var(--muted); padding: 48px 20px; font-size: 0.9rem; }

        /* ── Toggle public/privé ── */
        .visibility-toggle {
            display: flex; gap: 0;
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: 12px; padding: 4px; margin-bottom: 0;
        }
        .vis-btn {
            flex: 1; padding: 8px 12px; border: none; border-radius: 8px;
            background: none; font-family: 'Outfit', sans-serif;
            font-size: 0.82rem; font-weight: 600; color: var(--muted);
            cursor: pointer; transition: all 0.15s; display: flex;
            align-items: center; justify-content: center; gap: 6px;
        }
        .vis-btn.active { background: var(--accent); color: #1a1208; }

        /* ── En ligne ── */
        .online-badge {
            display: inline-flex; align-items: center; gap: 5px;
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: 100px; padding: 6px 12px;
            font-size: 0.82rem; font-weight: 600; color: var(--text);
            font-family: 'Outfit', sans-serif; cursor: default;
        }
        .online-badge-dot {
            width: 7px; height: 7px; border-radius: 50%;
            background: #4ade80; box-shadow: 0 0 6px #4ade80aa;
            flex-shrink: 0;
        }
        .online-section {
            margin-bottom: 20px;
        }
        .online-section-title {
            font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px;
            display: flex; align-items: center; gap: 8px;
        }
        .online-section-title::after { content: none; }
        .online-chips-row {
            display: flex; gap: 10px; overflow-x: auto;
            padding-bottom: 4px; scrollbar-width: none;
        }
        .online-chips-row::-webkit-scrollbar { display: none; }
        @keyframes onlineChipIn {
            from { opacity: 0; transform: scale(0.8) translateY(6px); }
            to   { opacity: 1; transform: scale(1)   translateY(0);   }
        }
        .online-chip {
            display: flex; flex-direction: column; align-items: center; gap: 5px;
            flex-shrink: 0; cursor: default;
            animation: onlineChipIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
            opacity: 0;
        }
        .online-chip-avatar-wrap {
            position: relative; width: 48px; height: 48px;
            background: var(--bg-card); border: 1.5px solid var(--border);
            border-radius: 50%; display: flex; align-items: center; justify-content: center;
            font-size: 1.5rem;
        }
        .online-chip-status {
            position: absolute; bottom: 1px; right: 1px;
            width: 11px; height: 11px; border-radius: 50%;
            border: 2px solid var(--bg);
        }
        .online-chip-status.hub   { background: #4ade80; box-shadow: 0 0 5px #4ade8099; }
        .online-chip-status.lobby { background: #facc15; box-shadow: 0 0 5px #facc1599; }
        .online-chip-status.game  { background: #a78bfa; box-shadow: 0 0 5px #a78bfa99; }
        .online-chip-name {
            font-size: 0.68rem; font-weight: 600; color: var(--muted);
            max-width: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            text-align: center;
        }
        .online-chip-rank {
            font-size: 0.62rem; font-weight: 700; color: var(--muted);
            text-align: center; line-height: 1;
        }
        .online-chip-rank.top1 { color: #fbbf24; }
        .online-chip-rank.top3 { color: var(--accent); }

        /* ── Salons disponibles ── */
        @keyframes roomCardIn {
            from { opacity: 0; transform: translateY(12px) scale(0.97); }
            to   { opacity: 1; transform: translateY(0)   scale(1);    }
        }
        .open-rooms-section {
            margin-bottom: 28px;
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: 20px; padding: 18px 16px 10px;
        }
        .open-rooms-title {
            font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.1em; color: var(--muted); margin-bottom: 14px;
            display: flex; align-items: center; gap: 8px;
        }
        .open-rooms-title::after { content: none; }
        .room-card {
            background: var(--bg); border: 1px solid var(--border);
            border-radius: 14px; padding: 12px 14px;
            display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
            animation: roomCardIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
            opacity: 0;
        }
        .room-card:last-child { margin-bottom: 0; }
        .room-card-icon { font-size: 1.5rem; flex-shrink: 0; }
        .room-card-info { flex: 1; min-width: 0; }
        .room-card-host { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .room-card-meta { font-size: 0.73rem; color: var(--muted); margin-top: 3px; }
        .room-card-join {
            background: var(--accent); color: #1a1208; border: none;
            border-radius: 10px; padding: 8px 16px; font-size: 0.82rem;
            font-weight: 700; cursor: pointer; font-family: 'Outfit', sans-serif;
            flex-shrink: 0; white-space: nowrap;
        }
        .open-rooms-empty { font-size: 0.84rem; color: var(--muted); text-align: center; padding: 10px 0 6px; }

        .hub-intro { margin-bottom: 24px; }

        .hub-intro h1 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.8rem;
            font-weight: 800;
            margin-bottom: 4px;
            color: var(--text);
        }

        .hub-intro p { color: var(--muted); font-size: 0.88rem; }

        .rooms-code-divider {
            height: 1px;
            background: var(--border);
            margin: 14px 0 12px;
        }
        .rooms-code-row {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .rooms-code-label {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        .rooms-code-input-row {
            display: flex;
            gap: 8px;
            align-items: flex-start;
        }
        .rooms-code-input-row .btn-secondary {
            height: 46px;
            box-sizing: border-box;
            padding-top: 0;
            padding-bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            vertical-align: middle;
        }
        .rooms-code-input {
            flex: 1;
            min-width: 0;
            height: 46px;
            box-sizing: border-box;
            padding: 0 14px;
            border-radius: 10px;
            border: 1.5px solid var(--border);
            background: var(--bg);
            color: var(--text);
            font-size: 1.1rem;
            font-family: 'Outfit', sans-serif;
            font-weight: 400;
            letter-spacing: 4px;
            outline: none;
            transition: border-color 0.2s;
            margin: 0;
            -webkit-appearance: none;
            appearance: none;
            line-height: 46px;
        }
        .rooms-code-input:focus { border-color: var(--accent); }
        .rooms-code-input::placeholder { color: var(--border); letter-spacing: 2px; font-size: 0.95rem; }

        .btn-secondary {
            padding: 11px 18px;
            border-radius: 10px;
            border: none;
            background: var(--accent);
            color: #0D0D0D;
            font-size: 0.88rem;
            font-weight: 700;
            font-family: 'Outfit', sans-serif;
            cursor: pointer;
            transition: background 0.15s;
            white-space: nowrap;
            flex-shrink: 0;
            width: auto;
            margin: 0;
        }

        .btn-secondary:hover { background: var(--accent-d); }

        .join-banner-error {
            font-size: 0.75rem;
            color: var(--red);
            display: none;
            margin-top: -4px;
        }

        /* ── Grille de jeux ── */
        .games-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .game-card {
            position: relative;
            border-radius: 16px;
            overflow: hidden;
            height: 150px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .game-card:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
        .game-card.soon  { opacity: 0.45; cursor: default; }
        .game-card.soon:hover { transform: none; box-shadow: none; }

        .game-card-bg {
            position: absolute;
            inset: 0;
        }

        .game-card-emoji {
            position: absolute;
            font-size: 6rem;
            right: -8px;
            bottom: -10px;
            opacity: 0.22;
            line-height: 1;
            pointer-events: none;
            user-select: none;
        }

        .game-card-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.2) 100%);
            padding: 20px 20px 18px;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
        }

        .game-name {
            font-family: 'Outfit', sans-serif;
            font-size: 1.25rem;
            font-weight: 700;
            color: #fff;
            margin-bottom: 4px;
            line-height: 1.2;
        }

        .game-desc {
            font-size: 0.78rem;
            color: rgba(255,255,255,0.65);
            line-height: 1.45;
            margin-bottom: 10px;
        }

        .game-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

        .badge {
            font-size: 0.65rem;
            font-weight: 700;
            padding: 3px 8px;
            border-radius: 100px;
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.08);
            color: rgba(255,255,255,0.6);
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .badge.available {
            background: rgba(232,201,122,0.15);
            border-color: rgba(232,201,122,0.5);
            color: var(--accent);
        }

        /* ────────────────────────────────
           OPTIONS QUIZ
        ──────────────────────────────── */
        #quiz-options-screen { padding-bottom: 0; flex-direction: column; }

        .opts-cta {
            position: sticky;
            bottom: 0;
            padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
            background: linear-gradient(to top, var(--bg) 70%, transparent);
            z-index: 10;
        }

        /* Hero */
        .opts-hero {
            position: relative;
            height: 140px;
            overflow: hidden;
            flex-shrink: 0;
        }

        .opts-hero-bg {
            position: absolute;
            inset: 0;
        }

        .opts-hero-content {
            position: relative;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 18px;
        }

        .opts-back {
            color: rgba(255,255,255,0.6);
            align-self: flex-start;
        }

        .opts-back:hover { color: #fff; }

        .opts-hero-text {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .opts-hero-title {
            font-family: 'Outfit', sans-serif;
            font-size: 1.5rem;
            font-weight: 700;
            color: #fff;
            line-height: 1.2;
        }

        .opts-hero-sub {
            font-size: 0.75rem;
            color: rgba(255,255,255,0.5);
            font-weight: 500;
            margin-top: 2px;
            letter-spacing: 0.04em;
        }

        .options-content {
            padding: 24px 0 0;
            flex: 1;
        }

        .option-section { margin-bottom: 26px; padding: 0 16px; }
        .option-section.full-bleed { padding: 0; }
        .option-section.full-bleed .field-label { padding: 0 16px; display: block; margin-bottom: 8px; }

        /* Cartes de thème */
        .themes-grid {
            display: flex;
            flex-direction: row;
            gap: 10px;
            overflow-x: auto;
            overflow-y: visible;
            scrollbar-width: none;
            padding: 4px 16px 8px;
            -webkit-overflow-scrolling: touch;
        }
        .themes-grid::-webkit-scrollbar { display: none; }

        .theme-card {
            position: relative;
            height: 90px;
            width: 90px;
            flex-shrink: 0;
            border-radius: 14px;
            overflow: hidden;
            cursor: pointer;
            border: 2px solid transparent;
            transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 0;
            margin: 0;
            background: none;
        }

        .theme-card-wide {
            width: 120px;
            height: 90px;
            flex-direction: column;
            gap: 6px;
        }

        .theme-card:hover { transform: translateY(-2px); }

        .theme-card.selected {
            border-color: var(--accent);
            box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(232,201,122,0.25);
        }

        .theme-card-bg {
            position: absolute;
            inset: 0;
        }

        .theme-svg {
            position: relative;
            width: 28px;
            height: 28px;
            color: rgba(255,255,255,0.85);
            flex-shrink: 0;
        }

        .theme-name {
            position: relative;
            font-size: 0.75rem;
            font-weight: 600;
            color: rgba(255,255,255,0.9);
            font-family: 'Outfit', sans-serif;
            letter-spacing: 0.02em;
        }

        .theme-card.selected .theme-svg { color: #fff; }
        .theme-card.selected .theme-name { color: #fff; }

        .custom-theme-input {
            width: 100%;
            background: var(--bg-card);
            border: 1.5px solid var(--accent);
            border-radius: 10px;
            padding: 10px 14px;
            color: var(--text);
            font-family: 'Outfit', sans-serif;
            font-size: 0.88rem;
            font-weight: 500;
            outline: none;
            box-sizing: border-box;
            transition: border-color 0.15s;
        }
        .custom-theme-input::placeholder { color: var(--muted); }
        .custom-theme-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,201,122,0.15); }

        /* Seg questions */
        .seg-control { display: flex; gap: 8px; }

        .seg-btn {
            flex: 1;
            padding: 12px 8px 10px;
            border-radius: 12px;
            border: 1.5px solid var(--border);
            background: var(--bg-card);
            color: var(--muted);
            font-family: 'Outfit', sans-serif;
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
            margin: 0;
            width: auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
        }

        .seg-val {
            font-size: 1.3rem;
            font-weight: 700;
            font-family: 'Outfit', sans-serif;
            line-height: 1;
        }

        .seg-hint {
            font-size: 0.62rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            opacity: 0.6;
        }

        .seg-btn:hover { border-color: var(--accent); color: var(--accent); }
        .seg-btn.selected {
            border-color: var(--accent);
            background: rgba(232,201,122,0.08);
            color: var(--accent);
        }

        /* Difficulté */
        .diff-control { display: flex; flex-direction: column; gap: 8px; }

        .diff-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 14px 16px;
            border-radius: 12px;
            border: 1.5px solid var(--border);
            background: var(--bg-card);
            color: var(--muted);
            font-size: 0.9rem;
            font-weight: 600;
            font-family: 'Outfit', sans-serif;
            cursor: pointer;
            transition: all 0.15s;
            margin: 0;
            text-align: left;
        }

        .diff-btn:hover { border-color: var(--accent); color: var(--text); }

        .diff-btn.selected {
            border-color: var(--accent);
            background: rgba(232,201,122,0.08);
            color: var(--accent);
        }

        .diff-stars { font-size: 0.9rem; letter-spacing: -1px; }

        /* ── Quiz options — Bar Moderne redesign ── */
        #quiz-options-screen { background: #000; }

        #quiz-options-screen .opts-hero {
            height: auto;
            background: #000;
            border-bottom: 1px solid rgba(255,255,255,0.07);
        }
        #quiz-options-screen .opts-hero-bg { display: none; }
        #quiz-options-screen .opts-hero-content {
            padding: calc(18px + env(safe-area-inset-top,0px)) 20px 20px;
            gap: 0;
        }
        #quiz-options-screen .opts-hero-text {
            flex-direction: column;
            gap: 2px;
            margin-top: 14px;
            width: 100%;
            align-items: center;
            text-align: center;
        }
        #quiz-options-screen .opts-hero-title {
            font-size: 1.9rem;
            font-weight: 800;
            letter-spacing: -0.03em;
        }
        #quiz-options-screen .opts-hero-sub {
            color: var(--accent);
            font-weight: 700;
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            opacity: 1;
        }

        /* Theme pills */
        #quiz-options-screen .themes-grid { gap: 8px; padding: 4px 16px 10px; }
        #quiz-options-screen .theme-card,
        #quiz-options-screen .theme-card-wide {
            width: auto !important;
            height: 42px !important;
            flex-direction: row;
            border-radius: 50px;
            padding: 0 16px 0 10px;
            gap: 8px;
            border: 1.5px solid rgba(255,255,255,0.1);
            background: rgba(255,255,255,0.05);
        }
        #quiz-options-screen .theme-card-bg { display: none; }
        #quiz-options-screen .theme-svg { display: none; }
        #quiz-options-screen .theme-emoji {
            font-size: 1.2rem;
            line-height: 1;
            flex-shrink: 0;
        }
        #quiz-options-screen .theme-name {
            font-size: 0.82rem;
            font-weight: 600;
            color: rgba(255,255,255,0.65);
            white-space: nowrap;
        }
        #quiz-options-screen .theme-card.selected {
            background: rgba(232,201,122,0.1);
            border-color: var(--accent);
            box-shadow: 0 0 10px rgba(232,201,122,0.12);
        }
        #quiz-options-screen .theme-card.selected .theme-name { color: var(--accent); }
        #quiz-options-screen .theme-card:hover { transform: none; background: rgba(255,255,255,0.08); }

        /* Settings 2-column grid */
        #quiz-options-screen .settings-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0 14px;
            padding: 0 16px;
            margin-bottom: 26px;
        }
        #quiz-options-screen .setting-block .field-label {
            display: block;
            margin-bottom: 8px;
        }

        /* Seg override: vertical stack */
        #quiz-options-screen .seg-control { flex-direction: column; gap: 5px; }
        #quiz-options-screen .seg-btn {
            flex-direction: row;
            justify-content: flex-start;
            padding: 9px 12px;
            border-radius: 10px;
            gap: 8px;
        }
        #quiz-options-screen .seg-val { font-size: 1.05rem; }
        #quiz-options-screen .seg-hint { font-size: 0.6rem; }

        /* Diff override: colored dots */
        #quiz-options-screen .diff-control { gap: 5px; }
        #quiz-options-screen .diff-btn {
            padding: 9px 12px;
            border-radius: 10px;
            gap: 8px;
            font-size: 0.85rem;
        }
        #quiz-options-screen .diff-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
            opacity: 0.6;
        }
        #quiz-options-screen .diff-btn.selected .diff-dot { opacity: 1; }
        #quiz-options-screen .diff-stars { display: none; }

        /* CTA : fond uni (pas de dégradé) */
        #quiz-options-screen .opts-cta { background: #000; }

        /* CTA collé en bas sur mobile */
        #quiz-options-screen { min-height: 100dvh; }
        #quiz-options-screen .options-content { flex: 1; }

        /* Colonnes questions/difficulté : hauteurs égales */
        #quiz-options-screen .settings-grid { align-items: stretch; }
        #quiz-options-screen .setting-block {
            display: flex;
            flex-direction: column;
        }
        #quiz-options-screen .setting-block .seg-control,
        #quiz-options-screen .setting-block .diff-control { flex: 1; }
        #quiz-options-screen .seg-btn,
        #quiz-options-screen .diff-btn { flex: 1; }

        /* Toggle visibilité repensé */
        #quiz-options-screen .visibility-toggle {
            background: none;
            border: none;
            padding: 0;
            gap: 6px;
            justify-content: flex-start;
        }
        #quiz-options-screen .vis-btn {
            flex: 0 0 auto;
            border: 1.5px solid rgba(255,255,255,0.12);
            border-radius: 50px;
            padding: 8px 18px;
            font-size: 0.82rem;
            background: rgba(255,255,255,0.04);
            color: rgba(255,255,255,0.45);
        }
        #quiz-options-screen .vis-btn.active {
            background: rgba(232,201,122,0.1);
            border-color: var(--accent);
            color: var(--accent);
        }

        /* ── Draw / HotPotato / Anec options — Bar Moderne ── */
        #draw-options-screen,
        #hotpotato-options-screen,
        #anec-options-screen {
            background: #000;
            min-height: 100dvh;
        }
        #draw-options-screen .options-content,
        #hotpotato-options-screen .options-content,
        #anec-options-screen .options-content { flex: 1; }

        #draw-options-screen .opts-hero,
        #hotpotato-options-screen .opts-hero,
        #anec-options-screen .opts-hero {
            height: auto;
            background: #000;
            border-bottom: 1px solid rgba(255,255,255,0.07);
        }
        #draw-options-screen .opts-hero-bg,
        #hotpotato-options-screen .opts-hero-bg,
        #anec-options-screen .opts-hero-bg { display: none; }

        #draw-options-screen .opts-hero-content,
        #hotpotato-options-screen .opts-hero-content,
        #anec-options-screen .opts-hero-content {
            padding: calc(18px + env(safe-area-inset-top,0px)) 20px 20px;
            gap: 0;
        }
        #draw-options-screen .opts-hero-title,
        #hotpotato-options-screen .opts-hero-title,
        #anec-options-screen .opts-hero-title {
            font-size: 1.9rem;
            font-weight: 800;
            letter-spacing: -0.03em;
        }
        #draw-options-screen .opts-hero-sub,
        #hotpotato-options-screen .opts-hero-sub,
        #anec-options-screen .opts-hero-sub {
            color: var(--accent);
            font-weight: 700;
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            opacity: 1;
        }

        /* Draw / HotPotato / Anec : hero-text centré, colonne, sans emoji */
        #draw-options-screen .opts-hero-text,
        #hotpotato-options-screen .opts-hero-text,
        #anec-options-screen .opts-hero-text {
            flex-direction: column;
            gap: 2px;
            margin-top: 14px;
            width: 100%;
            align-items: center;
            text-align: center;
        }
        #draw-options-screen .opts-hero-text > span,
        #hotpotato-options-screen .opts-hero-text > span,
        #anec-options-screen .opts-hero-text > span,
        #quiz-options-screen .opts-hero-text > span,
        #memory-options-screen .opts-hero-text > span { font-size: 2rem; line-height: 1; }

        /* CTA sans dégradé */
        #draw-options-screen .opts-cta,
        #hotpotato-options-screen .opts-cta,
        #anec-options-screen .opts-cta { background: #000; }

        /* Visibility toggle pills */
        #draw-options-screen .visibility-toggle,
        #hotpotato-options-screen .visibility-toggle,
        #anec-options-screen .visibility-toggle {
            background: none; border: none; padding: 0; gap: 6px; justify-content: flex-start;
        }
        #draw-options-screen .vis-btn,
        #hotpotato-options-screen .vis-btn,
        #anec-options-screen .vis-btn {
            flex: 0 0 auto;
            border: 1.5px solid rgba(255,255,255,0.12);
            border-radius: 50px;
            padding: 8px 18px;
            font-size: 0.82rem;
            background: rgba(255,255,255,0.04);
            color: rgba(255,255,255,0.45);
        }
        #draw-options-screen .vis-btn.active,
        #hotpotato-options-screen .vis-btn.active,
        #anec-options-screen .vis-btn.active {
            background: rgba(232,201,122,0.1);
            border-color: var(--accent);
            color: var(--accent);
        }

        /* Diff buttons redesign */
        #draw-options-screen .diff-btn,
        #hotpotato-options-screen .diff-btn,
        #anec-options-screen .diff-btn {
            padding: 12px 14px;
            border-radius: 10px;
            gap: 10px;
        }

        /* Draw & Anec : cacher les étoiles, afficher les dots */
        #draw-options-screen .diff-stars,
        #anec-options-screen .diff-stars { display: none; }

        #hotpotato-options-screen .diff-stars { display: none; }

        /* ── Hub — Bar Moderne ── */
        #hub-screen { background: #000; }

        #hub-screen .page-header {
            background: #000;
            border-bottom: 1px solid rgba(255,255,255,0.07);
        }
        #hub-screen .hub-logo {
            color: var(--accent);
            letter-spacing: 0.06em;
            font-size: 1.4rem;
        }

        #hub-screen .hub-intro h1 {
            font-size: 2rem;
            letter-spacing: -0.025em;
        }

        #hub-screen .open-rooms-section {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.07);
        }
        #hub-screen .room-card {
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
        }
        #hub-screen .rooms-code-input {
            background: rgba(255,255,255,0.04);
            border-color: rgba(255,255,255,0.12);
        }

        #hub-screen .game-card {
            height: 162px;
            border-radius: 18px;
        }
        #hub-screen .game-card-overlay {
            background: linear-gradient(150deg, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.08) 100%);
        }
        #hub-screen .game-card-emoji {
            font-size: 7.5rem;
            opacity: 0.3;
            right: -12px;
            bottom: -14px;
        }
        #hub-screen .game-name {
            font-size: 1.28rem;
            font-weight: 800;
            letter-spacing: -0.02em;
        }

        @media (min-width: 768px) {
            #hub-screen .game-card { height: 175px; }
        }

        @media (min-width: 1024px) {
            #hub-screen .hub-logo { font-size: 1.5rem; }
            #hub-screen .game-card { height: 195px; }
            #hub-screen .game-name { font-size: 1.35rem; }
            #hub-screen .hub-content {
                grid-template-areas:
                    "intro  games"
                    "online games"
                    "join   games";
                grid-template-rows: auto auto 1fr;
                padding-bottom: env(safe-area-inset-bottom, 0px);
            }
            #hub-screen .online-section {
                grid-area: online;
                padding: 0 36px 24px;
                border-right: 1px solid rgba(255,255,255,0.07);
            }
            #hub-screen .open-rooms-section {
                background: transparent;
                border: none;
                border-top: 1px solid rgba(255,255,255,0.07);
                border-right: 1px solid rgba(255,255,255,0.07);
                margin-bottom: 0;
            }
            #hub-screen .hub-intro {
                border-right-color: rgba(255,255,255,0.07);
            }
        }

        /* ── Lobby screens — Bar Moderne ── */
        #lobby-screen,
        #guest-lobby-screen {
            background: #000;
            min-height: 100dvh;
            flex-direction: column;
        }

        #lobby-screen .lobby-body,
        #guest-lobby-screen .lobby-body {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            padding-bottom: 0;
        }

        #lobby-screen .players-section,
        #guest-lobby-screen .players-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            margin-bottom: 0;
        }

        #lobby-screen .players-section .field-label,
        #guest-lobby-screen .players-section .field-label {
            flex-shrink: 0;
            display: block;
            margin-bottom: 12px;
        }

        #lobby-screen .players-list,
        #guest-lobby-screen .players-list {
            flex: 1;
            overflow-y: auto;
            min-height: 0;
            scrollbar-width: none;
            padding-bottom: 8px;
        }
        #lobby-screen .players-list::-webkit-scrollbar,
        #guest-lobby-screen .players-list::-webkit-scrollbar { display: none; }

        #lobby-screen #start-btn {
            flex-shrink: 0;
            margin: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        }
        #lobby-screen #draw-min-players-msg,
        #lobby-screen #hp-min-players-msg,
        #lobby-screen #anec-min-players-msg {
            flex-shrink: 0;
            margin: 0 0 calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        }

        #guest-lobby-screen .guest-waiting {
            flex-shrink: 0;
            padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px));
        }

        #lobby-screen .lobby-hero-bg,
        #guest-lobby-screen .lobby-hero-bg { display: none; }

        #lobby-screen .lobby-hero,
        #guest-lobby-screen .lobby-hero {
            background: #000;
            border-bottom: 1px solid rgba(255,255,255,0.07);
        }

        #lobby-screen .lobby-hero-deco,
        #guest-lobby-screen .lobby-hero-deco { opacity: 0.2; filter: blur(2px); }

        #lobby-screen .lobby-game-name,
        #guest-lobby-screen .lobby-game-name {
            font-size: 1.9rem;
            font-weight: 800;
            letter-spacing: -0.03em;
        }

        #lobby-screen .lobby-info-card,
        #guest-lobby-screen .lobby-info-card {
            background: rgba(255,255,255,0.05);
            border: 1.5px solid rgba(255,255,255,0.1);
            border-radius: 10px;
        }

        #lobby-screen .lobby-code-small,
        #guest-lobby-screen .lobby-code-small {
            background: rgba(232,201,122,0.06);
            border-color: rgba(232,201,122,0.25);
        }

        #lobby-screen .lobby-code-small-value,
        #guest-lobby-screen .lobby-code-small-value {
            color: var(--accent);
            letter-spacing: 6px;
        }

        #lobby-screen .player-row,
        #guest-lobby-screen .player-row {
            border-color: rgba(255,255,255,0.08);
            border-radius: 12px;
        }

        /* ────────────────────────────────
           LOBBY
        ──────────────────────────────── */
        #lobby-screen, #guest-lobby-screen { padding-bottom: 0; }

        /* Hero lobby */
        .lobby-hero {
            position: relative;
            overflow: hidden;
            padding-bottom: 28px;
        }

        .lobby-hero-bg {
            position: absolute;
            inset: 0;
        }

        .lobby-hero-content {
            position: relative;
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 0;
        }

        .lobby-hero-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .lobby-hero-body {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding-bottom: 20px;
            gap: 14px;
            position: relative;
            z-index: 1;
        }

        .lobby-hero-deco {
            position: absolute;
            top: -10px;
            right: -10px;
            font-size: 9rem;
            line-height: 1;
            opacity: 0.13;
            filter: blur(3px);
            pointer-events: none;
            user-select: none;
            z-index: 0;
        }

        .lobby-info-cards {
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 18px;
        }

        .lobby-info-card {
            background: rgba(255,255,255,0.1);
            border: 1px solid rgba(255,255,255,0.18);
            border-radius: 14px;
            padding: 10px 16px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            min-width: 72px;
        }

        .lobby-info-card-icon {
            font-size: 1.3rem;
            line-height: 1;
        }

        .lobby-info-card-value {
            font-size: 0.88rem;
            font-weight: 700;
            color: #fff;
            text-align: center;
            line-height: 1.2;
        }

        .lobby-info-card-label {
            font-size: 0.62rem;
            font-weight: 500;
            color: rgba(255,255,255,0.45);
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .lobby-code-small {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(0,0,0,0.2);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 999px;
            padding: 5px 16px;
            align-self: center;
        }

        .lobby-code-small-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: rgba(255,255,255,0.4);
        }

        .lobby-code-small-value {
            font-family: 'Outfit', sans-serif;
            font-size: 1.1rem;
            font-weight: 700;
            letter-spacing: 4px;
            color: rgba(255,255,255,0.85);
        }

        /* legacy kept for guest recap with recapTagsHTML */
        .lobby-recap-inline { display: none; }
        .room-code { display: none; }
        .lobby-code-wrap { display: none; }

        /* Corps du lobby */
        .lobby-body {
            padding: 24px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
        }

        .players-section { margin-bottom: 20px; }

        .players-list { display: flex; flex-direction: column; gap: 7px; }

        .player-row {
            display: flex;
            align-items: center;
            gap: 12px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 11px 14px;
        }

        .player-emoji { font-size: 1.2rem; line-height: 1; }
        .player-name { font-size: 0.88rem; font-weight: 500; flex: 1; color: var(--text); }

        .host-badge {
            font-size: 0.63rem;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 100px;
            background: rgba(232,201,122,0.1);
            border: 1px solid rgba(232,201,122,0.4);
            color: var(--accent);
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .player-rank {
            font-size: 0.75rem; font-weight: 700; color: var(--text);
            flex-shrink: 0; text-align: right; opacity: 0.7;
        }
        .player-rank.top1 { color: #fbbf24; opacity: 1; }
        .player-rank.top3 { color: var(--accent); opacity: 1; }

        .waiting-hint {
            text-align: center;
            font-size: 0.8rem;
            color: var(--muted);
            margin-bottom: 18px;
            font-style: italic;
        }

        .spinner {
            width: 26px;
            height: 26px;
            border: 2px solid var(--border);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 12px;
        }

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

        .guest-waiting { text-align: center; padding: 16px 0 24px; }
        .guest-waiting p { color: var(--muted); font-size: 0.88rem; font-style: italic; }

        /* ── Toast notifications ── */
        .toast {
            position: fixed;
            bottom: calc(28px + env(safe-area-inset-bottom, 0px));
            left: 50%;
            transform: translateX(-50%) translateY(16px);
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 100px;
            padding: 10px 20px;
            font-size: 0.82rem;
            font-weight: 500;
            color: var(--text);
            z-index: 400;
            opacity: 0;
            pointer-events: none;
            white-space: nowrap;
            transition: opacity 0.25s ease, transform 0.3s cubic-bezier(.34,1.56,.64,1);
        }
        .toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        /* ── Nom du jeu dans le hero du salon ── */
        .lobby-game-name {
            font-size: 1.5rem;
            font-weight: 800;
            color: #fff;
            letter-spacing: -0.01em;
        }

        /* ── Animation entrée / sortie joueur ── */
        @keyframes playerJoin {
            0%   { opacity: 0; transform: translateY(-10px) scale(0.95); }
            60%  { transform: translateY(2px) scale(1.02); }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }

        @keyframes playerLeave {
            0%   { opacity: 1; transform: translateY(0) scale(1); max-height: 60px; margin-bottom: 0; }
            60%  { opacity: 0; transform: translateY(6px) scale(0.96); }
            100% { opacity: 0; transform: translateY(8px) scale(0.95); max-height: 0; margin-bottom: -7px; }
        }

        .player-row-new   { animation: playerJoin  0.38s cubic-bezier(.34,1.56,.64,1) both; }
        .player-row-leave { animation: playerLeave 0.32s ease forwards; }

        /* ────────────────────────────────
           ÉCRAN DE JEU
        ──────────────────────────────── */
        #game-screen {
            height: 100dvh;
            flex-direction: column;
            background: var(--bg);
            position: relative;
            overflow: hidden;
        }

        #countdown-overlay {
            position: absolute;
            inset: 0;
            background: var(--bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 100;
        }

        #countdown-overlay.hidden { display: none; }

        .countdown-label {
            color: var(--muted);
            font-size: 0.75rem;
            font-weight: 700;
            margin-bottom: 16px;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }

        .countdown-num {
            font-family: 'Outfit', sans-serif;
            font-size: 9rem;
            font-weight: 800;
            color: var(--accent);
            line-height: 1;
        }

        #loading-overlay {
            position: absolute;
            inset: 0;
            background: var(--bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 100;
            gap: 20px;
        }

        #loading-overlay.hidden { display: none; }

        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 3px solid var(--border);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        .loading-text { color: var(--muted); font-size: 0.88rem; font-weight: 500; }

        #loading-progress-zone {
            display: flex;
            align-items: center;
            gap: 10px;
            opacity: 0;
            transition: opacity 0.5s ease;
        }

        #loading-progress-zone.visible { opacity: 1; }

        .loading-progress-wrap {
            width: 220px;
            background: var(--border);
            border-radius: 99px;
            height: 6px;
            overflow: hidden;
        }

        .loading-progress-bar {
            height: 100%;
            width: 0%;
            background: var(--accent);
            border-radius: 99px;
            transition: width 0.3s ease;
        }

        .loading-percent {
            color: var(--accent);
            font-size: 0.82rem;
            font-weight: 600;
            min-width: 36px;
            text-align: center;
        }

        /* ── Zone question ── */
        #question-zone {
            background: var(--bg-card);
            display: flex;
            flex-direction: column;
            height: 36vh;
            flex-shrink: 0;
            overflow: hidden;
            border-bottom: 1px solid var(--border);
            position: relative;
        }

        #question-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 0;
        }

        .btn-quit {
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--border);
            color: var(--muted);
            font-size: 0.78rem;
            font-family: 'Outfit', sans-serif;
            font-weight: 500;
            cursor: pointer;
            padding: 5px 10px;
            border-radius: 7px;
            transition: all 0.15s;
            width: auto;
            margin: 0;
        }

        .btn-quit:hover { border-color: var(--red); color: var(--red); }

        #game-progress {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--muted);
            letter-spacing: 0.1em;
            text-transform: uppercase;
        }

        #my-score {
            font-size: 0.88rem;
            font-weight: 700;
            color: var(--accent);
        }

        #question-text {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 12px 18px 8px;
            font-family: 'Outfit', sans-serif;
            font-size: clamp(0.95rem, 3vw, 1.25rem);
            font-weight: 500;
            color: var(--text);
            line-height: 1.4;
            overflow: hidden;
        }

        /* ── Image illustration (mobile : thumbnail absolu) ── */
        #question-image-wrap {
            display: none;
            position: absolute;
            bottom: 36px;
            right: 12px;
            z-index: 10;
            animation: fadeSlideUp 0.4s both;
        }
        #question-image {
            width: 80px;
            height: 80px;
            object-fit: cover;
            object-position: center;
            border-radius: 10px;
            border: 1.5px solid rgba(255,255,255,0.15);
            box-shadow: 0 4px 16px rgba(0,0,0,0.4);
            cursor: pointer;
            transition: transform 0.15s;
        }
        #question-image:hover { transform: scale(1.07); }

        #img-lightbox {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 9999;
            background: rgba(0,0,0,0.82);
            align-items: center;
            justify-content: center;
        }
        #img-lightbox.open { display: flex; }
        #img-lightbox img {
            max-width: 92vw;
            max-height: 88dvh;
            border-radius: 14px;
            box-shadow: 0 8px 48px rgba(0,0,0,0.7);
            object-fit: contain;
        }
        #img-lightbox-close {
            position: absolute;
            top: 18px;
            right: 22px;
            background: rgba(255,255,255,0.12);
            border: none;
            color: #fff;
            font-size: 1.6rem;
            line-height: 1;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #img-lightbox-close:hover { background: rgba(255,255,255,0.25); }

        .hist-img {
            width: 72px;
            height: 72px;
            object-fit: cover;
            border-radius: 8px;
            flex-shrink: 0;
            border: 1px solid rgba(255,255,255,0.1);
            cursor: pointer;
        }
        .hist-card-top {
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }
        .hist-card-text { flex: 1; min-width: 0; }

        #timer-wrap {
            padding: 6px 16px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: opacity 0.4s ease;
        }

        #timer-track {
            flex: 1;
            height: 3px;
            background: var(--border);
            border-radius: 2px;
            overflow: hidden;
        }

        #timer-bar {
            height: 100%;
            background: var(--accent);
            border-radius: 2px;
            width: 100%;
            transition: width 0.25s linear;
        }

        #timer-num {
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--muted);
            min-width: 26px;
            text-align: right;
        }

        #next-question-wrap {
            display: none;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px 8px;
            animation: fadeSlideUp 0.3s both;
        }
        #next-question-label {
            font-size: 0.72rem;
            font-weight: 600;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        #next-question-num {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--muted);
        }
        #next-question-wrap .nq-track {
            flex: 1;
            margin: 0 10px;
            height: 3px;
            background: var(--border);
            border-radius: 2px;
            overflow: hidden;
        }
        #next-question-wrap .nq-bar {
            height: 100%;
            background: var(--muted);
            border-radius: 2px;
            width: 100%;
            transition: width 0.15s linear;
            opacity: 0.5;
        }

        /* ── Zone réponses ── */
        #answers-zone {
            flex: 1;
            padding: 8px 10px calc(6px + env(safe-area-inset-bottom, 0px));
            display: flex;
            flex-direction: column;
            gap: 6px;
            overflow: hidden;
            background: var(--bg);
            min-height: 0;
        }

        #answers-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .answer-btn {
            padding: 8px 10px 7px;
            border-radius: 10px;
            border: 1.5px solid var(--border);
            background: var(--bg-card);
            color: var(--text);
            font-size: 0.78rem;
            font-weight: 500;
            font-family: 'Outfit', sans-serif;
            cursor: pointer;
            transition: all 0.15s;
            text-align: left;
            line-height: 1.35;
            display: flex;
            flex-direction: column;
            gap: 3px;
            margin: 0;
            width: 100%;
            min-height: 50px;
        }

        .answer-btn:hover:not(:disabled) {
            border-color: var(--accent);
            background: rgba(232,201,122,0.07);
            transform: translateY(-1px);
        }

        .answer-letter {
            font-size: 0.62rem;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        .answer-btn.chosen       { border-color: var(--accent); background: rgba(232,201,122,0.1); }
        .answer-btn.correct      { border-color: var(--green); background: rgba(76,175,120,0.12); color: var(--green); }
        .answer-btn.correct .answer-letter { color: var(--green); }
        .answer-btn.wrong        { border-color: var(--border); background: var(--bg); opacity: 0.4; }
        .answer-btn.wrong-chosen { border-color: var(--red); background: rgba(224,85,85,0.1); color: var(--red); }
        .answer-btn.wrong-chosen .answer-letter { color: var(--red); }
        .answer-btn:disabled     { cursor: default; transform: none !important; box-shadow: none !important; }
        .answer-btn:focus        { outline: none; }
        .answer-btn              { -webkit-tap-highlight-color: transparent; }

        #result-info {
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex-shrink: 0;
        }

        #score-delta {
            display: none;
            align-self: flex-start;
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            padding: 4px 10px;
            border-radius: 20px;
            animation: fadeSlideUp 0.35s both;
        }

        #score-delta.positive {
            color: var(--green);
            background: rgba(76,175,120,0.15);
            border: 1px solid rgba(76,175,120,0.3);
        }
        #score-delta.zero {
            color: var(--muted);
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--border);
        }

        #mini-scores {
            display: none;
            flex-wrap: wrap;
            gap: 5px 6px;
            overflow-y: auto;
            overflow-x: hidden;
            flex: 1;
            min-height: 0;
            align-content: start;
        }

        #mini-scores::-webkit-scrollbar { width: 3px; }
        #mini-scores::-webkit-scrollbar-track { background: transparent; }
        #mini-scores::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

        #waiting-zone {
            display: none;
            flex-wrap: wrap;
            gap: 5px 6px;
            overflow-y: auto;
            overflow-x: hidden;
            max-height: 30vh;
            border-top: 1px solid var(--border);
            padding-top: 6px;
            animation: fadeSlideUp 0.3s both;
        }

        #waiting-zone::-webkit-scrollbar { width: 3px; }
        #waiting-zone::-webkit-scrollbar-track { background: transparent; }
        #waiting-zone::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

        .waiting-chip {
            display: flex;
            align-items: center;
            gap: 6px;
            background: var(--bg-card);
            border: 1.5px solid var(--border);
            border-radius: 8px;
            padding: 5px 8px 5px 6px;
            min-width: 0;
            width: calc(50% - 3px);
            flex-shrink: 0;
            overflow: hidden;
            box-sizing: border-box;
            opacity: 0.45;
            transition: border-color 0.3s, background 0.3s, opacity 0.3s;
        }

        .waiting-chip.done {
            border-color: rgba(232,201,122,0.5);
            opacity: 1;
        }

        .waiting-chip .chip-avatar { font-size: 1.1rem; flex-shrink: 0; line-height: 1; }

        .waiting-chip .chip-info {
            display: flex;
            flex-direction: column;
            gap: 1px;
            min-width: 0;
            flex: 1;
        }

        .waiting-chip .chip-name {
            font-weight: 600;
            font-size: 0.68rem;
            color: var(--text);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .waiting-chip .chip-status {
            font-size: 0.6rem;
            font-weight: 500;
            color: var(--muted);
        }

        .waiting-chip.done .chip-status { color: var(--accent); }

        #question-explanation {
            display: none;
            font-size: 0.88rem;
            color: var(--text);
            font-style: italic;
            line-height: 1.5;
            flex-shrink: 0;
            animation: fadeSlideUp 0.4s both;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 12px;
            padding: 10px 14px;
        }
        #question-explanation .expl-emoji {
            font-style: normal;
            margin-right: 6px;
        }

        /* ────────────────────────────────
           CLASSEMENT FINAL
        ──────────────────────────────── */
        #leaderboard-screen {
            flex-direction: column;
            min-height: 100dvh;
            background: var(--bg);
        }

        .lb-header {
            background: var(--bg-card);
            padding: calc(28px + env(safe-area-inset-top, 0px)) 20px 24px;
            text-align: center;
        }

        .lb-header-title {
            font-family: 'Outfit', sans-serif;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 4px;
        }

        #leaderboard-screen .lb-tabs {
            display: flex;
            gap: 6px;
            justify-content: center;
            margin-top: 12px;
        }

        #leaderboard-screen .lb-tab {
            padding: 7px 20px;
            border-radius: 20px;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--muted);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.18s;
        }

        #leaderboard-screen .lb-tab.active {
            background: var(--accent);
            border: 1px solid var(--accent);
            color: #1a1208;
        }

        .lb-tab-panel { width: 100%; }

        .lb-list {
            flex: 1;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }

        .lb-row {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 18px;
            border-radius: 14px;
            border: 1px solid var(--border);
            background: var(--bg-card);
            animation: fadeSlideUp 0.35s both;
            position: relative;
            overflow: hidden;
        }

        .lb-row.lb-first {
            border-color: var(--accent);
            background: rgba(232,201,122,0.07);
        }

        .lb-row.lb-first::before {
            content: '';
            position: absolute;
            left: 0; top: 0; bottom: 0;
            width: 3px;
            background: var(--accent);
            border-radius: 3px 0 0 3px;
        }

        .lb-rank   { font-size: 1.3rem; width: 32px; text-align: center; flex-shrink: 0; }
        .lb-avatar { font-size: 1.5rem; flex-shrink: 0; }
        .lb-name   { flex: 1; font-weight: 600; font-size: 0.95rem; color: var(--text); }
        .lb-score  { font-weight: 700; font-size: 1rem; color: var(--accent); white-space: nowrap; }

        .lb-actions {
            padding: 16px 16px calc(36px + env(safe-area-inset-bottom, 0px));
            width: 100%;
        }

        /* ── Historique ── */
        .lb-history {
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            width: 100%;
        }

        .hist-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 16px 18px;
            animation: fadeSlideUp 0.35s both;
        }

        .hist-q {
            font-weight: 700;
            font-size: 0.9rem;
            color: var(--text);
            margin-bottom: 8px;
            display: flex;
            gap: 8px;
            align-items: flex-start;
        }

        .hist-num {
            flex-shrink: 0;
            font-size: 0.72rem;
            font-weight: 700;
            background: var(--border);
            color: var(--muted);
            border-radius: 6px;
            padding: 2px 7px;
            margin-top: 2px;
        }

        .hist-correct {
            font-size: 0.82rem;
            color: #5dbf7a;
            font-weight: 600;
            margin-bottom: 10px;
            padding-left: 2px;
        }

        .hist-players {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .hist-player {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.82rem;
            padding: 5px 8px;
            border-radius: 8px;
            background: var(--bg);
        }

        .hist-pname { flex: 1; color: var(--text); font-weight: 500; }

        .hist-ans {
            font-size: 0.78rem;
            color: var(--muted);
            text-align: right;
            max-width: 160px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .hist-player.correct .hist-ans { color: #5dbf7a; font-weight: 600; }
        .hist-player.wrong   .hist-ans { color: #E0783A; }
        .hist-player.timeout .hist-ans { color: var(--muted); opacity: 0.6; }
        .hist-pts { font-weight: 400; opacity: 0.55; font-size: 0.74rem; margin-left: 2px; }

        .hist-expl {
            margin-top: 10px;
            font-size: 0.84rem;
            color: var(--text);
            font-style: italic;
            line-height: 1.5;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 10px;
            padding: 9px 12px;
        }
        .hist-expl-emoji {
            font-style: normal;
            margin-right: 6px;
        }

        /* ────────────────────────────────
           ANIMATIONS
        ──────────────────────────────── */

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


        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .anim-fade-in { animation: fadeIn 0.4s ease both; }

        @keyframes popIn {
            0%   { transform: scale(0.4); opacity: 0; }
            70%  { transform: scale(1.15); }
            100% { transform: scale(1); opacity: 1; }
        }


        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            20%      { transform: translateX(-5px); }
            40%      { transform: translateX(5px); }
            60%      { transform: translateX(-3px); }
            80%      { transform: translateX(3px); }
        }

        @keyframes correctPulse {
            0%   { transform: scale(1); }
            40%  { transform: scale(1.04); }
            100% { transform: scale(1); }
        }

        @keyframes countdownPop {
            0%   { transform: scale(1.6); opacity: 0; }
            100% { transform: scale(1);   opacity: 1; }
        }

        .anim-fade-up   { animation: fadeSlideUp 0.35s ease both; }
        .anim-pop       { animation: popIn 0.4s cubic-bezier(.34,1.56,.64,1) both; }
        .anim-shake     { animation: shake 0.4s ease both; }
        .anim-correct   { animation: correctPulse 0.4s ease both; }
        .anim-countdown { animation: countdownPop 0.35s ease both; }

        /* ── Réponses joueurs (résultat) ── */

        /* ── Cartes joueurs (résultat question) ── */
        .player-answer-row {
            display: flex;
            align-items: center;
            gap: 6px;
            background: var(--bg-card);
            border: 1.5px solid var(--border);
            border-radius: 8px;
            padding: var(--pa-padding, 5px) 8px var(--pa-padding, 5px) 6px;
            animation: fadeSlideUp 0.3s ease both;
            min-width: 0;
            width: calc(50% - 3px);
            flex-shrink: 0;
            overflow: hidden;
            box-sizing: border-box;
        }

        .player-answer-row.correct { border-color: rgba(76,175,120,0.5); }
        .player-answer-row.wrong   { border-color: rgba(224,85,85,0.35); opacity: 0.7; }
        .player-answer-row.none    { opacity: 0.45; }

        .pa-avatar { font-size: var(--pa-avatar, 1.1rem); flex-shrink: 0; line-height: 1; }

        .pa-info {
            display: flex;
            flex-direction: column;
            gap: 1px;
            min-width: 0;
            flex: 1;
        }

        .pa-name {
            font-weight: 600;
            font-size: var(--pa-name-size, 0.68rem);
            color: var(--text);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .pa-answer {
            font-size: var(--pa-answer-size, 0.6rem);
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--muted);
        }

        .pa-answer.correct { color: var(--green); }
        .pa-answer.wrong   { color: var(--red); }

        .pa-delta {
            font-weight: 700;
            font-size: 0.65rem;
            color: var(--green);
            white-space: nowrap;
            flex-shrink: 0;
        }

        .pa-delta.zero { color: var(--muted); font-weight: 500; }

        /* ══════════════════════════════════════
           RESPONSIVE
        ══════════════════════════════════════ */

        /* ── Tablet (≥ 768px) — grille 2 colonnes pour les jeux ── */
        @media (max-width: 767px) {
            #question-text { font-size: 1.25rem; }
        }

        @media (min-width: 768px) {
            .hub-content     { padding: 32px 28px 0; }
            .options-content { padding: 28px 28px 0; }
            .lobby-body      { padding: 28px 28px 0; }
            .page-header     { padding: 16px 28px; }

            .games-grid {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 14px;
            }
            .game-card { height: 175px; }

            .theme-card { width: 100px; height: 100px; }
        }

        /* ── Desktop (≥ 1024px) — layout fullscreen ── */
        @media (min-width: 1024px) {
            .screen { min-height: auto; }

            /* Header */
            .page-header { height: 64px; padding: 0 48px; border-bottom: 1px solid var(--border); }
            .hub-logo    { font-size: 1.5rem; }

            /* ── Hub — sidebar gauche + grille droite ── */
            #hub-screen { min-height: 100dvh; }
            #hub-screen .hub-content { padding-bottom: env(safe-area-inset-bottom, 0px); }

            .hub-content {
                flex: 1;
                display: grid;
                grid-template-columns: 340px 1fr;
                grid-template-areas:
                    "intro games"
                    "join  games";
                grid-template-rows: auto 1fr;
                padding: 0;
            }

            .hub-intro {
                grid-area: intro;
                padding: 48px 36px 32px;
                margin-bottom: 0;
                border-right: 1px solid var(--border);
            }
            .hub-intro h1 { font-size: 2.4rem; }
            .hub-intro p  { font-size: 0.92rem; margin-top: 8px; }

            .open-rooms-section {
                grid-area: join;
                border-radius: 0;
                border: none;
                border-top: 1px solid var(--border);
                border-right: 1px solid var(--border);
                background: transparent;
                padding: 28px 36px;
                margin-bottom: 0;
            }

            .games-grid {
                grid-area: games;
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 16px;
                padding: 36px 44px;
                align-content: start;
            }
            .game-card { height: 195px; }
            .game-name { font-size: 1.35rem; }

            /* ── Overlay identité ── */
            .identity-content {
                max-width: 520px;
                margin: 0 auto;
                padding: 36px 24px 40px;
            }

            /* ── Quiz options ── */
            #quiz-options-screen { min-height: 100dvh; }
            .opts-left-panel { display: contents; }
            .opts-right-panel { display: none; }
            .opts-mobile-themes { display: block; }
            .opts-hero { height: 200px; }

            .options-content {
                max-width: 720px;
                margin: 0 auto;
                width: 100%;
                padding: 40px 48px 0;
            }

            .theme-card      { width: 110px; height: 110px; }
            .theme-card-wide { width: 140px; height: 110px; }

            .opts-cta {
                max-width: 720px;
                margin: 0 auto;
                width: 100%;
                padding: 24px 48px 40px;
            }
            .opts-cta .btn-primary {
                width: 100%;
            }

            /* ── Lobby ── */
            .lobby-hero-content { padding: 20px 48px 0; }
            .lobby-body {
                max-width: 760px;
                margin: 0 auto;
                width: 100%;
                padding: 40px 0 0;
            }
            #lobby-screen .btn-primary,
            #guest-lobby-screen .btn-primary { margin-bottom: 52px; }

            /* ── Jeu — split question | réponses ── */
            #game-screen {
                flex-direction: row;
                align-items: stretch;
                height: 100dvh;
            }

            #question-zone {
                flex: 1;
                height: unset;
                border-bottom: none;
                border-right: 1px solid var(--border);
                justify-content: center;
            }

            #question-meta { padding: 20px 36px 0; }
            #question-text {
                font-size: 1.9rem;
                padding: 44px 56px 24px;
                max-width: 800px;
                align-self: center;
                width: 100%;
            }
            #timer-wrap { padding: 8px 36px 28px; }

            #question-image-wrap {
                position: static;
                justify-content: center;
                padding: 0 56px 8px;
            }
            #question-image {
                width: 180px;
                height: 180px;
                object-fit: cover;
                object-position: center;
                border-radius: 12px;
            }

            #answers-zone {
                width: 500px;
                flex-shrink: 0;
                padding: 28px 32px 32px;
                gap: 14px;
            }
            .answer-btn { min-height: 84px; font-size: 0.9rem; padding: 16px 14px 14px; }

            /* ── Classement ── */
            .lb-list, .lb-history, .lb-actions {
                max-width: 720px;
                margin-left: auto;
                margin-right: auto;
            }
            .lb-actions { padding: 24px 0 56px; }
        }

        /* ── Large Desktop (≥ 1440px) ── */
        @media (min-width: 1440px) {
            .hub-content { grid-template-columns: 400px 1fr; }
            .hub-intro   { padding: 56px 44px 36px; }
            .open-rooms-section { padding: 32px 44px; }
            .games-grid  {
                grid-template-columns: repeat(3, 1fr);
                padding: 44px 60px;
                gap: 20px;
            }
            .game-card { height: 210px; }

            #question-text { font-size: 2.1rem; }
            #answers-zone  { width: 540px; padding: 32px 40px 36px; }
        }

        /* ── Draw Options Screen ── */
        #draw-options-screen { flex-direction: column; }

        /* ── Draw Canvas Screen ── */
        #draw-canvas-screen {
            flex-direction: column;
            background: var(--bg);
            overflow: hidden;
            height: 100dvh;
        }

        .draw-canvas-area {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px 12px;
            overflow: hidden;
            min-height: 0;
        }

        .draw-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
            background: var(--bg-card);
            border-bottom: 1px solid var(--border);
            gap: 12px;
            flex-shrink: 0;
            z-index: 10;
        }

        .draw-subject-badge {
            flex: 1;
            text-align: center;
            font-size: 0.82rem;
            font-weight: 700;
            color: var(--text);
            font-family: 'Outfit', sans-serif;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .draw-subject-label {
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--muted);
            display: block;
            margin-bottom: 1px;
        }

        .draw-timer {
            font-size: 1rem;
            font-weight: 700;
            font-family: 'Outfit', sans-serif;
            color: var(--accent);
            min-width: 36px;
            text-align: right;
            flex-shrink: 0;
        }

        .draw-timer.urgent { color: #E0783A; }

        #draw-timer-track {
            height: 3px;
            background: var(--border);
            flex-shrink: 0;
        }
        #draw-timer-bar {
            height: 100%;
            background: var(--accent);
            width: 100%;
            transition: width 0.5s linear;
        }

        #draw-reveal-overlay {
            position: absolute;
            inset: 0;
            background: var(--bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 20px;
            z-index: 30;
        }
        #draw-reveal-overlay.hidden { display: none; }

        .draw-reveal-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--muted);
            font-weight: 600;
        }

        .draw-reveal-subject {
            font-size: 2rem;
            font-weight: 800;
            color: var(--text);
            text-align: center;
            padding: 0 28px;
            font-family: 'Outfit', sans-serif;
            line-height: 1.2;
        }

        .draw-reveal-countdown {
            font-size: 5rem;
            font-weight: 800;
            color: var(--accent);
            font-family: 'Outfit', sans-serif;
            line-height: 1;
        }

        #draw-canvas {
            display: block;
            touch-action: none;
            cursor: crosshair;
            background: #ffffff;
            border-radius: 8px;
            box-shadow: 0 2px 20px rgba(0,0,0,0.4);
            /* ratio 3:4 portrait, limité par la hauteur disponible */
            aspect-ratio: 3 / 4;
            max-height: 100%;
            max-width: 100%;
            width: auto;
            height: 100%;
        }

        .draw-tools {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
            background: var(--bg);
            border-top: 1px solid var(--border);
            flex-shrink: 0;
        }

        .draw-tool-row {
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }

        .draw-tool-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .draw-tool-group-inline {
            display: flex;
            gap: 12px;
            justify-content: center;
            align-items: flex-start;
            flex-wrap: wrap;
        }

        .draw-tool-label {
            font-size: 0.65rem;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.07em;
        }

        .draw-colors {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
        }

        .color-swatch {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
            flex-shrink: 0;
            transition: transform 0.12s, border-color 0.12s;
        }

        .color-swatch.active { border-color: #fff; transform: scale(1.2); }

        .draw-size-btns { display: flex; gap: 4px; align-items: center; }

        .draw-size-btn {
            width: 32px; height: 32px;
            border-radius: 8px;
            border: 1.5px solid var(--border);
            background: var(--bg-card);
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: border-color 0.12s;
            flex-shrink: 0;
        }

        .draw-size-btn.active { border-color: var(--accent); }

        .draw-size-dot { background: var(--text); border-radius: 50%; }

        .draw-action-btns { display: flex; gap: 6px; flex-wrap: wrap; }

        .draw-eraser-btn, .draw-clear-btn {
            height: 32px;
            padding: 0 10px;
            border-radius: 8px;
            border: 1.5px solid var(--border);
            background: var(--bg-card);
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            gap: 4px;
            transition: border-color 0.12s;
            font-size: 0.82rem;
            font-weight: 600;
            flex-shrink: 0;
            color: var(--muted);
            white-space: nowrap;
        }

        .draw-undo-btn {
            height: 32px;
            padding: 0 10px;
            border-radius: 8px;
            border: 1.5px solid var(--border);
            background: var(--bg-card);
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            gap: 4px;
            transition: border-color 0.12s;
            font-size: 0.82rem;
            font-weight: 600;
            flex-shrink: 0;
            color: var(--muted);
            white-space: nowrap;
        }
        .draw-undo-btn:hover { border-color: var(--accent); color: var(--accent); }
        .draw-eraser-btn.active { border-color: var(--accent); color: var(--accent); }
        .draw-clear-btn:hover { border-color: #E0783A; color: #E0783A; }

        .draw-submit-overlay {
            position: absolute;
            inset: 0;
            background: var(--bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 16px;
            z-index: 20;
        }

        .draw-submit-msg {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text);
            text-align: center;
        }

        .draw-submit-count {
            font-size: 0.85rem;
            color: var(--muted);
        }

        .draw-header-right {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .draw-validate-btn {
            width: 32px;
            height: 32px;
            padding: 0;
            background: transparent;
            color: var(--green);
            border: 2px solid var(--green);
            border-radius: 50%;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.2s, background 0.15s;
            line-height: 1;
        }
        .draw-validate-btn:active { background: rgba(76,175,120,0.18); }
        .draw-validate-btn:disabled { opacity: 0.35; cursor: default; }

        /* ── Confirm modal ── */
        .draw-confirm-modal {
            position: absolute;
            inset: 0;
            background: rgba(13,13,13,0.75);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 40;
            padding: 24px;
        }
        .draw-confirm-modal.hidden { display: none; }
        .draw-confirm-box {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 18px;
            padding: 24px 20px;
            max-width: 320px;
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .draw-confirm-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
        .draw-confirm-msg { font-size: 0.875rem; color: var(--muted); line-height: 1.5; }
        .draw-confirm-btns { display: flex; gap: 8px; margin-top: 4px; }
        .draw-confirm-cancel {
            flex: 1; padding: 10px; border-radius: 10px;
            border: 1px solid var(--border); background: var(--bg);
            color: var(--text); font-size: 0.9rem; font-weight: 600; cursor: pointer;
        }
        .draw-confirm-ok {
            flex: 1; padding: 10px; border-radius: 10px;
            border: none; background: var(--accent);
            color: var(--bg); font-size: 0.9rem; font-weight: 700; cursor: pointer;
        }

        #draw-transition-overlay {
            position: absolute;
            inset: 0;
            background: var(--bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 14px;
            z-index: 30;
            padding: 24px;
            text-align: center;
        }
        #draw-transition-overlay.hidden { display: none; }

        .draw-transition-icon { font-size: 3.5rem; line-height: 1; }
        .draw-transition-title { font-size: 2rem; font-weight: 800; color: var(--accent); }
        .draw-transition-msg {
            font-size: 0.95rem;
            color: var(--muted);
            max-width: 300px;
            line-height: 1.55;
        }
        .draw-transition-countdown-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            margin-top: 8px;
        }
        .draw-transition-sub { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
        .draw-transition-num { font-size: 4rem; font-weight: 800; color: var(--text); line-height: 1; }

        /* ── Draw Vote Screen ── */
        #draw-vote-screen {
            flex-direction: column;
            background: var(--bg);
            overflow: hidden;
            height: 100dvh;
        }

        .vote-header {
            padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
        }

        .vote-progress { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
        .vote-timer { font-size: 1rem; font-weight: 700; color: var(--accent); }
        .vote-timer.urgent { color: #E0783A; }

        .vote-canvas-wrap {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 8px 16px;
            overflow: hidden;
        }

        .vote-canvas-wrap img {
            max-width: 100%;
            max-height: 100%;
            border-radius: 14px;
            border: 1px solid var(--border);
            background: #fff;
            object-fit: contain;
        }

        .vote-slider-zone {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
            flex-shrink: 0;
        }

        .vote-score-display {
            font-size: 3rem;
            font-weight: 800;
            color: var(--accent);
            line-height: 1;
            min-width: 60px;
            text-align: center;
        }

        .vote-score-label {
            font-size: 0.72rem;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            margin-top: -6px;
        }

        .vote-slider-wrap {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .vote-slider-end { font-size: 0.8rem; color: var(--muted); font-weight: 600; flex-shrink: 0; }

        input[type="range"].vote-slider {
            flex: 1;
            -webkit-appearance: none;
            appearance: none;
            height: 6px;
            border-radius: 3px;
            background: var(--border);
            outline: none;
            cursor: pointer;
        }
        input[type="range"].vote-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 26px; height: 26px;
            border-radius: 50%;
            background: var(--accent);
            cursor: pointer;
            border: 3px solid var(--bg);
            box-shadow: 0 0 0 2px var(--accent);
        }
        input[type="range"].vote-slider::-moz-range-thumb {
            width: 26px; height: 26px;
            border-radius: 50%;
            background: var(--accent);
            cursor: pointer;
            border: 3px solid var(--bg);
        }


        .vote-own-msg {
            text-align: center;
            padding: 16px;
            font-size: 0.9rem;
            color: var(--muted);
            font-style: italic;
            flex-shrink: 0;
        }

        .vote-done-msg {
            text-align: center;
            padding: 8px;
            font-size: 0.82rem;
            color: var(--green);
            flex-shrink: 0;
            font-weight: 600;
        }

        /* ── Draw Results Screen ── */
        #draw-results-screen {
            flex-direction: column;
            min-height: 100dvh;
            background: var(--bg);
        }

        .draw-result-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            border-radius: 14px;
            border: 1px solid var(--border);
            background: var(--bg-card);
            animation: fadeSlideUp 0.35s both;
            position: relative;
            overflow: hidden;
        }

        .draw-result-row.dr-first { border-color: var(--accent); background: rgba(232,201,122,0.07); }
        .draw-result-row.dr-first::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--accent); border-radius:3px 0 0 3px; }

        .dr-rank  { font-size: 1.3rem; width: 32px; text-align: center; flex-shrink: 0; }
        .dr-avatar { font-size: 1.5rem; flex-shrink: 0; }
        .dr-name  { flex: 1; font-weight: 600; font-size: 0.95rem; color: var(--text); }
        .dr-thumb {
            width: 52px; height: 40px;
            border-radius: 6px;
            border: 1px solid var(--border);
            object-fit: contain;
            background: #fff;
            flex-shrink: 0;
        }
        .dr-score { font-weight: 700; font-size: 0.95rem; color: var(--accent); white-space: nowrap; flex-shrink: 0; }

        /* desktop draw — même layout colonne, juste + d'espace */
        @media (min-width: 768px) {
            .draw-canvas-area { padding: 16px 24px; }
            .draw-tools { padding: 10px 24px calc(10px + env(safe-area-inset-bottom, 0px)); align-items: center; }
            .draw-tool-group-inline { justify-content: center; }
            .color-swatch { width: 28px; height: 28px; }
            .vote-canvas-wrap { padding: 16px 40px; }
            .vote-slider-zone { max-width: 480px; margin: 0 auto; }
            #anec-vote-slider-zone { max-width: 560px; width: 100%; align-self: center; margin: 0; }
            #draw-results-screen .lb-list { max-width: 720px; margin: 0 auto; }
        }
        /* ── Reconnect overlay ── */

        /* ── Modale dessin plein écran ── */
        #drawing-modal {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.88);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 200;
            padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
            gap: 12px;
        }
        #drawing-modal.hidden { display: none; }
        #drawing-modal img {
            max-width: 100%;
            max-height: calc(100dvh - 80px);
            border-radius: 12px;
            background: #fff;
            object-fit: contain;
        }
        #drawing-modal-close {
            position: absolute;
            top: calc(16px + env(safe-area-inset-top, 0px));
            right: calc(16px + env(safe-area-inset-right, 0px));
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.08);
            color: #fff;
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #drawing-modal-name {
            font-size: 0.82rem;
            color: rgba(255,255,255,0.6);
            font-weight: 500;
        }
        .dr-thumb { cursor: zoom-in; }

        /* ── Hot Potato ── */
        #hotpotato-options-screen { flex-direction: column; }
        #hotpotato-game-screen    { flex-direction: column; align-items: stretch; height: 100dvh; position: relative; padding: 0; overflow: hidden; }

        .hp-opts-hero-bg { background: linear-gradient(135deg, #1a0a0a 0%, #5c1a00 50%, #8b3000 100%); }

        #hp-countdown-overlay {
            position: absolute; inset: 0; background: var(--bg);
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            z-index: 20;
        }
        #hp-countdown-overlay.hidden { display: none; }

        /* Barre joueurs en haut */
        .hp-players-bar {
            width: 100%;
            padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
            border-bottom: 1px solid var(--border);
            display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; align-content: center;
            background: rgba(0,0,0,0.2);
            flex-shrink: 0;
            max-height: 96px;
            overflow: hidden;
            box-sizing: border-box;
        }
        .hp-player-chip {
            display: flex; align-items: center; gap: 3px;
            background: rgba(255,255,255,0.07);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 20px;
            padding: 3px 8px 3px 5px;
            font-size: 0.8rem; color: var(--text);
            transition: opacity 0.3s;
            white-space: nowrap;
            max-width: 110px;
            overflow: hidden;
        }
        .hp-player-chip .chip-name {
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }
        .hp-player-chip.is-holder {
            background: rgba(255,100,0,0.2);
            border-color: rgba(255,140,0,0.5);
        }
        .hp-player-chip.eliminated {
            opacity: 0.3;
        }
        /* Chips ultra-compacts pour les grandes parties */
        .hp-players-bar.compact .hp-player-chip {
            padding: 2px 6px 2px 4px;
            font-size: 0.7rem;
            gap: 2px;
            max-width: 80px;
        }
        .hp-players-bar.compact .hp-player-chip .chip-emoji {
            font-size: 0.85em;
        }

        /* Zone de jeu */
        .hp-play-zone {
            flex: 1; width: 100%; position: relative;
            display: flex; align-items: center; justify-content: center;
            overflow: hidden;
        }
        .hp-status-text {
            font-size: 0.8rem; color: rgba(255,255,255,0.25);
            text-align: center; padding: 0 24px;
            pointer-events: none;
            user-select: none;
        }
        .hp-status-text strong { color: rgba(255,255,255,0.35); font-weight: 500; }

        /* Patate tappable */
        .hp-tap-potato {
            position: absolute;
            width: 65px; height: 65px;
            border-radius: 50%;
            background: linear-gradient(135deg, #ff5500, #ffaa00);
            box-shadow: 0 0 28px rgba(255,100,0,0.6), 0 4px 16px rgba(0,0,0,0.4);
            border: none; cursor: pointer;
            font-size: 2.2rem; line-height: 1;
            display: flex; align-items: center; justify-content: center;
            animation: hp-pulse 0.7s infinite alternate;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            z-index: 2;
        }
        @keyframes hp-pulse {
            from { transform: scale(1) rotate(-5deg); box-shadow: 0 0 20px rgba(255,100,0,0.5); }
            to   { transform: scale(1.12) rotate(5deg); box-shadow: 0 0 40px rgba(255,160,0,0.8); }
        }

        .hp-explode-overlay {
            position: absolute; inset: 0;
            background: radial-gradient(ellipse at center, rgba(120,30,0,0.97) 0%, rgba(0,0,0,0.97) 100%);
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            padding: 24px 20px;
            gap: 0; z-index: 10; opacity: 0; pointer-events: none;
            transition: opacity 0.4s;
            box-sizing: border-box;
        }
        .hp-explode-overlay.visible { opacity: 1; pointer-events: all; }

        .hp-explode-emoji {
            font-size: clamp(56px, 11vh, 88px); line-height: 1;
            animation: hp-explode-pop 0.4s cubic-bezier(.34,1.56,.64,1) both;
            margin-bottom: clamp(10px, 2vh, 20px);
        }
        @keyframes hp-explode-pop {
            from { transform: scale(0.4); opacity: 0; }
            to   { transform: scale(1);   opacity: 1; }
        }

        .hp-explode-name {
            font-family: 'Outfit', sans-serif;
            font-size: clamp(1.2rem, 3.5vh, 1.6rem); font-weight: 800;
            color: #fff; text-align: center;
            margin-bottom: 4px;
        }
        .hp-explode-label {
            font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
            text-transform: uppercase; color: #ff7733;
            margin-bottom: clamp(14px, 2.5vh, 24px);
        }

        .hp-explode-stats {
            display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
            margin-bottom: clamp(12px, 2vh, 20px);
        }
        .hp-stat-pill {
            font-size: 0.72rem; font-weight: 600;
            padding: 4px 12px; border-radius: 100px;
            background: rgba(255,255,255,0.09);
            border: 1px solid rgba(255,255,255,0.15);
            color: rgba(255,255,255,0.7);
            white-space: nowrap;
        }
        .hp-stat-pill strong { color: #fff; }

        /* Séparateur */
        .hp-explode-divider {
            width: 40px; height: 1px;
            background: rgba(255,255,255,0.12);
            margin-bottom: clamp(10px, 2vh, 18px);
        }

        /* Grille des survivants */
        .hp-survivors-label {
            font-size: 0.65rem; font-weight: 600; letter-spacing: 0.12em;
            text-transform: uppercase; color: rgba(255,255,255,0.3);
            margin-bottom: 10px;
        }
        .hp-survivors-grid {
            display: flex; flex-wrap: wrap; justify-content: center;
            gap: 6px;
            max-width: 340px;
            width: 100%;
        }
        .hp-survivor-chip {
            display: flex; align-items: center; gap: 4px;
            background: rgba(255,255,255,0.07);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 20px;
            padding: 4px 10px 4px 6px;
            font-size: clamp(0.7rem, 1.8vw, 0.82rem);
            color: rgba(255,255,255,0.75);
            max-width: 120px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .hp-survivor-chip span:first-child { font-size: 1em; flex-shrink: 0; }

        .hp-next-countdown {
            margin-top: clamp(14px, 2.5vh, 32px);
            display: flex; flex-direction: column; align-items: center; gap: 8px;
        }
        .hp-next-countdown-label {
            font-size: 0.65rem; font-weight: 600; letter-spacing: 0.12em;
            text-transform: uppercase; color: rgba(255,255,255,0.3);
        }
        .hp-next-countdown-num {
            font-family: 'Outfit', sans-serif;
            font-size: 2rem; font-weight: 800; color: #fff; line-height: 1;
        }
        .hp-next-countdown-bar {
            width: 100px; height: 2px;
            background: rgba(255,255,255,0.1);
            border-radius: 2px; overflow: hidden;
        }
        .hp-next-countdown-fill {
            height: 100%; background: #ff7733; border-radius: 2px;
            width: 100%;
            transition: width 1s linear;
        }

        /* ── Fausses Anecdotes ── */
        #anec-options-screen     { flex-direction: column; }
        #anec-write-screen       { flex-direction: column; min-height: 100dvh; background: var(--bg); }
        #anec-write-screen .anec-compose-wrap,
        #anec-write-screen .anec-submit-area { max-width: 560px; width: 100%; align-self: center; }
        #anec-vote-screen        { flex-direction: column; min-height: 100dvh; background: var(--bg); }
        #anec-results-screen     { flex-direction: column; min-height: 100dvh; background: var(--bg); }
        #anec-transition-screen  { flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; background: var(--bg); gap: 24px; padding: 32px; text-align: center; }

        /* Bloc composition unifié (write screen) */
        .anec-compose-wrap {
            flex: 1;
            padding: 14px 16px 0;
            display: flex;
            flex-direction: column;
        }
        .anec-compose-card {
            display: flex;
            flex-direction: column;
            flex: 1;
            background: var(--bg-card);
            border: 1.5px solid var(--border);
            border-radius: 18px;
            overflow: hidden;
        }
        .anec-compose-prompt {
            padding: 16px 18px 14px;
            font-size: 1.08rem;
            font-weight: 600;
            font-style: italic;
            color: var(--accent);
            line-height: 1.55;
            border-bottom: 1px solid var(--border);
            background: rgba(232,201,122,0.05);
            flex-shrink: 0;
        }
        #anec-textarea.anec-textarea {
            flex: 1;
            min-height: 120px;
            background: transparent;
            border: none;
            border-radius: 0;
            padding: 14px 18px;
        }
        #anec-textarea.anec-textarea:focus { border-color: transparent; outline: none; }

        /* Bloc vote unifié */
        .anec-vote-card {
            display: flex;
            flex-direction: column;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 18px;
            overflow: hidden;
        }
        .anec-vote-card-prompt {
            padding: 14px 18px 12px;
            font-size: 0.98rem;
            font-weight: 600;
            font-style: italic;
            color: var(--accent);
            line-height: 1.5;
            border-bottom: 1px solid var(--border);
            background: rgba(232,201,122,0.05);
        }
        .anec-vote-card-answer {
            padding: 14px 18px;
            font-size: 1.05rem;
            line-height: 1.65;
            color: var(--text);
        }

        .anec-opts-hero-bg { background: linear-gradient(135deg, #0a1a12 0%, #0f3d2a 50%, #1a5c3a 100%); }

        .anec-game-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
            border-bottom: 1px solid var(--border);
            background: var(--bg-card);
            flex-shrink: 0;
        }

        .anec-header-title {
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--text);
            text-align: center;
            flex: 1;
        }

        .anec-header-timer {
            font-weight: 800;
            font-size: 1.1rem;
            color: var(--accent);
            min-width: 36px;
            text-align: right;
        }

        .anec-subject-section {
            padding: 20px 16px 8px;
            flex-shrink: 0;
        }

        .anec-subject-label {
            font-size: 0.72rem;
            font-weight: 600;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 10px;
        }

        .anec-subject-display {
            background: rgba(232,201,122,0.07);
            border: 1px solid rgba(232,201,122,0.25);
            border-radius: 14px;
            padding: 18px 20px;
            font-size: 1.18rem;
            font-weight: 600;
            color: var(--text);
            line-height: 1.55;
            font-style: italic;
        }

        .anec-write-section {
            flex: 1;
            padding: 16px 16px 0;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .anec-textarea {
            width: 100%;
            background: var(--bg-card);
            border: 1.5px solid var(--border);
            border-radius: 14px;
            color: var(--text);
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 400;
            line-height: 1.55;
            padding: 14px 16px;
            resize: none;
            min-height: 110px;
            outline: none;
            transition: border-color 0.18s;
        }
        .anec-textarea:focus { border-color: var(--accent); }
        .anec-textarea::placeholder { color: var(--muted); }
        .anec-textarea:disabled { opacity: 0.5; }

        .anec-submit-area {
            padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px));
            flex-shrink: 0;
        }

        .anec-submitted-overlay {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 14px 16px;
            background: rgba(76,175,120,0.12);
            border: 1px solid rgba(76,175,120,0.3);
            border-radius: 12px;
            color: var(--green);
            font-weight: 600;
            font-size: 0.9rem;
            text-align: center;
        }
        .anec-submitted-overlay.visible { display: flex; }

        .anec-options-list {
            flex: 1;
            padding: 12px 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            overflow-y: auto;
        }

        .anec-option-card {
            background: var(--bg-card);
            border: 1.5px solid var(--border);
            border-radius: 14px;
            padding: 14px 16px;
            cursor: pointer;
            transition: border-color 0.18s, background 0.18s;
            user-select: none;
        }
        .anec-option-card:hover { border-color: rgba(232,201,122,0.4); }
        .anec-option-card.selected {
            border-color: var(--accent);
            background: rgba(232,201,122,0.08);
        }
        .anec-option-card.own {
            border-color: rgba(255,255,255,0.15);
            opacity: 0.6;
            cursor: default;
        }
        .anec-option-card.own:hover { border-color: rgba(255,255,255,0.15); }
        .anec-option-card.correct {
            border-color: var(--green) !important;
            background: rgba(76,175,120,0.1) !important;
        }

        .anec-option-text {
            font-size: 0.9rem;
            font-weight: 400;
            color: var(--text);
            line-height: 1.5;
        }

        .anec-option-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 10px;
            padding-top: 8px;
            border-top: 1px solid var(--border);
        }

        .anec-author-badge {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 0.78rem;
            color: var(--muted);
            font-weight: 500;
        }
        .anec-author-badge .badge-ai {
            background: rgba(232,201,122,0.15);
            border: 1px solid rgba(232,201,122,0.3);
            color: var(--accent);
            border-radius: 6px;
            padding: 2px 7px;
            font-size: 0.72rem;
            font-weight: 700;
        }
        .anec-author-badge .badge-real {
            background: rgba(76,175,120,0.15);
            border: 1px solid rgba(76,175,120,0.3);
            color: var(--green);
            border-radius: 6px;
            padding: 2px 8px;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.04em;
        }

        .anec-voters-list {
            display: flex;
            align-items: center;
            gap: 3px;
            flex-wrap: wrap;
        }
        .anec-voter-avatar {
            font-size: 1rem;
            line-height: 1;
        }
        .anec-vote-count {
            font-size: 0.78rem;
            color: var(--muted);
            font-weight: 500;
            margin-left: 4px;
        }

        .anec-vote-footer {
            padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .anec-voted-msg {
            display: none;
            text-align: center;
            color: var(--green);
            font-size: 0.88rem;
            font-weight: 600;
            padding: 10px;
            background: rgba(76,175,120,0.1);
            border-radius: 10px;
            border: 1px solid rgba(76,175,120,0.25);
        }
        .anec-voted-msg.visible { display: block; }

        .anec-own-tag {
            font-size: 0.72rem;
            color: var(--muted);
            background: rgba(255,255,255,0.06);
            border-radius: 5px;
            padding: 2px 7px;
            margin-left: 4px;
        }

        .anec-loading-msg {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            flex: 1;
            gap: 12px;
            color: var(--muted);
            font-size: 0.9rem;
        }

        /* ── Results screens — Bar Moderne ── */
        #leaderboard-screen,
        #hotpotato-results-screen,
        #draw-results-screen,
        #anec-results-screen { background: #000; }

        #leaderboard-screen .lb-header,
        #hotpotato-results-screen .lb-header,
        #draw-results-screen .lb-header,
        #anec-results-screen .lb-header {
            background: #000;
            border-bottom: 1px solid rgba(255,255,255,0.07);
            padding: calc(28px + env(safe-area-inset-top,0px)) 20px 28px;
        }

        #leaderboard-screen .lb-header-title,
        #hotpotato-results-screen .lb-header-title,
        #draw-results-screen .lb-header-title,
        #anec-results-screen .lb-header-title {
            font-size: 1.9rem;
            font-weight: 800;
            color: #fff;
            letter-spacing: -0.03em;
            text-transform: none;
            margin-bottom: 0;
        }

        #leaderboard-screen .lb-tabs,
        #hotpotato-results-screen .lb-tabs,
        #draw-results-screen .lb-tabs,
        #anec-results-screen .lb-tabs {
            justify-content: center;
            gap: 6px;
            margin-top: 14px;
            padding: 2px 0 3px;
            overflow: visible;
        }

        #leaderboard-screen .lb-tab,
        #hotpotato-results-screen .lb-tab,
        #draw-results-screen .lb-tab,
        #anec-results-screen .lb-tab {
            border: 1.5px solid rgba(255,255,255,0.12);
            border-radius: 50px;
            background: rgba(255,255,255,0.04);
            color: rgba(255,255,255,0.45);
        }

        #leaderboard-screen .lb-tab.active,
        #hotpotato-results-screen .lb-tab.active,
        #draw-results-screen .lb-tab.active,
        #anec-results-screen .lb-tab.active {
            background: rgba(232,201,122,0.1);
            border: 1px solid var(--accent);
        }

        #leaderboard-screen .lb-row,
        #hotpotato-results-screen .lb-row,
        #draw-results-screen .lb-row,
        #anec-results-screen .lb-row {
            border-color: rgba(255,255,255,0.08);
            border-radius: 12px;
        }

        #leaderboard-screen .lb-actions,
        #hotpotato-results-screen .lb-actions,
        #draw-results-screen .lb-actions,
        #anec-results-screen .lb-actions { background: #000; }

        /* ── Global leaderboard — Bar Moderne ── */
        #lb-global-screen { background: #000; }

        #lb-global-screen .lb-global-hero {
            background: #000;
        }
        #lb-global-screen .lb-global-hero-deco { opacity: 0.2; }
        #lb-global-screen .lb-global-title {
            font-size: 1.9rem;
            font-weight: 800;
            letter-spacing: -0.03em;
        }
        #lb-global-screen .lb-global-sub {
            color: var(--accent);
            font-weight: 700;
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            opacity: 1;
        }
        #lb-global-screen .lb-tab {
            border: 1.5px solid rgba(255,255,255,0.12);
            border-radius: 50px;
            background: rgba(255,255,255,0.04);
            color: rgba(255,255,255,0.45);
            padding: 8px 18px;
        }
        #lb-global-screen .lb-tab.active {
            background: rgba(232,201,122,0.1);
            border-color: var(--accent);
            color: var(--accent);
        }
        #lb-global-screen .lb-row-global {
            border-color: rgba(255,255,255,0.08);
            border-radius: 12px;
        }

    /* ── Memory Flip ── */
    .mem-opts-hero-bg { background: linear-gradient(135deg, #0a1a2a 0%, #0f3d5c 50%, #1a6080 100%); }

    #memory-options-screen { background: #000; min-height: 100dvh; padding-bottom: 0; flex-direction: column; }

    #memory-options-screen .opts-hero {
        height: auto;
        background: #000;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    #memory-options-screen .opts-hero-bg { display: none; }
    #memory-options-screen .opts-hero-content {
        padding: calc(18px + env(safe-area-inset-top,0px)) 20px 20px;
        gap: 0;
    }
    #memory-options-screen .opts-hero-text {
        flex-direction: column;
        gap: 2px;
        margin-top: 14px;
        width: 100%;
        align-items: center;
        text-align: center;
    }
    #memory-options-screen .opts-hero-title {
        font-size: 1.9rem;
        font-weight: 800;
        letter-spacing: -0.03em;
    }
    #memory-options-screen .opts-hero-sub {
        color: var(--accent);
        font-weight: 700;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        opacity: 1;
    }

    #memory-options-screen .options-content { flex: 1; padding: 24px 0 0; }

    #memory-options-screen .settings-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 14px;
        padding: 0 16px;
        margin-bottom: 26px;
        align-items: stretch;
    }
    #memory-options-screen .setting-block { display: flex; flex-direction: column; }
    #memory-options-screen .setting-block .field-label { display: block; margin-bottom: 8px; }

    #memory-options-screen .seg-control { flex-direction: column; gap: 5px; }
    #memory-options-screen .seg-btn {
        flex-direction: row;
        justify-content: flex-start;
        padding: 9px 12px;
        border-radius: 10px;
        gap: 8px;
    }
    #memory-options-screen .seg-val { font-size: 1.05rem; }
    #memory-options-screen .seg-hint { font-size: 0.6rem; }

    #memory-options-screen .diff-control { gap: 5px; }
    #memory-options-screen .diff-btn {
        padding: 9px 12px;
        border-radius: 10px;
        gap: 8px;
        font-size: 0.85rem;
    }
    #memory-options-screen .diff-dot {
        width: 8px; height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
        opacity: 0.6;
    }
    #memory-options-screen .diff-btn.selected .diff-dot { opacity: 1; }
    #memory-options-screen .opts-cta { background: #000; }
    #memory-options-screen .visibility-toggle {
        background: none;
        border: none;
        padding: 0;
        gap: 6px;
        justify-content: flex-start;
    }
    #memory-options-screen .vis-btn {
        flex: 0 0 auto;
        border: 1.5px solid rgba(255,255,255,0.12);
        border-radius: 50px;
        padding: 8px 18px;
        font-size: 0.82rem;
        background: rgba(255,255,255,0.04);
        color: rgba(255,255,255,0.45);
    }
    #memory-options-screen .vis-btn.active {
        background: rgba(232,201,122,0.1);
        border-color: var(--accent);
        color: var(--accent);
    }

    .mem-info-btn { cursor: default; }

    /* Solo mode scores header */
    .mem-solo-scores-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 16px;
        flex-shrink: 0;
        overflow-x: auto;
        background: rgba(0,0,0,0.2);
        border-bottom: 1px solid var(--border);
        scrollbar-width: none;
    }
    .mem-solo-scores-row::-webkit-scrollbar { display: none; }
    .mem-solo-score-chip {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 12px;
        border-radius: 10px;
        border: 1.5px solid var(--border);
        background: var(--bg-card);
        min-width: 52px;
        flex-shrink: 0;
        transition: border-color 0.2s, background 0.2s;
    }
    .mem-solo-score-chip.active {
        border-color: var(--accent);
        background: rgba(232,201,122,0.1);
    }
    .mem-solo-chip-avatar { font-size: 1.4rem; line-height: 1; }
    .mem-solo-chip-score  { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
    .mem-solo-score-chip.active .mem-solo-chip-score { color: var(--accent); }

    /* Memory Lobby — même DA que lobby-screen */
    #memory-lobby-screen {
        background: #000;
        min-height: 100dvh;
        flex-direction: column;
    }
    #memory-options-screen { flex-direction: column; }

    #memory-lobby-screen .lobby-hero-bg { display: none; }

    #memory-lobby-screen .lobby-hero {
        background: #000;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    #memory-lobby-screen .lobby-hero-deco { opacity: 0.2; filter: blur(2px); }

    #memory-lobby-screen .lobby-game-name {
        font-size: 1.9rem;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

    #memory-lobby-screen .lobby-info-card {
        background: rgba(255,255,255,0.05);
        border: 1.5px solid rgba(255,255,255,0.1);
        border-radius: 10px;
    }

    #memory-lobby-screen .lobby-code-small {
        background: rgba(232,201,122,0.06);
        border-color: rgba(232,201,122,0.25);
    }

    #memory-lobby-screen .lobby-code-small-value {
        color: var(--accent);
        letter-spacing: 6px;
    }

    #memory-lobby-screen .player-row {
        border-color: rgba(255,255,255,0.08);
        border-radius: 12px;
    }

    #memory-lobby-screen .lobby-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-bottom: 0;
    }

    #memory-lobby-screen #mem-lobby-solo-view {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    #memory-lobby-screen #mem-lobby-solo-view .players-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        margin-bottom: 0;
    }

    #memory-lobby-screen #mem-lobby-solo-view .field-label {
        flex-shrink: 0;
        display: block;
        margin-bottom: 12px;
    }

    #memory-lobby-screen #mem-lobby-solo-view .players-list {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        scrollbar-width: none;
        padding-bottom: 8px;
    }
    #memory-lobby-screen #mem-lobby-solo-view .players-list::-webkit-scrollbar { display: none; }

    #memory-lobby-screen #mem-lobby-host-area {
        margin-top: auto;
        flex-shrink: 0;
        padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .mem-teams-row { display: flex; align-items: stretch; gap: 10px; }

    .mem-team-panel {
        flex: 1;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 16px 12px 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        position: relative;
        overflow: hidden;
    }

    .mem-team-panel::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 3px;
        border-radius: 16px 16px 0 0;
    }
    .mem-team-panel-a::before { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
    .mem-team-panel-b::before { background: linear-gradient(90deg, transparent, #64B4FF, transparent); }

    .mem-team-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        width: 100%;
    }

    .mem-team-badge {
        width: 34px; height: 34px;
        border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        font-size: 0.9rem; font-weight: 800;
    }
    .mem-badge-a { background: rgba(232,201,122,0.12); color: var(--accent); }
    .mem-badge-b { background: rgba(100,180,255,0.12); color: #64B4FF; }

    .mem-team-name {
        font-size: 0.7rem; font-weight: 700;
        color: rgba(255,255,255,0.4);
        text-transform: uppercase; letter-spacing: 0.1em;
    }

    .mem-team-count {
        font-size: 0.65rem; font-weight: 700;
        background: rgba(255,255,255,0.07);
        color: rgba(255,255,255,0.45);
        border-radius: 20px;
        padding: 2px 8px;
        min-width: 20px; text-align: center;
    }

    .mem-team-divider {
        width: 100%; height: 1px;
        background: var(--border);
        flex-shrink: 0;
    }

    .mem-team-players { width: 100%; display: flex; flex-direction: column; gap: 5px; flex: 1; }

    .mem-team-empty {
        font-size: 0.78rem; color: var(--muted);
        text-align: center; padding: 10px 0;
        width: 100%;
    }

    .mem-join-btn {
        width: 100%; padding: 9px 0;
        border-radius: 10px;
        border: 1.5px solid;
        background: transparent;
        font-family: 'Outfit', sans-serif; font-size: 0.78rem; font-weight: 700;
        cursor: pointer;
        text-transform: uppercase; letter-spacing: 0.07em;
        transition: background 0.15s;
        flex-shrink: 0;
    }
    .mem-join-a { border-color: rgba(232,201,122,0.3); color: var(--accent); }
    .mem-join-a:hover, .mem-join-a:active { background: rgba(232,201,122,0.08); }
    .mem-join-b { border-color: rgba(100,180,255,0.3); color: #64B4FF; }
    .mem-join-b:hover, .mem-join-b:active { background: rgba(100,180,255,0.08); }

    .mem-vs {
        font-size: 0.7rem; font-weight: 800; color: var(--muted);
        flex-shrink: 0; letter-spacing: 0.1em;
        align-self: center;
    }

    /* Memory Game — layout mobile-first */
    #memory-game-screen {
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
        position: relative;
    }
    .mem-game-header {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        padding: calc(var(--sat) + 10px) 12px 10px;
        background: rgba(255,255,255,0.02);
        border-bottom: 1px solid var(--border);
        gap: 8px;
    }
    .mem-team-side {
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 8px 14px;
        border-radius: 12px;
        border: 1px solid transparent;
        transition: background 0.25s, border-color 0.25s;
    }
    .mem-team-side.mem-side-active {
        background: rgba(232,201,122,0.08);
        border-color: rgba(232,201,122,0.35);
    }
    #mem-score-b.mem-side-active {
        background: rgba(100,180,255,0.08);
        border-color: rgba(100,180,255,0.35);
    }
    #mem-score-b { flex-direction: row-reverse; }
    .mem-side-score-val { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; }
    .mem-side-unit { font-size: 0.62rem; color: var(--muted); }

    /* File d'attente */
    .mem-queue-row {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 7px 12px;
        border-bottom: 1px solid var(--border);
    }
    .mem-q-chip {
        display: flex;
        align-items: center;
        gap: 6px;
        border-radius: 99px;
        transition: opacity 0.25s;
        white-space: nowrap;
        flex-shrink: 0;
        /* chips latéraux : juste l'avatar */
        padding: 4px 6px;
        background: transparent;
        border: 1px solid transparent;
    }
    .mem-q-chip.mem-q-now {
        padding: 6px 14px;
        background: rgba(232,201,122,0.12);
        border: 1px solid rgba(232,201,122,0.4);
    }
    .mem-q-chip.mem-q-past { }
    .mem-q-chip.mem-q-next { }
    .mem-q-avatar { font-size: 1.15rem; line-height: 1; }
    .mem-q-chip.mem-q-now .mem-q-avatar { font-size: 1.1rem; }
    .mem-q-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }
    .mem-q-sep { color: var(--border); font-size: 0.65rem; flex-shrink: 0; margin: 0 1px; }
    .mem-q-sep-fwd { color: var(--muted); }
    .mem-score-bump { animation: scoreBump 0.35s ease; }
    @keyframes scoreBump { 0%{transform:scale(1)} 50%{transform:scale(1.4)} 100%{transform:scale(1)} }

    .mem-turn-center { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
    .mem-turn-badge {
        width: 32px; height: 32px;
        border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        font-size: 1rem; font-weight: 800;
        background: rgba(232,201,122,0.15);
        color: var(--accent);
        transition: background 0.2s;
    }
    .mem-turn-badge-b { background: rgba(100,180,255,0.15); color: #64B4FF; }
    .mem-turn-label { font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

    .mem-timer-row { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px; }
    .mem-timer-bar { flex: 1; height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
    .mem-timer-fill { height: 100%; width: 100%; background: var(--accent); border-radius: 99px; }
    .mem-timer-count { font-size: 0.8rem; font-weight: 700; color: var(--accent); min-width: 18px; text-align: right; }

    /* Memory Board — remplit l'espace restant */
    .memory-board {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(5, 1fr);
        gap: clamp(4px, 1.5vw, 10px);
        padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
        box-sizing: border-box;
        width: 100%;
    }
    .memory-board.size-5x6 {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        align-content: start;
    }
    .memory-board.size-5x6 .memory-card {
        aspect-ratio: 1;
    }
    .memory-board.size-5x6 .memory-card-inner,
    .memory-board.size-5x6 .memory-card-back,
    .memory-board.size-5x6 .memory-card-front {
        position: absolute;
        inset: 0;
    }
    .memory-card {
        perspective: 600px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        min-height: 0;
    }
    .memory-card-inner {
        position: relative;
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;
        transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    }
    .memory-card.flipped .memory-card-inner { transform: rotateY(180deg); }
    .memory-card.flipped .memory-card-back,
    .memory-card.matched .memory-card-back { visibility: hidden; }
    .memory-card-back, .memory-card-front {
        position: absolute;
        inset: 0;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        border-radius: clamp(8px, 2vw, 12px);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: clamp(1.4rem, 6vw, 2.2rem);
    }
    .memory-card-back {
        background: rgba(255,255,255,0.05);
        border: 1px solid var(--border);
    }
    .mem-card-back-icon { opacity: 0.35; color: rgba(255,255,255,0.7); }
    .mem-debug-hint {
        position: absolute;
        bottom: 4px;
        right: 5px;
        font-size: clamp(0.6rem, 2vw, 0.8rem);
        line-height: 1;
        opacity: 0.75;
        z-index: 2;
        pointer-events: none;
    }
    .memory-card-front {
        background: rgba(255,255,255,0.07);
        border: 1px solid rgba(255,255,255,0.1);
        transform: rotateY(180deg);
    }
    .memory-card.matched .memory-card-front {
        background: rgba(76,175,120,0.18);
        border-color: rgba(76,175,120,0.5);
    }
    .memory-card.mem-shake { animation: memShake 0.35s ease; }
    @keyframes memShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

    #memory-results-screen { flex-direction: column; }
    #memory-results-screen .lb-row {
        border-color: rgba(255,255,255,0.08);
        border-radius: 12px;
    }
    #memory-results-screen .lb-row.lb-first {
        border-color: var(--accent);
        background: rgba(232,201,122,0.07);
    }

    /* ═══════════════════════════════════════
       LES BÂTONS (NIM)
       ═══════════════════════════════════════ */

    .nim-opts-hero-bg {
        background: linear-gradient(135deg, #1a0800 0%, #4a1500 50%, #6b2800 100%);
    }

    #nim-options-screen {
        background: #000;
        min-height: 100dvh;
        padding-bottom: 0;
        flex-direction: column;
    }

    #nim-options-screen .options-content { flex: 1; }

    #nim-options-screen .opts-hero {
        height: auto;
        background: #000;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    #nim-options-screen .opts-hero-bg { display: none; }

    #nim-options-screen .opts-hero-content {
        padding: calc(18px + env(safe-area-inset-top,0px)) 20px 20px;
        gap: 0;
    }

    #nim-options-screen .opts-hero-text {
        flex-direction: column;
        gap: 2px;
        margin-top: 14px;
        width: 100%;
        align-items: center;
        text-align: center;
    }

    #nim-options-screen .opts-hero-text > span { font-size: 2rem; line-height: 1; }

    #nim-options-screen .opts-hero-title {
        font-size: 1.9rem;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

    #nim-options-screen .opts-hero-sub {
        color: var(--accent);
        font-weight: 700;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        opacity: 1;
    }

    #nim-options-screen .opts-cta { background: #000; }

    #nim-options-screen .visibility-toggle {
        background: none; border: none; padding: 0; gap: 6px; justify-content: flex-start;
    }

    #nim-options-screen .vis-btn {
        flex: 0 0 auto;
        border: 1.5px solid rgba(255,255,255,0.12);
        border-radius: 50px;
        padding: 8px 18px;
        font-size: 0.82rem;
        background: rgba(255,255,255,0.04);
        color: rgba(255,255,255,0.45);
    }

    #nim-options-screen .vis-btn.active {
        background: rgba(232,201,122,0.1);
        border-color: var(--accent);
        color: var(--accent);
    }

    #nim-options-screen .diff-btn {
        cursor: default;
    }

    /* Game screen layout */
    #nim-game-screen {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        position: relative;
        overflow: hidden;
        height: 100dvh;
        max-height: 100dvh;
    }

    /* Countdown overlay */
    #nim-countdown-overlay {
        position: absolute;
        inset: 0;
        z-index: 50;
        background: rgba(0,0,0,0.85);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: clamp(12px, 3vw, 20px);
    }
    #nim-countdown-overlay.hidden { display: none; }
    #nim-countdown-label {
        font-size: clamp(1rem, 4vw, 1.4rem);
        color: rgba(255,255,255,0.7);
        letter-spacing: 0.05em;
        text-transform: uppercase;
        font-weight: 600;
    }
    #nim-countdown-num {
        font-size: clamp(5rem, 22vw, 9rem);
        font-weight: 800;
        color: #fff;
        line-height: 1;
    }

    /* Header */
    .nim-game-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: clamp(10px, 3vw, 16px) clamp(12px, 4vw, 20px);
        border-bottom: 1px solid rgba(255,255,255,0.07);
        flex-shrink: 0;
    }
    .nim-header-title {
        font-size: clamp(1rem, 4vw, 1.3rem);
        font-weight: 700;
        color: #fff;
        letter-spacing: 0.03em;
    }
    .nim-round-badge {
        font-size: clamp(0.7rem, 3vw, 0.9rem);
        font-weight: 600;
        color: rgba(255,255,255,0.55);
        background: rgba(255,255,255,0.07);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 20px;
        padding: 3px 10px;
    }

    /* Timer bar */
    .nim-timer-row {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px;
        flex-shrink: 0;
    }
    .nim-timer-track {
        flex: 1;
        height: 3px;
        background: rgba(255,255,255,0.07);
        overflow: hidden;
        border-radius: 2px;
    }
    .nim-timer-num {
        font-size: 0.75rem;
        font-weight: 700;
        color: #c05a20;
        width: 14px;
        text-align: right;
        flex-shrink: 0;
    }
    .nim-timer-bar {
        height: 100%;
        width: 100%;
        background: #c05a20;
        transform-origin: left;
        transform: scaleX(0);
    }
    .nim-timer-bar.nim-timer-running {
        animation: nimTimerDrain var(--nim-timer-duration, 5s) linear forwards;
    }
    @keyframes nimTimerDrain {
        from { transform: scaleX(1); }
        to   { transform: scaleX(0); }
    }

    /* Players bar */
    .nim-players-bar {
        display: flex;
        flex-wrap: wrap;
        gap: clamp(6px, 2vw, 10px);
        padding: clamp(8px, 2.5vw, 14px) clamp(12px, 4vw, 20px);
        border-bottom: 1px solid rgba(255,255,255,0.07);
        flex-shrink: 0;
    }
    .nim-player-chip {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 4px 10px 4px 6px;
        border-radius: 20px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.1);
        font-size: clamp(0.72rem, 2.8vw, 0.88rem);
        color: rgba(255,255,255,0.65);
        transition: all 0.25s ease;
    }
    .nim-player-chip .chip-avatar {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
        line-height: 1;
    }
    .nim-player-chip.nim-current {
        background: rgba(107, 40, 0, 0.45);
        border-color: #c05a20;
        color: #fff;
        box-shadow: 0 0 10px rgba(192,90,32,0.35);
    }
    .nim-player-chip.nim-eliminated {
        opacity: 0.32;
        text-decoration: line-through;
        filter: grayscale(0.7);
    }
    .nim-queue-arrow {
        color: rgba(255,255,255,0.25);
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
        flex-shrink: 0;
        align-self: center;
    }
    .nim-queue-sep {
        width: 1px;
        height: 20px;
        background: rgba(255,255,255,0.1);
        flex-shrink: 0;
        align-self: center;
        margin: 0 4px;
    }

    /* Sticks zone */
    .nim-sticks-zone {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: clamp(10px, 3vw, 20px) clamp(12px, 4vw, 20px) calc(clamp(90px, 22vw, 130px));
        gap: clamp(10px, 2.5vw, 16px);
        min-height: 0;
        text-align: center;
    }
    .nim-sticks-pile {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        justify-content: center;
        gap: clamp(4px, 1.5vw, 7px);
        min-height: clamp(70px, 20vw, 110px);
    }
    .nim-stick {
        width: clamp(7px, 2vw, 11px);
        height: clamp(60px, 18vw, 100px);
        background: linear-gradient(180deg, #d4803a 0%, #8b4513 60%, #5c2a08 100%);
        border-radius: 3px 3px 2px 2px;
        box-shadow: inset -2px 0 3px rgba(0,0,0,0.3), 1px 2px 4px rgba(0,0,0,0.4);
        transform-origin: bottom center;
        animation: nimStickEnter 0.25s ease-out both;
    }
    .nim-stick:nth-child(odd)  { transform: rotate(-2deg); }
    .nim-stick:nth-child(even) { transform: rotate(2deg);  }
    .nim-stick:nth-child(3n)   { transform: rotate(-1deg) translateY(-3px); }
    @keyframes nimStickEnter {
        from { transform: scaleY(0) rotate(0deg); opacity: 0; }
        to   { transform: scaleY(1); opacity: 1; }
    }
    .nim-stick-remove {
        animation: nimStickExit 0.3s ease-in forwards !important;
    }
    @keyframes nimStickExit {
        0%   { transform: scaleY(1) translateY(0); opacity: 1; }
        60%  { transform: scaleY(1.1) translateY(-8px); opacity: 0.6; }
        100% { transform: scaleY(0) translateY(20px); opacity: 0; }
    }
    .nim-sticks-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }
    .nim-sticks-num {
        font-size: clamp(2rem, 9vw, 3.5rem);
        font-weight: 800;
        color: #fff;
        line-height: 1;
    }
    .nim-sticks-label {
        font-size: clamp(0.72rem, 2.8vw, 0.88rem);
        color: rgba(255,255,255,0.45);
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .nim-spectator-label {
        font-size: clamp(0.72rem, 2.8vw, 0.85rem);
        color: rgba(255,255,255,0.3);
        letter-spacing: 0.05em;
        margin-top: 4px;
    }

    /* Turn info */
    .nim-turn-info {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: clamp(8px, 2.5vw, 12px) clamp(14px, 4vw, 22px);
        border-radius: 14px;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        min-width: clamp(160px, 50vw, 260px);
        justify-content: center;
    }
    .nim-turn-info.nim-turn-me {
        background: rgba(107, 40, 0, 0.35);
        border-color: #c05a20;
        box-shadow: 0 0 16px rgba(192,90,32,0.25);
    }
    .nim-turn-avatar {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
        line-height: 1;
    }
    .nim-turn-text {
        font-size: clamp(0.82rem, 3.2vw, 1rem);
        font-weight: 600;
        color: rgba(255,255,255,0.85);
    }
    .nim-turn-info.nim-turn-me .nim-turn-text {
        color: #fff;
    }

    /* Action buttons */
    .nim-actions {
        position: absolute;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        display: flex;
        gap: clamp(8px, 2.5vw, 14px);
        padding: 0 clamp(20px, 6vw, 40px);
        justify-content: center;
        z-index: 10;
    }
    .nim-take-btn {
        flex: 1;
        max-width: clamp(80px, 22vw, 120px);
        aspect-ratio: 1;
        border-radius: 16px;
        border: 2px solid rgba(255,255,255,0.15);
        background: rgba(255,255,255,0.07);
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        cursor: pointer;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .nim-take-btn:active:not(:disabled) {
        transform: scale(0.93);
        background: rgba(192, 90, 32, 0.45);
        border-color: #c05a20;
    }
    .nim-take-btn:disabled {
        opacity: 0.25;
        cursor: not-allowed;
    }
    .nim-take-num {
        font-size: clamp(1.6rem, 7vw, 2.4rem);
        font-weight: 800;
        line-height: 1;
    }
    .nim-take-label {
        font-size: clamp(0.6rem, 2.3vw, 0.75rem);
        color: rgba(255,255,255,0.55);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    /* Took toast */
    .nim-took-toast {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 14px 6px 8px;
        border-radius: 99px;
        background: rgba(255,255,255,0.07);
        border: 1px solid rgba(255,255,255,0.1);
        pointer-events: none;
        opacity: 0;
        font-size: clamp(0.78rem, 3vw, 0.9rem);
        color: rgba(255,255,255,0.75);
        white-space: nowrap;
    }
    .nim-took-toast.hidden { display: none; }
    .nim-took-toast.nim-took-in {
        display: flex;
        animation: nimToastIn 0.25s ease-out forwards;
    }
    .nim-took-toast.nim-took-out {
        animation: nimToastOut 0.3s ease-in forwards;
    }
    @keyframes nimToastIn {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes nimToastOut {
        from { opacity: 1; transform: translateY(0); }
        to   { opacity: 0; transform: translateY(-4px); }
    }
    .nim-took-avatar { font-size: 1.1rem; line-height: 1; }
    .nim-took-name   { font-weight: 600; color: #fff; }
    .nim-took-count  { color: #c05a20; font-weight: 700; }

    /* Elimination overlay */
    .nim-elim-overlay {
        position: absolute;
        inset: 0;
        z-index: 40;
        background: rgba(0,0,0,0.88);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: clamp(6px, 2vw, 12px);
        pointer-events: none;
    }
    .nim-elim-overlay.hidden { display: none; }
    .nim-elim-emoji {
        font-size: clamp(3rem, 14vw, 5.5rem);
        animation: nimElimPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
    }
    .nim-elim-name {
        font-size: clamp(1.4rem, 6vw, 2.2rem);
        font-weight: 800;
        color: #fff;
        animation: nimElimFade 0.35s 0.1s ease both;
    }
    .nim-elim-label {
        font-size: clamp(0.8rem, 3.2vw, 1rem);
        color: rgba(255,255,255,0.6);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        animation: nimElimFade 0.35s 0.2s ease both;
    }
    .nim-elim-sub {
        font-size: clamp(0.72rem, 2.8vw, 0.88rem);
        color: rgba(255,255,255,0.38);
        animation: nimElimFade 0.35s 0.3s ease both;
    }
    @keyframes nimElimPop {
        from { transform: scale(0.3); opacity: 0; }
        to   { transform: scale(1); opacity: 1; }
    }
    @keyframes nimElimFade {
        from { transform: translateY(8px); opacity: 0; }
        to   { transform: translateY(0); opacity: 1; }
    }

    /* Results screen */
    #nim-results-screen { flex-direction: column; }
    #nim-results-screen .lb-row {
        border-color: rgba(255,255,255,0.08);
        border-radius: 12px;
    }
    #nim-results-screen .lb-row.lb-first {
        border-color: var(--accent);
        background: rgba(232,201,122,0.07);
    }
