/* ═══════════════════════════════════════════════════════════
   LEONORE.EXE — PIXEL ROMANCE RPG
   © 2026 GREGOLAB STUDIOS
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ── PALETTE ─────────────────────────────────────────────── */
:root {
    --bg:          #07070f;
    --bg2:         #0f0f1f;
    --bg3:         #15152a;
    --primary:     #ff2d78;
    --primary-dark:#8a0035;
    --secondary:   #ff6b35;
    --accent:      #ffd700;
    --accent-dark: #7a5000;
    --neon-blue:   #00f5ff;
    --neon-blue-dk:#007a88;
    --neon-purple: #bf5fff;
    --neon-green:  #44ff88;
    --text:        #f0e6ff;
    --text-dim:    #5a5a8a;
    --shadow:      rgba(0,0,0,0.8);
}

/* ── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Press Start 2P', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    animation: flicker 10s infinite;
}

/* ── CRT SCANLINES ───────────────────────────────────────── */
.crt-overlay {
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(0,0,0,0.06) 3px,
            rgba(0,0,0,0.06) 4px
        );
    pointer-events: none;
    z-index: 9999;
}

/* subtle screen phosphor vignette */
.crt-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0,0,0,0.55) 100%);
}

@keyframes flicker {
    0%,97%,100% { opacity: 1; }
    98%          { opacity: .88; }
    99%          { opacity: 1; }
    99.5%        { opacity: .82; }
}

/* ── SCREEN TRANSITION ───────────────────────────────────── */
.screen-transition {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9997;
    pointer-events: none;
    opacity: 0;
}
.screen-transition.flash {
    animation: screenFlash .55s ease forwards;
}
@keyframes screenFlash {
    0%   { opacity: 0; }
    35%  { opacity: 1; }
    65%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ── SCREENS ─────────────────────────────────────────────── */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px 16px 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
}
.screen.active { display: flex; }

/* ── STARS (intro background) ───────────────────────────── */
.stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.star {
    position: absolute;
    background: white;
    animation: twinkle 3s infinite;
}
@keyframes twinkle {
    0%,100% { opacity: .15; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.6); }
}

/* ── PROGRESS BAR ────────────────────────────────────────── */
.progress-container {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--bg);
    padding: 8px 16px;
    z-index: 1000;
    border-bottom: 3px solid var(--primary);
    display: none;
}
.progress-container.visible { display: block; }

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.progress-label { font-size: 7px; color: var(--accent); }
.progress-level  { font-size: 7px; color: var(--neon-blue); }

.xp-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--bg3);
    border: 2px solid var(--neon-blue);
    overflow: hidden;
    position: relative;
}
.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple), var(--primary));
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
    position: relative;
}
.xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 4px; height: 100%;
    background: white;
    animation: xpShine .5s ease-in-out infinite alternate;
}
@keyframes xpShine {
    from { opacity: .4; }
    to   { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════
   INTRO SCREEN
══════════════════════════════════════════════════════════ */
#screen-intro {
    background: radial-gradient(ellipse at 40% 30%, #1e0a40 0%, #0a0315 45%, var(--bg) 80%);
}

.title-container {
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.intro-icon {
    font-size: 44px;
    animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon {
    0%,100% { transform: translateY(0) rotate(-5deg); }
    50%      { transform: translateY(-12px) rotate(5deg); }
}

.game-title {
    font-size: clamp(28px, 7vw, 54px);
    color: var(--primary);
    text-shadow:
        0 0 12px var(--primary),
        0 0 28px var(--primary),
        5px 5px 0 var(--primary-dark);
    letter-spacing: 6px;
    animation: titlePulse 2.5s ease-in-out infinite;
}
.accent-title {
    font-size: clamp(18px, 4.5vw, 30px);
    color: var(--accent);
    text-shadow:
        0 0 10px var(--accent),
        4px 4px 0 var(--accent-dark);
    animation: titlePulse 2.5s ease-in-out infinite .5s;
}
@keyframes titlePulse {
    0%,100% { filter: brightness(1); }
    50%      { filter: brightness(1.4); }
}

.title-divider {
    height: 2px;
    width: min(320px, 80vw);
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    margin: 6px 0;
}

.game-subtitle {
    font-size: clamp(7px, 1.8vw, 11px);
    color: var(--accent);
    letter-spacing: 3px;
}
.dim-text { color: var(--text-dim); font-size: 7px; }

.intro-info-box {
    border: 2px solid #1e1e40;
    padding: 16px 24px;
    background: rgba(10,10,30,.6);
    max-width: 380px;
    margin: 16px 0;
}
.info-text {
    font-size: 8px;
    color: var(--text-dim);
    line-height: 2.6;
}

.press-start {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(9px, 2vw, 13px);
    color: var(--neon-blue);
    background: transparent;
    border: 3px solid var(--neon-blue);
    box-shadow:
        0 0 12px var(--neon-blue),
        inset 0 0 10px rgba(0,245,255,.08);
    padding: 16px 28px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all .1s;
    animation: blink 1.1s steps(1) infinite;
    margin-top: 10px;
}
.press-start:hover {
    background: var(--neon-blue);
    color: var(--bg);
    box-shadow: 0 0 30px var(--neon-blue);
    animation: none;
}
.press-start:active { transform: scale(.96); }

.copyright-text {
    font-size: 6px;
    color: var(--text-dim);
    margin-top: 6px;
    letter-spacing: 1px;
}

/* ── BLINK ───────────────────────────────────────────────── */
@keyframes blink {
    0%,49% { opacity: 1; }
    50%,100% { opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   LEVEL HEADERS
══════════════════════════════════════════════════════════ */
.level-header {
    text-align: center;
    padding-top: 70px;
    margin-bottom: 8px;
}

.level-tag {
    display: inline-block;
    font-size: 7px;
    color: var(--neon-purple);
    letter-spacing: 4px;
    margin-bottom: 8px;
}
.unlocked-tag { color: var(--neon-green); }
.final-tag    { color: var(--primary); }
.gold-tag     { color: var(--accent); }

.level-title {
    font-size: clamp(14px, 4vw, 26px);
    color: var(--accent);
    text-shadow: 4px 4px 0 var(--accent-dark), 0 0 20px var(--accent);
}
.purple-title { color: var(--neon-purple); text-shadow: 3px 3px 0 #5a007a, 0 0 15px var(--neon-purple); }
.red-title    { color: var(--primary);     text-shadow: 3px 3px 0 var(--primary-dark), 0 0 20px var(--primary); }

/* ══════════════════════════════════════════════════════════
   DIALOGUE BOX
══════════════════════════════════════════════════════════ */
.dialogue-box {
    background: var(--bg2);
    border: 4px solid var(--text);
    box-shadow: 6px 6px 0 rgba(0,0,0,.6);
    padding: 18px 22px;
    max-width: 560px;
    width: 100%;
    position: relative;
}
.dialogue-box::after {
    content: '▶';
    position: absolute;
    bottom: 10px; right: 14px;
    font-size: 9px;
    color: var(--text);
    animation: blink .8s steps(1) infinite;
}

.speaker-name {
    font-size: 8px;
    color: var(--accent);
    margin-bottom: 10px;
    text-shadow: 0 0 6px var(--accent);
}
.dialogue-text {
    font-size: clamp(7px, 1.6vw, 9px);
    line-height: 2.2;
    color: var(--text);
    white-space: pre-line;
}

/* ══════════════════════════════════════════════════════════
   PUZZLE ZONE / LABELS
══════════════════════════════════════════════════════════ */
.puzzle-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.puzzle-label {
    font-size: clamp(6px, 1.4vw, 8px);
    color: var(--text-dim);
    text-align: center;
    letter-spacing: 2px;
    max-width: 500px;
}
.accent-label { color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   DATE DIALS — LEVEL 1
══════════════════════════════════════════════════════════ */
.date-dial-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.date-dial {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dial-display {
    background: #050510;
    border: 3px solid var(--accent);
    color: var(--accent);
    font-size: clamp(20px, 5vw, 28px);
    padding: 10px 6px;
    min-width: 64px;
    text-align: center;
    box-shadow: 0 0 14px rgba(255,215,0,.25), inset 0 0 8px rgba(255,215,0,.08);
}

.dial-btn {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    width: 44px;
    height: 30px;
    cursor: pointer;
    transition: all .1s;
}
.dial-btn:hover { background: var(--accent); color: var(--bg); }
.dial-btn:active { transform: scale(.92); }

.dial-separator {
    font-size: 22px;
    color: var(--accent);
    padding-bottom: 18px;
    opacity: .6;
}
.dial-label {
    font-size: 6px;
    color: var(--text-dim);
    letter-spacing: 2px;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.pixel-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(8px, 1.8vw, 11px);
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    cursor: pointer;
    box-shadow: 5px 5px 0 var(--primary-dark);
    letter-spacing: 2px;
    transition: transform .1s, box-shadow .1s;
    margin-top: 6px;
}
.pixel-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--primary-dark);
}
.pixel-btn:active {
    transform: translate(5px, 5px);
    box-shadow: 0 0 0 var(--primary-dark);
}

.red-btn {
    background: var(--primary);
    box-shadow: 5px 5px 0 var(--primary-dark);
}
.gold-btn {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 5px 5px 0 var(--accent-dark);
}
.gold-btn:hover  { box-shadow: 7px 7px 0 var(--accent-dark); }
.gold-btn:active { box-shadow: 0 0 0 var(--accent-dark); }

/* ══════════════════════════════════════════════════════════
   INPUTS
══════════════════════════════════════════════════════════ */
.pixel-input {
    background: #040414;
    border: 3px solid var(--neon-blue);
    color: var(--neon-blue);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(10px, 2.5vw, 14px);
    padding: 14px 18px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 0 12px rgba(0,245,255,.25), inset 0 0 10px rgba(0,245,255,.04);
    outline: none;
    caret-color: var(--neon-blue);
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: box-shadow .2s;
}
.pixel-input:focus {
    box-shadow: 0 0 24px rgba(0,245,255,.5), inset 0 0 16px rgba(0,245,255,.08);
}
.pixel-input::placeholder { color: var(--text-dim); font-size: .8em; }

/* ══════════════════════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════════════════════ */
.flash-msg {
    font-size: 8px;
    padding: 10px 14px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    opacity: 0;
    transition: opacity .3s;
    min-height: 36px;
}
.flash-msg.show    { opacity: 1; }
.flash-msg.error   { color: #ff5555; border: 2px solid #ff5555; }
.flash-msg.success { color: var(--neon-green); border: 2px solid var(--neon-green); }

/* ══════════════════════════════════════════════════════════
   HINT BOX
══════════════════════════════════════════════════════════ */
.hint-box {
    border: 2px solid var(--neon-purple);
    padding: 12px 16px;
    max-width: 440px;
    width: 100%;
    background: rgba(191,95,255,.05);
}
.hint-label {
    display: block;
    font-size: 7px;
    color: var(--neon-purple);
    margin-bottom: 8px;
}
.hint-text {
    font-size: 7px;
    color: var(--text-dim);
    line-height: 2;
    white-space: pre-line;
}

/* ══════════════════════════════════════════════════════════
   MEMORY CARDS
══════════════════════════════════════════════════════════ */
.memory-card {
    border: 4px solid var(--neon-purple);
    padding: 10px;
    background: var(--bg2);
    box-shadow: 7px 7px 0 rgba(191,95,255,.3);
    text-align: center;
    max-width: 300px;
    width: 100%;
}
.memory-photo {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #1a0a2e, #2e1a0a, #0a2e1a, #0a0a2e);
    background-size: 400% 400%;
    animation: gradShift 5s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 10px;
    border: 2px solid var(--text-dim);
}
@keyframes gradShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.memory-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
}
/* Premier souvenir : journal en grand pour pouvoir lire */
#memory1-photo.has-photo {
    aspect-ratio: auto;
    min-height: 420px;
    max-height: 75vh;
}
#screen-memory1 .level-header {
    padding-top: 36px;
    margin-bottom: 16px;
}
#screen-memory1 .memory-card {
    max-width: 520px;
}
#memory1-photo.has-photo img {
    width: 100%;
    height: auto;
    min-height: 400px;
    object-fit: contain;
}

/* Loupe zoom sur l'image 1 (journal) */
.memory-photo-zoom {
    position: relative;
    cursor: none;
}
.magnifier-lens {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px rgba(255,215,0,.4), inset 0 0 14px rgba(0,0,0,.3);
    z-index: 5;
}
.magnifier-lens.visible {
    opacity: 1;
}
.magnifier-lens-inner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
}

.memory-caption {
    font-size: 7px;
    color: var(--text-dim);
    line-height: 2;
    white-space: pre-line;
}

/* ══════════════════════════════════════════════════════════
   HEARTS ROW
══════════════════════════════════════════════════════════ */
.hearts-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 24px;
}
.heart-pixel {
    font-size: 16px;
    opacity: 0;
    animation: heartAppear .4s ease forwards;
}
@keyframes heartAppear {
    from { transform: scale(0) rotate(-30deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* ── FLOATING HEARTS ─────────────────────────────────────── */
.hearts-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}
.heart-particle {
    position: absolute;
    font-size: 18px;
    animation: floatHeart 4s ease-in-out forwards;
    opacity: 0;
}
@keyframes floatHeart {
    0%   { opacity: 0; transform: translateY(0) scale(0) rotate(-20deg); }
    20%  { opacity: 1; transform: translateY(-40px) scale(1) rotate(10deg); }
    80%  { opacity: .7; transform: translateY(-160px) scale(1.1) rotate(-5deg); }
    100% { opacity: 0; transform: translateY(-280px) scale(.8) rotate(15deg); }
}

/* ══════════════════════════════════════════════════════════
   PIXEL REVEAL — LEVEL 2 (très grand pour lire les écritures)
══════════════════════════════════════════════════════════ */
.reveal-wrapper {
    position: relative;
    max-width: 98vw;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.reveal-placeholder {
    width: 100%;
    flex: 1;
    min-height: 65vh;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #1a0a2e, #2e0a1a, #0a1a2e);
    background-size: 300% 300%;
    animation: gradShift 6s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    position: relative;
    overflow: hidden;
}
.reveal-placeholder img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    display: block;
}
.reveal-placeholder .reveal-emoji { z-index: 1; }
.pixel-reveal-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 2px;
    cursor: pointer;
    z-index: 2;
}
.pixel-tile {
    transition: opacity .45s ease;
}
.pixel-tile.revealed { opacity: 0; pointer-events: none; }

.reveal-counter {
    font-size: 7px;
    color: var(--text-dim);
    text-align: center;
    margin-top: 8px;
}

@media (min-width: 768px) {
    .reveal-wrapper {
        max-width: 98vw;
    }
    .reveal-placeholder {
        min-height: 75vh;
    }
    #screen-level2 .reveal-placeholder {
        min-height: 82vh;
    }
}

#screen-level2 {
    padding: 6px 10px 10px;
}
#screen-level2 .level-header {
    padding-top: 56px;
}
#screen-level2 .reveal-wrapper {
    max-width: 98vw;
    flex: 1;
    min-height: 0;
}
#screen-level2 .reveal-placeholder {
    min-height: 70vh;
    max-height: 88vh;
}
#screen-level2 .l2-actions {
    margin-top: 14px;
    padding-bottom: 20px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}
#screen-level2 {
    overflow-y: auto;
}
.accent-text { color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   MINI-JEU PASSIONS (écran 4)
══════════════════════════════════════════════════════════ */
.passions-game-arena {
    position: relative;
    width: 100%;
    max-width: 520px;
    height: 320px;
    margin: 16px auto;
    background: linear-gradient(145deg, #0d0d1f 0%, #1a0a2a 50%, #0d1a1f 100%);
    border: 3px solid var(--neon-purple);
    border-radius: 8px;
    box-shadow: 0 0 24px rgba(191,95,255,.2), inset 0 0 40px rgba(0,0,0,.3);
    overflow: hidden;
}
.passion-item {
    position: absolute;
    width: 80px;
    height: 72px;
    border: 3px solid var(--accent);
    background: rgba(15,8,28,.95);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s, opacity .3s;
    box-shadow: 0 0 16px rgba(255,215,0,.3);
    z-index: 2;
}
.passion-item-flying {
    animation: none;
}
.passion-item:hover {
    transform: scale(1.12);
    box-shadow: 0 0 28px var(--accent);
}
.passion-item.collected {
    opacity: 0.35;
    pointer-events: none;
    transform: scale(0.8);
    border-color: var(--neon-green);
    animation: passionPop 0.45s ease forwards;
}
.passion-emoji {
    font-size: 26px;
    line-height: 1;
}
.passion-label {
    font-size: 6px;
    color: var(--accent);
    text-align: center;
    line-height: 1.35;
    max-width: 72px;
    text-shadow: 0 0 8px rgba(255,215,0,.6), 0 1px 2px rgba(0,0,0,.8);
    font-weight: bold;
}
.passions-counter {
    font-size: 8px;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 12px;
}
.dialogue-box-small .dialogue-text {
    font-size: 7px;
    line-height: 2;
}

@keyframes passionFloat {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50%      { transform: translate(-50%, -50%) translateY(-8px); }
}
@keyframes passionPop {
    0%   { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.35; }
}

/* ══════════════════════════════════════════════════════════
   MINI-JEU LIEUX — TES EMPREINTES (écran 6)
══════════════════════════════════════════════════════════ */
.places-match-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 680px;
    width: 100%;
    margin: 12px auto;
}
.places-match-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.place-clue {
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    color: var(--text);
    background: var(--bg2);
    border: 2px solid #2a2a4a;
    padding: 12px 10px;
    cursor: pointer;
    text-align: left;
    line-height: 1.9;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.place-clue:hover:not(.matched) {
    border-color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(191,95,255,.3);
    transform: translateX(3px);
}
.place-clue.selected {
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(255,215,0,.4);
    background: #1a1400;
    color: var(--accent);
}
.place-clue.matched {
    border-color: var(--neon-green);
    color: var(--neon-green);
    opacity: .6;
    pointer-events: none;
}
.place-clue.wrong-match,
.place-name.wrong-match {
    border-color: #ff5555;
    animation: shake .35s;
}
.place-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: var(--neon-blue);
    background: var(--bg2);
    border: 2px solid var(--neon-blue);
    padding: 14px 10px;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, box-shadow .15s, transform .1s;
    box-shadow: 0 0 8px rgba(0,245,255,.1);
}
.place-name:hover:not(.matched) {
    box-shadow: 0 0 16px rgba(0,245,255,.4);
    transform: translateX(-3px);
}
.place-name.matched {
    border-color: var(--neon-green);
    color: var(--neon-green);
    opacity: .6;
    pointer-events: none;
}
.place-emoji {
    display: inline-block;
    margin-right: 6px;
    font-style: normal;
    font-size: clamp(22px, 5vw, 36px);
    line-height: 1;
}
@media (max-width: 520px) {
    .places-match-board {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════
   MINI-JEU VOYAGE — LEGACY (garder pour compat)
══════════════════════════════════════════════════════════ */
.places-game-arena {
    position: relative;
    width: 100%;
    max-width: 540px;
    min-height: 340px;
    height: 340px;
    margin: 16px auto;
    background: linear-gradient(160deg, #12102a 0%, #1e0a35 50%, #0f1820 100%);
    border: 3px solid var(--neon-blue);
    border-radius: 10px;
    box-shadow: 0 0 28px rgba(0,245,255,.2), inset 0 0 40px rgba(0,0,0,.2);
    overflow: hidden;
}
.places-path {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.places-path-svg {
    width: 100%;
    height: 100%;
    display: block;
}
.places-path-line {
    stroke-dasharray: 4 3;
    animation: pathDash 1.2s linear infinite;
}
@keyframes pathDash {
    to { stroke-dashoffset: -14; }
}
.places-nodes {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.places-nodes .place-node {
    pointer-events: auto;
}
.place-node {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    padding: 10px 14px;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: var(--neon-blue);
    background: rgba(10,15,30,.95);
    border: 2px solid var(--neon-blue);
    border-radius: 6px;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, color .2s, border-color .2s;
    animation: placePulse 2.2s ease-in-out infinite;
    box-shadow: 0 0 14px rgba(0,245,255,.2);
    white-space: nowrap;
}
.place-node:hover {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 0 24px var(--neon-blue);
    color: var(--accent);
    border-color: var(--accent);
}
.place-node.visited {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 18px var(--neon-green);
    animation: placeVisited 0.5s ease forwards;
}
@keyframes placePulse {
    0%, 100% { box-shadow: 0 0 14px rgba(0,245,255,.25); opacity: 1; }
    50%      { box-shadow: 0 0 22px rgba(0,245,255,.5); opacity: .95; }
}
@keyframes placeVisited {
    0%   { transform: translate(-50%, -50%) scale(1.15); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* ══════════════════════════════════════════════════════════
   INVENTORY — LEVEL 3
══════════════════════════════════════════════════════════ */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 380px;
    width: 100%;
    padding: 14px;
    border: 3px solid var(--text-dim);
    background: #080815;
}

.inv-slot {
    aspect-ratio: 1;
    border: 2px solid #2a2a4a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .18s;
    background: #0d0d1f;
    font-size: 22px;
    gap: 4px;
}
.inv-slot:hover {
    border-color: var(--accent);
    transform: scale(1.06);
    background: #1a1a30;
}
.inv-slot.correct {
    border-color: var(--neon-green);
    box-shadow: 0 0 12px var(--neon-green), inset 0 0 10px rgba(68,255,136,.15);
}
.inv-slot.wrong {
    border-color: #ff5555;
    animation: shake .35s;
}
.inv-slot-label {
    font-size: 5px;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.4;
    padding: 0 2px;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

/* ══════════════════════════════════════════════════════════
   NAME GAME — LEVEL 3 (recompose ton prénom)
══════════════════════════════════════════════════════════ */
.name-game-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
    min-height: 52px;
}
.name-game-cell {
    width: 36px;
    height: 44px;
    border: 3px solid var(--neon-purple);
    background: #0d0d1f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-dim);
    font-family: 'Press Start 2P', monospace;
}
.name-game-cell.filled {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(255,215,0,.3);
}
.name-game-letters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 400px;
    margin: 0 auto 20px;
}
.name-game-tile {
    width: 44px;
    height: 44px;
    border: 3px solid var(--accent);
    background: #0d0d1f;
    color: var(--accent);
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.name-game-tile:hover {
    transform: scale(1.1);
    box-shadow: 0 0 14px var(--accent);
}
.name-game-tile:active { transform: scale(0.96); }
.name-game-tile.wrong {
    border-color: #ff5555;
    animation: shake .35s;
}

/* ══════════════════════════════════════════════════════════
   CHOICE LIST — LEVEL 4
══════════════════════════════════════════════════════════ */
.choice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 520px;
    width: 100%;
}
.choice-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 3px solid #2a2a4a;
    background: #0d0d1f;
    cursor: pointer;
    font-size: clamp(7px, 1.5vw, 9px);
    color: var(--text);
    transition: all .15s;
}
.choice-item:hover {
    border-color: var(--primary);
    background: #1f0f1f;
    transform: translateX(6px);
}
.choice-letter {
    font-size: 11px;
    color: var(--primary);
    min-width: 20px;
}
.choice-item.correct-choice {
    border-color: var(--neon-green);
    background: #0a1f0f;
    color: var(--neon-green);
}
.choice-item.wrong-choice {
    border-color: #ff5555;
    background: #1f0a0a;
    color: #ff5555;
    animation: shake .35s;
}

/* ══════════════════════════════════════════════════════════
   SURNOMS — cases à dévoiler
══════════════════════════════════════════════════════════ */
.nicknames-hint {
    font-size: 8px;
    color: var(--neon-purple);
    margin-bottom: 12px;
    text-align: center;
}
.nicknames-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 520px;
    margin: 16px auto;
}
.nickname-box {
    padding: 12px 18px;
    border: 3px solid #2a2a4a;
    background: #0d0d1f;
    font-size: clamp(7px, 1.5vw, 9px);
    min-width: 100px;
    text-align: center;
    transition: border-color .3s, background .3s, transform .2s;
}
.nickname-box .nickname-placeholder,
.nickname-box .nickname-label {
    display: block;
}
.nickname-box-hidden .nickname-label {
    display: none;
}
.nickname-box-hidden .nickname-placeholder {
    color: var(--text-dim);
}
.nickname-box-revealed .nickname-placeholder {
    display: none;
}
.nickname-box-revealed .nickname-label {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(255,45,120,.5);
}
.nickname-box-revealed {
    border-color: var(--primary);
    background: rgba(255,45,120,.08);
}

/* ══════════════════════════════════════════════════════════
   WORD DISPLAY — LEVEL 5
══════════════════════════════════════════════════════════ */
.word-display {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 500px;
    width: 100%;
}
.word-letter-box {
    width: clamp(32px, 8vw, 52px);
    height: clamp(44px, 11vw, 62px);
    border-bottom: 4px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 3.5vw, 22px);
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
    transition: all .3s;
    background: transparent;
}
.word-letter-box.filled {
    border-color: var(--primary);
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

/* ══════════════════════════════════════════════════════════
   EMOTION SCREEN
══════════════════════════════════════════════════════════ */
.emotion-screen {
    background: radial-gradient(ellipse at 50% 40%, #1a0520 0%, #0a0315 55%, var(--bg) 85%);
}
.emotion-text-container {
    max-width: 560px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.emotion-icon {
    font-size: 38px;
    margin-bottom: 20px;
    animation: floatIcon 3s ease-in-out infinite;
}
.emotion-line {
    font-size: clamp(7px, 1.7vw, 10px);
    color: var(--text);
    line-height: 3.2;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .9s ease, transform .9s ease;
    min-height: 14px;
}
.emotion-line.visible {
    opacity: 1;
    transform: translateY(0);
}
.emotion-line.highlight {
    color: var(--primary);
    text-shadow: 0 0 12px var(--primary);
}

/* ══════════════════════════════════════════════════════════
   FINAL SCREEN
══════════════════════════════════════════════════════════ */
.final-screen {
    background: radial-gradient(ellipse at 50% 30%, #200020 0%, #0f0015 50%, var(--bg) 85%);
}

.final-gift-box {
    width: clamp(120px, 28vw, 170px);
    height: clamp(120px, 28vw, 170px);
    background: var(--primary);
    box-shadow: 7px 7px 0 var(--primary-dark), 0 0 50px rgba(255,45,120,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    cursor: pointer;
    animation: giftBounce 2s ease-in-out infinite;
    margin: 20px auto;
    position: relative;
    transition: transform .25s;
}
.final-gift-box:hover { transform: scale(1.1) rotate(2deg); }
.final-gift-box:active { transform: scale(.95); animation: none; }

@keyframes giftBounce {
    0%,100% { transform: translateY(0) rotate(0deg); }
    25%      { transform: translateY(-12px) rotate(-3deg); }
    75%      { transform: translateY(-6px) rotate(3deg); }
}

.gift-ribbon-h {
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 20px;
    background: var(--accent);
    transform: translateY(-50%);
}
.gift-ribbon-v {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 20px;
    background: var(--accent);
    transform: translateX(-50%);
}
.gift-emoji {
    position: relative;
    z-index: 1;
}

.gift-prompt {
    font-size: 7px;
    color: var(--text-dim);
    text-align: center;
    animation: blink 1s steps(1) infinite;
}

.gift-reveal {
    display: none;
    text-align: center;
    animation: fadeInUp .9s ease;
    max-width: 560px;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gift-title {
    font-size: clamp(14px, 4vw, 24px);
    color: var(--accent);
    text-shadow: 0 0 24px var(--accent), 4px 4px 0 var(--accent-dark);
}
.gift-countdown {
    font-size: clamp(12px, 2.5vw, 18px);
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent);
    margin: 0 0 8px 0;
    font-weight: bold;
}

@keyframes giftZinzin {
    0%, 100% { transform: scale(1) rotate(-0.5deg); }
    25%      { transform: scale(1.02) rotate(0.8deg); }
    50%      { transform: scale(0.98) rotate(-0.8deg); }
    75%      { transform: scale(1.01) rotate(0.5deg); }
}

.gift-description {
    font-size: clamp(7px, 1.6vw, 9px);
    color: var(--text);
    line-height: 2.8;
    padding: 20px;
    border: 3px solid var(--primary);
    background: rgba(255,45,120,.04);
    max-width: 480px;
    width: 100%;
    white-space: pre-line;
    transition: color .4s ease, opacity .4s ease;
    animation: giftZinzin 2s ease-in-out infinite;
}

.gift-description.gift-description-hidden {
    color: transparent;
    opacity: 0.08;
}

.gift-description.gift-description-hidden:hover {
    color: var(--text);
    opacity: 1;
}
.gift-signature {
    font-size: 8px;
    color: var(--text-dim);
    text-align: center;
    margin-top: 8px;
    line-height: 2.5;
    white-space: pre-line;
}

/* ══════════════════════════════════════════════════════════
   PIXEL CONFETTI
══════════════════════════════════════════════════════════ */
.confetti-piece {
    position: fixed;
    top: -10px;
    animation: confettiFall linear forwards;
    z-index: 9998;
}
@keyframes confettiFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .pixel-btn    { padding: 12px 20px; }
    .dialogue-box { padding: 14px 16px; }
    .inventory-grid { grid-template-columns: repeat(3, 1fr); }
    .date-dial-container { gap: 10px; }
    .level-header { padding-top: 80px; }
}
@media (max-width: 360px) {
    .game-title { font-size: 22px; }
    .inventory-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ══════════════════════════════════════════════════════════
   PIXEL ART GLOW UTILITIES
══════════════════════════════════════════════════════════ */
.glow-pink   { text-shadow: 0 0 12px var(--primary); }
.glow-gold   { text-shadow: 0 0 12px var(--accent); }
.glow-blue   { text-shadow: 0 0 12px var(--neon-blue); }
.glow-purple { text-shadow: 0 0 12px var(--neon-purple); }
