/* ==========================================================================
   DESIGN SYSTEM - HACHE GPS ADVENTURE
   Mobile-First, Responsive, Cyber-Exploration Aesthetic
   ========================================================================== */

:root {
    /* Palette de couleurs */
    --bg-deep: #090d14;
    --bg-surface: #111827;
    --bg-card: #1a2233;
    --bg-card-hover: #222d42;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.16);

    /* Accents vibrants */
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.35);
    --accent-amber: #f59e0b;
    --accent-amber-glow: rgba(245, 158, 11, 0.3);
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.35);
    --accent-red: #ef4444;

    /* Typographie */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Rayons et ombres */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.25);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Texture de fond subtile */
body {
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Typographie */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--text-primary);
}

.mono {
    font-family: var(--font-mono);
}

/* Conteneur global */
.app-container {
    max-width: 540px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0 16px 32px 16px;
    position: relative;
}

/* En-tête de l'application */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    transition: opacity var(--transition-smooth);
}

.app-header.header-minimal {
    border-bottom-color: transparent;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-cyan);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand-icon {
    width: 28px;
    height: 28px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover, .icon-btn:active {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-highlight);
    transform: scale(0.96);
}

/* Système d'écrans (Vue active / inactive) */
.app-screen {
    display: none;
    flex-direction: column;
    flex: 1;
    animation: fadeIn 0.35s ease forwards;
}

.app-screen.active {
    display: flex;
}

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

/* ==========================================================================
   1. ÉCRAN DE VERROU (PORTE D'ENTRÉE)
   ========================================================================== */
.gate-hero {
    margin-top: auto;
    margin-bottom: auto;
    padding: 24px 0;
}

.gate-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    box-shadow: var(--shadow-card);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-amber));
}

.gate-emblem {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px auto;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    display: grid;
    place-items: center;
    color: var(--accent-cyan);
    font-size: 28px;
}

.gate-title {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.gate-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.riddle-box {
    background: var(--bg-card);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.riddle-quote {
    font-style: italic;
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--accent-amber);
    line-height: 1.4;
}

.gate-input-group {
    margin-bottom: 16px;
}

.text-input {
    width: 100%;
    height: 52px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-highlight);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-align: center;
    padding: 0 16px;
    transition: all var(--transition-fast);
}

.text-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.primary-btn {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.primary-btn:active {
    transform: scale(0.98);
}

.error-message {
    display: none;
    color: var(--accent-red);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 12px;
    animation: fadeIn 0.2s ease;
}

.error-message.visible {
    display: block;
}

.hint-container {
    margin-top: 16px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.hint-box {
    margin-top: 10px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--accent-amber);
}

.hidden {
    display: none !important;
}

/* Animations Porte */
.shake {
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

.unlock-pulse {
    animation: unlockGlow 0.8s ease forwards;
}

@keyframes unlockGlow {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); box-shadow: 0 0 40px var(--accent-cyan-glow); border-color: var(--accent-cyan); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   2. ÉCRAN DU HUB DE MISSION
   ========================================================================== */
.hub-header {
    margin-bottom: 20px;
}

.hub-title {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.hub-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Barre de progression */
.progress-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 24px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.progress-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-count {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-weight: 600;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-card);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
    border-radius: 99px;
    transition: width 0.5s ease;
}

/* Cartes de mini-jeux */
.mission-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.mission-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.mission-card:hover, .mission-card:active {
    background: var(--bg-card);
    border-color: var(--border-highlight);
    transform: translateY(-2px);
}

.mission-card.completed {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.04);
}

.mission-card.completed::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-emerald);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: grid;
    place-items: center;
    font-size: 22px;
    flex-shrink: 0;
}

.mission-card.completed .card-icon {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
}

.card-content {
    flex: 1;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.card-tag {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
}

.mission-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.card-title {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.card-reward {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.mission-card.completed .card-reward {
    color: var(--accent-emerald);
    font-weight: 600;
}

.card-arrow {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.mission-card:hover .card-arrow {
    transform: translateX(3px);
    color: var(--text-primary);
}

.final-unlock-cta {
    margin-top: auto;
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    box-shadow: 0 4px 20px var(--accent-emerald-glow);
}

/* ==========================================================================
   3. STRUCTURE COMMUNE DES MINI-JEUX
   ========================================================================== */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.game-title-wrap {
    text-align: center;
}

.game-tag {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.game-title {
    font-size: 1.25rem;
}

.game-instructions {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.game-status-bar {
    margin-top: 16px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    min-height: 24px;
}

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

.status-online {
    color: var(--accent-emerald);
    font-weight: 700;
}

.status-error {
    color: var(--accent-red);
}

.game-controls {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.secondary-btn {
    flex: 1;
    height: 48px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.secondary-btn:hover, .secondary-btn:active {
    background: var(--bg-card);
    border-color: var(--border-highlight);
}

/* ==========================================================================
   4. MINI-JEU 1 : CIRCUIT ÉNERGÉTIQUE
   ========================================================================== */
.circuit-board {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
    position: relative;
}

.circuit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.circuit-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color var(--transition-fast);
    position: relative;
    user-select: none;
}

.circuit-tile:active {
    background: var(--bg-card-hover);
}

.pipe-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.pipe-track {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 16;
    stroke-linecap: square;
    fill: none;
}

.pipe-core {
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 6;
    stroke-linecap: round;
    fill: none;
    transition: stroke 0.3s ease, filter 0.3s ease;
}

.pipe-node {
    fill: rgba(255, 255, 255, 0.3);
    transition: fill 0.3s ease;
}

/* Tuile alimentée */
.circuit-tile.is-powered .pipe-core {
    stroke: var(--accent-cyan);
    filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.circuit-tile.is-powered .pipe-node {
    fill: var(--accent-cyan);
    filter: drop-shadow(0 0 4px var(--accent-cyan));
}

.grid-solved .circuit-tile.is-powered .pipe-core {
    stroke: var(--accent-emerald);
    filter: drop-shadow(0 0 8px var(--accent-emerald));
}

.grid-solved .circuit-tile.is-powered .pipe-node {
    fill: var(--accent-emerald);
}

/* Balises entrée / sortie */
.circuit-markers {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ==========================================================================
   5. MINI-JEU 2 : OSCILLOSCOPE SIGNAL
   ========================================================================== */
.oscilloscope-screen {
    background: #04070d;
    border: 2px solid #1e293b;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    margin-bottom: 16px;
}

#oscilloscope-canvas {
    width: 100%;
    height: 180px;
    display: block;
}

.signal-legend {
    display: flex;
    justify-content: space-around;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot-target {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 6px var(--accent-cyan);
}

.dot-player {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-amber);
    box-shadow: 0 0 6px var(--accent-amber);
}

/* Jauge de synchronisation */
.sync-gauge-wrap {
    margin-bottom: 20px;
}

.sync-gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.sync-gauge-track {
    width: 100%;
    height: 10px;
    background: var(--bg-card);
    border-radius: 99px;
    overflow: hidden;
}

.sync-gauge-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-cyan);
    border-radius: 99px;
    transition: width 0.1s linear, background-color 0.2s ease;
}

/* Contrôles de signal */
.slider-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.slider-unit {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.slider-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stepper-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: bold;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.stepper-btn:active {
    background: var(--bg-card-hover);
    transform: scale(0.95);
}

/* Range input stylisé */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-card);
    border-radius: 99px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-amber);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-amber-glow);
    border: 2px solid #ffffff;
}

/* ==========================================================================
   6. MINI-JEU 3 : CRYPTEX MÉCANIQUE
   ========================================================================== */
.cryptex-body {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.cryptex-wheels-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.cryptex-wheel-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.wheel-btn {
    width: 100%;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.wheel-btn:active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: scale(0.94);
}

.wheel-viewport {
    width: 100%;
    height: 68px;
    background: linear-gradient(180deg, #0b111b 0%, #172338 50%, #0b111b 100%);
    border: 1.5px solid #2d3d59;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.6);
    user-select: none;
    touch-action: pan-y;
}

.wheel-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transition: transform 0.1s ease;
}

.val-bump {
    animation: bump 0.15s ease;
}

@keyframes bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); color: var(--accent-amber); }
    100% { transform: scale(1); }
}

.wheel-unlocked .wheel-viewport {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 15px var(--accent-emerald-glow), inset 0 0 15px rgba(16, 185, 129, 0.2);
}

.wheel-unlocked .wheel-value {
    color: var(--accent-emerald);
    text-shadow: 0 0 12px var(--accent-emerald);
}

/* Boîte des indices */
.clues-card {
    background: var(--bg-card);
    border: 1px dashed var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.clues-header {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--accent-amber);
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clues-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.clue-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
}

.clue-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ==========================================================================
   7. ÉCRAN FINAL (RÉVÉLATION COORDONNÉES GPS)
   ========================================================================== */
.victory-hero {
    margin-top: auto;
    margin-bottom: auto;
    padding: 16px 0;
    text-align: center;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99;
}

.victory-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.victory-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.victory-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* Boîte des coordonnées */
.gps-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--accent-emerald);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    margin-bottom: 24px;
    box-shadow: 0 0 35px var(--accent-emerald-glow);
    position: relative;
    overflow: hidden;
}

.gps-card-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.gps-coordinates-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.gps-coord-line {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.04em;
}

.gps-decimal {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-cyan);
}

.gps-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-apps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.nav-app-btn {
    height: 46px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.nav-app-btn:hover, .nav-app-btn:active {
    background: var(--bg-card-hover);
    border-color: var(--border-highlight);
    transform: translateY(-2px);
}

/* ==========================================================================
   8. MINI-JEU 4 : INTERCEPTION RÉFLEXE
   ========================================================================== */
.reflex-arena {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.reflex-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.reflex-score-badge {
    color: var(--accent-cyan);
    font-weight: 700;
}

.reflex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    aspect-ratio: 1 / 1;
    max-width: 320px;
    margin: 0 auto 16px auto;
}

.reflex-pod {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    padding: 0;
    transition: transform 0.1s ease, border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
}

.pod-inner {
    width: 65%;
    height: 65%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    place-items: center;
    transition: all 0.15s ease;
}

.pod-core {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.15s ease;
}

/* Balise active / cible */
.reflex-pod.pod-active {
    border-color: var(--accent-amber);
    box-shadow: 0 0 25px var(--accent-amber-glow);
    animation: podPulse 0.35s infinite alternate ease-in-out;
}

.reflex-pod.pod-active .pod-inner {
    background: rgba(245, 158, 11, 0.25);
    transform: scale(1.1);
}

.reflex-pod.pod-active .pod-core {
    background: var(--accent-amber);
    box-shadow: 0 0 12px var(--accent-amber);
    transform: scale(1.5);
}

@keyframes podPulse {
    from { transform: scale(0.96); }
    to { transform: scale(1.04); }
}

/* Balise touchée */
.reflex-pod.pod-hit {
    border-color: var(--accent-emerald) !important;
    box-shadow: 0 0 30px var(--accent-emerald-glow) !important;
    transform: scale(1.15) !important;
}

.reflex-pod.pod-hit .pod-core {
    background: var(--accent-emerald) !important;
}

.grid-solved .reflex-pod {
    border-color: var(--accent-emerald);
}

.grid-solved .reflex-pod .pod-core {
    background: var(--accent-emerald);
}

/* ==========================================================================
   9. MINI-JEU 5 : QUIZ FOOTBALL
   ========================================================================== */
.quiz-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.quiz-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--accent-amber);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quiz-counter {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.quiz-question {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option-btn {
    min-height: 52px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
    user-select: none;
}

.quiz-option-btn:hover:not(:disabled), .quiz-option-btn:active:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}

.opt-letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.opt-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
}

/* Réponses correctes / incorrectes */
.quiz-option-btn.opt-correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--accent-emerald) !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px var(--accent-emerald-glow);
}

.quiz-option-btn.opt-correct .opt-letter {
    background: var(--accent-emerald);
    color: #ffffff;
}

.quiz-option-btn.opt-wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--accent-red) !important;
    color: #ffffff !important;
}

.quiz-option-btn.opt-wrong .opt-letter {
    background: var(--accent-red);
    color: #ffffff;
}

/* Feedback sous la question */
.quiz-feedback-box {
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 0.9rem;
    margin-top: 14px;
    line-height: 1.4;
    animation: fadeIn 0.25s ease;
}

.feedback-correct {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}

.feedback-wrong {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

/* Mème de Victoire Football */
.quiz-meme-box {
    background: var(--bg-card);
    border: 2px solid var(--accent-amber);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 18px;
    text-align: center;
    box-shadow: 0 0 35px var(--accent-amber-glow);
    animation: memePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes memePop {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.meme-header-caption {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 12px;
    line-height: 1.35;
}

.meme-img-wrapper {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    margin-bottom: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: #000000;
}

.meme-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    display: block;
}

.meme-punchline {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--accent-amber);
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ==========================================================================
   10. MODALES & DIALOGUES
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    place-items: center;
    padding: 16px;
    z-index: 100;
}

.modal-overlay.visible {
    display: grid;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.modal-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.danger-btn {
    background: var(--accent-red);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   9. OPTIMISATION MOBILE BREAKPOINTS
   ========================================================================== */
@media (max-width: 360px) {
    .brand-badge {
        font-size: 0.95rem;
    }
    .gps-coord-line {
        font-size: 1.25rem;
    }
    .wheel-value {
        font-size: 1.8rem;
    }
    .wheel-viewport {
        height: 56px;
    }
}
