@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;900&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: #0c0f16;
    font-family: 'Montserrat', sans-serif;
    user-select: none;
}

button {
    font-family: inherit;
}

#game-canvas {
    width: 100vw;
    height: 100vh;
    display: block;
}

/* Hide cursor during active gameplay (pointer lock or movementX/Y mode) */
body.game-playing #game-canvas,
body.game-playing #game-canvas canvas {
    cursor: none;
}

/* --- UI OVERLAYS & GLASSMORPHISM --- */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
}

#overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

#difficulty-selector input[type="checkbox"] {
    filter: hue-rotate(15deg) saturate(2);
}

#difficulty-selector label:hover {
    background: rgba(67, 170, 139, 0.08);
    border-radius: 8px;
    padding: 4px;
    margin: -4px;
}

#start-screen, #end-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0d47a1 0%, #062a5c 40%, #030c1e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 100;
    pointer-events: auto;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
}

#end-screen { display: none; }

/* --- POINTER LOCK RESUME OVERLAY (Minecraft-style) --- */
#pointer-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none; /* shown by JS when lock is lost during gameplay */
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 15, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    pointer-events: auto;
}

#pointer-lock-overlay.visible {
    display: flex;
    animation: plo-fade-in 0.25s ease both;
}

@keyframes plo-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#pointer-lock-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: rgba(13, 17, 23, 0.82);
    border: 1px solid rgba(67, 170, 139, 0.35);
    border-radius: 20px;
    padding: 40px 60px;
    box-shadow: 0 0 60px rgba(67, 170, 139, 0.15), inset 0 1px 0 rgba(255,255,255,0.06);
}

.plo-icon {
    font-size: 3rem;
    animation: plo-pulse 1.8s ease-in-out infinite;
}

@keyframes plo-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.12); opacity: 0.75; }
}

.plo-title {
    font-size: 1.9rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.plo-hint {
    font-size: 1.05rem;
    color: #43aa8b;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
}

.plo-sub {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 400;
}

/* h1/h2 globaux — utilisés pour l'end-screen et autres overlays, pas le menu principal */
#end-screen h1 {
    font-size: 4.5rem;
    font-weight: 900;
    margin: 0;
    color: #ff6b1a;
    text-shadow: 4px 4px 0px #0d47a1, 0 0 30px rgba(255, 107, 26, 0.4);
    text-transform: uppercase;
    letter-spacing: 5px;
}

#end-screen h2 {
    font-size: 1.4rem;
    color: #00b4d8;
    margin-top: 10px;
    margin-bottom: 40px;
    font-weight: 600;
    letter-spacing: 2px;
}

.panel-glass {
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

#notebook-screen,
#synthesis-screen,
#richter-screen,
#hotspot-screen,
#howto-overlay {
    background: rgba(13, 17, 23, 0.92);
}

.instructions {
    padding: 30px 40px;
    margin-bottom: 40px;
    max-width: 750px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.btn-primary {
    padding: 18px 50px;
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff6b1a 0%, #ff3d00 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(255, 107, 26, 0.4);
    pointer-events: auto;
    letter-spacing: 1px;
}
.btn-primary:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 107, 26, 0.6);
}
.btn-primary:active {
    transform: scale(0.98) translateY(1px);
}

/* --- HUD ELEMENTS --- */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    display: none;
}

#mission-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 380px;
    padding: 20px;
    color: white;
    border-left: 6px solid #e94560;
    animation: slideIn 0.5s ease-out;
    display: none;
}

#mission-title {
    font-size: 0.85rem;
    color: #43aa8b;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}
#mission-text {
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: 600;
}

#score-hud {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 15px 30px;
    color: white;
    font-weight: 900;
    font-size: 1.4rem;
    border-bottom: 4px solid #43aa8b;
    display: none;
    letter-spacing: 1px;
    transition: transform 0.2s ease;
}

#interaction-prompt {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    color: #0d1117;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 900;
    font-size: 1.05rem;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid #e94560;
}

/* Dialogue Box overlay */
#dialogue-box {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1050px;
    padding: 30px 45px;
    color: white;
    display: none;
    align-items: center;
    gap: 35px;
    pointer-events: auto;
    cursor: pointer;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(13, 20, 35, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    animation: floatUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Bordures lumineuses réactives */
#dialogue-box.speaker-geo {
    border-color: rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.25), 0 20px 50px rgba(0,0,0,0.6) !important;
}
#dialogue-box.speaker-guide {
    border-color: rgba(34, 197, 94, 0.6) !important;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.25), 0 20px 50px rgba(0,0,0,0.6) !important;
}
#dialogue-box.speaker-archeo {
    border-color: rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.25), 0 20px 50px rgba(0,0,0,0.6) !important;
}
#dialogue-box.speaker-analyst {
    border-color: rgba(168, 85, 247, 0.6) !important;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.25), 0 20px 50px rgba(0,0,0,0.6) !important;
}
#dialogue-box.speaker-default {
    border-color: rgba(239, 68, 68, 0.6) !important;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.25), 0 20px 50px rgba(0,0,0,0.6) !important;
}

#speaker-portrait {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    background-color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease;
}

#dialogue-box.speaker-geo #speaker-portrait { border-color: #38bdf8; box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); }
#dialogue-box.speaker-guide #speaker-portrait { border-color: #22c55e; box-shadow: 0 0 20px rgba(34, 197, 94, 0.4); }
#dialogue-box.speaker-archeo #speaker-portrait { border-color: #f59e0b; box-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
#dialogue-box.speaker-analyst #speaker-portrait { border-color: #a855f7; box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); }
#dialogue-box.speaker-default #speaker-portrait { border-color: #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }

#dialogue-content {
    flex-grow: 1;
}
#speaker-name {
    color: #ffffff;
    font-weight: 900;
    font-size: 1.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    transition: color 0.4s ease;
}
#dialogue-box.speaker-geo #speaker-name { color: #38bdf8; }
#dialogue-box.speaker-guide #speaker-name { color: #22c55e; }
#dialogue-box.speaker-archeo #speaker-name { color: #f59e0b; }
#dialogue-box.speaker-analyst #speaker-name { color: #a855f7; }
#dialogue-box.speaker-default #speaker-name { color: #ef4444; }

/* Indicateur sonore dynamique */
.soundwave {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    width: 25px;
    height: 18px;
    margin-left: 12px;
}
.soundwave .stroke {
    display: block;
    width: 3px;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    animation: bounceSoundwave 1.2s ease-in-out infinite alternate;
    transition: background-color 0.4s ease;
}
#dialogue-box.speaker-geo .soundwave .stroke { background-color: #38bdf8; }
#dialogue-box.speaker-guide .soundwave .stroke { background-color: #22c55e; }
#dialogue-box.speaker-archeo .soundwave .stroke { background-color: #f59e0b; }
#dialogue-box.speaker-analyst .soundwave .stroke { background-color: #a855f7; }
#dialogue-box.speaker-default .soundwave .stroke { background-color: #ef4444; }

.soundwave .stroke:nth-child(1) { animation-delay: 0.1s; }
.soundwave .stroke:nth-child(2) { animation-delay: 0.3s; }
.soundwave .stroke:nth-child(3) { animation-delay: 0.5s; }
.soundwave .stroke:nth-child(4) { animation-delay: 0.2s; }
.soundwave .stroke:nth-child(5) { animation-delay: 0.4s; }

@keyframes bounceSoundwave {
    0% { height: 15%; }
    100% { height: 100%; }
}

#dialogue-text {
    font-size: 1.55rem;
    line-height: 1.75;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    margin-top: 10px;
}

#dialogue-instruction {
    font-size: 1.05rem;
    color: #94a3b8;
    margin-top: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
    display: inline-block;
    width: 100%;
}

/* Code couleur sémantique pour les mots clés */
.hl-danger {
    color: #ff6b6b;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.35);
}
.hl-protect {
    color: #4ade80;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
}
.hl-stats {
    color: #fbbf24;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
}

/* Listes à puces aérées */
.dialogue-list {
    list-style: none;
    padding-left: 5px;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dialogue-list li {
    position: relative;
    padding-left: 28px;
    font-size: 1.45rem;
    line-height: 1.6;
}
.dialogue-list li::before {
    content: "➜";
    position: absolute;
    left: 2px;
    color: #38bdf8;
    font-weight: 900;
    font-size: 1.2rem;
    top: 0px;
}
#dialogue-box.speaker-guide .dialogue-list li::before { color: #22c55e; }
#dialogue-box.speaker-archeo .dialogue-list li::before { color: #f59e0b; }
#dialogue-box.speaker-analyst .dialogue-list li::before { color: #a855f7; }

/* Cartes de définition et citations */
.dialogue-definition-card {
    background: rgba(56, 189, 248, 0.08);
    border-left: 4px solid #38bdf8;
    padding: 14px 20px;
    border-radius: 4px 12px 12px 4px;
    margin: 18px 0;
    font-size: 1.45rem;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.dialogue-quote-card {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid #f59e0b;
    padding: 14px 20px;
    border-radius: 4px 12px 12px 4px;
    margin: 18px 0;
    font-size: 1.45rem;
    line-height: 1.6;
    font-style: italic;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* === Lisibilité enfant : indices Q&A (bulle dialogue + indice quiz) === */
#qa-hint {
    font-size: 1.15rem;
    border-left: 4px solid #fbbf24;
}
#quiz-extra-hint {
    font-size: 1.15rem !important;
}

/* --- FADE OVERLAY FOR TRANSITIONS --- */
#fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    opacity: 0;
    pointer-events: none;
    z-index: 90;
    transition: opacity 0.5s ease;
}

/* --- SCREENSAVER/ALERTS --- */
#alert-screen {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 38, 38, 0.95);
    color: white;
    padding: 20px 50px;
    font-size: 2.5rem;
    font-weight: 900;
    border-radius: 12px;
    display: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 40px rgba(220, 38, 38, 0.7);
    z-index: 80;
    text-align: center;
    border: 3px solid white;
}

#btn-esc {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.75);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: none;
    z-index: 60;
    pointer-events: auto;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}
#btn-esc:hover {
    color: white;
    background: rgba(233, 69, 96, 0.85);
    border-color: #e94560;
}

/* Richter Screen Overlay */
#richter-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    color: white;
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 120;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    animation: zoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.richter-slider-container {
    width: 100%;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#richter-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 10px;
    border-radius: 5px;
    background: #1e293b;
    outline: none;
    cursor: pointer;
}

#richter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e94560;
    cursor: pointer;
    box-shadow: 0 0 10px #e94560;
    transition: transform 0.1s;
}

#richter-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#richter-mag-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: #e94560;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

#richter-desc {
    width: 100%;
    padding: 15px;
    font-size: 0.95rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    line-height: 1.5;
}

/* Notebook HUD Button */
#notebook-hud-btn {
    position: absolute;
    top: 20px;
    left: 420px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 800;
    background: rgba(13, 17, 23, 0.75);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    z-index: 50;
    pointer-events: auto;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}
#notebook-hud-btn:hover {
    background: #e94560;
    border-color: #ff5775;
    transform: translateY(-2px);
}

/* Quiz Hint Box */
#quiz-hint-box {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1050px;
    padding: 30px 45px;
    color: white;
    display: none;
    align-items: center;
    gap: 35px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    pointer-events: auto;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(8, 10, 15, 0.93) !important;
    animation: floatUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 150;
}

#quiz-hint-portrait {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #f59e0b;
    background-color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

#quiz-hint-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#quiz-hint-title {
    color: #fbbf24;
    font-weight: 900;
    font-size: 1.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

#quiz-hint-text {
    font-size: 1.55rem;
    line-height: 1.75;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    margin-bottom: 8px;
}

#quiz-hint-btn {
    align-self: flex-start;
    padding: 12px 28px;
    font-size: 1.15rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.3);
}
#quiz-hint-btn:hover {
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.5);
}

/* Notebook Fullscreen Screen */
#notebook-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    max-width: 1150px;
    max-height: 820px;
    padding: 30px 45px;
    color: white;
    display: none;
    flex-direction: column;
    z-index: 130;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notebook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.notebook-header h2 {
    white-space: nowrap;
    font-size: 1.35rem;
    letter-spacing: 1.5px;
}

.notebook-progress {
    font-size: 0.92rem;
    color: #43aa8b;
    font-weight: 700;
    background: rgba(67, 170, 139, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(67, 170, 139, 0.2);
    white-space: nowrap;
}

.notebook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    align-items: start;
    align-content: start;
    grid-auto-rows: max-content;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 8px;
}

/* Custom Scrollbar for Grid */
.notebook-grid::-webkit-scrollbar {
    width: 6px;
}
.notebook-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
    border-radius: 3px;
}
.notebook-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}
.notebook-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.notebook-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.notebook-card.unlocked:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.notebook-card.locked {
    filter: grayscale(1);
    opacity: 0.6;
    background: rgba(15, 23, 42, 0.4);
    border-style: dashed;
    border-color: rgba(255,255,255,0.15);
    justify-content: center;
    align-items: center;
    text-align: center;
}

.city-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.notebook-card.locked .city-thumb {
    filter: grayscale(1);
    opacity: 0.65;
}

.card-emoji {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #e94560;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-desc {
    font-size: 1.15rem;
    line-height: 1.55;
    color: #cbd5e1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-hint {
    font-size: 1.0rem;
    color: #94a3b8;
    font-style: italic;
}

/* Unlock Notification Banner */
#unlock-notification {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 380px;
    padding: 15px 25px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 4px solid #43aa8b;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    pointer-events: none;
    transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#unlock-notification.active {
    top: 92px;
}

.notif-icon {
    font-size: 1.8rem;
}

.notif-text-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: white;
}

.notif-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #43aa8b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.notif-desc {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Animations */
@keyframes slideIn {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes floatUp {
    from { transform: translate(-50%, 40px) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}
@keyframes zoomIn {
    from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes shake {
    0% { transform: translate(2px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}
.shaking-canvas {
    animation: shake 0.15s infinite;
}

.qa-option-btn {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 14px 22px;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.qa-option-btn:hover {
  background: linear-gradient(135deg, #1f2937, #374151);
  border-color: #38bdf8;
  transform: translateX(6px);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4), 0 6px 15px rgba(0,0,0,0.4);
}
.qa-option-btn:active {
  transform: scale(0.98) translateX(6px);
}
.qa-option-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.qa-option-btn:disabled:hover {
  background: linear-gradient(135deg, #111827, #1f2937);
  border-color: rgba(255, 255, 255, 0.1);
}

/* === Badges / Médailles (onglet Carnet) === */
.notebook-tabs {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-btn.active {
    background: rgba(233, 69, 96, 0.15);
    border-color: #e94560;
    color: #e94560;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.25);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    align-items: start;
    align-content: start;
    grid-auto-rows: max-content;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 8px;
}

.badges-grid::-webkit-scrollbar {
    width: 6px;
}
.badges-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
    border-radius: 3px;
}
.badges-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}
.badges-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.badge-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.badge-card.unlocked {
    border-color: rgba(251, 191, 36, 0.4);
    background: linear-gradient(135deg, rgba(251,191,36,0.06), rgba(255,255,255,0.03));
    animation: badgeGlow 2.5s ease-in-out infinite;
}

.badge-card.unlocked:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(251, 191, 36, 0.2);
}

.badge-card.locked {
    filter: grayscale(1);
    opacity: 0.55;
    background: rgba(15, 23, 42, 0.4);
    border-style: dashed;
    border-color: rgba(255,255,255,0.15);
    justify-content: center;
    align-items: center;
    text-align: center;
}

.badge-icon {
    font-size: 2.6rem;
    text-align: center;
    line-height: 1.2;
}

.badge-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fbbf24;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-name.locked-name {
    color: #64748b;
}

.badge-concept {
    font-size: 0.9rem;
    font-weight: 700;
    color: #43aa8b;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background: rgba(67, 170, 139, 0.1);
    border-radius: 6px;
    align-self: center;
}

.badge-desc {
    font-size: 1.1rem;
    line-height: 1.55;
    color: #cbd5e1;
    text-align: center;
}

.badge-hint {
    font-size: 1.0rem;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(251, 191, 36, 0.15); }
    50% { box-shadow: 0 0 18px rgba(251, 191, 36, 0.45); }
}

/* ========================================== */
/* RESPONSIVE LAYOUTS & SCALING (ZOOM)        */
/* ========================================== */

/* --- Large Desktops / High Resolution (>= 1600px) --- */
@media (min-width: 1600px) {
    #dialogue-box, #quiz-hint-box {
        max-width: 1200px;
        padding: 35px 55px;
        gap: 45px;
    }
    #speaker-portrait, #quiz-hint-portrait {
        width: 140px;
        height: 140px;
        font-size: 4rem;
    }
    #speaker-name, #quiz-hint-title {
        font-size: 1.8rem;
    }
    #dialogue-text, #quiz-hint-text {
        font-size: 1.65rem;
    }
    .qa-option-btn {
        font-size: 1.35rem;
        padding: 16px 24px;
    }
    #dialogue-instruction, #quiz-hint-btn {
        font-size: 1.1rem;
    }
}

/* --- Laptop Sizing & MacBook Air 13" (1025px to 1440px) --- */
@media (max-width: 1440px) and (min-width: 1025px) {
    #dialogue-box, #quiz-hint-box {
        max-width: 980px;
        padding: 28px 40px;
        gap: 30px;
        bottom: 25px;
    }
    #speaker-portrait, #quiz-hint-portrait {
        width: 110px;
        height: 110px;
        font-size: 3.2rem;
    }
    #speaker-name, #quiz-hint-title {
        font-size: 1.55rem;
    }
    #dialogue-text, #quiz-hint-text {
        font-size: 1.45rem;
        line-height: 1.7;
    }
    .qa-option-btn {
        font-size: 1.2rem;
        padding: 12px 20px;
    }
}

/* --- Tablets & Small Desktops (768px to 1024px) --- */
@media (max-width: 1024px) {
    #dialogue-box, #quiz-hint-box {
        width: 92%;
        max-width: 900px;
        padding: 25px 35px;
        gap: 25px;
        bottom: 20px;
    }
    #speaker-portrait, #quiz-hint-portrait {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }
    #speaker-name, #quiz-hint-title {
        font-size: 1.45rem;
    }
    #dialogue-text, #quiz-hint-text {
        font-size: 1.3rem;
        line-height: 1.5;
    }
    .qa-option-btn {
        font-size: 1.15rem;
        padding: 12px 18px;
    }
    #dialogue-instruction, #quiz-hint-btn {
        font-size: 0.9rem;
    }
    
    #notebook-screen {
        width: 94%;
        height: 94%;
        padding: 20px 30px;
    }
    .notebook-header {
        flex-wrap: wrap;
    }
}

/* --- Mobile Devices (< 768px) --- */
@media (max-width: 767px) {
    #dialogue-box, #quiz-hint-box {
        width: 94%;
        bottom: 15px;
        padding: 20px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
        animation: floatUpMobile 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    #speaker-portrait, #quiz-hint-portrait {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
    
    #dialogue-content, #quiz-hint-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    #speaker-name, #quiz-hint-title {
        font-size: 1.25rem;
        margin-bottom: 4px;
        text-align: center;
    }
    
    #dialogue-text, #quiz-hint-text {
        font-size: 1.1rem;
        line-height: 1.45;
        text-align: center;
    }
    
    #qa-options-container {
        width: 100%;
        margin-top: 10px;
        gap: 6px;
    }
    
    .qa-option-btn {
        font-size: 1.0rem;
        padding: 10px 14px;
        text-align: center;
        width: 100%;
    }
    
    #dialogue-instruction {
        font-size: 0.8rem;
        text-align: center;
        margin-top: 10px;
    }
    
    #quiz-hint-btn {
        align-self: center;
        font-size: 1.0rem;
        padding: 10px 22px;
    }
    
    /* Richter Simulator Responsive */
    #richter-screen {
        width: 95%;
        padding: 20px;
    }
    #richter-screen h2 {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
    }
    #richter-desc {
        font-size: 0.85rem !important;
    }
    
    /* Notebook Responsive */
    #notebook-screen {
        width: 96%;
        height: 96%;
        padding: 15px;
    }
    .notebook-header h2 {
        font-size: 1.2rem !important;
    }
    .notebook-tabs {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    .tab-btn {
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
    }
    .notebook-progress {
        font-size: 0.85rem !important;
        padding: 4px 10px !important;
    }
    .notebook-grid, .badges-grid, .villes-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 10px;
    }
    
    /* HUD overlays responsive adjustments */
    #mission-hud {
        width: calc(100% - 40px);
        left: 20px;
        top: 20px;
        padding: 12px;
    }
    #score-hud {
        top: auto;
        bottom: 20px;
        right: 20px;
        font-size: 1.1rem;
        padding: 8px 16px;
    }
    #notebook-hud-btn {
        bottom: 20px;
        left: 20px;
        font-size: 0.85rem;
        padding: 8px 16px;
    }
    
    #end-screen h1 {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }
    #end-screen h2 {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    .instructions {
        padding: 15px 20px;
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 20px;
    }
    .btn-primary {
        padding: 12px 30px;
        font-size: 1.05rem;
    }
}

@keyframes floatUpMobile {
    from { transform: translate(-50%, 40px) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* --- DEVELOPER PANEL STYLES --- */
.btn-dev-menu {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 110;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fbbf24;
    padding: 10px 22px;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-dev-menu:hover {
    background: #fbbf24;
    color: #0f172a;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
    transform: translateY(-2px);
}

#dev-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 950px;
    max-height: 85vh;
    z-index: 500;
    pointer-events: auto;
    display: none;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.dev-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(251, 191, 36, 0.25);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.dev-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.dev-close-btn:hover {
    color: #e94560;
}

.dev-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dev-section {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

.dev-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #e2e8f0;
    font-size: 1.15rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dev-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.dev-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dev-card h4 {
    margin: 0;
    color: #fbbf24;
    font-size: 0.95rem;
}

.dev-select {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.15);
    color: #f1f5f9;
    padding: 8px;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.dev-select:focus {
    border-color: #fbbf24;
}

.btn-dev-action {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #0f172a;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-dev-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.dev-cheats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.btn-dev-cheat {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(255,255,255,0.1);
    color: #f8fafc;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-dev-cheat:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
    color: #fbbf24;
}

.dev-switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 8px 15px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    color: #e2e8f0;
}

.dev-switch-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #fbbf24;
}

/* --- SYNTHESIS SCREEN OVERLAY --- */
#synthesis-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    max-width: 1000px;
    max-height: 750px;
    padding: 35px 50px;
    color: white;
    display: none;
    flex-direction: column;
    z-index: 140;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.synthesis-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-align: center;
    flex-shrink: 0;
}

#synthesis-title {
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.synthesis-title-icon {
    -webkit-text-fill-color: initial;
}

.synthesis-title-text {
    background: linear-gradient(135deg, #43aa8b 0%, #4cc9f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.synthesis-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-top: 8px;
    font-weight: 600;
}

.synthesis-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 10px;
}

/* Custom Scrollbar for Synthesis */
.synthesis-content::-webkit-scrollbar {
    width: 8px;
}
.synthesis-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.synthesis-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.synthesis-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.synthesis-pedagogy {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 25px;
    border-radius: 12px;
    flex-shrink: 0;
}

.synthesis-pedagogy h3 {
    margin-top: 0;
    color: #4cc9f0;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

#synthesis-points {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#synthesis-points li {
    position: relative;
    padding-left: 30px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #e2e8f0;
}

#synthesis-points li::before {
    content: "🔸";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 1.1rem;
}

.synthesis-footer-info {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    flex-shrink: 0;
}

.synthesis-badge-box, .synthesis-score-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.synthesis-badge-box h3, .synthesis-score-box h3 {
    margin-top: 0;
    color: #43aa8b;
    font-size: 1.1rem;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.synthesis-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    flex-grow: 1;
}

.synthesis-badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(67, 170, 139, 0.08);
    border: 1px solid rgba(67, 170, 139, 0.2);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.synthesis-badge-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.synthesis-badge-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.2;
}

.synthesis-no-badges {
    color: #64748b;
    font-style: italic;
    font-size: 0.95rem;
    margin: auto;
    text-align: center;
}

.synthesis-score-display {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fbbf24;
    margin: auto;
    text-align: center;
    background: rgba(251, 191, 36, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    width: 100%;
}

.synthesis-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

#synthesis-btn-continue {
    padding: 15px 50px;
    font-size: 1.2rem;
}

/* ========================================== */
/* NOUVEAU MENU PRINCIPAL — Palette Océan & Tempête */
/* ========================================== */

/* --- Canvas carte du monde (fond animé) --- */
#menu-world-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.82;
    pointer-events: none;
}

/* --- Conteneur du menu (au-dessus du canvas) --- */
#menu-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 20px 0;
    pointer-events: auto;
}

/* --- Titre glitch RISQUES / NATURELS --- */
#menu-title-container {
    text-align: center;
    margin-bottom: 6px;
    line-height: 0.82;
}

.menu-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.8rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 6px;
    margin: 0;
    position: relative;
    text-shadow:
        0 0 20px rgba(0, 180, 216, 0.5),
        0 0 40px rgba(0, 71, 161, 0.3);
}

/* Glitch effect */
.menu-title.glitch {
    position: relative;
}
.menu-title.glitch::before,
.menu-title.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.85;
}
.menu-title.glitch::before {
    color: #00b4d8;
    z-index: -1;
    animation: glitch-anim-1 4s infinite linear alternate-reverse;
}
.menu-title.glitch::after {
    color: #ff6b1a;
    z-index: -2;
    animation: glitch-anim-2 4s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0%, 92%, 100% { transform: translate(0); opacity: 0; }
    93% { transform: translate(-3px, 1px); opacity: 0.8; }
    94% { transform: translate(3px, -2px); opacity: 0.8; }
    95% { transform: translate(-2px, -1px); opacity: 0.8; }
    96% { transform: translate(2px, 2px); opacity: 0.8; }
    97% { transform: translate(-1px, 0px); opacity: 0.8; }
    98% { transform: translate(0); opacity: 0; }
}
@keyframes glitch-anim-2 {
    0%, 92%, 100% { transform: translate(0); opacity: 0; }
    93% { transform: translate(3px, -1px); opacity: 0.8; }
    94% { transform: translate(-3px, 2px); opacity: 0.8; }
    95% { transform: translate(2px, 1px); opacity: 0.8; }
    96% { transform: translate(-2px, -2px); opacity: 0.8; }
    97% { transform: translate(1px, 0px); opacity: 0.8; }
    98% { transform: translate(0); opacity: 0; }
}

/* --- Boutons du menu --- */
#menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0 12px;
    width: 320px;
    max-width: 90vw;
}

.btn-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 30px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 1px;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.btn-menu--primary {
    background: linear-gradient(135deg, #ff6b1a 0%, #ff3d00 100%);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(255, 107, 26, 0.4), 0 0 0 2px rgba(255, 107, 26, 0.2);
}
.btn-menu--primary:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 107, 26, 0.6), 0 0 0 2px rgba(255, 107, 26, 0.4);
}
.btn-menu--primary:active {
    transform: scale(0.98) translateY(1px);
}

.btn-menu--secondary {
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.8) 0%, rgba(0, 180, 216, 0.6) 100%);
    color: #e2e8f0;
    border: 2px solid rgba(0, 180, 216, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.btn-menu--secondary:hover {
    transform: scale(1.05) translateY(-3px);
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.9) 0%, rgba(0, 119, 200, 0.8) 100%);
    border-color: rgba(0, 180, 216, 0.6);
    box-shadow: 0 12px 28px rgba(0, 180, 216, 0.3);
}
.btn-menu--secondary:active {
    transform: scale(0.98) translateY(1px);
}

.btn-menu-icon {
    font-size: 1.3rem;
}

/* --- Crédits avec effet typewriter --- */
#menu-credits {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #00b4d8;
    font-weight: 600;
    letter-spacing: 1px;
    min-height: 1.2em;
    text-shadow: 0 0 10px rgba(0, 180, 216, 0.3);
}

#typewriter-cursor {
    color: #ff6b1a;
    animation: typewriter-blink 0.7s steps(1) infinite;
}
@keyframes typewriter-blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

/* --- Version --- */
#menu-version {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 2px;
}

/* --- Toast messages (Aucune sauvegarde, etc.) --- */
.menu-toast {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(255, 107, 26, 0.9);
    color: white;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    z-index: 50;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(255, 107, 26, 0.4);
}
.menu-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Overlay "Comment jouer" --- */
#howto-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    padding: 35px 40px;
    color: white;
    display: none;
    flex-direction: column;
    z-index: 130;
    pointer-events: auto;
    border: 1px solid rgba(0, 180, 216, 0.2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: zoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#howto-overlay.visible {
    display: flex;
}

.howto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 180, 216, 0.15);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.howto-header h2 {
    color: #00b4d8;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.5rem;
    margin: 0;
}
.howto-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}
.howto-close-btn:hover { color: #ff6b1a; }

.howto-table-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 8px;
}
.howto-table-container::-webkit-scrollbar { width: 6px; }
.howto-table-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.howto-table {
    width: 100%;
    border-collapse: collapse;
}
.howto-table th {
    text-align: left;
    color: #00b4d8;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 12px;
    border-bottom: 2px solid rgba(0, 180, 216, 0.2);
}
.howto-table td {
    padding: 12px;
    font-size: 1.05rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.howto-table tr:hover td {
    background: rgba(0, 180, 216, 0.05);
}
.key-cell {
    white-space: nowrap;
}
.howto-table kbd {
    display: inline-block;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #00b4d8;
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    min-width: 28px;
    text-align: center;
}

.howto-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* --- Bouton Sauvegarder dans le menu de pause --- */
.save-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.3) 0%, rgba(0, 119, 200, 0.2) 100%);
    border: 2px solid rgba(0, 180, 216, 0.4);
    color: #00b4d8;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    pointer-events: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.save-btn:hover {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.5) 0%, rgba(0, 119, 200, 0.4) 100%);
    border-color: #00b4d8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 180, 216, 0.3);
}
.save-btn:active {
    transform: scale(0.98);
}
.save-icon {
    font-size: 1.3rem;
}

/* --- Toast confirmation sauvegarde --- */
.save-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: linear-gradient(135deg, #00b4d8 0%, #0077c8 100%);
    color: white;
    padding: 14px 35px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    z-index: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    box-shadow: 0 15px 35px rgba(0, 180, 216, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}
.save-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Responsive menu --- */
@media (max-width: 768px) {
    .menu-title {
        font-size: 2.8rem;
        letter-spacing: 4px;
    }
    #menu-buttons {
        width: 280px;
    }
    .btn-menu {
        padding: 12px 24px;
        font-size: 1rem;
    }
    #howto-overlay {
        width: 96%;
        padding: 20px;
    }
    .howto-table td {
        font-size: 0.9rem;
        padding: 8px;
    }
    .howto-table kbd {
        font-size: 0.8rem;
        padding: 3px 7px;
    }
}

/* --- Hotspot Modal --- */
#hotspot-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    padding: 24px;
    display: none;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
    pointer-events: auto;
}

.hotspot-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.hotspot-modal-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 900;
    color: #ff6b1a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hotspot-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.hotspot-close-btn:hover {
    color: #ef4444;
}

.hotspot-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hotspot-img-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hotspot-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hotspot-desc-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.hotspot-desc-text strong {
    color: #00b4d8;
}

.hotspot-modal-footer {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* ==========================================================================
   JEU 1 REFONTE — Hint bar + Holo panel (scoped to #gp-* and .gp-*)
   ========================================================================== */

.gp-hint-bar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.85);
    border-top: 2px solid #06b6d4;
    border-radius: 10px 10px 0 0;
    padding: 10px 22px 12px;
    color: #e2e8f0;
    font-family: 'Montserrat', sans-serif;
    z-index: 40;
    pointer-events: none;
    max-width: 92vw;
    box-shadow: 0 -8px 28px rgba(6, 182, 212, 0.18);
    text-align: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
body.dialogue-open .gp-hint-bar {
    visibility: hidden;
}
.gp-hint-bar #gp-phase-label,
.gp-hint-bar #gf-phase-label,
.gp-hint-bar #gv-phase-label {
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #06b6d4;
}
.gp-hint-bar #gp-plates-status,
.gp-hint-bar #gf-sandbags-status,
.gp-hint-bar #gv-states-status {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.gp-plate-chip {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.gp-plate-chip.placed {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.55);
    color: #6ee7b7;
}
.gp-hint-bar #gp-current-hint,
.gp-hint-bar #gf-current-hint,
.gp-hint-bar #gv-current-hint {
    font-size: 0.92rem;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.35;
    max-width: 640px;
}

/* Holo panel popup — synchronisé avec le mesh 3D mural */
.gp-panel {
    position: absolute;
    top: 16%;
    right: 24px;
    width: 290px;
    padding: 0;
    z-index: 50;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(6, 182, 212, 0.45);
    box-shadow: 0 10px 36px rgba(6, 182, 212, 0.25);
    animation: gpPanelSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes gpPanelSlide {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
.gp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(14, 165, 233, 0.10));
    border-bottom: 1px solid rgba(6, 182, 212, 0.3);
}
.gp-panel-header #gp-panel-title,
.gp-panel-header #gf-panel-title,
.gp-panel-header #gv-panel-title {
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #06b6d4;
}
.gp-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}
.gp-close-btn:hover { color: #ef4444; }
.gp-panel-body {
    padding: 14px 16px 18px;
}
.gp-panel-body #gp-panel-phase,
.gp-panel-body #gf-panel-phase,
.gp-panel-body #gv-panel-phase {
    font-size: 0.98rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 6px;
}
.gp-panel-body #gp-panel-instruction,
.gp-panel-body #gf-panel-instruction,
.gp-panel-body #gv-panel-instruction {
    font-size: 0.88rem;
    line-height: 1.45;
    color: #cbd5e1;
}

/* Media query : lisibilité sur petits écrans */
@media (max-width: 1024px) {
    .gp-hint-bar { bottom: 8px; padding: 8px 14px 10px; }
    .gp-hint-bar #gp-current-hint,
    .gp-hint-bar #gf-current-hint,
    .gp-hint-bar #gv-current-hint { font-size: 0.84rem; }
    .gp-panel { width: 240px; right: 12px; }
}

/* ===== JEU 1 REFONTE : Liste de Quêtes Dynamique ===== */
#gp-quest-tracker,
#gf-quest-tracker,
#gv-quest-tracker {
    position: absolute;
    top: 170px;
    left: 20px;
    width: 320px;
    padding: 16px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 8px 32px rgba(0, 180, 216, 0.15);
    z-index: 30;
    pointer-events: none;
    animation: fadeIn 0.4s ease-out;
}
#gp-quest-tracker { border-left: 6px solid #00b4d8; }
#gf-quest-tracker { border-left: 6px solid #10b981; box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15); }
#gv-quest-tracker { border-left: 6px solid #f97316; box-shadow: 0 8px 32px rgba(249, 115, 22, 0.15); }
.gp-quest-header {
    font-size: 0.85rem;
    color: #00b4d8;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 180, 216, 0.3);
    padding-bottom: 6px;
}
.gp-quest-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gp-quest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #94a3b8;
    transition: all 0.3s ease;
}
.gp-quest-item.active {
    color: #f1f5f9;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}
.gp-quest-item.completed {
    color: #4ade80;
    text-decoration: line-through;
    opacity: 0.7;
}
.gp-q-checkbox {
    width: 14px;
    height: 14px;
    border: 2px solid #475569;
    border-radius: 3px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.gp-quest-item.active .gp-q-checkbox {
    border-color: #00b4d8;
    box-shadow: 0 0 6px rgba(0, 180, 216, 0.5);
}
.gp-quest-item.completed .gp-q-checkbox {
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.2);
}
.gp-quest-item.completed .gp-q-checkbox::after {
    content: "✓";
    position: absolute;
    top: -3px;
    left: 2px;
    font-size: 0.75rem;
    color: #22c55e;
    font-weight: 900;
}

@keyframes redAlertFlash {
    0%, 100% { background-color: rgba(239, 68, 68, 0); }
    50% { background-color: rgba(239, 68, 68, 0.15); }
}
.red-alert-flashing {
    animation: redAlertFlash 1.5s infinite;
}

#gp-crisis-overlay.active {
    display: block !important;
    animation: redAlertFlash 1.5s infinite;
}

/* === VILLES TAB & GRID STYLING === */
.villes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    align-items: start;
    align-content: start;
    grid-auto-rows: max-content;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 8px;
    margin-top: 15px;
}
.villes-grid::-webkit-scrollbar {
    width: 6px;
}
.villes-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
    border-radius: 3px;
}
.villes-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}
.villes-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.ville-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.ville-card.unlocked {
    border-color: rgba(0, 180, 216, 0.3);
    box-shadow: inset 0 0 12px rgba(0, 180, 216, 0.05);
}

.ville-card.unlocked:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 180, 216, 0.6);
    box-shadow: 0 12px 28px rgba(0, 180, 216, 0.15), inset 0 0 16px rgba(0, 180, 216, 0.1);
}

.ville-card.locked {
    filter: grayscale(0.8);
    opacity: 0.6;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    background: rgba(15, 23, 42, 0.6);
}

.ville-locked-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 10px;
}

.ville-locked-icon {
    font-size: 2.8rem;
    animation: lock-wobble 4s ease-in-out infinite;
}

.ville-locked-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 5px 0 0 0;
}

.ville-locked-hint {
    font-size: 0.95rem;
    color: #64748b;
    font-style: italic;
    line-height: 1.4;
    margin: 0;
}

/* Localisation / Carte */
.ville-map-container {
    position: relative;
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background-image: url('../images/world_realistic_flat.png');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ville-map-marker {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ff3d00;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px #ff3d00;
}

.ville-map-marker::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid #ff3d00;
    border-radius: 50%;
    animation: marker-pulse 1.8s ease-out infinite;
}

/* Infos Textuelles */
.ville-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #00b4d8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
}

.ville-meta-item {
    font-size: 0.95rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.ville-meta-label {
    font-weight: 700;
    color: #94a3b8;
}

.ville-hazards-box {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ville-hazards-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ff6b1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.ville-hazards-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ville-hazard-item {
    font-size: 0.95rem;
    color: #cbd5e1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

/* Animations */
@keyframes marker-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

@keyframes lock-wobble {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-8deg); }
    30% { transform: rotate(6deg); }
    45% { transform: rotate(-4deg); }
    60% { transform: rotate(2deg); }
}

/* Modale de fiche de ville dans le menu d'accueil */
#menu-city-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    padding: 25px;
    z-index: 150;
    color: white;
    border: 1px solid rgba(0, 180, 216, 0.4);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.85), inset 0 0 20px rgba(0, 180, 216, 0.15);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#menu-city-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.6rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

#menu-city-close:hover {
    color: #ff3d00;
}

/* Modale de fiche de ville dans le carnet de voyage */
#notebook-city-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    padding: 25px;
    z-index: 200; /* Plus haut que les grilles du carnet */
    color: white;
    border: 1px solid rgba(0, 180, 216, 0.4);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 180, 216, 0.2);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#notebook-city-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.6rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

#notebook-city-close:hover {
    color: #ff3d00;
}

/* Modale de fiche synthèse dans le carnet de voyage */
#notebook-fiche-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: 90%;
    max-height: 85%;
    overflow-y: auto;
    padding: 25px;
    z-index: 210; /* Plus haut que les villes modales */
    color: white;
    border: 1px solid rgba(0, 180, 216, 0.4);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 180, 216, 0.2);
    backdrop-filter: blur(25px);
    border-radius: 16px;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#notebook-fiche-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.6rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
    z-index: 10;
}

#notebook-fiche-close:hover {
    color: #ff3d00;
}

/* Tableau de synthèse pédagogique */
.synthesis-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.synthesis-table th, .synthesis-table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.synthesis-table th {
    background: rgba(0, 180, 216, 0.15);
    color: #00b4d8;
    font-weight: 700;
    width: 30%;
    vertical-align: top;
}

.synthesis-table td {
    color: #cbd5e1;
}

.synthesis-table tr:last-child th, .synthesis-table tr:last-child td {
    border-bottom: none;
}

.fiche-photo-container {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    background-size: cover;
    background-position: center;
}

/* Indicateur interactif sur les fiches */
.clickable-fiche {
    cursor: pointer !important;
}

.card-click-prompt {
    animation: pulse-prompt 2s infinite ease-in-out;
}

@keyframes pulse-prompt {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* === Indicateur de guidage 2D (#nav-indicator, S3) === */
#nav-indicator {
    position: absolute;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    z-index: 80;
    animation: nav-ind-pulse 1.2s ease-in-out infinite;
}

@keyframes nav-ind-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.08); }
}

.nav-ind-arrow {
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 36px solid var(--nav-color, #00f3ff);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.85));
}

.nav-ind-dist {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    color: #ffffff;
    white-space: nowrap;
    text-shadow:
        -1px -1px 0 #020617,
         1px -1px 0 #020617,
        -1px  1px 0 #020617,
         1px  1px 0 #020617,
         0 2px 4px rgba(0, 0, 0, 0.85);
}

/* === Mouvement réduit (accessibilité) : coupe les animations qui secouent ou clignotent === */
@media (prefers-reduced-motion: reduce) {
    .shaking-canvas,
    .menu-title.glitch::before,
    .menu-title.glitch::after,
    #typewriter-cursor,
    #nav-indicator {
        animation: none;
    }
}
