/* ═══════════════════════════════════════════════════════════════════════════════
   JS CPC — Feuille de style principale
   Thème sombre moderne · Toutes les pages
   ═══════════════════════════════════════════════════════════════════════════════

   Sommaire
   ──────────────────────────────────────────────────────────────────────────────
    1.  Variables CSS             (:root — couleurs, fontes, effets, catégories)
    2.  Base                      (reset, body émulateur, icons FontAwesome, sr-only)
    3.  Layout émulateur          (app-header, main-container, top-toolbar, layout-grid)
    4.  Cards                     (.card, .card-header)
    5.  Boutons                   (base partagée, .button, .btn-primary, .icon-toggle…)
    6.  Panneau debug CPU         (.reg-grid, .flags-bar, .psg-regs)
    7.  Écran / Canvas            (.screen-container, #screen, .led-bulb, plein écran)
    8.  Périphériques             (lecteurs disquette, cassette, .tape-counter…)
    9.  Auto-Type                 (.autotype-card textarea)
   10.  Modal settings            (.modal-overlay, .modal, .config-grid…)
   11.  États du transport cassette (.btn-icon.toggled-button + classes sémantiques)
   12.  Animations                (@keyframes — tous les fichiers)
   13.  Liste de programmes cassette (.tape-programs, .tape-prog-item…)
   14.  Turbo                     (#button-turbo.turbo-on)
   15.  game.html                 (scopé .game-page : header 52px, game-area, overlay…)
   16.  Imprimante virtuelle      (.printer-card — cpc-blank.html uniquement)
   17.  Game Card — couches visuelles (.card-visual, .card-thumbnail, .card-video…)
   18.  Pages statiques — partagé (body override scroll, texture, header sticky, nav, footer)
   19.  Page d'accueil            (index.html : hero, mockup CPC, sections, history, prompt)
   20.  Catalogue de jeux         (sample.html : filter-bar, game-card, grille, empty-state)
   21.  Page d'erreur 404         (404.html : cpc-screen, error-code, glitch, btn-error)
   ─────────────────────────────────────────────────────────────────────────── */


/* ══ 1. Variables CSS ═══════════════════════════════════════════════════════ */
:root {
    /* ── Couleurs de base ── */
    --bg-main:      #0f172a;
    --bg-card:      #1e293b;
    --bg-toolbar:   #111827;
    --primary:      #6366f1;
    --primary-hover:#4f46e5;
    --danger:       #ef4444;
    --accent:       #10b981;
    --text-main:    #f1f5f9;
    --text-muted:   #94a3b8;
    --border:       #334155;

    /* ── Typographies (pages statiques) ── */
    --font-mono:    'Share Tech Mono', 'Courier New', monospace;
    --font-display: 'Syne', system-ui, sans-serif;

    /* ── Effets globaux ── */
    --scanline-opacity: 0.04;

    /* ── Couleurs catégories jeux (sample.html) ── */
    --cat-action:   #f59e0b;
    --cat-arcade:   #ec4899;
    --cat-platform: #f97316;
    --cat-rpg:      #8b5cf6;
    --cat-puzzle:   #06b6d4;
    --cat-sport:    #22c55e;
    --cat-demo:     #a78bfa;
    --cat-strat:    #64748b;

    /* ── Couleurs types de média (sample.html) ── */
    --media-disc:   #6366f1;
    --media-snap:   #10b981;
    --media-cart:   #f59e0b;
}


/* ══ 2. Base ════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

/* Corps de l'émulateur (cpc-blank.html, game.html).
   Les pages statiques surchargent ce bloc en section 18. */
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Assure l'affichage correct des icônes FontAwesome */
.fas, .far, .fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Accessibilité : élément visuellement caché mais lisible par les lecteurs d'écran */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border-width: 0;
}


/* ══ 3. Layout émulateur ════════════════════════════════════════════════════ */
.app-header {
    background: var(--bg-toolbar);
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
}
.header-content  { display: flex; justify-content: space-between; align-items: center; }
.logo-section    { display: flex; align-items: center; gap: 10px; }
.logo-section h1 { font-size: 1.2rem; margin: 0; }
.logo-section h1 span { color: var(--primary); font-weight: 800; }
.header-monitoring {
    display: flex; gap: 20px;
    font-size: 0.85rem; font-family: monospace; color: var(--accent);
}

.main-container {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.tool-group { display: flex; gap: 8px; }

.layout-grid {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 15px;
}


/* ══ 4. Cards ═══════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.card h3, .card h4 {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Groupe inline dans les card-headers (ex. imprimante) */
.card-header-actions { display: flex; gap: 6px; align-items: center; }


/* ══ 5. Boutons ═════════════════════════════════════════════════════════════ */

/* Base partagée par tous les éléments interactifs */
.button, .btn-primary, .btn-danger, .icon-toggle, .btn-icon, .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 40px;
    min-height: 36px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button {
    border: 1px solid var(--border);
    background: #334155;
    color: white;
    border-radius: 6px;
    padding: 6px 12px;
}
.button:hover { background: var(--primary); }

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: bold;
}

.btn-danger {
    background: #450a0a;
    color: #f87171;
    border: 1px solid #7f1d1d;
    border-radius: 8px;
    padding: 10px 20px;
}

/* Boutons icône de la toolbar (son, joystick, settings…) */
.icon-toggle {
    width: 45px;
    height: 40px;
    border-radius: 8px;
    background: #1e293b;
    color: #64748b;
    border: 1px solid var(--border);
}
.icon-toggle i { font-size: 1.1rem; }
.icon-toggle:hover { border-color: var(--primary); background: #334155; }
.icon-toggle.active {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #10b981;
    box-shadow: 0 0 12px rgba(16,185,129,0.4);
}

/* Boutons icône du transport cassette */
.btn-icon {
    padding: 8px;
    background: #334155;
    color: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    flex: 1;
}
.btn-icon i { font-size: 1.1rem; }
.btn-icon:hover { background: #475569; }

/* Bouton d'action principal (injecter auto-type, etc.) */
.btn-action {
    width: 100%;
    margin-top: 10px;
    background: var(--primary);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
}
.btn-action:hover { background: var(--primary-hover); }

/* Bouton texte (Vider, Réduire) dans les card-headers */
.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-text:hover { color: var(--text-main); background: #334155; }

/* Éjection : rouge au survol */
.danger:hover,
#drivea-eject:hover, #driveb-eject:hover,
#tape-eject:hover, #snapshot-eject:hover,
#cart-eject:hover {
    background-color: var(--danger) !important;
    color: white !important;
}

/* Désactivation visuelle */
.disabled-button {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Slider volume (cpc-blank.html) */
.volume-box {
    display: flex; align-items: center; gap: 10px;
    background: #000; padding: 5px 15px; border-radius: 20px;
}
.slider { cursor: pointer; accent-color: var(--primary); }


/* ══ 6. Panneau debug CPU ═══════════════════════════════════════════════════ */
.reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-family: 'Courier New', monospace;
}
.reg-item {
    display: flex; justify-content: space-between;
    background: #000; padding: 4px 8px;
    border-radius: 4px; border: 1px solid #334155;
}
.reg-item span { color: var(--text-muted); font-size: 0.75rem; }
.reg-item b    { color: #5eead4; }
.flags-bar {
    margin-top: 10px; background: #000; color: #fbbf24;
    text-align: center; padding: 5px;
    font-family: monospace; border-radius: 4px;
}
.psg-regs {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; font-size: 0.8rem;
    font-family: monospace; color: #60a5fa;
}


/* ══ 7. Écran / Canvas ══════════════════════════════════════════════════════ */
.screen-container {
    background: #000;
    border: 4px solid var(--border);
    border-radius: 8px;
    position: relative;
    padding: 10px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.4);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* L'émulateur produit 272 lignes ; aspect-ratio simule le doublement (544px) */
#screen {
    width: 100%;
    aspect-ratio: 783 / 544;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
}

/* LEDs lecteurs */
.screen-leds {
    position: absolute; bottom: 10px; right: 15px;
    display: flex; gap: 15px;
    background: rgba(0,0,0,0.5); padding: 5px 10px;
    border-radius: 20px; pointer-events: none;
}
.led-bulb {
    width: 10px; height: 10px; border-radius: 50%;
    background-color: #300000; color: transparent; font-size: 0;
    border: 1px solid #1a1a1a;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.5);
    transition: all 0.1s ease; position: relative;
}
.led-bulb.active {
    background-color: #ff0000;
    box-shadow: 0 0 10px #f00, inset 0 1px 1px rgba(255,255,255,0.5);
}
.led-bulb::before {
    position: absolute; left: -12px; top: -2px;
    color: #aaa; font-size: 9px; font-family: sans-serif;
}
#drivea-led::before { content: "A"; }
#driveb-led::before { content: "B"; }

/* Plein écran (cpc-blank.html) */
#emulator-area:fullscreen {
    width: 100vw; height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background-color: #000;
}
#emulator-area:fullscreen #screen {
    width: auto; height: 100vh;
    aspect-ratio: 783 / 544;
    margin: 0 auto;
}


/* ══ 8. Périphériques (lecteurs, cassette) ══════════════════════════════════ */
.file-name {
    background: #000; padding: 6px; border-radius: 6px;
    font-size: 0.75rem; margin-bottom: 8px;
    font-family: monospace; color: #94a3b8;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-row        { display: flex; gap: 5px; }
.btn-row button { flex: 1; padding: 6px; font-size: 0.75rem; }

/* Transport cassette */
.tape-controls { display: flex; gap: 4px; margin-bottom: 8px; }

/* Compteur de bande */
.tape-counter {
    font-family: 'Digital-7', monospace;
    color: #ff0000;
    background: #1a0000;
    padding: 2px 8px; border-radius: 4px; font-size: 1.2rem;
}

/* Indicateur moteur relais cassette : OFF (gris) → ON (.motor-on = vert) */
#tape-motor-status {
    font-size: 10px; font-weight: bold;
    padding: 2px 4px; border-radius: 3px;
    transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
    color: #555; border: 1px solid #555;
}
#tape-motor-status.motor-on {
    color: #10b981 !important;
    border-color: #10b981 !important;
    text-shadow: 0 0 6px rgba(16,185,129,0.5);
}

/* Liste de programmes disquette (inline dans les drive-cards) */
.drive-programs {
    display: none;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 10px;
}


/* ══ 9. Auto-Type ═══════════════════════════════════════════════════════════ */
.autotype-card textarea {
    width: 100%;
    min-height: 80px;
    background: #000;
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    font-family: monospace;
    resize: none;
    outline: none;
    box-sizing: border-box;
}


/* ══ 10. Modal settings ═════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none; z-index: 100;
}
.modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px; border-radius: 16px;
    display: none; z-index: 101; width: 500px;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.modal-header h2 { font-size: 1.1rem; margin: 0; }
.config-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.radio-group   { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; }
.radio-group label { font-size: 0.85rem; cursor: pointer; }


/* ══ 11. États du transport cassette ════════════════════════════════════════
   TapeController.setTapeState() pose .toggled-button sur le bouton actif.
   Le patch JS ajoute en plus la classe sémantique (.recording / .playing /
   .rewinding / .forwarding) qui déclenche le style et l'animation ci-dessous. */

/* Base active (tous états) */
.btn-icon.toggled-button {
    background: #1e3a5f !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
    box-shadow: 0 0 8px rgba(59,130,246,0.4);
}

/* RECORD — rouge clignotant */
.btn-icon.toggled-button.recording {
    background: #450a0a !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
    box-shadow: 0 0 10px rgba(239,68,68,0.5);
    animation: blink-recording 1s infinite;
}

/* PLAY — vert pulsé */
.btn-icon.toggled-button.playing {
    background: #064e3b !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
    animation: pulse-play 1.2s ease-in-out infinite;
}

/* REWIND / FORWARD — ambre */
.btn-icon.toggled-button.rewinding,
.btn-icon.toggled-button.forwarding {
    background: #451a03 !important;
    border-color: #f59e0b !important;
    color: #fcd34d !important;
    box-shadow: 0 0 8px rgba(245,158,11,0.4);
}

/* Boutons transport désactivés (STATE_EMPTY) */
.btn-icon.disabled-button {
    opacity: 0.3;
    cursor: not-allowed !important;
    pointer-events: none;
    animation: none !important;
    box-shadow: none !important;
}


/* ══ 12. Animations (@keyframes) ════════════════════════════════════════════ */

/* Cassette RECORD — bouton rouge clignotant */
@keyframes blink-recording {
    0%   { opacity: 1;   background-color: #ef4444; box-shadow: 0 0 8px #ef4444; }
    50%  { opacity: 0.6; background-color: #991b1b; box-shadow: none; }
    100% { opacity: 1;   background-color: #ef4444; box-shadow: 0 0 8px #ef4444; }
}

/* Cassette PLAY — LED pulsée verte */
@keyframes pulse-play {
    0%, 100% { box-shadow: 0 0 5px  rgba(16,185,129,0.4); }
    50%       { box-shadow: 0 0 14px rgba(16,185,129,0.8); }
}

/* Spinner de chargement — points rebondissants (game.html) */
@keyframes bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%       { transform: translateY(-8px); opacity: 0.5; }
}

/* Point de statut pulsé (status-pill, hero-badge) */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Mode Turbo actif */
@keyframes turbo-pulse {
    from { text-shadow: 0 0 4px #f59e0b;  transform: scale(1);    }
    to   { text-shadow: 0 0 12px #fbbf24, 0 0 20px #fde68a; transform: scale(1.15); }
}

/* Curseur clignotant style terminal */
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Apparition progressive d'une ligne (mockup index.html, écran 404.html) */
@keyframes fade-in-line {
    to { opacity: 1; }
}

/* Flottement du visuel hero (index.html) */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* Entrée des cartes jeux (sample.html) */
@keyframes card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Glitch couche A (404.html) */
@keyframes glitch-a {
    0%, 88%, 100% { clip-path: inset(100% 0 0 0); transform: translate(0); }
    89%            { clip-path: inset(15% 0 70% 0); transform: translate(-4px, 2px); }
    91%            { clip-path: inset(60% 0 20% 0); transform: translate(3px, -1px); }
    93%            { clip-path: inset(40% 0 45% 0); transform: translate(-2px, 3px); }
    95%            { clip-path: inset(100% 0 0 0);  transform: translate(0); }
}

/* Glitch couche B (404.html) */
@keyframes glitch-b {
    0%, 90%, 100% { clip-path: inset(100% 0 0 0); transform: translate(0); }
    91%            { clip-path: inset(70% 0 10% 0); transform: translate(4px, -2px); }
    93%            { clip-path: inset(20% 0 65% 0); transform: translate(-3px, 1px); }
    95%            { clip-path: inset(50% 0 35% 0); transform: translate(2px, -3px); }
    97%            { clip-path: inset(100% 0 0 0);  transform: translate(0); }
}


/* ══ 13. Liste de programmes cassette ═══════════════════════════════════════ */
.tape-programs {
    margin-top: 8px;
    max-height: 130px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    background: #080f1a;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.tape-analyzing {
    padding: 6px 8px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.75rem;
}

.tape-prog-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    cursor: pointer;
    border-bottom: 1px solid #0f172a;
    transition: background 0.1s;
}
.tape-prog-item:last-child { border-bottom: none; }
.tape-prog-item:hover  { background: #1e3a5f; }
.tape-prog-item.active { background: #064e3b; border-left: 3px solid var(--accent); padding-left: 5px; }

.prog-idx  { color: #475569; min-width: 14px; text-align: right; }
.prog-name { flex: 1; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-time { color: #475569; font-size: 0.68rem; white-space: nowrap; }


/* ── Variante drive-programs (max-height 150px, pour disquettes A/B) ── */
.drive-programs {
    max-height: 150px;
    margin-top: 10px;
}

/* Deuxième ligne de boutons avec espacement supérieur (cassette) */
.btn-row-mt { margin-top: 5px; }

/* Indicateur moteur cassette */
.tape-motor-status {
    font-size: 10px;
    font-weight: bold;
    color: #555;
    border: 1px solid #555;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Groupe flex côté droit des card-headers périphériques */
.drive-header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Icône colorée avec la couleur d'accent (utilisée dans fps-display) */
.icon-accent { color: var(--accent); }


/* ══ 14. Turbo ══════════════════════════════════════════════════════════════ */
#button-turbo.turbo-on {
    background: #78350f !important;
    color: #fbbf24 !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 14px rgba(251,191,36,0.5);
}
#button-turbo.turbo-on i {
    color: #fde68a;
    animation: turbo-pulse 0.5s infinite alternate;
}


/* ══ 15. game.html — Page d'émulation immersive ═════════════════════════════
   Scopé avec .game-page pour ne pas interférer avec cpc-blank.html.        */

/* Réinitialisation layout plein-page */
body.game-page {
    height: 100% !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

/* ── Header compact (52px) ── */
.game-header {
    flex-shrink: 0;
    background: var(--bg-toolbar);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 10;
}
.header-left  { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
}
.logo-icon {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; color: white;
}
.logo-link h1 { margin: 0; font-size: 1rem; font-weight: 800; }
.logo-link h1 span { color: var(--primary); }

.header-divider { width: 1px; height: 24px; background: var(--border); }

/* Titre du jeu en cours */
.game-title-bar {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem; font-family: 'Courier New', monospace;
}
.game-title-bar .disc-icon { color: var(--text-muted); font-size: 0.75rem; }
.game-title-bar .game-name {
    color: var(--accent); font-weight: bold;
    max-width: 260px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Indicateur de statut ── */
.status-pill {
    display: flex; align-items: center; gap: 6px;
    font-family: 'Courier New', monospace; font-size: 0.72rem;
    padding: 4px 10px; border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.3); color: var(--text-muted);
    transition: all 0.3s ease; white-space: nowrap;
}
.status-pill.loading { color: #fbbf24; border-color: rgba(251,191,36,0.4); }
.status-pill.running { color: var(--accent); border-color: rgba(16,185,129,0.4); }
.status-pill.error   { color: var(--danger); border-color: rgba(239,68,68,0.4); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-pill.running .status-dot { animation: pulse-dot 1.5s ease-in-out infinite; }

/* ── Boutons du header game.html ── */
.btn-header {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 14px; border-radius: 7px;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border);
    background: #334155; color: var(--text-main);
    text-decoration: none; transition: all 0.2s; white-space: nowrap;
}
.btn-header:hover                     { background: var(--primary); border-color: var(--primary); }
.btn-header.btn-fullscreen            { background: transparent; color: var(--text-muted); }
.btn-header.btn-fullscreen:hover      { background: #334155; color: var(--text-main); }
.btn-header.btn-sound-toggle          { background: transparent; color: var(--accent); border-color: rgba(16,185,129,0.4); }
.btn-header.btn-sound-toggle.muted    { color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-header.btn-sound-toggle:hover    { background: #334155; }
.btn-header.btn-joystick              { background: transparent; color: var(--accent); border-color: rgba(16,185,129,0.4); }
.btn-header.btn-joystick.disabled     { color: var(--text-muted); border-color: var(--border); }
.btn-header.btn-joystick:hover        { background: #334155; color: var(--text-main); }

/* ── Slider volume dans le header game.html ── */
.volume-wrap {
    display: flex; align-items: center; gap: 7px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border); border-radius: 20px;
    padding: 4px 12px;
}
.volume-wrap i { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }
.volume-wrap input[type=range] {
    -webkit-appearance: none; appearance: none;
    width: 80px; height: 3px;
    background: var(--border); border-radius: 2px;
    outline: none; cursor: pointer; accent-color: var(--primary);
}
.volume-wrap input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--primary); cursor: pointer;
    box-shadow: 0 0 6px rgba(99,102,241,0.5);
}
.volume-wrap input[type=range]::-moz-range-thumb {
    width: 13px; height: 13px; border-radius: 50%; border: none;
    background: var(--primary); cursor: pointer;
}

/* ── Compteur FPS ── */
.fps-display {
    font-family: 'Courier New', monospace; font-size: 0.7rem;
    color: var(--text-muted); min-width: 52px; text-align: right;
}

/* ── Zone écran principale ── */
.game-area {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    background: #000; overflow: hidden; position: relative;
    height: calc(100vh - 52px);
    max-height: calc(100vh - 52px);
}

/* ── Overlay de chargement ── */
#loading-overlay {
    position: absolute; inset: 0;
    background: #000814;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 20px; z-index: 50;
    transition: opacity 0.5s ease;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loading-logo { font-size: 2.5rem; font-weight: 900; letter-spacing: -0.03em; color: white; }
.loading-logo span { color: var(--primary); }

.loading-bar-wrap { width: 280px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.loading-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    border-radius: 2px; transition: width 0.3s ease;
}
.loading-label { font-family: 'Courier New', monospace; font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.loading-label span { color: var(--accent); }

/* Spinner CPC-style (3 points rebondissants) */
.cpc-spinner { display: flex; gap: 6px; }
.cpc-spinner span {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary); animation: bounce 0.8s ease-in-out infinite;
}
.cpc-spinner span:nth-child(2) { animation-delay: 0.15s; background: #818cf8; }
.cpc-spinner span:nth-child(3) { animation-delay: 0.30s; background: #38bdf8; }

/* Canvas plein page, ratio CPC 783:544 préservé */
#emulator-area.game-emulator {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}

/* Taille dynamique viewport pour game.html */
.game-page #screen {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    width:  min(100vw,  calc((100vh - 52px) * 783 / 544));
    height: min(calc(100vh - 52px), calc(100vw * 544 / 783));
    aspect-ratio: 783 / 544;
}

/* LEDs disquette en mode game */
.game-page .screen-leds {
    position: absolute; bottom: 8px; right: 12px;
    display: flex; gap: 12px;
    background: rgba(0,0,0,0.6); padding: 4px 10px;
    border-radius: 20px; pointer-events: none;
}

/* Plein écran mode game */
.game-page #emulator-area:fullscreen {
    width: 100vw; height: 100vh; background: #000;
    display: flex; align-items: center; justify-content: center;
}
.game-page #emulator-area:fullscreen #screen { max-height: 100vh; width: auto; }

/* Éléments fantômes requis par les scripts (hors-écran, invisibles) */
.ghost-ui {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; opacity: 0; pointer-events: none;
    left: -9999px; top: -9999px;
}


/* ══ 16. Imprimante virtuelle (cpc-blank.html uniquement) ═══════════════════
   La carte #printer-card est display:none par défaut.
   VirtualPrinter.printLine() la rend visible au premier caractère reçu.    */

.printer-card { margin-top: 0; }

/* Zone de sortie scrollable — style "papier listing" vert sur noir */
.printer-output {
    max-height: 200px; overflow-y: auto;
    background: #020c02; border: 1px solid #1a3a1a;
    border-radius: 6px; padding: 8px 10px; margin-top: 8px;
    font-family: 'Courier New', monospace; font-size: 0.8rem;
    scrollbar-width: thin; scrollbar-color: #1a3a1a transparent;
}

/* Chaque ligne imprimée */
.printer-line {
    color: #33ff33; line-height: 1.6;
    white-space: pre-wrap; word-break: break-all;
    border-bottom: 1px solid #0a1a0a; padding: 1px 0;
}
.printer-line:last-child { border-bottom: none; }
.printer-line:hover { background: #071407; }


/* ══ 17. Game Card — Système de couches visuelles ═══════════════════════════
   Couche 1 : .main-icon        (icône de secours, fond)
   Couche 2 : .card-video       (vidéo preview, toujours rendue)
   Couche 3 : .card-thumbnail   (vignette PNG — par-dessus la vidéo par défaut)
   Couche 4 : .media-badge, .card-idx  (badges, toujours au-dessus)
   Au survol : .card-thumbnail passe en z:1 → la vidéo (z:2) devient visible  */

.card-visual {
    height: 106px; background: #0a1020;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}

/* Couche 1 — Icône de secours */
.card-visual .main-icon {
    position: absolute; z-index: 1;
    font-size: 2.5rem;
    color: var(--card-color, var(--primary));
    filter: drop-shadow(0 0 10px var(--card-color, var(--primary)));
    transition: transform 0.2s, filter 0.2s;
}

/* Couche 2 — Vidéo preview (toujours rendue, sous la vignette par défaut) */
.card-video {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover; z-index: 2;
    background: #000;
    transition: transform 0.3s ease;
}
/* .active sert uniquement au sélecteur JS pour play/pause */
.card-video.active { /* visible via z-index au survol */ }
.game-card:hover .card-video { transform: scale(1.08); }

/* Couche 3 — Vignette PNG (par-dessus la vidéo ; passe derrière au survol) */
.card-thumbnail {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover; z-index: 3; display: block;
    transition: z-index 0s;
}
/* Au survol : la vignette descend sous la vidéo */
.card-thumbnail {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover; 
    z-index: 3; /* L'image est au premier plan */
    display: block;
    transition: opacity 0.3s ease-in-out; /* Transition fluide */
}visibility: hidden;

/* Couche 4 — Badges et index (au-dessus de tout) */
.media-badge, .card-idx { z-index: 10; pointer-events: none; }

/* Éléments décoratifs non-interactifs */
.cat-tag, .card-year { pointer-events: none; }

/* Tooltip — au-dessus de tout */
.game-tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    color: var(--text-main);
    padding: 12px 14px; border-radius: 10px;
    font-size: 0.82rem; line-height: 1.4; max-width: 280px;
    z-index: 9999; pointer-events: none;
    opacity: 0; transform: translateY(5px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    visibility: hidden;
    font-family: 'Syne', sans-serif;
}
.game-tooltip.visible { opacity: 1; transform: translateY(0); visibility: visible; }

/* Désactiver le tooltip sur les écrans tactiles */
@media (hover: none) { .game-tooltip { display: none !important; } }


/* ══ 18. Pages statiques — Partagé (index, sample, 404) ════════════════════
   Override des règles émulateur (overflow:hidden / height:100vh) pour les
   pages qui ont besoin du scroll.
   Header sticky, navigation, footer partagés par les 3 pages statiques.   */

/* Réinitialisation scroll — s'applique sur index, sample et 404 */
html:not(.emu-mode) body:not(.game-page):not(.pro-mode) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-display);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

/* Neutralise le .main-container de l'émulateur sur les pages statiques */
html:not(.emu-mode) body:not(.game-page):not(.pro-mode) .main-container {
    overflow-y: visible !important;
    height: auto !important;
    flex: none !important;
}

/* Texture grain (overlay fixe) */
html:not(.emu-mode) body:not(.game-page):not(.pro-mode)::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 9999; opacity: 0.4;
}

/* Scanlines (overlay fixe) */
html:not(.emu-mode) body:not(.game-page):not(.pro-mode)::after {
    content: '';
    position: fixed; inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent, transparent 2px,
        rgba(0,0,0,var(--scanline-opacity)) 2px,
        rgba(0,0,0,var(--scanline-opacity)) 4px
    );
    pointer-events: none; z-index: 9998;
}

/* ── Header sticky des pages statiques ── */
.app-header.sticky {
    padding: 0 24px;
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(12px);
}
.app-header.sticky .header-content {
    height: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo cliquable (lien) */
.logo-section-link {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text-main);
}
.logo-section-link .logo-icon-lg {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: white; flex-shrink: 0;
}
.logo-section-link h1 { font-size: 1.25rem; margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.logo-section-link h1 span { color: var(--primary); }

/* Navigation principale */
.main-nav { display: flex; gap: 4px; align-items: center; }
.nav-link {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 8px;
    font-size: 0.875rem; font-weight: 600;
    text-decoration: none; color: var(--text-muted);
    transition: all 0.2s ease; border: 1px solid transparent;
}
.nav-link:hover {
    color: var(--text-main);
    background: rgba(99,102,241,0.1);
    border-color: rgba(99,102,241,0.3);
}
.nav-link.active {
    color: var(--primary);
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.4);
}
.nav-link.nav-cta { background: var(--primary); color: white; border-color: var(--primary); }
.nav-link.nav-cta:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* Footer commun des pages statiques */
footer {
    background: var(--bg-toolbar);
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    position: relative;
    z-index: 1;
}
.footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-logo {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; font-weight: 800; font-size: 1rem; color: var(--text-main);
}
.footer-logo i, .footer-logo span { color: var(--primary); }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 16px; }
.footer-links a {
    font-size: 0.8rem; color: var(--text-muted);
    text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-main); }

/* Dots colorés partagés (mockup CPC, 404, prompt) */
.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green  { background: #22c55e; }


/* ══ 19. Page d'accueil (index.html) ═══════════════════════════════════════ */

/* Conteneur principal */
body:not(.game-page):not(.pro-mode) main {
    flex: 1;
    max-width: 1200px; width: 100%;
    margin: 0 auto; padding: 0 24px;
}

/* ── Hero ── */
.hero {
    padding: 80px 0 60px;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 60px; align-items: center;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 0.75rem;
    color: var(--accent);
    background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3);
    border-radius: 20px; padding: 5px 12px; margin-bottom: 20px;
}
.hero-badge::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; background: var(--accent); animation: pulse-dot 2s infinite;
}
.hero h2 {
    font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800;
    line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 18px;
}
.hero h2 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 50%, #38bdf8 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 32px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Boutons hero */
.btn-hero-primary {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--primary); color: white; border: none;
    border-radius: 10px; padding: 12px 24px;
    font-weight: 700; font-size: 0.95rem; cursor: pointer;
    text-decoration: none; font-family: var(--font-display);
    transition: all 0.2s ease; box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.btn-hero-primary:hover { background: var(--primary-hover); box-shadow: 0 0 30px rgba(99,102,241,0.5); transform: translateY(-1px); }

.btn-hero-secondary {
    display: inline-flex; align-items: center; gap: 9px;
    background: transparent; color: var(--text-main);
    border: 1px solid var(--border); border-radius: 10px; padding: 12px 24px;
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    text-decoration: none; font-family: var(--font-display); transition: all 0.2s ease;
}
.btn-hero-secondary:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,0.06); }
.btn-hero-secondary-sm { font-size: 0.85rem; padding: 9px 18px; border-radius: 8px; align-self: flex-start; }

/* Faux écran CPC animé */
.hero-visual { position: relative; animation: float 6s ease-in-out infinite; }
.cpc-mockup {
    background: #0a0a14; border: 2px solid var(--border); border-radius: 12px; padding: 20px;
    box-shadow: 0 0 0 1px rgba(99,102,241,0.15), 0 40px 80px rgba(0,0,0,0.5), 0 0 60px rgba(99,102,241,0.1);
    position: relative; overflow: hidden;
}
.cpc-mockup::before {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.06) 4px);
    pointer-events: none; z-index: 2;
}
.cpc-screen-inner {
    background: #000814; border-radius: 4px; padding: 20px 16px;
    font-family: var(--font-mono); font-size: 0.78rem; min-height: 200px;
    position: relative; overflow: hidden;
}
.cpc-line { color: #4ade80; line-height: 1.7; opacity: 0; animation: fade-in-line 0.3s ease forwards; }
.cpc-line.dim    { color: #166534; }
.cpc-line.bright { color: #86efac; }
.cpc-line.blue   { color: #60a5fa; }
.cpc-line.yellow { color: #fbbf24; }
.cpc-line.cyan   { color: #22d3ee; }
.cpc-line.red    { color: #f87171; }
.cpc-cursor {
    display: inline-block; width: 8px; height: 14px; background: #4ade80;
    vertical-align: middle; animation: blink-cursor 1s step-end infinite; margin-left: 2px;
}

/* Délais d'animation progressifs pour les lignes du mockup CPC (index.html) */
.cpc-screen-inner .cpc-line:nth-child(1)  { animation-delay: 0.1s; }
.cpc-screen-inner .cpc-line:nth-child(2)  { animation-delay: 0.3s; }
.cpc-screen-inner .cpc-line:nth-child(3)  { animation-delay: 0.5s; }
.cpc-screen-inner .cpc-line:nth-child(4)  { animation-delay: 0.7s; }
.cpc-screen-inner .cpc-line:nth-child(5)  { animation-delay: 0.9s; }
.cpc-screen-inner .cpc-line:nth-child(6)  { animation-delay: 1.1s; }
.cpc-screen-inner .cpc-line:nth-child(7)  { animation-delay: 1.3s; }
.cpc-screen-inner .cpc-line:nth-child(8)  { animation-delay: 1.5s; }
.cpc-screen-inner .cpc-line:nth-child(9)  { animation-delay: 1.7s; }
.cpc-screen-inner .cpc-line:nth-child(10) { animation-delay: 1.9s; }
.cpc-screen-inner .cpc-line:nth-child(11) { animation-delay: 2.1s; }
.cpc-screen-inner .cpc-line:nth-child(12) { animation-delay: 2.3s; }
.mockup-bar {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.mockup-dot  { width: 10px; height: 10px; border-radius: 50%; }
.mockup-title {
    flex: 1; text-align: center;
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
}

/* ── Sections communes (Demo, History, Prompt) ── */
.section-demo, .section-history, .section-prompt {
    padding: 60px 0; border-top: 1px solid var(--border);
}
.section-label {
    font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--primary); text-transform: uppercase;
    letter-spacing: 0.12em; margin-bottom: 10px;
}
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.section-subtitle { color: var(--text-muted); max-width: 560px; font-size: 1rem; }

/* ── Demo cards ── */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; }
.demo-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 28px;
    display: flex; flex-direction: column; gap: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative; overflow: hidden;
}
.demo-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--primary), #818cf8); opacity: 0; transition: opacity 0.2s;
}
.demo-card:hover { border-color: var(--primary); box-shadow: 0 0 30px rgba(99,102,241,0.15); }
.demo-card:hover::before { opacity: 1; }
.demo-card.featured {
    grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 40px;
    background: linear-gradient(135deg, #1e1b4b 0%, var(--bg-card) 60%);
    border-color: rgba(99,102,241,0.4);
}
.demo-card.featured::before { opacity: 1; }
.demo-card-icon {
    width: 52px; height: 52px; border-radius: 12px;
    background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: var(--primary); flex-shrink: 0;
}
.demo-card.featured .demo-card-icon { width: 70px; height: 70px; font-size: 1.8rem; }
.demo-card h4 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.demo-card p  { margin: 0; color: var(--text-muted); font-size: 0.875rem; }
.demo-card .btn-hero-primary { align-self: flex-start; font-size: 0.875rem; padding: 10px 20px; }
.demo-card.featured .demo-card-text { flex: 1; }

/* ── Section Histoire ── */
.history-toc {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 16px 20px; margin: 28px 0 40px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.history-toc > span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }
.history-toc a {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
    text-decoration: none; padding: 5px 12px; border-radius: 6px;
    border: 1px solid var(--border); transition: all 0.2s ease;
}
.history-toc a:hover { color: var(--primary); border-color: var(--primary); background: rgba(99,102,241,0.07); }
.history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.history-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.history-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.history-num {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--primary);
    background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25);
    border-radius: 4px; padding: 3px 7px; flex-shrink: 0; margin-top: 4px;
}
.history-card h3 { margin: 0 0 2px; font-size: 1.05rem; font-weight: 700; }
.history-card .history-year { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.history-card p { margin: 0; color: var(--text-muted); font-size: 0.875rem; line-height: 1.65; }

/* ── Prompt aléatoire ── */
.prompt-box {
    background: #000814; border: 1px solid var(--border); border-radius: 14px;
    overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.4); margin-top: 28px;
}
.prompt-topbar {
    background: #111827; padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.prompt-dots { display: flex; gap: 6px; }
.prompt-dots span { width: 10px; height: 10px; border-radius: 50%; }
.prompt-title-bar { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.prompt-body { padding: 28px 32px 32px; font-family: var(--font-mono); font-size: 0.9rem; min-height: 90px; }
.prompt-label { color: #64748b; margin-bottom: 10px; }
.prompt-label span { color: var(--accent); }
.prompt-text { color: #4ade80; font-size: 1rem; line-height: 1.8; }
.prompt-cursor-inline {
    display: inline-block; width: 9px; height: 1em; background: #4ade80;
    vertical-align: text-bottom; animation: blink-cursor 1s step-end infinite; margin-left: 3px;
}
.prompt-reload {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font-mono); font-size: 0.72rem;
    color: var(--text-muted); background: none;
    border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px;
    cursor: pointer; transition: all 0.2s; margin-top: 18px;
}
.prompt-reload:hover { color: var(--accent); border-color: var(--accent); }

/* ── Responsive index.html ── */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding: 48px 0 36px; }
    .hero-visual { order: -1; }
    .demo-grid { grid-template-columns: 1fr; }
    .demo-card.featured { flex-direction: column; }
    .history-grid { grid-template-columns: 1fr; }
    .main-nav .nav-link span { display: none; }
}
@media (max-width: 600px) {
    main { padding: 0 16px; }
    .footer-inner { flex-direction: column; text-align: center; }
}


/* ══ 20. Catalogue de jeux (sample.html) ═══════════════════════════════════ */

/* Largeur max catalogue (1400px vs 1200px pour l'accueil) */
.catalog-main {
    max-width: 1400px;
    padding-bottom: 64px;
    position: relative;
    z-index: 1;
}
.catalog-footer .footer-inner { max-width: 1400px; }

/* Header catalogue — hauteur légèrement différente */
.catalog-header .header-content { height: 58px; max-width: 1400px; }
.logo-icon-sm {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 7px; display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; color: white;
}
.header-nav { display: flex; gap: 5px; align-items: center; }
.count-chip {
    font-family: var(--font-mono); font-size: 0.68rem;
    background: rgba(99,102,241,0.15); color: var(--primary);
    border: 1px solid rgba(99,102,241,0.3); border-radius: 20px; padding: 2px 8px;
}

/* Hero catalogue */
.catalog-hero {
    padding: 36px 0 24px;
    display: flex; justify-content: space-between;
    align-items: flex-end; gap: 20px; flex-wrap: wrap;
}
.eyebrow {
    font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--primary); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px;
}
.catalog-hero h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.1; }
.catalog-hero h2 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Barre de recherche */
.search-wrap { position: relative; }
.search-wrap .si {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); color: var(--text-muted); font-size: 0.82rem; pointer-events: none;
}
#search-input {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 9px 40px 9px 36px;
    color: var(--text-main); font-family: var(--font-mono);
    font-size: 0.82rem; width: 260px; outline: none; transition: border-color 0.2s;
}
#search-input::placeholder { color: var(--text-muted); }
#search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.search-shortcut {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-family: var(--font-mono); font-size: 0.6rem;
    color: var(--text-muted); background: #0f172a; border: 1px solid var(--border);
    border-radius: 4px; padding: 2px 5px; pointer-events: none;
}

/* Barre de filtres */
.filter-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; margin-bottom: 24px;
}
.filter-label {
    font-family: var(--font-mono); font-size: 0.66rem;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em;
    padding-right: 8px; border-right: 1px solid var(--border); margin-right: 2px; flex-shrink: 0;
}
.filter-group { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-sep   { width: 1px; height: 24px; background: var(--border); margin: 0 4px; flex-shrink: 0; align-self: center; }
.filter-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 20px;
    font-size: 0.76rem; font-weight: 600;
    border: 1px solid var(--border); background: transparent; color: var(--text-muted);
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
    font-family: 'Syne', sans-serif;
}
.filter-pill:hover { color: var(--text-main); border-color: #475569; background: #1a2540; }
.filter-pill.active { color: white; border-color: transparent; }

/* Couleurs actives — catégories */
.filter-pill.active[data-cat="all"]       { background: #334155; color: var(--text-main); border-color: #475569; }
.filter-pill.active[data-cat="Action"]    { background: var(--cat-action);   box-shadow: 0 0 10px rgba(245,158,11,.35); }
.filter-pill.active[data-cat="Arcade"]    { background: var(--cat-arcade);   box-shadow: 0 0 10px rgba(236,72,153,.35); }
.filter-pill.active[data-cat="Platform"]  { background: var(--cat-platform); box-shadow: 0 0 10px rgba(249,115,22,.35); }
.filter-pill.active[data-cat="RPG"]       { background: var(--cat-rpg);      box-shadow: 0 0 10px rgba(139,92,246,.35); }
.filter-pill.active[data-cat="Puzzle"]    { background: var(--cat-puzzle);   box-shadow: 0 0 10px rgba(6,182,212,.35); }
.filter-pill.active[data-cat="Sport"]     { background: var(--cat-sport);    box-shadow: 0 0 10px rgba(34,197,94,.35); }
.filter-pill.active[data-cat="Demo"]      { background: var(--cat-demo);     box-shadow: 0 0 10px rgba(167,139,250,.35); }
.filter-pill.active[data-cat="Strategie"] { background: var(--cat-strat);    box-shadow: 0 0 10px rgba(100,116,139,.35); }

/* Couleurs actives — médias */
.filter-pill.active[data-media="all"]  { background: #334155; color: var(--text-main); border-color: #475569; }
.filter-pill.active[data-media="disc"] { background: var(--media-disc); box-shadow: 0 0 10px rgba(99,102,241,.4); }
.filter-pill.active[data-media="snap"] { background: var(--media-snap); box-shadow: 0 0 10px rgba(16,185,129,.4); }
.filter-pill.active[data-media="cart"] { background: var(--media-cart); box-shadow: 0 0 10px rgba(245,158,11,.4); }

.sort-select {
    margin-left: auto; background: #0f172a; border: 1px solid var(--border);
    color: var(--text-main); border-radius: 8px; padding: 5px 10px;
    font-size: 0.76rem; font-family: 'Syne', sans-serif; cursor: pointer; outline: none;
}
.sort-select option { background: var(--bg-card); }

/* Barre de résultats */
.results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 8px; }
.results-info { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.results-info span { color: var(--accent); }
.active-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.active-tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--font-mono); font-size: 0.66rem;
    background: rgba(99,102,241,0.12); color: var(--primary);
    border: 1px solid rgba(99,102,241,0.25); border-radius: 20px; padding: 2px 9px;
}

/* Grille des jeux */
#games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }

/* Carte jeu */
.game-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex; flex-direction: column;
    position: relative; text-decoration: none; color: inherit;
    animation: card-in 0.28s ease both;
}
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 44px rgba(0,0,0,0.45), 0 0 0 1px rgba(99,102,241,0.3);
    border-color: rgba(99,102,241,0.4);
}
.game-card:active { transform: translateY(-1px); }

/* Barre de couleur en haut de chaque carte */
.game-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--card-color, var(--primary)); opacity: 0.65; transition: opacity 0.2s;
}
.game-card:hover::before { opacity: 1; }

/* Zone visuelle (surcharge §17 avec fond dégradé et halo) */
.game-card .card-visual {
    background: linear-gradient(150deg, #0a1020 0%, #172035 100%);
}
.game-card .card-visual::after {
    content: ''; position: absolute; width: 90px; height: 90px; border-radius: 50%;
    background: radial-gradient(circle, var(--card-color, var(--primary)) 0%, transparent 70%); opacity: 0.15;
}
.game-card:hover .main-icon { transform: scale(1.14); filter: drop-shadow(0 0 22px var(--card-color, var(--primary))); }

/* Badge média */
.media-badge {
    position: absolute; top: 9px; right: 9px;
    display: flex; align-items: center; gap: 4px;
    font-family: var(--font-mono); font-size: 0.6rem;
    padding: 3px 7px; border-radius: 20px; font-weight: 700;
    backdrop-filter: blur(6px); letter-spacing: 0.04em;
}
.mb-disc { background: rgba(99,102,241,0.22); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.4); }
.mb-snap { background: rgba(16,185,129,0.22); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.4); }
.mb-cart { background: rgba(245,158,11,0.22); color: #fcd34d; border: 1px solid rgba(245,158,11,0.4); }

/* Numéro d'index */
.card-idx { position: absolute; top: 9px; left: 10px; font-family: var(--font-mono); font-size: 0.58rem; color: rgba(255,255,255,0.2); }

/* Corps de la carte */
.card-body  { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 0.92rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.card-meta  { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cat-tag    { font-size: 0.66rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; color: white; letter-spacing: 0.04em; background: var(--card-color, var(--primary)); }
.card-year  { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); }

/* Bouton play — glisse vers le bas au survol */
.card-play-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px; background: var(--card-color, var(--primary));
    color: white; font-size: 0.76rem; font-weight: 700;
    border-top: 1px solid rgba(255,255,255,0.07);
    opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s;
}
.game-card:hover .card-play-btn { opacity: 1; transform: translateY(0); }

/* Empty state */
.empty-state { display: none; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; gap: 14px; text-align: center; }
.empty-state.show { display: flex; }
.empty-state i { font-size: 3rem; color: var(--border); }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.empty-state button {
    margin-top: 4px; padding: 9px 20px;
    background: var(--primary); color: white; border: none;
    border-radius: 8px; cursor: pointer; font-weight: 700;
    font-family: 'Syne', sans-serif; font-size: 0.85rem; transition: background 0.2s;
}
.empty-state button:hover { background: var(--primary-hover); }

/* Responsive catalogue */
@media (max-width: 768px) {
    #games-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
    .header-nav .nav-link span { display: none; }
    #search-input { width: 180px; }
    .filter-bar { gap: 6px; }
}
@media (max-width: 480px) {
    .catalog-main { padding: 0 12px 48px; }
    #games-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-hero { padding: 22px 0 18px; }
}


/* ══ 21. Page d'erreur 404 ══════════════════════════════════════════════════ */

/* Layout : main centré verticalement */
.page-404 main {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 24px; gap: 48px;
}

/* ── Code 404 avec effet glitch ── */
.error-code {
    font-family: var(--font-mono);
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 900; line-height: 1; letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--primary), #818cf8, #38bdf8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    position: relative; user-select: none;
}
.error-code::before,
.error-code::after {
    content: '404'; position: absolute; inset: 0;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.error-code::before {
    background: linear-gradient(135deg, var(--danger), #f97316);
    -webkit-background-clip: text; background-clip: text;
    animation: glitch-a 3.5s infinite; opacity: 0.7;
}
.error-code::after {
    background: linear-gradient(135deg, #38bdf8, var(--accent));
    -webkit-background-clip: text; background-clip: text;
    animation: glitch-b 3.5s infinite; opacity: 0.5;
}

/* ── Faux écran CPC (404) ── */
.cpc-screen {
    width: 100%; max-width: 580px; background: #000;
    border: 3px solid var(--border); border-radius: 10px; overflow: hidden;
    box-shadow: 0 0 0 1px #0f172a, 0 25px 50px -12px rgba(0,0,0,0.6), 0 0 80px rgba(99,102,241,0.08);
    position: relative;
}
.cpc-screen::after {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.12) 3px, rgba(0,0,0,0.12) 4px);
    pointer-events: none; z-index: 2;
}
.screen-topbar {
    background: #111827; border-bottom: 1px solid #1e293b;
    padding: 8px 14px; display: flex; align-items: center; gap: 10px;
}
.screen-topbar-dots { display: flex; gap: 6px; }
.screen-topbar-dots span { width: 9px; height: 9px; border-radius: 50%; }
.screen-topbar-title { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); flex: 1; text-align: center; }
.screen-body { padding: 20px 24px 24px; font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.8; color: #aaa; min-height: 200px; }
.screen-line  { color: #888; }
.screen-error { color: var(--danger); font-weight: bold; margin-top: 4px; }
.screen-hint  { color: #6366f1; }
.screen-prompt { color: #c0c0c0; margin-top: 12px; }
.screen-cursor {
    display: inline-block; width: 10px; height: 1.1em; background: #c0c0c0;
    vertical-align: text-bottom; animation: blink-cursor 1s step-end infinite; margin-left: 1px;
}

/* ── Texte d'explication (404) ── */
.error-text { text-align: center; max-width: 480px; }
.error-text h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.02em; }
.error-text p  { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.error-text code {
    font-family: var(--font-mono); font-size: 0.88rem; color: var(--accent);
    background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2);
    padding: 1px 6px; border-radius: 4px;
}

/* ── Boutons de navigation (404) ── */
.error-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-error {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px; border-radius: 9px;
    font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
    text-decoration: none; transition: all 0.2s ease; cursor: pointer; border: none;
}
.btn-error.primary {
    background: var(--primary); color: white; box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.btn-error.primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
.btn-error.secondary { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }
.btn-error.secondary:hover { color: var(--text-main); border-color: var(--primary); background: rgba(99,102,241,0.08); }
.btn-error.danger { background: transparent; color: var(--accent); border: 1px solid rgba(16,185,129,0.35); }
.btn-error.danger:hover { background: rgba(16,185,129,0.08); border-color: var(--accent); color: var(--text-main); }