:root {
            --bg-dark: #0a0a0f;
            --surface: #13141f;
            --surface-light: #1c1d2e;
            --neon-blue: #00f0ff;
            --neon-purple: #b026ff;
            --neon-red: #ff0055;
            --text-main: #e2e8f0;
            --text-muted: #828ba2;
        }

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

        html {
            height: 100%;
        }

        body {
            background-color: var(--bg-dark);
            color: var(--text-main);
            font-family: 'Outfit', sans-serif;
            height: 100vh;
            height: 100dvh;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        header {
            background-color: var(--surface);
            border-bottom: 2px solid var(--neon-purple);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 0 20px rgba(176, 38, 255, 0.2);
            z-index: 10;
            flex-shrink: 0;
        }

        .brand {
            display: flex;
            flex-direction: column;
        }

        .brand h1 {
            font-size: 1.8rem;
            font-weight: 700;
            background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .brand span {
            font-family: 'Fira Code', monospace;
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .badges {
            display: flex;
            gap: 15px;
            align-items: center;
        }

        .badge-url {
            font-family: 'Fira Code', monospace;
            color: var(--neon-blue);
            font-size: 0.9rem;
        }

        .badge-ai {
            background: linear-gradient(45deg, #ff0055, #b026ff);
            color: white;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 700;
            letter-spacing: 1px;
            box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
            animation: pulse 2s infinite;
        }

        .online-header-badge {
            display: flex;
            align-items: center;
            gap: 7px;
            white-space: nowrap;
        }

        @keyframes pulse {
            0% { box-shadow: 0 0 10px rgba(255, 0, 85, 0.4); }
            50% { box-shadow: 0 0 20px rgba(176, 38, 255, 0.8); }
            100% { box-shadow: 0 0 10px rgba(255, 0, 85, 0.4); }
        }

        .main-container {
            display: flex;
            flex: 1;
            min-height: 0;
            height: auto;
            overflow: hidden;
        }

        aside {
            width: 270px;
            background-color: var(--surface);
            border-right: 1px solid rgba(255,255,255,0.05);
            padding: 1.5rem 1.2rem;
            display: flex;
            flex-direction: column;
            gap: 10px;
            overflow-y: auto;
            flex-shrink: 0;
            min-height: 0;
            padding-bottom: calc(1.5rem + 18px);
        }

        aside::-webkit-scrollbar { width: 6px; }
        aside::-webkit-scrollbar-thumb {
            background: rgba(0, 240, 255, 0.3);
            border-radius: 10px;
        }

        .aside-right {
            width: 290px;
            background-color: var(--surface);
            border-left: 1px solid rgba(255,255,255,0.05);
            padding: 1.5rem 1.2rem;
            display: flex;
            flex-direction: column;
            gap: 12px;
            overflow-y: auto;
            flex-shrink: 0;
            min-height: 0;
            padding-bottom: calc(1.5rem + 18px);
        }

        .aside-right::-webkit-scrollbar { width: 6px; }
        .aside-right::-webkit-scrollbar-thumb {
            background: rgba(176, 38, 255, 0.3);
            border-radius: 10px;
        }

        aside > *:last-child,
        .aside-right > *:last-child {
            margin-bottom: 18px;
        }

        .sidebar-title {
            font-family: 'Fira Code', monospace;
            font-size: 0.9rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 5px;
            margin-top: 10px;
        }

        .game-btn {
            background: var(--surface-light);
            border: 1px solid rgba(0, 240, 255, 0.2);
            color: var(--text-main);
            padding: 12px 15px;
            border-radius: 8px;
            font-family: 'Outfit', sans-serif;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            text-align: left;
            transition: all 0.3s ease;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .game-btn:hover, .game-btn.active {
            background: rgba(0, 240, 255, 0.1);
            border-color: var(--neon-blue);
            box-shadow: inset 4px 0 0 var(--neon-blue), 0 0 15px rgba(0, 240, 255, 0.2);
            transform: translateX(5px);
        }
        
        .action-btn {
            background: rgba(176, 38, 255, 0.1);
            border-color: var(--neon-purple);
        }
        .action-btn:hover {
            background: rgba(176, 38, 255, 0.2);
            box-shadow: inset 4px 0 0 var(--neon-purple), 0 0 15px rgba(176, 38, 255, 0.3);
        }
        
        .reset-btn {
            background: rgba(255, 0, 85, 0.05);
            border-color: rgba(255, 0, 85, 0.3);
        }
        .reset-btn:hover {
            background: rgba(255, 0, 85, 0.15);
            border-color: var(--neon-red);
            box-shadow: inset 4px 0 0 var(--neon-red), 0 0 15px rgba(255, 0, 85, 0.3);
        }

        .score-board {
            background: transparent;
            padding: 4px 0;
            font-family: 'Fira Code', monospace;
            font-size: 0.85rem;
        }
        .score-header-row {
            display: grid;
            grid-template-columns: 1fr 48px 48px;
            gap: 0 6px;
            margin-bottom: 6px;
            padding-bottom: 6px;
            border-bottom: 1px solid rgba(0,240,255,0.15);
        }
        .score-header-row span:nth-child(2) {
            color: var(--neon-blue);
            font-size: 0.72rem;
            text-align: right;
            font-weight: 700;
        }
        .score-header-row span:nth-child(3) {
            color: var(--neon-purple);
            font-size: 0.72rem;
            text-align: right;
            font-weight: 700;
        }
        .score-row {
            display: grid;
            grid-template-columns: 1fr 48px 48px;
            gap: 0 6px;
            margin-bottom: 7px;
            color: var(--text-main);
            align-items: center;
        }
        .score-row:last-child { margin-bottom: 0; }
        .score-row span:nth-child(1) {
            color: var(--text-muted);
            font-size: 0.78rem;
            line-height: 1.3;
        }
        .score-row span:nth-child(2) {
            color: var(--neon-blue);
            font-weight: 700;
            text-align: right;
            text-shadow: 0 0 5px rgba(0, 240, 255, 0.4);
        }
        .score-row span:nth-child(3) {
            color: var(--neon-purple);
            font-weight: 700;
            text-align: right;
            text-shadow: 0 0 5px rgba(176, 38, 255, 0.4);
        }

        .record-wall-title {
            margin-top: 14px;
            color: var(--neon-blue);
        }

        .record-wall {
            max-height: 240px;
            overflow-y: auto;
            padding: 8px;
            border: 1px solid rgba(0, 240, 255, 0.18);
            border-radius: 8px;
            background:
                linear-gradient(180deg, rgba(0, 240, 255, 0.06), rgba(176, 38, 255, 0.06)),
                rgba(10, 10, 15, 0.42);
            box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.05), 0 0 18px rgba(176, 38, 255, 0.08);
            scrollbar-width: thin;
            scrollbar-color: rgba(0, 240, 255, 0.45) rgba(255, 255, 255, 0.05);
        }

        .record-wall::-webkit-scrollbar { width: 6px; }
        .record-wall::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.04);
            border-radius: 999px;
        }
        .record-wall::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, var(--neon-blue), var(--neon-purple));
            border-radius: 999px;
        }

        .record-wall-row {
            padding: 9px 10px;
            margin-bottom: 8px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            background: rgba(19, 20, 31, 0.86);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
        }
        .record-wall-row:last-child { margin-bottom: 0; }

        .record-wall-top,
        .record-wall-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .record-wall-top strong {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--text-main);
            font-size: 0.92rem;
        }

        .record-wall-top span {
            flex-shrink: 0;
            color: var(--neon-blue);
            font-family: 'Fira Code', monospace;
            font-size: 0.86rem;
            font-weight: 700;
            text-shadow: 0 0 8px rgba(0, 240, 255, 0.45);
        }

        .record-wall-meta {
            margin-top: 5px;
            color: var(--text-muted);
            font-family: 'Fira Code', monospace;
            font-size: 0.68rem;
            line-height: 1.25;
        }

        .record-wall-meta span:first-child {
            color: var(--neon-purple);
        }

        .record-wall-empty {
            padding: 18px 10px;
            color: var(--text-muted);
            font-family: 'Fira Code', monospace;
            font-size: 0.76rem;
            line-height: 1.45;
            text-align: center;
        }

        .record-modal {
            position: fixed;
            inset: 0;
            z-index: 1000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(5, 6, 12, 0.72);
            backdrop-filter: blur(8px);
        }

        .record-modal.show {
            display: flex;
        }

        .record-modal-card {
            width: min(420px, 100%);
            padding: 24px;
            border: 1px solid rgba(0, 240, 255, 0.35);
            border-radius: 8px;
            position: relative;
            background:
                linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(176, 38, 255, 0.12)),
                var(--surface);
            box-shadow: 0 0 36px rgba(0, 240, 255, 0.18), 0 22px 70px rgba(0, 0, 0, 0.48);
        }

        .record-reject-btn {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 38px;
            height: 38px;
            border: 2px solid #000;
            border-radius: 50%;
            background: #ff1744;
            color: #000;
            font-family: 'Fira Code', monospace;
            font-size: 1.45rem;
            font-weight: 900;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 0 18px rgba(255, 0, 85, 0.45);
        }

        .record-reject-btn:hover {
            transform: translateY(-1px);
            background: #ff335f;
        }

        .record-modal-kicker {
            color: var(--neon-blue);
            font-family: 'Fira Code', monospace;
            font-size: 0.78rem;
            letter-spacing: 1.5px;
            text-transform: uppercase;
        }

        .record-modal-card h2 {
            margin-top: 8px;
            font-size: 1.7rem;
            letter-spacing: 0;
            color: var(--text-main);
        }

        .record-modal-card p {
            display: flex;
            justify-content: space-between;
            gap: 14px;
            margin: 14px 0 18px;
            color: var(--text-muted);
            font-family: 'Fira Code', monospace;
            font-size: 0.9rem;
        }

        .record-modal-card p strong {
            color: var(--neon-purple);
            text-shadow: 0 0 8px rgba(176, 38, 255, 0.55);
        }

        .record-modal-card input {
            width: 100%;
            min-height: 46px;
            padding: 0 14px;
            border: 1px solid rgba(0, 240, 255, 0.28);
            border-radius: 8px;
            outline: none;
            background: rgba(10, 10, 15, 0.78);
            color: var(--text-main);
            font-family: 'Outfit', sans-serif;
            font-size: 1rem;
        }

        .record-modal-card input:focus {
            border-color: var(--neon-blue);
            box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12);
        }

        .record-modal-actions {
            display: grid;
            grid-template-columns: 1fr 1.35fr;
            gap: 10px;
            margin-top: 14px;
        }

        .record-modal-actions button {
            min-height: 44px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            color: var(--text-main);
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 700;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.06);
            transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .record-modal-actions button[type="submit"] {
            border-color: rgba(0, 240, 255, 0.42);
            background: linear-gradient(135deg, rgba(0, 240, 255, 0.16), rgba(176, 38, 255, 0.18));
        }

        .record-modal-actions button:hover {
            transform: translateY(-1px);
            border-color: var(--neon-blue);
            box-shadow: 0 0 16px rgba(0, 240, 255, 0.18);
        }

        .mobile-record-panel {
            display: none;
        }

        .mobile-panel-title {
            font-family: 'Fira Code', monospace;
            font-size: 0.72rem;
            color: var(--neon-blue);
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        main {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            padding: 0.5rem 2rem 2rem;
            position: relative;
            background: radial-gradient(circle at center, var(--surface-light) 0%, var(--bg-dark) 100%);
        }

        #fullscreenContainer {
            width: 100% !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            text-align: center !important;
        }

        #fullscreenBtn {
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            margin-left: auto !important;
            margin-right: auto !important;
        }

        .canvas-container {
            position: relative;
            padding: 10px;
            background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
            border-radius: 12px;
            box-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
            transition: all 0.3s ease;
        }

        canvas {
            background-color: var(--bg-dark);
            border-radius: 8px;
            display: block;
            max-width: 100%;
        }

        .canvas-container:fullscreen {
            display: flex;
            justify-content: center;
            align-items: center;
            background: var(--bg-dark);
            padding: 0;
            border-radius: 0;
            width: 100vw;
            height: 100vh;
        }
        .canvas-container:fullscreen canvas {
            height: 100vh;
            width: auto;
            aspect-ratio: 8/5;
            border-radius: 0;
        }

        .instructions {
            margin-top: 20px;
            font-family: 'Fira Code', monospace;
            color: var(--text-muted);
            text-align: center;
            font-size: 0.9rem;
            background: rgba(0,0,0,0.5);
            padding: 10px 20px;
            border-radius: 20px;
        }

        /* ===== GAME SCREEN (zone fullscreen) ===== */
        #gameScreen {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
        }

        #exitFsBtn {
            display: none; /* caché hors fullscreen */
        }

        /* ── Fullscreen desktop : canvas immersif, sans manette tactile ──
           Fonctionne via fs-active (classe JS) + :fullscreen (natif desktop) */
        #gameScreen:fullscreen,
        #gameScreen:-webkit-full-screen,
        #gameScreen.fs-active {
            position: fixed !important;
            inset: 0 !important;
            display: flex !important;
            flex-direction: column !important;
            background: var(--bg-dark);
            width: 100% !important;
            height: 100% !important;
            z-index: 9000;
            padding: 0;
            overflow: hidden;
            align-items: stretch !important;
            justify-content: center !important;
        }

        /* Bouton ✕ : overlay discret */
        #gameScreen:fullscreen #exitFsBtn,
        #gameScreen:-webkit-full-screen #exitFsBtn,
        #gameScreen.fs-active #exitFsBtn {
            display: flex !important;
            position: absolute;
            top: 12px;
            right: 14px;
            z-index: 80;
            background: rgba(255,0,85,0.18);
            border: 1px solid rgba(255,0,85,0.4);
            color: var(--text-main);
            padding: 6px 12px;
            border-radius: 8px;
            font-family: 'Fira Code', monospace;
            font-size: 0.78rem;
            cursor: pointer;
        }

        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active #exitFsBtn,
            #gameScreen:fullscreen #exitFsBtn,
            #gameScreen:-webkit-full-screen #exitFsBtn {
                top: max(10px, env(safe-area-inset-top)) !important;
                left: 30vw !important;
                right: auto !important;
                transform: translateX(-50%) !important;
            }
        }

        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active #exitFsBtn,
            #gameScreen:fullscreen #exitFsBtn,
            #gameScreen:-webkit-full-screen #exitFsBtn {
                top: max(10px, env(safe-area-inset-top)) !important;
                left: 50% !important;
                right: auto !important;
                transform: translateX(-50%) !important;
            }
        }

        /* Zone jeu : toute la surface disponible */
        #gameScreen:fullscreen .canvas-container,
        #gameScreen:-webkit-full-screen .canvas-container,
        #gameScreen.fs-active .canvas-container {
            flex: 1 1 auto !important;
            min-height: 0 !important;
            width: 100% !important;
            height: 100% !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple), var(--neon-red)) !important;
            border: none !important;
            padding: 10px !important;
            border-radius: 0 !important;
            box-shadow:
                inset 0 0 0 2px rgba(255,255,255,0.08),
                inset 0 0 38px rgba(0,240,255,0.28),
                0 0 48px rgba(176,38,255,0.45) !important;
            overflow: hidden !important;
        }

        /* Canvas : remplit au mieux la zone en préservant le ratio 8:5 */
        #gameScreen:fullscreen canvas,
        #gameScreen:-webkit-full-screen canvas,
        #gameScreen.fs-active canvas {
            max-width: 100% !important;
            max-height: 100% !important;
            width: 100% !important;
            height: 100% !important;
            aspect-ratio: 8 / 5 !important;
            border-radius: 0;
            object-fit: contain;
        }

        /* Instructions masquées */
        #gameScreen:fullscreen .instructions,
        #gameScreen:-webkit-full-screen .instructions,
        #gameScreen.fs-active .instructions { display: none !important; }

        /* Desktop : pas de manette tactile en plein écran */
        #gameScreen:fullscreen #touchControls,
        #gameScreen:-webkit-full-screen #touchControls,
        #gameScreen.fs-active #touchControls {
            display: none !important;
        }

        /* ===== TOUCH CONTROLS ===== */
        #touchControls {
            display: none;
            flex-direction: column;
            width: 100%;
            max-width: 800px;
            padding: 6px 14px 10px;
            gap: 0;
            background: rgba(10,10,15,0.6);
            border-top: 1px solid rgba(255,255,255,0.06);
        }
        /* Barre du haut : label jeu + pause */
        .tc-topbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
        }
        .tc-game-hint {
            font-family: 'Fira Code', monospace;
            font-size: 0.72rem;
            color: var(--text-muted);
            letter-spacing: 1px;
        }
        /* Bouton générique */
        .tc-btn {
            background: rgba(0,240,255,0.08);
            border: 2px solid rgba(0,240,255,0.3);
            color: var(--text-main);
            border-radius: 12px;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
            touch-action: none;
            -webkit-tap-highlight-color: transparent;
            user-select: none; -webkit-user-select: none;
            transition: background 0.07s, box-shadow 0.07s;
            font-size: 1.3rem;
        }
        .tc-btn.pressed, .tc-btn:active {
            background: rgba(0,240,255,0.32);
            border-color: var(--neon-blue);
            box-shadow: 0 0 14px rgba(0,240,255,0.55);
        }
        /* D-pad : 4 gros boutons larges type pill */
        .tc-cross {
            display: grid;
            grid-template-areas:
                "up   up"
                "left right"
                "down down";
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            flex: 1;
            max-width: 270px;
        }
        .tc-cross .tc-up    { grid-area: up;    height: 80px; border-radius: 40px; font-size: 2rem; }
        .tc-cross .tc-down  { grid-area: down;  height: 80px; border-radius: 40px; font-size: 2rem; }
        .tc-cross .tc-left  { grid-area: left;  height: 80px; border-radius: 40px; font-size: 2rem; }
        .tc-cross .tc-right { grid-area: right; height: 80px; border-radius: 40px; font-size: 2rem; }
        .tc-cross-mid { display: none; }
        /* Bouton action (circle) */
        .tc-action-btn {
            width: 92px; height: 92px;
            border-radius: 50%;
            font-size: 2rem;
            background: rgba(176,38,255,0.18);
            border: 2px solid rgba(176,38,255,0.6);
            box-shadow: 0 0 16px rgba(176,38,255,0.28);
        }
        .tc-action-btn.pressed, .tc-action-btn:active {
            background: rgba(176,38,255,0.55);
            box-shadow: 0 0 30px rgba(176,38,255,0.85);
        }
        /* Bouton feu (rouge) */
        .tc-fire-btn {
            width: 92px; height: 92px;
            border-radius: 50%;
            font-size: 2rem;
            background: rgba(255,0,85,0.15);
            border: 2px solid rgba(255,0,85,0.55);
            box-shadow: 0 0 16px rgba(255,0,85,0.28);
        }
        .tc-fire-btn.pressed, .tc-fire-btn:active {
            background: rgba(255,0,85,0.55);
            box-shadow: 0 0 30px rgba(255,0,85,0.85);
        }
        /* Bouton pause */
        .tc-pause-btn {
            width: 50px; height: 50px;
            border-radius: 50%;
            font-size: 1.15rem;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.22);
        }
        .tc-menu-top-btn {
            width: 50px; height: 50px;
            margin-left: auto;
            margin-right: 8px;
            border-radius: 16px;
            font-size: 1rem;
            font-family: 'Fira Code', monospace;
            font-weight: 700;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.22);
            pointer-events: auto;
        }
        /* Layout D-pad + action */
        .tc-layout { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
        /* Layout G/D (BrickSmash) */
        .tc-lr-layout { display: flex; gap: 14px; align-items: center; }
        .tc-big-btn {
            flex: 1; height: 88px;
            border-radius: 44px; font-size: 2.4rem;
        }
        .tc-galaga-layout {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(96px, 1.15fr);
            align-items: stretch;
            gap: 8px;
            width: 100%;
        }
        .tc-galaga-side {
            display: contents;
        }
        .tc-galaga-move,
        .tc-galaga-fire {
            width: 100%;
            min-height: 72px;
            border-radius: 24px;
            font-weight: 700;
        }
        .tc-galaga-move {
            font-size: 2rem;
        }
        #tc-galaga-left,
        #tc-galaga-right {
            font-size: 0;
        }
        #tc-galaga-left::before,
        #tc-galaga-right::before {
            font-size: 2rem;
            line-height: 1;
        }
        #tc-galaga-left::before {
            content: "\2190";
        }
        #tc-galaga-right::before {
            content: "\2192";
        }
        #tc-galaga-fire-left {
            display: none;
        }
        .tc-galaga-fire {
            width: 100%;
            font-size: 1rem;
            font-family: 'Fira Code', monospace;
            letter-spacing: 1px;
            background: rgba(255,0,85,0.16);
            border-color: rgba(255,0,85,0.58);
            box-shadow: 0 0 16px rgba(255,0,85,0.28);
        }
        .tc-galaga-fire.pressed,
        .tc-galaga-fire:active {
            background: rgba(255,0,85,0.55);
            box-shadow: 0 0 30px rgba(255,0,85,0.85);
        }
        /* Layout UD (Pong) */
        .tc-ud-layout { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
        .tc-big-ud { height: 76px; width: 100%; border-radius: 38px; font-size: 2.2rem; }
        /* Layout Pong dédié */
        .tc-pong-layout {
            display: flex;
            align-items: stretch;
            justify-content: center;
            gap: 10px;
            width: 100%;
        }
        .tc-pong-move,
        .tc-pong-ok {
            min-height: 74px;
            border-radius: 22px;
            flex: 1;
            flex-direction: column;
            gap: 3px;
            font-size: 1.8rem;
            font-weight: 700;
        }
        .tc-pong-ok {
            flex: 0 0 86px;
            background: rgba(176,38,255,0.18);
            border-color: rgba(176,38,255,0.55);
        }
        .tc-pong-move span,
        .tc-pong-ok span {
            font-family: 'Fira Code', monospace;
            font-size: 0.62rem;
            letter-spacing: 1px;
            color: var(--text-muted);
        }
        .tc-pong-play-layout {
            display: grid;
            grid-template-columns: 1fr 78px 1fr;
            gap: 10px;
            width: 100%;
            align-items: stretch;
        }
        .tc-pong-play-btn,
        .tc-pong-menu-btn {
            min-height: 82px;
            border-radius: 24px;
            flex-direction: column;
            gap: 4px;
            font-size: 2rem;
            font-weight: 700;
        }
        .tc-pong-menu-btn {
            background: rgba(255,255,255,0.08);
            border-color: rgba(255,255,255,0.24);
            font-size: 1.35rem;
        }
        .tc-pong-play-btn span,
        .tc-pong-menu-btn span {
            font-family: 'Fira Code', monospace;
            font-size: 0.62rem;
            letter-spacing: 1px;
            color: var(--text-muted);
        }
        /* Féminin ou Masculin — boutons F et M */
        .tc-genre-layout { display: flex; gap: 16px; width: 100%; padding: 0 8px; }
        .tc-genre-btn {
            flex: 1; height: 88px; border-radius: 18px;
            font-family: 'Outfit', sans-serif; font-weight: 700;
            font-size: 1.6rem; letter-spacing: 2px;
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        }
        .tc-genre-btn span { font-size: 0.65rem; font-weight: 500; letter-spacing: 1px; opacity: 0.85; }
        .tc-genre-f { background: rgba(255,105,180,0.12); border: 2.5px solid #ff69b4; color: #ff69b4; box-shadow: 0 0 14px rgba(255,105,180,0.25); }
        .tc-genre-f.pressed, .tc-genre-f:active { background: rgba(255,105,180,0.4); box-shadow: 0 0 28px rgba(255,105,180,0.8); }
        .tc-genre-m { background: rgba(0,170,255,0.12); border: 2.5px solid #00aaff; color: #00aaff; box-shadow: 0 0 14px rgba(0,170,255,0.25); }
        .tc-genre-m.pressed, .tc-genre-m:active { background: rgba(0,170,255,0.4); box-shadow: 0 0 28px rgba(0,170,255,0.8); }

        /* Bouton tap (Flappy, Runner) */
        .tc-tap-btn {
            flex: 1; height: 92px;
            border-radius: 46px;
            font-size: 1.45rem;
            font-family: 'Outfit', sans-serif; font-weight: 700; letter-spacing: 2px;
            background: linear-gradient(135deg, rgba(176,38,255,0.2), rgba(0,240,255,0.15));
            border: 2px solid var(--neon-purple);
            color: var(--text-main);
            box-shadow: 0 0 18px rgba(176,38,255,0.25);
            animation: tap-pulse 1.5s infinite;
        }
        .tc-tap-btn.pressed, .tc-tap-btn:active {
            background: rgba(176,38,255,0.5);
            box-shadow: 0 0 34px rgba(176,38,255,0.88);
            animation: none;
        }
        @keyframes tap-pulse {
            0%,100% { box-shadow: 0 0 18px rgba(176,38,255,0.25); }
            50%      { box-shadow: 0 0 34px rgba(0,240,255,0.48); border-color: var(--neon-blue); }
        }
        /* Groupe action (right side) */
        .tc-right-group { display: flex; flex-direction: column; align-items: center; gap: 14px; }

        /* ===== BARRE JOUEURS EN LIGNE ===== */
        .online-bar {
            height: 28px;
            background: rgba(0,0,0,0.4);
            border-top: 1px solid rgba(0,240,255,0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-family: 'Fira Code', monospace;
            font-size: 0.78rem;
            color: var(--text-muted);
            flex-shrink: 0;
        }
        .online-dot {
            width: 8px; height: 8px;
            border-radius: 50%;
            background: #00ff88;
            box-shadow: 0 0 6px #00ff88;
            animation: dot-pulse 2s ease-in-out infinite;
            flex-shrink: 0;
        }
        @keyframes dot-pulse {
            0%, 100% { opacity: 1; box-shadow: 0 0 6px #00ff88; }
            50%       { opacity: 0.5; box-shadow: 0 0 14px #00ff88; }
        }
        .online-count {
            color: #00ff88;
            font-weight: 700;
        }

        /* === MOBILE === */
        @media (max-width: 768px) {
            body { overflow-y: hidden; }
            header { padding: 0.5rem 1rem; }
            .brand h1 { font-size: 1.1rem; letter-spacing: 1px; }
            .brand span { display: none; }
            .badge-url { display: none; }
            .badge-ai { font-size: 0.7rem; padding: 4px 8px; }

            .main-container {
                flex-direction: column;
                flex: 1;
                min-height: 0;
                height: auto;
            }

            aside {
                width: 100%;
                flex-direction: row;
                flex-wrap: nowrap;
                overflow-x: auto;
                overflow-y: hidden;
                padding: 0.5rem 0.75rem;
                gap: 6px;
                border-right: none;
                border-bottom: 1px solid rgba(255,255,255,0.07);
                height: auto;
            }
            aside::-webkit-scrollbar { height: 3px; width: 0; }
            .aside-end-spacer { flex-shrink: 0; width: 1rem; display: block; }

            .sidebar-title, .reset-btn { display: none; }
            .aside-right { display: none; }

            .online-bar {
                position: fixed;
                top: calc(56px + env(safe-area-inset-top));
                right: 8px;
                z-index: 80;
                height: auto;
                max-width: 150px;
                padding: 5px 8px;
                border: 1px solid rgba(0,255,136,0.28);
                border-radius: 999px;
                background: rgba(10,10,15,0.82);
                backdrop-filter: blur(8px);
                font-size: 0.62rem;
                gap: 5px;
                pointer-events: none;
            }

            .online-dot {
                width: 6px;
                height: 6px;
            }

            .game-btn {
                min-width: max-content;
                white-space: nowrap;
                padding: 7px 13px;
                font-size: 0.8rem;
                border-radius: 20px;
                flex-shrink: 0;
            }
            .game-btn:hover, .game-btn.active { transform: none; }

            main {
                padding: 0.4rem 0.4rem 0;
                justify-content: flex-start;
                gap: 0;
                min-height: 0;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
            }

            .canvas-container { padding: 4px; border-radius: 8px; }
            canvas { width: 100% !important; height: auto !important; border-radius: 5px; }

            .instructions { margin-top: 4px; font-size: 0.68rem; padding: 5px 12px; }

            #touchControls { display: flex; }

            .mobile-record-panel {
                display: flex;
                position: relative;
                z-index: 0;
                flex: 0 0 auto;
                flex-direction: column;
                gap: 8px;
                width: 100%;
                margin: 12px 0 0;
                padding: 10px;
                border: 1px solid rgba(0, 240, 255, 0.16);
                border-radius: 8px;
                background: rgba(19, 20, 31, 0.78);
                box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.04);
            }

            .mobile-score-board {
                font-size: 0.72rem;
                max-height: 132px;
                overflow-y: auto;
                padding-right: 4px;
            }

            .mobile-record-wall {
                max-height: 132px;
            }

            .mobile-record-wall .record-wall-row {
                padding: 8px;
                margin-bottom: 6px;
            }

            .mobile-record-wall .record-wall-top strong {
                font-size: 0.86rem;
            }

            .mobile-record-wall .record-wall-meta {
                font-size: 0.62rem;
            }

            body.game-fullscreen-active .mobile-record-panel {
                display: none !important;
            }

            #gameScreen.fs-active,
            #gameScreen:fullscreen,
            #gameScreen:-webkit-full-screen {
                justify-content: flex-start !important;
            }

            #gameScreen.fs-active .canvas-container,
            #gameScreen:fullscreen .canvas-container,
            #gameScreen:-webkit-full-screen .canvas-container {
                flex: 0 0 60% !important;
                height: auto !important;
            }

            #gameScreen.fs-active canvas,
            #gameScreen:fullscreen canvas,
            #gameScreen:-webkit-full-screen canvas {
                width: auto !important;
                height: auto !important;
                border-radius: 6px;
            }

            #gameScreen.fs-active #touchControls,
            #gameScreen:fullscreen #touchControls,
            #gameScreen:-webkit-full-screen #touchControls {
                display: flex !important;
                flex: 0 0 40% !important;
                min-height: 0 !important;
                width: 100% !important;
                box-sizing: border-box !important;
                background: rgba(10, 10, 15, 0.96) !important;
                border-top: 1px solid rgba(0,240,255,0.15) !important;
                align-items: center !important;
                justify-content: center !important;
                overflow: hidden !important;
            }
        }

        body:has(#gameScreen.fs-active) .online-bar,
        body:has(#gameScreen:fullscreen) .online-bar {
            display: none !important;
        }

        body.game-fullscreen-active .online-bar {
            display: none !important;
        }

        /* === MOBILE PAYSAGE (landscape) === */
        @media (max-width: 900px) and (orientation: landscape) {
            body {
                height: 100vh;
                height: 100dvh;
                overflow: hidden;
            }
            header { height: 36px; padding: 0.2rem 0.8rem; }
            .brand span, .badge-url { display: none; }
            .brand h1 { font-size: 0.9rem; letter-spacing: 0.5px; }
            .badge-ai { font-size: 0.62rem; padding: 3px 7px; }
            .main-container {
                display: grid;
                grid-template-columns: minmax(152px, 22vw) minmax(0, 1fr) minmax(152px, 23vw);
                flex: 1;
                height: auto;
                min-height: 0;
                overflow: hidden;
            }
            .instructions { display: none; }
            .mobile-record-panel { display: none !important; }
            #fullscreenContainer { margin-bottom: 2px !important; }
            #fullscreenBtn { padding: 3px 12px !important; font-size: 0.75rem !important; }
            .online-bar { display: none; }
            #touchControls { padding: 2px 8px 4px; }

            #gameScreen.fs-active,
            #gameScreen:fullscreen,
            #gameScreen:-webkit-full-screen {
                justify-content: flex-start !important;
            }

            #gameScreen.fs-active .canvas-container,
            #gameScreen:fullscreen .canvas-container,
            #gameScreen:-webkit-full-screen .canvas-container {
                flex: 0 0 60% !important;
                height: auto !important;
            }

            #gameScreen.fs-active canvas,
            #gameScreen:fullscreen canvas,
            #gameScreen:-webkit-full-screen canvas {
                width: auto !important;
                height: auto !important;
                border-radius: 6px;
            }

            #gameScreen.fs-active #touchControls,
            #gameScreen:fullscreen #touchControls,
            #gameScreen:-webkit-full-screen #touchControls {
                display: flex !important;
                flex: 0 0 40% !important;
                min-height: 0 !important;
                width: 100% !important;
                box-sizing: border-box !important;
                background: rgba(10, 10, 15, 0.96) !important;
                border-top: 1px solid rgba(0,240,255,0.15) !important;
                align-items: center !important;
                justify-content: center !important;
                overflow: hidden !important;
            }

            .tc-topbar { margin-bottom: 3px; }
            .tc-cross .tc-up, .tc-cross .tc-down,
            .tc-cross .tc-left, .tc-cross .tc-right { height: 52px; font-size: 1.5rem; border-radius: 26px; }
            .tc-action-btn, .tc-fire-btn { width: 66px; height: 66px; font-size: 1.6rem; }
            .tc-big-btn { height: 56px; font-size: 1.9rem; }
            .tc-big-ud  { height: 48px; font-size: 1.8rem; }
            .tc-tap-btn { height: 56px; font-size: 1.2rem; }
            .tc-pvp-btn { height: 54px !important; font-size: 1.5rem; }
            .tc-pause-btn { width: 38px; height: 38px; font-size: 0.95rem; }

            /* Colonnes latérales mobiles : scroll complet jusqu'au dernier élément */
            aside:not(.aside-right),
            .aside-right {
                display: flex !important;
                width: auto;
                height: 100%;
                max-height: none;
                min-height: 0;
                min-width: 0;
                flex: none;
                flex-direction: column;
                flex-wrap: nowrap;
                overflow-y: scroll;
                overflow-x: hidden;
                padding: 0.45rem 0.55rem calc(4rem + env(safe-area-inset-bottom));
                gap: 8px;
                border-bottom: 0;
                scrollbar-gutter: stable;
                -webkit-overflow-scrolling: touch;
            }

            aside:not(.aside-right) {
                border-right: 1px solid rgba(255,255,255,0.07);
            }

            .aside-right {
                border-left: 1px solid rgba(255,255,255,0.07);
            }

            aside:not(.aside-right) .sidebar-title,
            .aside-right .sidebar-title {
                display: none;
            }

            aside:not(.aside-right) .game-btn,
            .aside-right .game-btn {
                width: 100%;
                min-height: 38px;
                flex-shrink: 0;
                padding: 8px 9px;
                font-size: 0.72rem;
                border-radius: 10px;
            }

            aside:not(.aside-right) .game-btn:last-child,
            .aside-right > *:last-child {
                margin-bottom: 56px;
            }

            .score-board {
                gap: 5px;
            }

            .score-header-row,
            .score-row {
                grid-template-columns: minmax(0, 1fr) 42px 52px;
                gap: 4px;
                padding: 6px 5px;
                font-size: 0.58rem;
                border-radius: 6px;
            }

            main {
                min-width: 0;
                min-height: 0;
                height: 100%;
                padding: 0.25rem 0.65rem 0.45rem;
                justify-content: flex-start;
                overflow: hidden;
            }

            #gameScreen:not(.fs-active) {
                height: 100%;
                min-height: 0;
                justify-content: flex-start;
                overflow: hidden;
            }

            #gameScreen:not(.fs-active) .canvas-container {
                width: min(100%, calc((100dvh - 94px) * 1.6));
                max-height: calc(100dvh - 104px);
                padding: 5px;
                border-radius: 9px;
            }

            #gameScreen:not(.fs-active) canvas {
                width: 100%;
                height: auto;
                max-height: calc(100dvh - 114px);
                aspect-ratio: 8 / 5;
                object-fit: contain;
            }

            .aside-right .score-board {
                font-size: 0.56rem;
            }

            .aside-right .record-wall {
                flex: 1 1 auto;
                min-height: 150px;
                max-height: clamp(150px, 48dvh, 270px);
                padding: 5px;
            }

            .aside-right .record-wall-row {
                padding: 6px 7px;
                margin-bottom: 5px;
            }

            .aside-right .record-wall-top strong,
            .aside-right .record-wall-top span {
                font-size: 0.64rem;
            }

            .aside-right .record-wall-meta {
                font-size: 0.52rem;
            }

            /* Boutons plein écran mobile : taille compacte même en overlay */
            #gameScreen.fs-active #touchControls,
            #gameScreen:fullscreen #touchControls,
            #gameScreen:-webkit-full-screen #touchControls { padding: 4px 16px 10px !important; }

            #gameScreen.fs-active .tc-cross .tc-up,
            #gameScreen.fs-active .tc-cross .tc-down,
            #gameScreen.fs-active .tc-cross .tc-left,
            #gameScreen.fs-active .tc-cross .tc-right,
            #gameScreen:fullscreen .tc-cross .tc-up,
            #gameScreen:fullscreen .tc-cross .tc-down,
            #gameScreen:fullscreen .tc-cross .tc-left,
            #gameScreen:fullscreen .tc-cross .tc-right { height: 52px !important; font-size: 1.5rem !important; }

            #gameScreen.fs-active .tc-action-btn,
            #gameScreen.fs-active .tc-fire-btn,
            #gameScreen:fullscreen .tc-action-btn,
            #gameScreen:fullscreen .tc-fire-btn { width: 66px !important; height: 66px !important; font-size: 1.6rem !important; }

            #gameScreen.fs-active .tc-big-btn,
            #gameScreen:fullscreen .tc-big-btn { height: 56px !important; font-size: 1.9rem !important; }

            #gameScreen.fs-active .tc-big-ud,
            #gameScreen:fullscreen .tc-big-ud { height: 48px !important; font-size: 1.8rem !important; }

            #gameScreen.fs-active .tc-tap-btn,
            #gameScreen:fullscreen .tc-tap-btn { height: 56px !important; font-size: 1.2rem !important; }

            #gameScreen.fs-active .tc-pvp-btn,
            #gameScreen:fullscreen .tc-pvp-btn { height: 54px !important; font-size: 1.5rem !important; }
        }

        @media (max-width: 900px), (pointer: coarse) {
            #gameScreen.fs-active[data-touch-layout="spectator"] .tc-spectator,
            #gameScreen:fullscreen[data-touch-layout="spectator"] .tc-spectator,
            #gameScreen:-webkit-full-screen[data-touch-layout="spectator"] .tc-spectator {
                height: 100%;
                padding: 12px 18px !important;
            }

            #gameScreen.fs-active[data-touch-layout="spectator"] .tc-spectator-menu,
            #gameScreen:fullscreen[data-touch-layout="spectator"] .tc-spectator-menu,
            #gameScreen:-webkit-full-screen[data-touch-layout="spectator"] .tc-spectator-menu {
                width: 118px;
                height: 86px;
                border-radius: 24px;
                font-size: 1.45rem;
            }
        }

        @media (max-width: 700px) and (orientation: landscape) {
            .main-container {
                grid-template-columns: 136px minmax(0, 1fr) 132px;
            }

            aside:not(.aside-right),
            .aside-right {
                padding-left: 0.4rem;
                padding-right: 0.4rem;
                gap: 6px;
            }

            aside:not(.aside-right) .game-btn,
            .aside-right .game-btn {
                min-height: 34px;
                padding: 7px 7px;
                font-size: 0.66rem;
            }

            .score-header-row,
            .score-row {
                grid-template-columns: minmax(0, 1fr) 34px 40px;
                font-size: 0.5rem;
                padding: 5px 4px;
            }
        }

        @media (max-width: 900px), (pointer: coarse) {
            #fullscreenContainer {
                width: 100% !important;
                align-self: stretch !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
            }

            #fullscreenBtn {
                align-self: center !important;
                margin-left: auto !important;
                margin-right: auto !important;
            }
        }

        /* === MOBILE HORS PLEIN ÉCRAN : manette compacte sous le jeu === */
        @media (max-width: 768px) {
            #gameScreen:not(.fs-active) {
                flex: 0 0 auto;
                min-height: auto;
                display: flex;
                flex-direction: column;
                align-items: stretch;
                gap: 6px;
                overflow: visible;
            }

            #gameScreen:not(.fs-active) .canvas-container {
                flex: 0 0 auto;
                width: 100%;
                align-self: center;
            }

            #gameScreen:not(.fs-active) .instructions {
                order: 3;
                margin: 4px 4px 0;
                padding: 5px 10px;
                font-size: 0.64rem;
                border-radius: 10px;
            }

            #gameScreen:not(.fs-active) #touchControls {
                order: 2;
                display: flex;
                position: relative;
                z-index: 1;
                flex: 0 0 auto;
                width: 100%;
                max-width: none;
                margin-top: 2px;
                padding: 6px 8px 8px;
                gap: 6px;
                border: 1px solid rgba(0,240,255,0.12);
                border-radius: 10px;
                background: rgba(10,10,15,0.82);
            }

            #gameScreen:not(.fs-active) .tc-topbar {
                min-height: 30px;
                margin-bottom: 0;
            }

            #gameScreen:not(.fs-active) .tc-game-hint {
                font-size: 0.62rem;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            #gameScreen:not(.fs-active) .tc-pause-btn {
                width: 38px;
                height: 38px;
                font-size: 0.9rem;
                flex-shrink: 0;
            }

            #gameScreen:not(.fs-active) .tc-layout {
                grid-template-columns: minmax(0, 1fr) auto;
                gap: 10px;
                align-items: stretch;
                padding: 0;
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-dpad"] .tc-layout {
                display: grid !important;
            }

            #gameScreen:not(.fs-active) .tc-cross {
                max-width: none;
                width: 100%;
                gap: 6px;
            }

            #gameScreen:not(.fs-active) .tc-cross .tc-up,
            #gameScreen:not(.fs-active) .tc-cross .tc-down,
            #gameScreen:not(.fs-active) .tc-cross .tc-left,
            #gameScreen:not(.fs-active) .tc-cross .tc-right {
                height: 52px;
                min-height: 52px;
                border-radius: 16px;
                font-size: 1.45rem;
            }

            #gameScreen:not(.fs-active) .tc-right-group {
                justify-content: center;
                gap: 8px;
            }

            #gameScreen:not(.fs-active) .tc-action-btn,
            #gameScreen:not(.fs-active) .tc-fire-btn {
                width: 64px;
                height: 64px;
                font-size: 1.45rem;
            }

            #gameScreen:not(.fs-active) .tc-lr-layout,
            #gameScreen:not(.fs-active) .tc-galaga-layout,
            #gameScreen:not(.fs-active) .tc-ud-layout,
            #gameScreen:not(.fs-active) .tc-pong-layout,
            #gameScreen:not(.fs-active) .tc-pong-play-layout,
            #gameScreen:not(.fs-active) .tc-pvp-layout {
                width: 100%;
                gap: 8px;
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-galaga"] .tc-galaga-layout {
                display: grid !important;
                grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(94px, 1.18fr);
                gap: 8px;
                align-items: stretch;
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-galaga"] .tc-galaga-side {
                display: contents !important;
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-left {
                display: none !important;
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-galaga"] .tc-galaga-move,
            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-galaga"] .tc-galaga-fire {
                min-height: 64px;
                height: 64px;
                border-radius: 20px;
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-galaga"] .tc-galaga-fire {
                font-size: 0.95rem;
            }

            #gameScreen:not(.fs-active) .tc-pong-move,
            #gameScreen:not(.fs-active) .tc-pong-ok {
                min-height: 72px;
                height: 72px;
                border-radius: 20px;
                font-size: 1.8rem;
            }

            #gameScreen:not(.fs-active) .tc-pong-ok {
                flex-basis: 82px;
            }

            #gameScreen:not(.fs-active) .tc-pong-move span,
            #gameScreen:not(.fs-active) .tc-pong-ok span {
                font-size: 0.58rem;
            }

            #gameScreen:not(.fs-active) .tc-pong-play-layout {
                grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr);
                align-items: stretch;
            }

            #gameScreen:not(.fs-active) .tc-pong-play-btn,
            #gameScreen:not(.fs-active) .tc-pong-menu-btn {
                min-height: 78px;
                height: 78px;
                border-radius: 22px;
            }

            #gameScreen:not(.fs-active) .tc-pong-play-btn {
                font-size: 1.95rem;
            }

            #gameScreen:not(.fs-active) .tc-pong-menu-btn {
                font-size: 1.22rem;
            }

            #gameScreen:not(.fs-active) .tc-pong-play-btn span,
            #gameScreen:not(.fs-active) .tc-pong-menu-btn span {
                font-size: 0.56rem;
            }

            #gameScreen:not(.fs-active) .tc-big-btn,
            #gameScreen:not(.fs-active) .tc-big-ud {
                height: 58px !important;
                min-height: 58px;
                border-radius: 18px;
                font-size: 1.45rem;
            }

            #gameScreen:not(.fs-active) .tc-pvp-layout {
                display: flex;
                align-items: stretch;
                gap: 10px;
            }

            #gameScreen:not(.fs-active) .tc-pvp-side {
                min-width: 0;
                gap: 7px;
            }

            #gameScreen:not(.fs-active) .tc-pvp-name {
                font-size: 0.66rem;
                color: var(--text-main);
            }

            #gameScreen:not(.fs-active) .tc-pvp-btn {
                height: 68px !important;
                min-height: 68px;
                border-radius: 18px;
                font-size: 1.45rem;
            }

            #gameScreen:not(.fs-active) .tc-tap-btn {
                height: 68px;
                min-height: 68px;
                border-radius: 22px;
                font-size: 1.2rem;
            }
        }

        /* Pong 2 joueurs hors plein écran sur mobile/tablette tactile */
        @media (max-width: 900px), (pointer: coarse) {
            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-pvp"] #touchControls {
                padding: 8px 10px 10px;
                background: rgba(10,10,15,0.9);
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-pvp"] .tc-pvp-layout {
                display: grid !important;
                grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
                gap: 10px;
                width: 100%;
                align-items: stretch;
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-pvp"] .tc-pvp-side {
                min-width: 0;
                display: grid;
                grid-template-rows: 18px 76px 76px;
                gap: 8px;
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-pvp"] .tc-pvp-name {
                font-size: 0.72rem;
                color: var(--text-main);
                text-shadow: 0 0 8px rgba(0,240,255,0.45);
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-pvp"] .tc-pvp-btn {
                height: 76px !important;
                min-height: 76px !important;
                border-radius: 22px !important;
                font-size: 1.65rem !important;
                background: rgba(0,240,255,0.11);
            }

            #gameScreen:not(.fs-active)[data-touch-layout="tc-l-pvp"] .tc-pvp-sep {
                display: block;
                width: 1px;
                height: 100%;
                background: rgba(255,255,255,0.12);
                margin: 0;
            }
        }

        /* === FULLSCREEN — boutons agrandis === */
        #gameScreen:fullscreen #touchControls,
        #gameScreen:-webkit-full-screen #touchControls,
        #gameScreen.fs-active #touchControls { padding: 8px 22px 20px; }

        #gameScreen:fullscreen .tc-cross .tc-up,
        #gameScreen:fullscreen .tc-cross .tc-down,
        #gameScreen:fullscreen .tc-cross .tc-left,
        #gameScreen:fullscreen .tc-cross .tc-right,
        #gameScreen:-webkit-full-screen .tc-cross .tc-up,
        #gameScreen:-webkit-full-screen .tc-cross .tc-down,
        #gameScreen:-webkit-full-screen .tc-cross .tc-left,
        #gameScreen:-webkit-full-screen .tc-cross .tc-right,
        #gameScreen.fs-active .tc-cross .tc-up,
        #gameScreen.fs-active .tc-cross .tc-down,
        #gameScreen.fs-active .tc-cross .tc-left,
        #gameScreen.fs-active .tc-cross .tc-right { height: 86px; font-size: 2.3rem; }

        #gameScreen:fullscreen .tc-action-btn,
        #gameScreen:fullscreen .tc-fire-btn,
        #gameScreen:-webkit-full-screen .tc-action-btn,
        #gameScreen:-webkit-full-screen .tc-fire-btn,
        #gameScreen.fs-active .tc-action-btn,
        #gameScreen.fs-active .tc-fire-btn { width: 102px; height: 102px; font-size: 2.4rem; }

        #gameScreen:fullscreen .tc-big-btn,
        #gameScreen:-webkit-full-screen .tc-big-btn,
        #gameScreen.fs-active .tc-big-btn { height: 102px; font-size: 2.7rem; }

        #gameScreen:fullscreen .tc-big-ud,
        #gameScreen:-webkit-full-screen .tc-big-ud,
        #gameScreen.fs-active .tc-big-ud { height: 90px; font-size: 2.5rem; }

        #gameScreen:fullscreen .tc-tap-btn,
        #gameScreen:-webkit-full-screen .tc-tap-btn,
        #gameScreen.fs-active .tc-tap-btn { height: 112px; font-size: 1.9rem; }

        #gameScreen:fullscreen .tc-pvp-btn,
        #gameScreen:-webkit-full-screen .tc-pvp-btn,
        #gameScreen.fs-active .tc-pvp-btn { height: 90px !important; font-size: 2.1rem; }

        /* === MODE SPECTATEUR === */
        .tc-spectator {
            display: none;
            align-items: center;
            justify-content: space-between;
            padding: 10px 0;
            font-family: 'Fira Code', monospace;
            font-size: 0.88rem;
            color: var(--text-muted);
            gap: 12px;
            letter-spacing: 1px;
            width: 100%;
        }
        .tc-spectator-status {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            min-width: 0;
            flex: 1;
        }
        .tc-spectator-dot {
            width: 9px; height: 9px;
            border-radius: 50%;
            background: #b026ff;
            box-shadow: 0 0 8px #b026ff;
            animation: dot-pulse 1.5s infinite;
            flex-shrink: 0;
        }
        .tc-spectator-menu {
            width: 86px;
            height: 58px;
            border-radius: 18px;
            flex-direction: column;
            gap: 2px;
            font-size: 1.15rem;
            background: rgba(176,38,255,0.18);
            border-color: rgba(176,38,255,0.55);
            flex-shrink: 0;
        }
        .tc-spectator-menu span {
            font-family: 'Fira Code', monospace;
            font-size: 0.56rem;
            letter-spacing: 1px;
            color: var(--text-muted);
        }

        /* === PONG 2 JOUEURS touch === */
        .tc-pvp-layout {
            display: none;
            gap: 10px;
            align-items: stretch;
            width: 100%;
        }
        .tc-pvp-side {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 6px;
        }
        .tc-pvp-name {
            font-family: 'Fira Code', monospace;
            font-size: 0.72rem;
            color: var(--text-muted);
            text-align: center;
            letter-spacing: 1px;
        }
        .tc-pvp-btn {
            flex: 1;
            height: 80px;
            border-radius: 40px;
            font-size: 1.85rem;
        }
        .tc-pvp-sep {
            width: 1px;
            background: rgba(255,255,255,0.08);
            margin: 0 2px;
            flex-shrink: 0;
        }

        .tc-pvp-replay {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            z-index: 8;
            min-width: 132px;
            min-height: 78px;
            padding: 12px 18px;
            border-radius: 24px;
            flex-direction: column;
            gap: 4px;
            font-size: 2rem;
            font-weight: 900;
            background: linear-gradient(135deg, rgba(0,240,255,0.24), rgba(176,38,255,0.26));
            border-color: rgba(0,240,255,0.65);
            box-shadow: 0 0 28px rgba(0,240,255,0.34), 0 0 34px rgba(176,38,255,0.22);
            pointer-events: auto;
        }
        .tc-pvp-replay span {
            font-family: 'Fira Code', monospace;
            font-size: 0.62rem;
            letter-spacing: 1px;
            color: var(--text-main);
        }

        /* === MOBILE FULLSCREEN LARGE TOUCH TARGETS === */
        @media (max-width: 900px), (pointer: coarse) {
            #gameScreen.fs-active,
            #gameScreen:fullscreen,
            #gameScreen:-webkit-full-screen {
                gap: 0 !important;
            }

            #gameScreen.fs-active .canvas-container,
            #gameScreen:fullscreen .canvas-container,
            #gameScreen:-webkit-full-screen .canvas-container {
                background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple), var(--neon-red)) !important;
                padding: 6px !important;
                box-shadow:
                    inset 0 0 0 1px rgba(255,255,255,0.1),
                    0 0 24px rgba(0,240,255,0.28) !important;
            }

            #gameScreen.fs-active #touchControls,
            #gameScreen:fullscreen #touchControls,
            #gameScreen:-webkit-full-screen #touchControls {
                max-width: none !important;
                gap: 10px !important;
                padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
                background:
                    linear-gradient(180deg, rgba(19,20,31,0.98), rgba(10,10,15,0.98)) !important;
            }

            #gameScreen.fs-active .tc-topbar,
            #gameScreen:fullscreen .tc-topbar,
            #gameScreen:-webkit-full-screen .tc-topbar {
                flex: 0 0 54px !important;
                margin: 0 !important;
            }

            #gameScreen.fs-active .tc-game-hint,
            #gameScreen:fullscreen .tc-game-hint,
            #gameScreen:-webkit-full-screen .tc-game-hint {
                font-size: 0.82rem !important;
            }

            #gameScreen.fs-active .tc-pause-btn,
            #gameScreen.fs-active .tc-menu-top-btn,
            #gameScreen:fullscreen .tc-pause-btn,
            #gameScreen:fullscreen .tc-menu-top-btn,
            #gameScreen:-webkit-full-screen .tc-pause-btn,
            #gameScreen:-webkit-full-screen .tc-menu-top-btn {
                width: 58px !important;
                height: 58px !important;
                font-size: 1.25rem !important;
            }

            #gameScreen.fs-active .tc-layout,
            #gameScreen:fullscreen .tc-layout,
            #gameScreen:-webkit-full-screen .tc-layout,
            #gameScreen.fs-active .tc-lr-layout,
            #gameScreen:fullscreen .tc-lr-layout,
            #gameScreen:-webkit-full-screen .tc-lr-layout,
            #gameScreen.fs-active .tc-ud-layout,
            #gameScreen:fullscreen .tc-ud-layout,
            #gameScreen:-webkit-full-screen .tc-ud-layout,
            #gameScreen.fs-active .tc-pvp-layout,
            #gameScreen:fullscreen .tc-pvp-layout,
            #gameScreen:-webkit-full-screen .tc-pvp-layout {
                flex: 1 1 auto !important;
                width: 100% !important;
                min-height: 0 !important;
            }

            #gameScreen.fs-active .tc-layout,
            #gameScreen:fullscreen .tc-layout,
            #gameScreen:-webkit-full-screen .tc-layout {
                align-items: stretch !important;
                gap: 18px !important;
                padding: 0 !important;
            }

            #gameScreen.fs-active .tc-cross,
            #gameScreen:fullscreen .tc-cross,
            #gameScreen:-webkit-full-screen .tc-cross {
                max-width: none !important;
                min-width: 0 !important;
                gap: 10px !important;
                align-self: stretch !important;
            }

            #gameScreen.fs-active .tc-cross .tc-up,
            #gameScreen.fs-active .tc-cross .tc-down,
            #gameScreen.fs-active .tc-cross .tc-left,
            #gameScreen.fs-active .tc-cross .tc-right,
            #gameScreen:fullscreen .tc-cross .tc-up,
            #gameScreen:fullscreen .tc-cross .tc-down,
            #gameScreen:fullscreen .tc-cross .tc-left,
            #gameScreen:fullscreen .tc-cross .tc-right,
            #gameScreen:-webkit-full-screen .tc-cross .tc-up,
            #gameScreen:-webkit-full-screen .tc-cross .tc-down,
            #gameScreen:-webkit-full-screen .tc-cross .tc-left,
            #gameScreen:-webkit-full-screen .tc-cross .tc-right {
                height: auto !important;
                min-height: 74px !important;
                border-radius: 22px !important;
                font-size: 2.15rem !important;
            }

            #gameScreen.fs-active .tc-right-group,
            #gameScreen:fullscreen .tc-right-group,
            #gameScreen:-webkit-full-screen .tc-right-group {
                flex: 0 0 clamp(104px, 28%, 150px) !important;
                justify-content: center !important;
                gap: 18px !important;
            }

            #gameScreen.fs-active .tc-action-btn,
            #gameScreen.fs-active .tc-fire-btn,
            #gameScreen:fullscreen .tc-action-btn,
            #gameScreen:fullscreen .tc-fire-btn,
            #gameScreen:-webkit-full-screen .tc-action-btn,
            #gameScreen:-webkit-full-screen .tc-fire-btn {
                width: clamp(96px, 24vw, 132px) !important;
                height: clamp(96px, 24vw, 132px) !important;
                font-size: 2.25rem !important;
            }

            #gameScreen.fs-active .tc-big-btn,
            #gameScreen:fullscreen .tc-big-btn,
            #gameScreen:-webkit-full-screen .tc-big-btn,
            #gameScreen.fs-active .tc-big-ud,
            #gameScreen:fullscreen .tc-big-ud,
            #gameScreen:-webkit-full-screen .tc-big-ud {
                height: auto !important;
                min-height: 96px !important;
                border-radius: 26px !important;
                font-size: 2.45rem !important;
            }

            #gameScreen.fs-active .tc-tap-btn,
            #gameScreen:fullscreen .tc-tap-btn,
            #gameScreen:-webkit-full-screen .tc-tap-btn {
                height: auto !important;
                min-height: 132px !important;
                border-radius: 34px !important;
                font-size: 1.75rem !important;
            }

            #gameScreen.fs-active .tc-pvp-layout,
            #gameScreen:fullscreen .tc-pvp-layout,
            #gameScreen:-webkit-full-screen .tc-pvp-layout {
                gap: 14px !important;
            }

            #gameScreen.fs-active .tc-pvp-side,
            #gameScreen:fullscreen .tc-pvp-side,
            #gameScreen:-webkit-full-screen .tc-pvp-side {
                gap: 10px !important;
            }

            #gameScreen.fs-active .tc-pvp-btn,
            #gameScreen:fullscreen .tc-pvp-btn,
            #gameScreen:-webkit-full-screen .tc-pvp-btn {
                height: auto !important;
                min-height: 74px !important;
                border-radius: 24px !important;
                font-size: 1.75rem !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #touchControls {
                position: relative !important;
                padding-top: max(78px, env(safe-area-inset-top)) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar {
                position: absolute !important;
                top: max(14px, env(safe-area-inset-top)) !important;
                left: max(16px, env(safe-area-inset-left)) !important;
                right: max(16px, env(safe-area-inset-right)) !important;
                height: 56px !important;
                display: flex !important;
                justify-content: center !important;
                align-items: center !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-game-hint {
                max-width: calc(100% - 168px) !important;
                text-align: center !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                position: absolute !important;
                top: 0 !important;
                right: 0 !important;
                width: 56px !important;
                height: 56px !important;
                pointer-events: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout {
                position: relative !important;
                grid-template-columns: minmax(0, 1fr) clamp(86px, 18vw, 120px) minmax(0, 1fr) !important;
                gap: 14px !important;
                align-items: end !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up {
                grid-column: 1 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                grid-column: 3 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
                position: absolute !important;
                top: calc(-132px - max(0px, env(safe-area-inset-top))) !important;
                right: max(76px, calc(env(safe-area-inset-right) + 76px)) !important;
                width: 56px !important;
                height: 56px !important;
                min-height: 56px !important;
                border-radius: 18px !important;
                font-size: 1.2rem !important;
                z-index: 3 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn span,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn span,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn span {
                font-size: 0.5rem !important;
            }
        }

        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active,
            #gameScreen:fullscreen,
            #gameScreen:-webkit-full-screen {
                flex-direction: column !important;
                justify-content: flex-start !important;
            }

            #gameScreen.fs-active .canvas-container,
            #gameScreen:fullscreen .canvas-container,
            #gameScreen:-webkit-full-screen .canvas-container {
                flex: 0 0 50% !important;
                width: 100% !important;
                height: auto !important;
            }

            #gameScreen.fs-active #touchControls,
            #gameScreen:fullscreen #touchControls,
            #gameScreen:-webkit-full-screen #touchControls {
                display: flex !important;
                flex: 0 0 50% !important;
                width: 100% !important;
                min-height: 0 !important;
                border-top: 1px solid rgba(0,240,255,0.22) !important;
            }
        }

        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active,
            #gameScreen:fullscreen,
            #gameScreen:-webkit-full-screen {
                flex-direction: row !important;
                justify-content: flex-start !important;
                align-items: stretch !important;
            }

            #gameScreen.fs-active .canvas-container,
            #gameScreen:fullscreen .canvas-container,
            #gameScreen:-webkit-full-screen .canvas-container {
                flex: 1 1 58% !important;
                width: auto !important;
                height: 100% !important;
            }

            #gameScreen.fs-active #touchControls,
            #gameScreen:fullscreen #touchControls,
            #gameScreen:-webkit-full-screen #touchControls {
                display: flex !important;
                flex: 0 0 min(44vw, 430px) !important;
                width: min(44vw, 430px) !important;
                height: 100% !important;
                min-height: 0 !important;
                border-top: 0 !important;
                border-left: 1px solid rgba(0,240,255,0.22) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #exitFsBtn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #exitFsBtn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #exitFsBtn {
                top: max(8px, env(safe-area-inset-top)) !important;
                right: max(10px, env(safe-area-inset-right)) !important;
                transform: none !important;
                z-index: 6 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #touchControls {
                padding: max(62px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar {
                top: max(8px, env(safe-area-inset-top)) !important;
                left: max(10px, env(safe-area-inset-left)) !important;
                right: max(154px, calc(env(safe-area-inset-right) + 154px)) !important;
                height: 48px !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                right: 0 !important;
                width: 48px !important;
                height: 48px !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout {
                height: 100% !important;
                grid-template-columns: minmax(0, 1fr) clamp(72px, 13vw, 96px) minmax(0, 1fr) !important;
                align-items: center !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
                top: calc(50% - 118px) !important;
                right: auto !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                width: 54px !important;
                height: 54px !important;
                min-height: 54px !important;
                border-radius: 17px !important;
            }

            #gameScreen.fs-active .tc-layout,
            #gameScreen:fullscreen .tc-layout,
            #gameScreen:-webkit-full-screen .tc-layout {
                flex-direction: column !important;
                gap: 12px !important;
            }

            #gameScreen.fs-active .tc-cross,
            #gameScreen:fullscreen .tc-cross,
            #gameScreen:-webkit-full-screen .tc-cross {
                flex: 1 1 auto !important;
                width: 100% !important;
            }

            #gameScreen.fs-active .tc-right-group,
            #gameScreen:fullscreen .tc-right-group,
            #gameScreen:-webkit-full-screen .tc-right-group {
                flex: 0 0 auto !important;
                width: 100% !important;
                flex-direction: row !important;
            }

            #gameScreen.fs-active .tc-action-btn,
            #gameScreen.fs-active .tc-fire-btn,
            #gameScreen:fullscreen .tc-action-btn,
            #gameScreen:fullscreen .tc-fire-btn,
            #gameScreen:-webkit-full-screen .tc-action-btn,
            #gameScreen:-webkit-full-screen .tc-fire-btn {
                width: clamp(76px, 18vh, 104px) !important;
                height: clamp(76px, 18vh, 104px) !important;
            }

            #gameScreen.fs-active .tc-cross .tc-up,
            #gameScreen.fs-active .tc-cross .tc-down,
            #gameScreen.fs-active .tc-cross .tc-left,
            #gameScreen.fs-active .tc-cross .tc-right,
            #gameScreen:fullscreen .tc-cross .tc-up,
            #gameScreen:fullscreen .tc-cross .tc-down,
            #gameScreen:fullscreen .tc-cross .tc-left,
            #gameScreen:fullscreen .tc-cross .tc-right,
            #gameScreen:-webkit-full-screen .tc-cross .tc-up,
            #gameScreen:-webkit-full-screen .tc-cross .tc-down,
            #gameScreen:-webkit-full-screen .tc-cross .tc-left,
            #gameScreen:-webkit-full-screen .tc-cross .tc-right {
                min-height: 64px !important;
            }
        }

        /* Pong solo portrait : correction finale menu/pause au-dessus des boutons */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar {
                overflow: visible !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar {
                z-index: 40 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
                top: calc(-88px - max(0px, env(safe-area-inset-top))) !important;
                left: calc((100% - clamp(74px, 18vw, 96px) - 24px) / 4 - 24px) !important;
                right: auto !important;
                width: 52px !important;
                height: 52px !important;
                min-height: 52px !important;
                z-index: 45 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                position: absolute !important;
                top: calc(-88px - max(0px, env(safe-area-inset-top))) !important;
                right: calc((100% - clamp(74px, 18vw, 96px) - 24px) / 4 - 26px) !important;
                left: auto !important;
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                width: 52px !important;
                height: 52px !important;
                min-width: 52px !important;
                min-height: 52px !important;
                border-radius: 50% !important;
                z-index: 50 !important;
                pointer-events: auto !important;
            }
        }

        /* Pong solo portrait : menu au-dessus de monter, pause au-dessus de descendre */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #touchControls {
                position: relative !important;
                padding-top: max(56px, env(safe-area-inset-top)) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                transform: none !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-game-hint {
                position: absolute !important;
                top: max(8px, env(safe-area-inset-top)) !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                max-width: 52% !important;
                height: 42px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout {
                position: relative !important;
                grid-template-columns: minmax(0, 1fr) clamp(74px, 18vw, 96px) minmax(0, 1fr) !important;
                gap: 12px !important;
                align-items: end !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up {
                grid-column: 1 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                grid-column: 3 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
                position: absolute !important;
                top: calc(-54px - max(0px, env(safe-area-inset-top))) !important;
                left: calc((100% - clamp(74px, 18vw, 96px) - 24px) / 4 - 24px) !important;
                right: auto !important;
                transform: none !important;
                width: 48px !important;
                height: 48px !important;
                min-height: 48px !important;
                border-radius: 16px !important;
                z-index: 8 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                position: absolute !important;
                top: calc(-54px - max(0px, env(safe-area-inset-top))) !important;
                right: calc((100% - clamp(74px, 18vw, 96px) - 24px) / 4 - 24px) !important;
                left: auto !important;
                display: flex !important;
                width: 48px !important;
                height: 48px !important;
                z-index: 8 !important;
                pointer-events: auto !important;
            }
        }

        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"],
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"],
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] {
                flex-direction: column !important;
                justify-content: center !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .canvas-container,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .canvas-container,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .canvas-container {
                flex: 1 1 auto !important;
                width: 100% !important;
                height: 100% !important;
                padding-top: max(58px, calc(env(safe-area-inset-top) + 58px)) !important;
                padding-left: clamp(94px, 16vw, 150px) !important;
                padding-right: clamp(94px, 16vw, 150px) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] #touchControls {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                max-width: none !important;
                flex: none !important;
                display: block !important;
                padding: 0 !important;
                background: transparent !important;
                border: 0 !important;
                pointer-events: none !important;
                z-index: 3;
            }

            /* Topbar = passe-plat : on masque juste le hint, on garde M + Pause autour du Quitter */
            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-topbar {
                position: absolute !important;
                inset: 0 !important;
                display: block !important;
                background: transparent !important;
                border: 0 !important;
                pointer-events: none !important;
                z-index: 6 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-game-hint {
                display: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-menu-top-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-menu-top-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-menu-top-btn,
            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pause-btn {
                position: fixed !important;
                top: max(4px, env(safe-area-inset-top)) !important;
                width: 44px !important;
                height: 44px !important;
                min-width: 44px !important;
                min-height: 44px !important;
                border-radius: 50% !important;
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                pointer-events: auto !important;
                z-index: 121 !important;
            }

            /* M à gauche du Quitter (centré) */
            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-menu-top-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-menu-top-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-menu-top-btn {
                right: calc(50% + 64px) !important;
                left: auto !important;
            }

            /* Pause à droite du Quitter (centré) */
            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pause-btn {
                left: calc(50% + 64px) !important;
                right: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-layout,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-layout,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-layout {
                position: absolute !important;
                inset: 0 !important;
                display: block !important;
                width: 100% !important;
                height: 100% !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-side,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-side,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-side {
                position: absolute !important;
                top: max(18px, env(safe-area-inset-top)) !important;
                bottom: max(18px, env(safe-area-inset-bottom)) !important;
                width: clamp(82px, 14vw, 128px) !important;
                display: flex !important;
                flex-direction: column !important;
                gap: 10px !important;
                pointer-events: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-side:first-of-type,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-side:first-of-type,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-side:first-of-type,
            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-side:nth-of-type(1),
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-side:nth-of-type(1),
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-side:nth-of-type(1) {
                left: max(10px, env(safe-area-inset-left)) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-side:last-child,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-side:last-child,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-side:last-child {
                right: max(10px, env(safe-area-inset-right)) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-sep,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-sep,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-sep {
                display: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-name,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-name,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-name {
                height: 20px;
                font-size: 0.68rem !important;
                color: var(--text-main) !important;
                text-shadow: 0 0 8px rgba(0,240,255,0.55);
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-btn {
                flex: 1 1 0 !important;
                min-height: 0 !important;
                height: auto !important;
                border-radius: 22px !important;
                font-size: clamp(1.35rem, 5vh, 2rem) !important;
                background: rgba(10, 10, 15, 0.72) !important;
                backdrop-filter: blur(8px);
            }


            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] .tc-pvp-replay,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] .tc-pvp-replay,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] .tc-pvp-replay {
                position: absolute !important;
                left: 50% !important;
                top: 50% !important;
                transform: translate(-50%, -50%) !important;
                width: clamp(118px, 24vw, 168px) !important;
                min-height: clamp(72px, 16vh, 104px) !important;
                border-radius: 26px !important;
                font-size: clamp(1.7rem, 6vh, 2.4rem) !important;
                backdrop-filter: blur(10px);
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] #exitFsBtn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] #exitFsBtn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] #exitFsBtn {
                top: max(8px, env(safe-area-inset-top)) !important;
                right: 50% !important;
                transform: translateX(50%) !important;
            }
        }
        @media (max-width: 900px) and (orientation: landscape) and (max-height: 360px),
               (pointer: coarse) and (orientation: landscape) and (max-height: 360px) {
            #gameScreen.fs-active #touchControls,
            #gameScreen:fullscreen #touchControls,
            #gameScreen:-webkit-full-screen #touchControls {
                gap: 8px !important;
                padding: 8px 12px !important;
            }

            #gameScreen.fs-active .tc-topbar,
            #gameScreen:fullscreen .tc-topbar,
            #gameScreen:-webkit-full-screen .tc-topbar {
                flex-basis: 44px !important;
            }

            #gameScreen.fs-active .tc-game-hint,
            #gameScreen:fullscreen .tc-game-hint,
            #gameScreen:-webkit-full-screen .tc-game-hint {
                font-size: 0.68rem !important;
            }

            #gameScreen.fs-active .tc-pause-btn,
            #gameScreen:fullscreen .tc-pause-btn,
            #gameScreen:-webkit-full-screen .tc-pause-btn {
                width: 48px !important;
                height: 48px !important;
            }

            #gameScreen.fs-active .tc-cross .tc-up,
            #gameScreen.fs-active .tc-cross .tc-down,
            #gameScreen.fs-active .tc-cross .tc-left,
            #gameScreen.fs-active .tc-cross .tc-right,
            #gameScreen:fullscreen .tc-cross .tc-up,
            #gameScreen:fullscreen .tc-cross .tc-down,
            #gameScreen:fullscreen .tc-cross .tc-left,
            #gameScreen:fullscreen .tc-cross .tc-right,
            #gameScreen:-webkit-full-screen .tc-cross .tc-up,
            #gameScreen:-webkit-full-screen .tc-cross .tc-down,
            #gameScreen:-webkit-full-screen .tc-cross .tc-left,
            #gameScreen:-webkit-full-screen .tc-cross .tc-right {
                min-height: 56px !important;
                border-radius: 18px !important;
            }
        }

        /* Pong solo paysage : controles rapides en 2 lignes */
        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #touchControls {
                position: relative !important;
                display: flex !important;
                flex-direction: column !important;
                padding: max(76px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
                gap: 10px !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #exitFsBtn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #exitFsBtn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #exitFsBtn {
                top: max(10px, env(safe-area-inset-top)) !important;
                right: max(10px, env(safe-area-inset-right)) !important;
                min-width: 112px !important;
                height: 48px !important;
                transform: none !important;
                z-index: 8 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar {
                position: absolute !important;
                top: max(10px, env(safe-area-inset-top)) !important;
                left: max(14px, env(safe-area-inset-left)) !important;
                right: max(242px, calc(env(safe-area-inset-right) + 242px)) !important;
                height: 48px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-game-hint {
                max-width: 100% !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
                white-space: nowrap !important;
                text-align: center !important;
                font-size: clamp(0.68rem, 2.4vh, 0.9rem) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                position: absolute !important;
                top: 0 !important;
                right: -62px !important;
                width: 48px !important;
                height: 48px !important;
                pointer-events: auto !important;
                z-index: 7 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout {
                position: static !important;
                flex: 1 1 auto !important;
                min-height: 0 !important;
                height: 100% !important;
                display: grid !important;
                grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
                grid-template-rows: 1fr !important;
                gap: 12px !important;
                align-items: stretch !important;
                width: 100% !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up {
                grid-column: 1 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                grid-column: 2 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn {
                width: 100% !important;
                height: 100% !important;
                min-height: 0 !important;
                border-radius: 28px !important;
                font-size: clamp(2.2rem, 8vh, 3.8rem) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn span,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn span,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn span {
                font-size: clamp(0.56rem, 2vh, 0.78rem) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
                position: absolute !important;
                top: max(10px, env(safe-area-inset-top)) !important;
                right: max(178px, calc(env(safe-area-inset-right) + 178px)) !important;
                left: auto !important;
                transform: none !important;
                width: 48px !important;
                height: 48px !important;
                min-height: 48px !important;
                border-radius: 16px !important;
                font-size: 1.1rem !important;
                z-index: 7 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn span,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn span,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn span {
                font-size: 0.46rem !important;
            }
        }

        /* Pong solo paysage : deux pouces en bas, controles secondaires en haut */
        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #touchControls {
                position: relative !important;
                padding: max(64px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
                gap: 0 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #exitFsBtn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #exitFsBtn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #exitFsBtn {
                top: max(8px, env(safe-area-inset-top)) !important;
                right: max(10px, env(safe-area-inset-right)) !important;
                height: 46px !important;
                min-width: 112px !important;
                z-index: 9 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar {
                position: absolute !important;
                top: max(8px, env(safe-area-inset-top)) !important;
                left: max(12px, env(safe-area-inset-left)) !important;
                right: max(194px, calc(env(safe-area-inset-right) + 194px)) !important;
                height: 46px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-game-hint {
                max-width: calc(100% - 118px) !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
                white-space: nowrap !important;
                text-align: center !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                right: auto !important;
                width: 46px !important;
                height: 46px !important;
                pointer-events: auto !important;
                z-index: 8 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
                position: absolute !important;
                top: max(8px, env(safe-area-inset-top)) !important;
                right: max(130px, calc(env(safe-area-inset-right) + 130px)) !important;
                left: auto !important;
                transform: none !important;
                width: 46px !important;
                height: 46px !important;
                min-height: 46px !important;
                border-radius: 15px !important;
                z-index: 8 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout {
                position: relative !important;
                flex: 1 1 auto !important;
                height: 100% !important;
                min-height: 0 !important;
                width: 100% !important;
                display: block !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                position: absolute !important;
                bottom: 0 !important;
                width: 100% !important;
                height: clamp(118px, 48vh, 190px) !important;
                min-height: clamp(118px, 48vh, 190px) !important;
                border-radius: 30px !important;
                font-size: clamp(2.4rem, 9vh, 4rem) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up {
                left: 0 !important;
                width: calc(50% - 6px) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                right: 0 !important;
                width: calc(50% - 6px) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn span,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn span,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn span {
                font-size: clamp(0.62rem, 2vh, 0.82rem) !important;
            }
        }

        /* Pong solo paysage : boutons aux extremites, jeu au centre */
        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"],
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"],
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] {
                position: fixed !important;
                inset: 0 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .canvas-container,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .canvas-container,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .canvas-container {
                flex: 1 1 auto !important;
                width: 100% !important;
                height: 100% !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #touchControls {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                flex: none !important;
                max-width: none !important;
                padding: 0 !important;
                background: transparent !important;
                border: 0 !important;
                pointer-events: none !important;
                z-index: 5 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar {
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                right: 0 !important;
                width: 100% !important;
                height: 100% !important;
                transform: none !important;
                display: flex !important;
                justify-content: center !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-game-hint {
                position: fixed !important;
                top: max(10px, env(safe-area-inset-top)) !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                max-width: min(280px, 34vw) !important;
                height: 48px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                z-index: 7 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-btn {
                pointer-events: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                position: fixed !important;
                top: auto !important;
                bottom: calc(max(16px, env(safe-area-inset-bottom)) + clamp(104px, 28vh, 168px) + 12px) !important;
                right: calc(max(12px, env(safe-area-inset-right)) + (clamp(138px, 18vw, 210px) - 48px) / 2) !important;
                left: auto !important;
                display: flex !important;
                width: 48px !important;
                height: 48px !important;
                z-index: 8 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
                position: fixed !important;
                top: auto !important;
                bottom: calc(max(16px, env(safe-area-inset-bottom)) + clamp(104px, 28vh, 168px) + 12px) !important;
                left: calc(max(12px, env(safe-area-inset-left)) + (clamp(138px, 18vw, 210px) - 48px) / 2) !important;
                right: auto !important;
                transform: none !important;
                width: 48px !important;
                height: 48px !important;
                min-height: 48px !important;
                border-radius: 16px !important;
                z-index: 8 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout {
                position: absolute !important;
                inset: 0 !important;
                display: block !important;
                width: 100% !important;
                height: 100% !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                position: fixed !important;
                bottom: max(16px, env(safe-area-inset-bottom)) !important;
                width: clamp(138px, 18vw, 210px) !important;
                height: clamp(104px, 28vh, 168px) !important;
                min-height: clamp(104px, 28vh, 168px) !important;
                border-radius: 28px !important;
                font-size: clamp(2rem, 8vh, 3.4rem) !important;
                z-index: 7 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up {
                left: max(12px, env(safe-area-inset-left)) !important;
                right: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                right: max(12px, env(safe-area-inset-right)) !important;
                left: auto !important;
            }
        }

        /* FINAL OVERRIDE - Pong solo portrait fullscreen: fixed thumb layout */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #touchControls {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                max-width: none !important;
                padding: 0 !important;
                background: transparent !important;
                border: 0 !important;
                pointer-events: none !important;
                overflow: visible !important;
                z-index: 5 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-topbar,
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                display: block !important;
                pointer-events: none !important;
                overflow: visible !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-game-hint {
                position: fixed !important;
                top: max(10px, env(safe-area-inset-top)) !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                width: min(360px, 72vw) !important;
                height: 38px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                text-align: center !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
                pointer-events: none !important;
                z-index: 9 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                position: fixed !important;
                bottom: max(18px, env(safe-area-inset-bottom)) !important;
                width: calc(50vw - 34px) !important;
                height: clamp(112px, 16vh, 150px) !important;
                min-height: clamp(112px, 16vh, 150px) !important;
                border-radius: 28px !important;
                font-size: clamp(2rem, 6vh, 3.2rem) !important;
                pointer-events: auto !important;
                z-index: 20 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-up {
                left: max(18px, env(safe-area-inset-left)) !important;
                right: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-pong-play-down {
                right: max(18px, env(safe-area-inset-right)) !important;
                left: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                position: fixed !important;
                top: auto !important;
                bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(112px, 16vh, 150px) + 46px) !important;
                width: 54px !important;
                height: 54px !important;
                min-width: 54px !important;
                min-height: 54px !important;
                border-radius: 18px !important;
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                pointer-events: auto !important;
                z-index: 30 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
                left: calc(max(18px, env(safe-area-inset-left)) + (50vw - 34px - 54px) / 2) !important;
                right: auto !important;
                transform: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
                right: calc(max(18px, env(safe-area-inset-right)) + (50vw - 34px - 54px) / 2) !important;
                left: auto !important;
                border-radius: 50% !important;
            }
        }

        /* FINAL OVERRIDE - BrickSmash fullscreen: left/right thumb controls */
        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"],
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"],
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] {
                position: fixed !important;
                inset: 0 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .canvas-container,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .canvas-container,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .canvas-container {
                flex: 1 1 auto !important;
                width: 100% !important;
                height: 100% !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #touchControls {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                flex: none !important;
                max-width: none !important;
                padding: 0 !important;
                background: transparent !important;
                border: 0 !important;
                pointer-events: none !important;
                overflow: visible !important;
                z-index: 5 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .tc-topbar,
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-l-lr,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-l-lr,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-l-lr {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                display: block !important;
                pointer-events: none !important;
                overflow: visible !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .tc-game-hint {
                position: fixed !important;
                top: max(10px, env(safe-area-inset-top)) !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                width: min(280px, 34vw) !important;
                height: 42px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                pointer-events: none !important;
                z-index: 9 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .tc-pause-btn {
                position: fixed !important;
                top: auto !important;
                bottom: calc(max(16px, env(safe-area-inset-bottom)) + clamp(104px, 28vh, 168px) + 12px) !important;
                right: calc(max(12px, env(safe-area-inset-right)) + (clamp(138px, 18vw, 210px) - 54px) / 2) !important;
                left: auto !important;
                width: 54px !important;
                height: 54px !important;
                min-width: 54px !important;
                min-height: 54px !important;
                border-radius: 50% !important;
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                pointer-events: auto !important;
                z-index: 30 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-lr-right,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-lr-right,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-lr-right {
                position: fixed !important;
                bottom: max(16px, env(safe-area-inset-bottom)) !important;
                width: clamp(138px, 18vw, 210px) !important;
                height: clamp(104px, 28vh, 168px) !important;
                min-height: clamp(104px, 28vh, 168px) !important;
                border-radius: 28px !important;
                font-size: clamp(2.6rem, 11vh, 4.4rem) !important;
                pointer-events: auto !important;
                z-index: 20 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-lr-left {
                left: max(12px, env(safe-area-inset-left)) !important;
                right: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-lr-right,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-lr-right,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-lr-right {
                right: max(12px, env(safe-area-inset-right)) !important;
                left: auto !important;
            }
        }

        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .canvas-container,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .canvas-container,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .canvas-container {
                flex: 1 1 auto !important;
                width: 100% !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #touchControls {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                flex: none !important;
                max-width: none !important;
                padding: 0 !important;
                background: transparent !important;
                border: 0 !important;
                pointer-events: none !important;
                overflow: visible !important;
                z-index: 5 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .tc-topbar,
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-l-lr,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-l-lr,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-l-lr {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                display: block !important;
                pointer-events: none !important;
                overflow: visible !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .tc-game-hint {
                position: fixed !important;
                top: calc(max(10px, env(safe-area-inset-top)) + 46px) !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                width: min(360px, 72vw) !important;
                height: 38px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
                pointer-events: none !important;
                z-index: 9 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-lr-right,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-lr-right,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-lr-right {
                position: fixed !important;
                bottom: max(18px, env(safe-area-inset-bottom)) !important;
                width: calc(50vw - 34px) !important;
                height: clamp(112px, 16vh, 150px) !important;
                min-height: clamp(112px, 16vh, 150px) !important;
                border-radius: 28px !important;
                font-size: clamp(2.6rem, 7vh, 4rem) !important;
                pointer-events: auto !important;
                z-index: 20 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-lr-left,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-lr-left {
                left: max(18px, env(safe-area-inset-left)) !important;
                right: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] #tc-lr-right,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] #tc-lr-right,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] #tc-lr-right {
                right: max(18px, env(safe-area-inset-right)) !important;
                left: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .tc-pause-btn {
                position: fixed !important;
                top: auto !important;
                bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(112px, 16vh, 150px) + 46px) !important;
                right: calc(max(18px, env(safe-area-inset-right)) + (50vw - 34px - 54px) / 2) !important;
                left: auto !important;
                width: 54px !important;
                height: 54px !important;
                min-width: 54px !important;
                min-height: 54px !important;
                border-radius: 50% !important;
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                pointer-events: auto !important;
                z-index: 30 !important;
            }
        }

        /* FINAL OVERRIDE - Galaga fullscreen portrait: same two-thumb layout */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"],
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"],
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] {
                justify-content: flex-start !important;
                align-items: stretch !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .canvas-container,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .canvas-container,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .canvas-container {
                flex: 0 0 auto !important;
                width: 100% !important;
                height: auto !important;
                margin-top: clamp(42px, 5.5vh, 86px) !important;
                padding: 10px !important;
                align-items: flex-start !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] canvas,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] canvas,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] canvas {
                width: 100% !important;
                height: auto !important;
                max-height: none !important;
                aspect-ratio: 8 / 5 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #touchControls {
                position: absolute !important;
                left: 0 !important;
                right: 0 !important;
                bottom: max(88px, calc(env(safe-area-inset-bottom) + 8vh)) !important;
                flex: none !important;
                width: 100% !important;
                max-width: none !important;
                margin: 0 !important;
                padding: 10px 12px !important;
                background: rgba(10,10,15,0.9) !important;
                border-top: 1px solid rgba(0,240,255,0.18) !important;
                align-items: stretch !important;
                justify-content: flex-start !important;
                pointer-events: none !important;
                z-index: 12 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-topbar {
                width: 100% !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-pause-btn {
                width: 48px !important;
                height: 48px !important;
                min-width: 48px !important;
                min-height: 48px !important;
                pointer-events: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-l-galaga,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-l-galaga,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-l-galaga {
                display: grid !important;
                grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(108px, 1.18fr) !important;
                gap: 10px !important;
                width: 100% !important;
                pointer-events: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-galaga-side,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-galaga-side,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-galaga-side {
                display: contents !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-left,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-left,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-left {
                display: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-galaga-move,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-galaga-move,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-galaga-move,
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-galaga-fire,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-galaga-fire,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-galaga-fire {
                position: static !important;
                width: 100% !important;
                height: clamp(78px, 11vh, 112px) !important;
                min-height: clamp(78px, 11vh, 112px) !important;
                border-radius: 26px !important;
                pointer-events: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-galaga-move,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-galaga-move,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-galaga-move {
                font-size: 0 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-left::before,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-left::before,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-left::before,
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-right::before,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-right::before,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-right::before {
                font-size: clamp(2.1rem, 6vh, 3rem) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-galaga-fire,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-galaga-fire,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-galaga-fire {
                font-size: clamp(1rem, 3.2vh, 1.25rem) !important;
            }
        }

        /* FINAL OVERRIDE - Galaga fullscreen landscape: left thumb moves, right thumb fires */
        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"],
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"],
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] {
                position: fixed !important;
                inset: 0 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .canvas-container,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .canvas-container,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .canvas-container {
                flex: 1 1 auto !important;
                width: 100% !important;
                height: 100% !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #touchControls,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #touchControls,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #touchControls {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                flex: none !important;
                max-width: none !important;
                padding: 0 !important;
                background: transparent !important;
                border: 0 !important;
                pointer-events: none !important;
                overflow: visible !important;
                z-index: 5 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-topbar,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-topbar,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-topbar,
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-l-galaga,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-l-galaga,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-l-galaga {
                position: absolute !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                display: block !important;
                pointer-events: none !important;
                overflow: visible !important;
            }

            /* ✕ Quitter : déplacé dans la gouttière gauche pour ne pas chevaucher le HUD (SCORE/BEST/VAGUE) */
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #exitFsBtn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #exitFsBtn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #exitFsBtn {
                top: max(10px, env(safe-area-inset-top)) !important;
                left: max(8px, env(safe-area-inset-left)) !important;
                right: auto !important;
                transform: none !important;
                min-width: 0 !important;
                padding: 6px 10px !important;
                font-size: 0.72rem !important;
                z-index: 81 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-game-hint {
                position: fixed !important;
                top: max(10px, env(safe-area-inset-top)) !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                width: min(250px, 32vw) !important;
                height: 40px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                pointer-events: none !important;
                z-index: 9 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-pause-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-pause-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-pause-btn {
                position: fixed !important;
                top: max(10px, env(safe-area-inset-top)) !important;
                right: max(12px, env(safe-area-inset-right)) !important;
                width: 52px !important;
                height: 52px !important;
                min-width: 52px !important;
                min-height: 52px !important;
                border-radius: 50% !important;
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                pointer-events: auto !important;
                z-index: 30 !important;
            }

            /* Bouton Menu (M) : empilé sous la Pause dans la gouttière droite (sinon il la chevauche) */
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-menu-top-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-menu-top-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-menu-top-btn {
                position: fixed !important;
                top: calc(max(10px, env(safe-area-inset-top)) + 62px) !important;
                right: max(12px, env(safe-area-inset-right)) !important;
                left: auto !important;
                width: 52px !important;
                height: 52px !important;
                min-width: 52px !important;
                min-height: 52px !important;
                border-radius: 50% !important;
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                pointer-events: auto !important;
                z-index: 30 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-galaga-side,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-galaga-side,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-galaga-side {
                display: block !important;
                pointer-events: none !important;
                z-index: 20 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-left,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-left,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-left {
                display: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-left,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-left,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-left,
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-right,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-right,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-right {
                position: fixed !important;
                bottom: max(12px, env(safe-area-inset-bottom)) !important;
                width: clamp(78px, 11vw, 128px) !important;
                height: clamp(82px, 24vh, 142px) !important;
                min-height: clamp(82px, 24vh, 142px) !important;
                border-radius: 28px !important;
                pointer-events: auto !important;
                z-index: 20 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-left,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-left,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-left {
                left: max(12px, env(safe-area-inset-left)) !important;
                right: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-right,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-right,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-right {
                left: calc(max(12px, env(safe-area-inset-left)) + clamp(78px, 11vw, 128px) + 8px) !important;
                right: auto !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-right,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-right,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-fire-right {
                position: fixed !important;
                right: max(14px, env(safe-area-inset-right)) !important;
                bottom: max(12px, env(safe-area-inset-bottom)) !important;
                width: clamp(132px, 18vw, 196px) !important;
                height: clamp(104px, 30vh, 176px) !important;
                min-height: clamp(104px, 30vh, 176px) !important;
                border-radius: 34px !important;
                pointer-events: auto !important;
                z-index: 20 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-galaga-move,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-galaga-move,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-galaga-move {
                font-size: 0 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-left::before,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-left::before,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-left::before,
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] #tc-galaga-right::before,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] #tc-galaga-right::before,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] #tc-galaga-right::before {
                font-size: clamp(2rem, 9vh, 3.2rem) !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-galaga-fire,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-galaga-fire,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-galaga-fire {
                font-size: clamp(1rem, 4vh, 1.35rem) !important;
            }
        }

        /* FINAL FINAL OVERRIDE - Exit button stays over the game area */
        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active #exitFsBtn,
            #gameScreen:fullscreen #exitFsBtn,
            #gameScreen:-webkit-full-screen #exitFsBtn {
                top: max(10px, env(safe-area-inset-top)) !important;
                left: 30vw !important;
                right: auto !important;
                transform: translateX(-50%) !important;
                z-index: 120 !important;
            }
        }

        /* Pong solo / 2 joueurs : annuler le left:30vw hérité du FINAL FINAL OVERRIDE
           (sinon left + right s'appliquent ensemble et le bouton s'étire sur tout le haut) */
        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #exitFsBtn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #exitFsBtn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #exitFsBtn {
                left: auto !important;
                right: max(10px, env(safe-area-inset-right)) !important;
                transform: none !important;
            }
            #gameScreen.fs-active[data-touch-layout="tc-l-pvp"] #exitFsBtn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pvp"] #exitFsBtn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pvp"] #exitFsBtn {
                left: auto !important;
                right: 50% !important;
                transform: translateX(50%) !important;
            }
        }

        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active #exitFsBtn,
            #gameScreen:fullscreen #exitFsBtn,
            #gameScreen:-webkit-full-screen #exitFsBtn {
                top: max(10px, env(safe-area-inset-top)) !important;
                left: 50% !important;
                right: auto !important;
                transform: translateX(-50%) !important;
                z-index: 120 !important;
            }
        }

        /* FINAL OVERRIDE - Pong solo portrait top controls */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-menu-top,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-menu-top,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-menu-top {
                display: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-game-hint {
                position: fixed !important;
                top: calc(max(10px, env(safe-area-inset-top)) + 48px) !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                z-index: 119 !important;
            }
        }

        /* GenreGame : le hint F=FÉMININ M=MASCULIN est redondant avec les boutons F/M */
        #gameScreen.fs-active[data-touch-layout="tc-l-genre"] .tc-game-hint,
        #gameScreen:fullscreen[data-touch-layout="tc-l-genre"] .tc-game-hint,
        #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-genre"] .tc-game-hint {
            display: none !important;
        }

        /* FINAL HARMONY OVERRIDE - same header rhythm for the 8 mobile fullscreen games */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active .tc-game-hint,
            #gameScreen:fullscreen .tc-game-hint,
            #gameScreen:-webkit-full-screen .tc-game-hint {
                position: fixed !important;
                top: calc(max(10px, env(safe-area-inset-top)) + 48px) !important;
                left: 50% !important;
                width: min(420px, 82vw) !important;
                height: 32px !important;
                transform: translateX(-50%) !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
                pointer-events: none !important;
                z-index: 119 !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-menu-top,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-menu-top,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-menu-top,
            #gameScreen.fs-active[data-touch-layout="spectator"] #tc-menu-top,
            #gameScreen:fullscreen[data-touch-layout="spectator"] #tc-menu-top,
            #gameScreen:-webkit-full-screen[data-touch-layout="spectator"] #tc-menu-top {
                display: none !important;
            }

            #gameScreen.fs-active .tc-menu-top-btn,
            #gameScreen:fullscreen .tc-menu-top-btn,
            #gameScreen:-webkit-full-screen .tc-menu-top-btn,
            #gameScreen.fs-active .tc-pause-btn,
            #gameScreen:fullscreen .tc-pause-btn,
            #gameScreen:-webkit-full-screen .tc-pause-btn {
                width: 54px !important;
                height: 54px !important;
                min-width: 54px !important;
                min-height: 54px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                visibility: visible !important;
                opacity: 1 !important;
                pointer-events: auto !important;
            }
        }

        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active .tc-game-hint,
            #gameScreen:fullscreen .tc-game-hint,
            #gameScreen:-webkit-full-screen .tc-game-hint {
                position: fixed !important;
                top: calc(max(10px, env(safe-area-inset-top)) + 44px) !important;
                left: 30vw !important;
                width: min(360px, 34vw) !important;
                height: 30px !important;
                transform: translateX(-50%) !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
                pointer-events: none !important;
                z-index: 119 !important;
            }

            /* Layouts D-pad (Tetris, Snake, FlipMatch, Pac-Man), Tap (Flappy) et Galaga :
               titre du jeu masqué en paysage plein écran */
            #gameScreen.fs-active[data-touch-layout="tc-l-dpad"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-dpad"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-dpad"] .tc-game-hint,
            #gameScreen.fs-active[data-touch-layout="tc-l-tap"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-tap"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-tap"] .tc-game-hint,
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-game-hint {
                display: none !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] #tc-menu-top,
            #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] #tc-menu-top,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] #tc-menu-top,
            #gameScreen.fs-active[data-touch-layout="spectator"] #tc-menu-top,
            #gameScreen:fullscreen[data-touch-layout="spectator"] #tc-menu-top,
            #gameScreen:-webkit-full-screen[data-touch-layout="spectator"] #tc-menu-top {
                display: none !important;
            }
        }

        /* Galaga : titre du jeu masqué aussi en portrait plein écran */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-galaga"] .tc-game-hint,
            #gameScreen:fullscreen[data-touch-layout="tc-l-galaga"] .tc-game-hint,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-galaga"] .tc-game-hint {
                display: none !important;
            }
        }

        /* FINAL OVERRIDE - BrickSmash keeps Menu and Pause balanced over the thumb buttons */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .tc-menu-top-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .tc-menu-top-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .tc-menu-top-btn {
                position: fixed !important;
                top: auto !important;
                bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(112px, 16vh, 150px) + 46px) !important;
                left: calc(max(18px, env(safe-area-inset-left)) + (50vw - 34px - 54px) / 2) !important;
                right: auto !important;
                margin: 0 !important;
                border-radius: 18px !important;
                z-index: 30 !important;
            }
        }

        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .tc-menu-top-btn,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .tc-menu-top-btn,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .tc-menu-top-btn {
                position: fixed !important;
                top: auto !important;
                bottom: calc(max(16px, env(safe-area-inset-bottom)) + clamp(104px, 28vh, 168px) + 12px) !important;
                left: calc(max(12px, env(safe-area-inset-left)) + (clamp(138px, 18vw, 210px) - 54px) / 2) !important;
                right: auto !important;
                margin: 0 !important;
                border-radius: 18px !important;
                z-index: 30 !important;
            }
        }

        /* FINAL OVERRIDE - BrickSmash play screen stays above controls */
        @media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"],
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"],
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] {
                justify-content: flex-start !important;
                align-items: stretch !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .canvas-container,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .canvas-container,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .canvas-container {
                flex: 0 0 auto !important;
                width: 100% !important;
                height: min(58vh, calc(100svh - max(18px, env(safe-area-inset-bottom)) - clamp(112px, 16vh, 150px) - 128px)) !important;
                margin-top: calc(max(10px, env(safe-area-inset-top)) + 82px) !important;
                padding: 10px !important;
                align-items: center !important;
                justify-content: center !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] canvas,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] canvas,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] canvas {
                width: 100% !important;
                height: 100% !important;
                max-width: 100% !important;
                max-height: 100% !important;
                object-fit: contain !important;
                border-radius: 8px !important;
            }
        }

        @media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] .canvas-container,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] .canvas-container,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] .canvas-container {
                height: calc(100svh - max(16px, env(safe-area-inset-bottom)) - clamp(104px, 28vh, 168px) - 22px) !important;
                margin-top: 0 !important;
                padding: 8px !important;
                align-items: center !important;
                justify-content: center !important;
            }

            #gameScreen.fs-active[data-touch-layout="tc-l-lr"] canvas,
            #gameScreen:fullscreen[data-touch-layout="tc-l-lr"] canvas,
            #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-lr"] canvas {
                width: 100% !important;
                height: 100% !important;
                max-width: 100% !important;
                max-height: 100% !important;
                object-fit: contain !important;
                border-radius: 8px !important;
            }
        }

/* === NEON PONG RUSH : Menu visible en jeu, Rejouer seulement après GAME OVER === */
.tc-replay-btn {
    background: linear-gradient(135deg, rgba(0,255,136,0.18), rgba(0,240,255,0.16)) !important;
    border-color: rgba(0,255,136,0.55) !important;
    box-shadow: 0 0 16px rgba(0,255,136,0.24) !important;
}
.tc-replay-btn.pressed,
.tc-replay-btn:active {
    background: rgba(0,255,136,0.34) !important;
    border-color: #00ff88 !important;
    box-shadow: 0 0 26px rgba(0,255,136,0.6) !important;
}
.tc-replay-btn span {
    font-size: 0.56rem !important;
    letter-spacing: 0.6px !important;
    color: var(--text-main) !important;
}

/* Hors plein écran : le bouton central reste Menu pendant la partie, puis devient Rejouer au Game Over. */
#gameScreen:not(.fs-active)[data-touch-layout="tc-l-pong-play"] .tc-pong-play-layout {
    grid-template-columns: minmax(0, 1fr) 98px minmax(0, 1fr) !important;
}
#gameScreen:not(.fs-active)[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
    display: flex !important;
    width: 98px !important;
    min-width: 98px !important;
    font-size: 1.35rem !important;
}

/* Plein écran portrait : Menu/Rejouer au-dessus de MONTER, Pause au-dessus de DESCENDRE. */
@media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
    #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
    #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
    #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
        display: flex !important;
        position: fixed !important;
        top: auto !important;
        bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(112px, 16vh, 150px) + 46px) !important;
        left: calc(max(18px, env(safe-area-inset-left)) + (50vw - 34px - 54px) / 2) !important;
        right: auto !important;
        transform: none !important;
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        border-radius: 18px !important;
        z-index: 31 !important;
        pointer-events: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
    #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
    #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
        display: flex !important;
        position: fixed !important;
        top: auto !important;
        bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(112px, 16vh, 150px) + 46px) !important;
        right: calc(max(18px, env(safe-area-inset-right)) + (50vw - 34px - 54px) / 2) !important;
        left: auto !important;
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        border-radius: 50% !important;
        z-index: 31 !important;
        pointer-events: auto !important;
    }
}

/* Plein écran paysage : Menu/Rejouer au-dessus du bouton gauche, Pause au-dessus du bouton droit. */
@media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
    #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
    #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn,
    #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pong-menu-btn {
        display: flex !important;
        position: fixed !important;
        top: auto !important;
        bottom: calc(max(16px, env(safe-area-inset-bottom)) + clamp(104px, 28vh, 168px) + 12px) !important;
        left: calc(max(12px, env(safe-area-inset-left)) + (clamp(138px, 18vw, 210px) - 48px) / 2) !important;
        right: auto !important;
        transform: none !important;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        border-radius: 16px !important;
        z-index: 31 !important;
        pointer-events: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    #gameScreen.fs-active[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
    #gameScreen:fullscreen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn,
    #gameScreen:-webkit-full-screen[data-touch-layout="tc-l-pong-play"] .tc-pause-btn {
        display: flex !important;
        position: fixed !important;
        top: auto !important;
        bottom: calc(max(16px, env(safe-area-inset-bottom)) + clamp(104px, 28vh, 168px) + 12px) !important;
        right: calc(max(12px, env(safe-area-inset-right)) + (clamp(138px, 18vw, 210px) - 48px) / 2) !important;
        left: auto !important;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        border-radius: 50% !important;
        z-index: 31 !important;
        pointer-events: auto !important;
    }
}
