/* ============================================
   GAME.CSS — Hub, Quiz, Minigames, Final
   ============================================ */

/* --- ÉCRAN COMBAT TÉNÈBRES --- */
#oni-fight { 
    position: fixed; inset: 0; 
    background: radial-gradient(ellipse at center, #0a0508 0%, #020104 60%) !important; 
    z-index: 3000; display: none; flex-direction: column; align-items: center; justify-content: center; 
}
.shake-oni { cursor: pointer; filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8)); }
.oni-hit { animation: tremor-hit 0.1s infinite !important; filter: drop-shadow(0 0 40px white) brightness(1.5) !important; }
@keyframes tremor-hit { 0%{transform:translate(10px,10px) scale(1.1)} 50%{transform:translate(-10px,-10px) scale(1.1)} 100%{transform:translate(10px,-10px) scale(1.1)} }

/* --- HUB --- */
#screen-hub { background: radial-gradient(circle at center, rgba(255, 183, 197, 0.2) 0%, hsl(310, 80%, var(--bg-lightness)) 100%); transition: background 1.5s ease; }
.compass-ring { width: 180px; height: 180px; border: 6px solid var(--sakura); border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; margin: 10px; background: rgba(255,255,255,0.05); box-shadow: inset 0 0 20px rgba(255,183,197,0.2), 0 0 20px rgba(255,183,197,0.2); }
.compass-inner-ring { position: absolute; width: 150px; height: 150px; border: 3px dashed var(--sakura); border-radius: 50%; animation: spin-reverse 15s linear infinite; opacity: 0.6; pointer-events: none;}
#needle-gold { width: 6px; height: 80px; background: var(--gold); position: absolute; bottom: 50%; transform-origin: bottom center; border-radius: 10px; box-shadow: 0 0 15px var(--gold); z-index: 4; transition: transform 0.2s ease-out;}
.grid-9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 20px; margin-bottom: 10px; }
.slot { width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); border: 2px dashed rgba(255,183,197,0.4); border-radius: 15px; font-size: 30px; transition: all 0.5s cubic-bezier(0.17, 0.89, 0.32, 1.49); cursor: pointer; position: relative; filter: grayscale(0.85) opacity(0.55); }
.slot.unlocked { filter: grayscale(0) opacity(1); border: 3px solid var(--gold); background: rgba(255, 183, 197, 0.2); box-shadow: 0 0 15px rgba(255,183,197,0.5); font-size: 40px; animation: pulse-card 2s infinite alternate; }
#hub-progress-container { width: 80%; height: 14px; background: rgba(255,183,197,0.15); border-radius: 10px; overflow: hidden; margin-top: 8px; border: 2px solid rgba(255,183,197,0.5); }
#hub-progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--sakura), var(--gold)); transition: width 0.8s cubic-bezier(0.17, 0.89, 0.32, 1.49); }

/* --- GAME ARENA --- */
#game-arena { position:relative; width:100%; min-height:200px; display:flex; flex-direction:column; align-items:center; justify-content:center; touch-action: none; padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }
#game-target { font-size: 100px; cursor: pointer; transition: left 0.1s, top 0.1s, transform 0.1s; display: inline-block; position: relative; touch-action: none; filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));}
.catch-target { position: relative; transition: transform 0.2s ease-out; will-change: transform; }
.drum-btn { font-size: 30px; padding: 20px; margin: 10px; border-radius: 50%; background: var(--sakura); border: 4px solid white; color: white; cursor: pointer; touch-action: manipulation; font-family: 'Fredoka One', cursive;}
.mem-btn { font-size: 40px; margin: 5px; cursor: pointer; padding: 10px; background: rgba(255,255,255,0.1); border-radius: 10px; touch-action: manipulation;}

/* --- EFFETS DE JEU --- */
.magic-paw { position: fixed; font-size: 45px; pointer-events: none; z-index: 9999; filter: drop-shadow(0 0 15px var(--sakura)); transform: translate(-50%, -50%); animation: paw-fade 1s cubic-bezier(0.1, 0.8, 0.2, 1) forwards; }
@keyframes paw-fade { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }

#intro-eyes { position: absolute; top: 40%; left: 50%; transform: translateX(-50%); display: flex; gap: 45px; opacity: 0; transition: opacity 3s ease; z-index: 50; pointer-events: none; filter: drop-shadow(0 0 25px var(--sakura)); }
.intro-eye { width: 35px; height: 12px; background: white; border-radius: 50%; box-shadow: 0 0 15px white, 0 0 40px var(--sakura); animation: eye-blink 5s infinite; }
@keyframes eye-blink { 0%, 90%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

.fleeing-neko { 
    position: absolute; font-size: 35px; z-index: 2000; filter: drop-shadow(0 0 15px white); 
    pointer-events: none; will-change: transform, opacity; opacity: 0;
    left: 50%; top: 50%;
}
.fleeing-neko::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 4px; height: 30px; transform: translate(-50%, -50%) rotate(var(--trail-angle, 0deg));
    background: linear-gradient(to bottom, rgba(255,255,255,0.6), transparent);
    border-radius: 2px; filter: blur(2px);
}
@keyframes blast-out { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(2); opacity: 0; filter: blur(2px); } }

.smoke-puff { position: absolute; font-size: 60px; pointer-events: none; animation: smoke-fade 0.4s ease-out forwards; z-index: 100;}
@keyframes smoke-fade { 0% { opacity: 1; transform: scale(0.5); filter: blur(0px); } 100% { opacity: 0; transform: scale(1.5); filter: blur(5px); } }

@keyframes laser-shoot { 0% { width: 0; opacity: 1; } 50% { width: var(--length); opacity: 1; } 100% { width: var(--length); opacity: 0; } }

.captured-soul { position: absolute; font-size: 50px; z-index: 4000; filter: drop-shadow(0 0 20px white); pointer-events: none; transition: all 1s cubic-bezier(0.5, 0, 0.2, 1); left: 50%; top: 40%; transform: translate(-50%, -50%) scale(1.5); }

/* --- ÉCRAN FINAL --- */
#screen-final { background: linear-gradient(to bottom, transparent 0%, transparent 100%); transition: background 1.5s ease; }
#final-circ-nekos { position: relative; width: 100%; display: flex; justify-content: center; align-items: center; min-height: min(450px, 50dvh); margin-top: min(40px, 4dvh); margin-bottom: 10px; overflow: visible; transition: opacity 1.5s ease; }
.final-node { position: absolute; font-size: 50px; opacity: 0; transform: scale(0) rotate(180deg); transition: all 0.6s cubic-bezier(0.17, 0.89, 0.32, 1.49); filter: drop-shadow(0 0 10px white); z-index: 10;}
#final-story-box { font-family: 'Fredoka One', cursive; font-size: 18px; line-height: 1.6; min-height: 100px; margin-top: 10px; color: #ffffff !important; text-shadow: 0px 4px 10px rgba(0,0,0,1), 0px 0px 5px rgba(0,0,0,1), 0 0 30px rgba(0,0,0,0.8) !important; font-weight: bold; transition: opacity 0.8s ease, transform 0.8s ease; opacity: 1; transform: translateY(0); z-index: 9999 !important; position: relative; }
@media (max-width: 480px) {
    #final-story-box {
        font-size: 16px;
        padding: 4px 16px;
        margin: 0 12px;
        min-height: 60px;
        /* Pas de background — text-shadow renforcé pour lisibilité */
        text-shadow:
            0 2px 4px rgba(0,0,0,1),
            0 4px 12px rgba(0,0,0,1),
            0 0 30px rgba(0,0,0,0.95) !important;
    }
}
/* iPhone SE et très petits écrans — texte miroir plus compact */
@media (max-height: 680px) {
    #final-story-box { font-size: 15px !important; }
}

/* --- CERTIFICAT --- */
.certificate { background: #fffdfa; color: #3d2f2d; border: 8px solid var(--gold); border-radius: 15px; padding: 20px; width: 90%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); position: relative; margin: 20px auto; text-align: center; }
.certificate h3 { color: var(--gold); margin: 0 0 15px 0; text-shadow: 1px 1px 2px black; font-size: 24px; }
.certificate p { font-size: 16px; margin: 8px 0; }
.cert-names { font-size: 14px; color: var(--sakura); line-height: 1.6; margin-top: 15px; font-weight: bold;}

/* ═══════════════════════════════════════════
   RELIQUES SVG SUMI-E + INVENTAIRE MIKO
   ═══════════════════════════════════════════ */

/* SVG Reliques — style encre */
.relic-svg {
    width: 100%; height: 100%;
    color: var(--gold);
    filter: drop-shadow(0 0 4px rgba(255,215,0,0.3));
    transition: all 0.3s ease;
}

/* Slot débloqué — glow pulse + fond subtil */
.slot.unlocked {
    background: radial-gradient(circle, rgba(255,215,0,0.08) 0%, transparent 70%);
    animation: slot-glow 3s ease-in-out infinite alternate;
}
.slot.unlocked .relic-svg { color: var(--gold); filter: drop-shadow(0 0 8px rgba(255,215,0,0.4)); }
@keyframes slot-glow {
    0% { box-shadow: 0 0 5px rgba(255,215,0,0.15); }
    100% { box-shadow: 0 0 15px rgba(255,215,0,0.35); }
}

/* Slot verrouillé — silhouette fantôme */
.slot.locked {
    background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%);
}
.slot.locked .relic-svg {
    color: rgba(255,255,255,0.1);
    filter: none;
    opacity: 0.4;
}

/* Animation pop quand on débloque un slot */
.slot.just-unlocked {
    animation: slot-pop 0.6s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}
@keyframes slot-pop {
    0% { transform: scale(0.3) rotate(-20deg); opacity: 0; }
    60% { transform: scale(1.3) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}


.game-target-svg:active { transform: scale(0.9); }

/* --- WIN RELIC (écran réussi) --- */
.win-relic-icon {
    width: 120px; height: 120px;
    color: var(--gold);
    margin: 0 auto;
    filter: drop-shadow(0 0 25px rgba(255,215,0,0.6)) drop-shadow(0 0 50px rgba(255,215,0,0.3));
    animation: win-relic-pop 0.8s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}
@keyframes win-relic-pop {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; filter: drop-shadow(0 0 0 transparent); }
    50% { transform: scale(1.4) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); filter: drop-shadow(0 0 25px rgba(255,215,0,0.6)) drop-shadow(0 0 50px rgba(255,215,0,0.3)); }
}

/* --- CEINTURE DE MIKO (Inventaire bas de l'écran) --- */
#miko-belt {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 60px; z-index: 200;
    background: linear-gradient(to top, rgba(26,5,29,0.95), rgba(26,5,29,0.7), transparent);
    display: none; /* Affiché seulement sur le hub */
    align-items: center; justify-content: center;
    gap: 4px; padding: 8px 10px;
    pointer-events: auto;
}
#miko-belt.visible { display: flex !important; }

.belt-slot {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,215,0,0.12);
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 8px;
}
.belt-slot .relic-svg { stroke-width: 2.5; }
.belt-slot.belt-filled {
    border-color: rgba(255,215,0,0.5);
    background: rgba(255,215,0,0.08);
}
.belt-slot.belt-filled .relic-svg {
    color: var(--gold);
    filter: drop-shadow(0 0 5px rgba(255,215,0,0.3));
}
.belt-slot:not(.belt-filled) .relic-svg {
    color: rgba(255,255,255,0.08);
    filter: none;
}
.belt-slot.belt-filled::after {
    content: ''; position: absolute; inset: -3px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255,215,0,0.2);
    pointer-events: none;
}

/* Tooltip au tap */
.belt-tooltip {
    position: absolute; bottom: 55px; left: 50%; transform: translateX(-50%);
    background: rgba(26,5,29,0.95); border: 1px solid var(--gold);
    border-radius: 10px; padding: 8px 14px;
    color: white; font-size: 13px; text-align: center;
    white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity 0.3s;
    font-family: 'Fredoka One', cursive;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    z-index: 210;
}
.belt-tooltip.show { opacity: 1; }
.belt-tooltip .tooltip-name { color: var(--gold); font-size: 15px; }

/* --- MEMORY GAME SVG BUTTONS --- */
.mem-btn-svg {
    width: 70px !important; height: 70px !important;
    padding: 12px !important;
    color: var(--gold);
    background: rgba(0,0,0,0.3) !important;
    border: 2px solid rgba(255,215,0,0.3) !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mem-btn-svg:active {
    transform: scale(0.9);
    background: rgba(255,215,0,0.15) !important;
    border-color: var(--gold) !important;
}

/* --- TIMER ENCENS --- */
@keyframes smoke-rise {
    0% { opacity: 0.3; transform: translateY(0) scaleX(1); }
    50% { opacity: 0.15; transform: translateY(-15px) scaleX(1.5); }
    100% { opacity: 0; transform: translateY(-30px) scaleX(2); }
}

/* --- INDICES PROGRESSIFS --- */
.quiz-hint {
    color: rgba(168,213,162,0.8); font-size: 14px; font-style: italic;
    text-align: center; margin: 8px 0; padding: 6px 12px;
    background: rgba(0,0,0,0.2); border-radius: 8px;
    animation: hint-fade-in 1s ease;
}
@keyframes hint-fade-in { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

/* =========================================
   NOUVEAUX STYLES : KAWAII & PÉNALITÉ
   ========================================= */

/* 1. Typo du Quiz lisible et ronde */
#quiz-title {
    font-family: 'Fredoka One', cursive !important;
    letter-spacing: 1px;
    font-size: 28px !important;
}

/* 2. Flottement poétique et doux pour les objets des mini-jeux */
.game-target-svg {
    filter: drop-shadow(0 0 10px #ffb7c5) drop-shadow(0 0 25px rgba(255,183,197,0.5));
    animation: float-kawaii 3s ease-in-out infinite alternate;
    transition: transform 0.2s ease;
}
.game-target-svg:active {
    transform: scale(0.9) !important;
}
@keyframes float-kawaii {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-12px) scale(1.05); }
}

/* 3. Tremblement d'écran (Pénalité douce au lieu de l'Oni) */

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

/* --- TAMPON DRAMATIQUE (Hanko Slam) --- */
.hanko-slam {
    position: fixed; left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(5) rotate(-25deg);
    width: 100px; height: 100px;
    border: 6px solid #b71c1c;
    border-radius: 10px;
    color: #b71c1c;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 36px; line-height: 1.1;
    display: flex; align-items: center; justify-content: center; text-align: center;
    z-index: 9500;
    opacity: 0;
    mix-blend-mode: multiply;
    animation: hanko-slam-anim 0.8s cubic-bezier(0.2, 0, 0.2, 1.4) forwards;
    pointer-events: none;
}
@keyframes hanko-slam-anim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(5) rotate(-25deg); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(0.9) rotate(-15deg); }
    50% { transform: translate(-50%, -50%) scale(1.1) rotate(-13deg); }
    100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1) rotate(-15deg);
        box-shadow: inset 0 0 15px rgba(183,28,28,0.5), 0 0 30px rgba(183,28,28,0.2); }
}


/* --- OUTRO SCREEN 1: 9 GARDIENS RÉUNIS --- */
#final-circ-nekos.guardian-opal-active {
    width: min(78vw, 420px);
    height: min(92vw, 500px);
    margin: 10px auto 18px auto;
    overflow: visible;
}

.guardian-opal-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    opacity: 1;
    transition: opacity 0.45s ease;
}
.guardian-opal-scene.is-fading { opacity: 0; }

.guardian-opal-ring {
    position: absolute;
    left: 50%;
    top: 47%;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
    background: radial-gradient(circle, rgba(255,245,252,0.5) 0%, rgba(255,225,238,0.2) 38%, rgba(255,255,255,0) 72%);
    box-shadow: 0 0 24px rgba(255,232,244,0.55), 0 0 52px rgba(255,224,180,0.18);
}
.guardian-opal-ring.is-active { animation: guardianRingBurst 0.8s cubic-bezier(.17,.89,.32,1.28) forwards; }

.guardian-opal-slot {
    position: absolute;
    left: 50%;
    top: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(0.1) rotate(calc(var(--gr) + 18deg));
    transform-origin: center center;
    will-change: transform, opacity, filter;
    filter: saturate(0.08) brightness(1.3) contrast(1.06)
            drop-shadow(0 0 10px rgba(255,255,255,0.92))
            drop-shadow(0 0 18px rgba(255,230,186,0.36))
            drop-shadow(0 0 28px rgba(255,214,238,0.28));
}
.guardian-opal-slot::after {
    content: '';
    position: absolute;
    inset: -7%;
    border-radius: 50%;
    background:
      radial-gradient(circle at 28% 22%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.22) 18%, rgba(255,255,255,0) 40%),
      radial-gradient(circle at 76% 32%, rgba(210,246,255,0.18) 0%, rgba(210,246,255,0) 40%),
      radial-gradient(circle at 54% 72%, rgba(255,216,234,0.18) 0%, rgba(255,216,234,0) 46%),
      radial-gradient(circle at 38% 54%, rgba(255,236,184,0.13) 0%, rgba(255,236,184,0) 52%);
    mix-blend-mode: screen;
    opacity: 0.9;
    pointer-events: none;
}
.guardian-opal-slot .neko-scale-wrapper {
    transform: scale(var(--gs));
    transform-origin: center center;
    opacity: 0.98;
}
.guardian-opal-slot .neko-art-container {
    animation: none !important;
}
.guardian-opal-slot .gold,
.guardian-opal-slot .bell,
.guardian-opal-slot .head,
.guardian-opal-slot .ears,
.guardian-opal-slot .necklace,
.guardian-opal-slot .back-legs,
.guardian-opal-slot .paws,
.guardian-opal-slot .arm-top-left,
.guardian-opal-slot .arm-top-left-tip,
.guardian-opal-slot .arm-top-right,
.guardian-opal-slot .arm-top-right-tip {
    filter: saturate(0.2) brightness(1.15);
}
.guardian-opal-slot.is-visible { animation: guardianOpalSpinIn 0.82s cubic-bezier(.17,.89,.32,1.22) forwards; }
.guardian-opal-slot.is-main.is-visible { animation: guardianOpalBoing 0.9s cubic-bezier(.17,.89,.32,1.32) forwards; }
.guardian-opal-scene.is-settled .guardian-opal-slot {
    opacity: 1;
    animation: guardianLevitate 4.6s ease-in-out infinite;
    animation-delay: var(--floatDelay);
}
.guardian-opal-scene.is-settled .guardian-opal-slot.is-main {
    animation: guardianLevitateMain 5.2s ease-in-out infinite, guardianCrystalPulse 3.6s ease-in-out infinite;
}
.guardian-opal-glint {
    position: absolute;
    left: 50%;
    top: 47%;
    width: 22px;
    height: 22px;
    transform: translate(52px, 44px) scale(0.65);
    border-radius: 50%;
    opacity: 0;
    background: radial-gradient(circle, rgba(255,253,225,0.98) 0%, rgba(255,230,122,0.75) 28%, rgba(255,230,122,0) 72%);
    box-shadow: 0 0 16px rgba(255,240,148,0.9), 0 0 26px rgba(255,225,160,0.42);
}
.guardian-opal-scene.is-settled .guardian-opal-glint { animation: guardianPlaqueGlint 5s ease-in-out infinite; }

@keyframes guardianOpalBoing {
    0% { opacity: 0; transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(0.08) rotate(-8deg); }
    58% { opacity: 1; transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(calc(var(--gs) * 1.12)) rotate(2deg); }
    76% { opacity: 1; transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(calc(var(--gs) * 0.95)) rotate(-1deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(var(--gs)) rotate(0deg); }
}
@keyframes guardianOpalSpinIn {
    0% { opacity: 0; transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(0.08) rotate(calc(var(--gr) + 28deg)); }
    65% { opacity: 1; transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(calc(var(--gs) * 1.04)) rotate(calc(var(--gr) - 3deg)); }
    100% { opacity: 1; transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(var(--gs)) rotate(var(--gr)); }
}
@keyframes guardianRingBurst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
    30% { opacity: 0.95; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(3.4); }
}
@keyframes guardianLevitate {
    0%, 100% { transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(var(--gs)) rotate(var(--gr)); }
    50% { transform: translate(-50%, -50%) translate(var(--gx), calc(var(--gy) - 8px)) scale(var(--gs)) rotate(var(--gr)); }
}
@keyframes guardianLevitateMain {
    0%,100% { transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(var(--gs)) rotate(0deg); }
    50% { transform: translate(-50%, -50%) translate(var(--gx), calc(var(--gy) - 10px)) scale(var(--gs)) rotate(0deg); }
}
@keyframes guardianCrystalPulse {
    0%,100% {
        filter: saturate(0.08) brightness(1.3) contrast(1.06)
                drop-shadow(0 0 10px rgba(255,255,255,0.92))
                drop-shadow(0 0 18px rgba(255,230,186,0.36))
                drop-shadow(0 0 28px rgba(255,214,238,0.28));
    }
    50% {
        filter: saturate(0.15) brightness(1.42) contrast(1.09)
                drop-shadow(0 0 14px rgba(255,255,255,1))
                drop-shadow(0 0 24px rgba(255,236,194,0.48))
                drop-shadow(0 0 34px rgba(214,248,255,0.34));
    }
}
@keyframes guardianPlaqueGlint {
    0%, 86%, 100% { opacity: 0; transform: translate(52px, 44px) scale(0.55); }
    90% { opacity: 1; transform: translate(52px, 44px) scale(1.05); }
    94% { opacity: 0.35; transform: translate(52px, 44px) scale(0.78); }
}


/* --- OUTRO SCÈNE 1 : CONSTELLATION MYSTIC POP --- */
#screen-final.mystic-pop-scene1 #final-circ-nekos {
    width: min(92vw, 560px);
    height: min(64vh, 520px);
    margin: 6px auto 8px auto;
    display: block;
    opacity: 1;
    perspective: 1000px;
    overflow: visible;
}
#screen-final.mystic-pop-scene1 #final-story-box {
    min-height: 150px;
}
.mystic-pop-scene {
    position: absolute;
    inset: 0;
    opacity: 1;
    transition: opacity .6s ease;
    pointer-events: none;
    overflow: visible;
}
.mystic-pop-scene.is-fading { opacity: 0; }
.mystic-pop-ring,
.mystic-pop-ripple-layer,
.mystic-pop-neko-layer {
    position: absolute;
    inset: 0;
    overflow: visible;
}
.mystic-pop-ring {
    transform-style: preserve-3d;
    animation: none;
}
.mystic-pop-ring.is-orbiting {
    animation: mysticPopOrbit 25s linear infinite;
}
.mystic-pop-relic {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90px;
    height: 90px;
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--mx), var(--my)) scale(.16) rotate(16deg);
    filter: drop-shadow(0 0 10px rgba(255,255,255,.32)) drop-shadow(0 0 18px rgba(255,215,132,.18));
}
.mystic-pop-relic.is-visible {
    animation: mysticPopRelicIn .78s cubic-bezier(.17,.89,.32,1.25) forwards;
}
.mystic-pop-relic-art {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mystic-pop-relic-art svg {
    width: 100% !important;
    height: 100% !important;
}
.mystic-pop-ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%) scale(.2);
    border-radius: 50%;
    border: 2px solid rgba(255,245,250,.85);
    box-shadow: 0 0 18px rgba(255,246,213,.22);
    animation: mysticPopRipple .88s ease-out forwards;
}
.mystic-pop-neko-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.3);
    opacity: 0;
}
.mystic-pop-neko-wrap.is-visible {
    animation: mysticPopNekoIn 1.2s cubic-bezier(.17,.89,.32,1.22) forwards;
}
.mystic-pop-neko {
    width: 130px;
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mystic-pop-neko .neko-scale-wrapper {
    transform: scale(.35);
    transform-origin: center center;
    flex-shrink: 0;
}
.mystic-pop-neko .head,
.mystic-pop-neko .arm-top-left,
.mystic-pop-neko .arm-top-right,
.mystic-pop-neko .paw-left,
.mystic-pop-neko .paw-right,
.mystic-pop-neko .back-leg-left,
.mystic-pop-neko .back-leg-right,
.mystic-pop-neko .ear-left-out,
.mystic-pop-neko .ear-right-out {
    background: linear-gradient(to bottom, rgba(255,255,255,.96) 0%, rgba(236,244,255,.9) 38%, rgba(229,234,244,.84) 100%) !important;
    border-color: rgba(135,160,190,.72) !important;
    box-shadow: inset 0 10px 14px rgba(255,255,255,.82), inset 0 -12px 18px rgba(184,213,255,.34) !important;
}
.mystic-pop-neko .arm-top-left-tip,
.mystic-pop-neko .arm-top-right-tip,
.mystic-pop-neko .arm-top-left-tip::after,
.mystic-pop-neko .gold,
.mystic-pop-neko .bell {
    background: linear-gradient(to bottom, rgba(255,248,226,.96) 0%, rgba(255,227,149,.92) 100%) !important;
    border-color: rgba(189,141,41,.78) !important;
}
.mystic-pop-neko .necklace { background: linear-gradient(to bottom, #f7d6e3 0%, #f3adc8 100%) !important; }
.mystic-pop-neko .ear-left-inner,
.mystic-pop-neko .ear-right-inner,
.mystic-pop-neko .nose,
.mystic-pop-neko .mouth,
.mystic-pop-neko .mouth-right { background: #f4c7da !important; }
.mystic-pop-neko .mustache-left,
.mystic-pop-neko .mustache-left-bottom,
.mystic-pop-neko .mustache-right,
.mystic-pop-neko .mustache-right-bottom,
.mystic-pop-neko .eye-left,
.mystic-pop-neko .eye-right { background: #566170 !important; }
.mystic-pop-neko .arm-top-right { animation: arm-right 1.5s both infinite; }
.mystic-pop-neko .arm-top-right-tip { animation: arm-tip-right 1.5s both infinite; }
.mystic-pop-neko-core {
    position: absolute;
    left: 50%;
    top: 52%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,244,181,.95) 0%, rgba(255,218,102,.48) 22%, rgba(255,255,255,0) 68%);
    filter: blur(2px);
    animation: mysticPopCorePulse 2.4s ease-in-out infinite;
    mix-blend-mode: screen;
}
/* ============================================================
/* ============================================================
   MANEKI NEKO BLANC — Version finale
   Miroir exact de la logique obsidian : lumière de l'intérieur.
   Corps blanc, yeux blanc pur, tablette animée, zéro rose.
   ============================================================ */

/* Corps → blanc avec lumière interne vers le bas,
   miroir de l'obsidian (cyan intérieur → blanc intérieur) */
.pearl-mode.obsidian-mode .head,
.pearl-mode.obsidian-mode .arm-top-left,
.pearl-mode.obsidian-mode .arm-top-right,
.pearl-mode.obsidian-mode .paw-left,
.pearl-mode.obsidian-mode .paw-right,
.pearl-mode.obsidian-mode .back-leg-left,
.pearl-mode.obsidian-mode .back-leg-right,
.pearl-mode.obsidian-mode .ear-left-out,
.pearl-mode.obsidian-mode .ear-right-out {
    background: linear-gradient(to bottom, #ffffff 0%, #e8eef8 100%) !important;
    border-color: rgba(180,190,210,0.5) !important;
    box-shadow:
        inset 0px 8px 12px rgba(255,255,255,0.9),
        inset 0px -15px 25px rgba(220,235,255,0.6) !important;
}

.pearl-mode.obsidian-mode .arm-top-left-tip,
.pearl-mode.obsidian-mode .arm-top-right-tip,
.pearl-mode.obsidian-mode .arm-top-left-tip::after {
    background: linear-gradient(to bottom, #ffffff, #e8eef8) !important;
    border-color: rgba(180,190,210,0.4) !important;
    box-shadow: inset 0px -10px 15px rgba(220,235,255,0.5) !important;
}

.pearl-mode.obsidian-mode .ear-left-inner,
.pearl-mode.obsidian-mode .ear-right-inner {
    background: #1a1a22 !important;
    border-color: rgba(80,80,100,0.3) !important;
    box-shadow: none !important;
}
.pearl-mode.obsidian-mode .necklace {
    background: linear-gradient(to bottom, #141418, #0a0a0e) !important;
    border-color: rgba(30,30,40,0.6) !important;
    box-shadow: none !important;
}

/* Yeux → blanc pur éclatant, miroir exact des yeux cyan obsidian */
.pearl-mode.obsidian-mode .eye-left,
.pearl-mode.obsidian-mode .eye-right {
    opacity: 1 !important;
    height: 5px !important;
    width: 28px !important;
    background: #1a1a2e !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow:
        0 0 0 2px rgba(255,255,255,0.9),
        0 0 12px rgba(255,255,255,0.8),
        0 0 25px rgba(255,255,255,0.4) !important;
    transform: rotate(0deg) !important;
    margin-top: 15px !important;
}
.pearl-mode.obsidian-mode .eye-left  { margin-left: 20px !important; }
.pearl-mode.obsidian-mode .eye-right { margin-right: 20px !important; }
.pearl-mode.obsidian-mode .eye-left::after,
.pearl-mode.obsidian-mode .eye-left::before,
.pearl-mode.obsidian-mode .eye-right::after,
.pearl-mode.obsidian-mode .eye-right::before { display: none !important; }

.pearl-mode.obsidian-mode .mustache-left,
.pearl-mode.obsidian-mode .mustache-right,
.pearl-mode.obsidian-mode .mustache-left-bottom,
.pearl-mode.obsidian-mode .mustache-right-bottom,
.pearl-mode.obsidian-mode .nose,
.pearl-mode.obsidian-mode .mouth,
.pearl-mode.obsidian-mode .mouth-right { opacity: 0 !important; }

/* Tablette — animation koban-glow identique à l'intro */
.pearl-mode.obsidian-mode .gold,
.pearl-mode.obsidian-mode .bell {
    background: radial-gradient(circle at center, #ffd700 0%, #f39c12 60%, #d35400 100%) !important;
    border-color: transparent !important;
    animation: koban-glow 3s ease-in-out infinite alternate !important;
}
.pearl-mode.obsidian-mode .carving {
    color: #4a2311 !important;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5) !important;
}

/* Core supprimé — source du bloom rose */
.pearl-core { display: none !important; }

/* ---- Halo + particules ---- */
.pearl-neko { position: relative; }

.pearl-sparkles {
    position: absolute;
    inset: -40px;
    pointer-events: none;
    z-index: 20;
}

.pearl-halo {
    position: absolute;
    left: 50%; top: 78%;
    width: 90px; height: 35px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.2) 0%, transparent 70%);
    filter: blur(10px);
    animation: pearlHaloPulse 4s ease-in-out infinite;
}

.pearl-spark {
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 4px #fff, 0 0 10px rgba(255,255,255,0.8);
    animation: pearlSparkOrbit var(--dur, 3.2s) linear infinite;
    transform-origin: calc(50% + var(--rx, 70px)) calc(50% + var(--ry, 0px));
    opacity: 0;
}

.ps-1  { --dur:3.2s; --rx: 68px; --ry:  0px; top:50%; left:50%; animation-delay:0s; }
.ps-2  { --dur:4.0s; --rx: 55px; --ry:-20px; top:50%; left:50%; animation-delay:-.7s; }
.ps-3  { --dur:2.8s; --rx: 75px; --ry: 15px; top:50%; left:50%; animation-delay:-1.4s; }
.ps-4  { --dur:4.6s; --rx:-60px; --ry:-18px; top:50%; left:50%; animation-delay:-2.1s; }
.ps-5  { --dur:3.5s; --rx: 62px; --ry: 22px; top:50%; left:50%; animation-delay:-2.8s; }
.ps-6  { --dur:3.0s; --rx:-72px; --ry:  8px; top:50%; left:50%; animation-delay:-3.5s; }

@keyframes pearlSparkOrbit {
    0%   { opacity: 0;   transform: rotate(0deg)   translateX(var(--rx)) scale(0.5); }
    12%  { opacity: 0.7; }
    82%  { opacity: 0.7; }
    100% { opacity: 0;   transform: rotate(360deg) translateX(var(--rx)) scale(1); }
}
@keyframes pearlHaloPulse {
    0%,100% { opacity: 0.5;  transform: translate(-50%,-50%) scale(0.9); }
    50%     { opacity: 0.9;  transform: translate(-50%,-50%) scale(1.1); }
}

.mystic-pop-neko-wrap.is-visible .pearl-neko {
    animation: pearlNekoReveal 1.6s cubic-bezier(0.2, 0.85, 0.3, 1) forwards;
}
@keyframes pearlNekoReveal {
    0%   { filter: brightness(4) saturate(0); transform: scale(0.8) translateY(10px); }
    30%  { filter: brightness(2); }
    65%  { transform: scale(1.03) translateY(-2px); }
    100% { filter: brightness(1); transform: scale(1) translateY(0); }
}

/* Drop-shadow : blanc pur, zéro couleur parasite */
.mystic-pop-neko-wrap.is-visible {
    filter:
        drop-shadow(0 0 6px rgba(255,255,255,1))
        drop-shadow(0 0 18px rgba(255,255,255,0.55))
        drop-shadow(0 0 35px rgba(255,255,255,0.22)) !important;
}


@keyframes mysticPopOrbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes mysticPopRelicIn {
    0%   { opacity: 0; transform: translate(-50%, -50%) translate(var(--mx), var(--my)) scale(.12) rotate(22deg); }
    60%  { opacity: 1; transform: translate(-50%, -50%) translate(var(--mx), var(--my)) scale(1.12) rotate(-8deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) translate(var(--mx), var(--my)) scale(1) rotate(0deg); }
}
@keyframes mysticPopRipple {
    0% { opacity: .8; transform: translate(-50%, -50%) scale(.25); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(4.4); }
}
@keyframes mysticPopNekoIn {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(.28); }
    45%  { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes mysticPopCorePulse {
    0%,100% { opacity: .62; transform: translate(-50%, -50%) scale(.92); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}
@media (max-width: 768px) {
    #screen-final.mystic-pop-scene1 #final-circ-nekos {
        width: min(84vw, 390px);
        height: min(47vh, 330px);
        margin-top: 4px;
    }
    .mystic-pop-relic { width: 72px; height: 72px; }
    .mystic-pop-neko { width: 110px; height: 136px; }
    .mystic-pop-neko .neko-scale-wrapper { transform: scale(.295); }
}

/* ============================================================
   SÉQUENCE OMBRE AGONIE — outro
   ============================================================ */

/* Tremblement violent + fissures cyan */
.ombre-agonie {
    animation: ombreShake 0.08s linear infinite !important;
}
.ombre-agonie .eclipse-void {
    animation: ombreFissure 1.4s ease forwards !important;
}
.ombre-agonie .shadow-smoke .smoke-particle {
    animation-duration: 0.3s !important;
}
.ombre-agonie .crimson-aura {
    animation: ombreAuraPanic 0.15s linear infinite !important;
}
/* Fissures cyan qui déchirent l'ombre */
.ombre-agonie .eclipse-ring {
    box-shadow:
        0 0 0 2px rgba(160,240,255,0.8),
        0 0 20px rgba(160,240,255,0.6),
        0 0 50px rgba(160,240,255,0.3),
        inset 0 0 20px rgba(0,0,0,0.9) !important;
    border-color: rgba(160,240,255,0.9) !important;
    transition: all 0.3s ease !important;
}

@keyframes ombreShake {
    0%   { transform: translate(-50%, -50%) scale(0.7) rotate(-1.5deg) translateX(-3px); }
    25%  { transform: translate(-50%, -50%) scale(0.72) rotate(1.5deg) translateX(4px); }
    50%  { transform: translate(-50%, -50%) scale(0.68) rotate(-2deg) translateX(-5px); }
    75%  { transform: translate(-50%, -50%) scale(0.71) rotate(1deg) translateX(3px); }
    100% { transform: translate(-50%, -50%) scale(0.7) rotate(-1deg) translateX(-2px); }
}

@keyframes ombreFissure {
    0%   { background: radial-gradient(circle, #0a0408 0%, #04020a 60%, #010001 100%); }
    40%  { background: radial-gradient(circle, #0a1520 0%, rgba(160,240,255,0.15) 40%, #010001 100%); }
    100% { background: radial-gradient(circle, rgba(160,240,255,0.4) 0%, rgba(160,240,255,0.05) 50%, transparent 100%); }
}

@keyframes ombreAuraPanic {
    0%   { opacity: 0.9; transform: translate(-50%,-50%) scaleY(1.6) scaleX(0.7) rotate(-2deg); }
    50%  { opacity: 0.5; transform: translate(-50%,-50%) scaleY(1.3) scaleX(0.9) rotate(2deg); }
    100% { opacity: 0.9; transform: translate(-50%,-50%) scaleY(1.7) scaleX(0.65) rotate(-1deg); }
}

/* Fragments d'encre qui explosent */
@keyframes inkFrag {
    0%   { opacity: 1; transform: translate(-50%,-50%) rotate(var(--rot, 0deg)) translate(0,0) scale(1); }
    60%  { opacity: 0.8; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--tx,0px)), calc(-50% + var(--ty,0px))) rotate(var(--rot, 180deg)) scale(0.2); }
}

/* Scale neko outro */
.mystic-pop-neko .neko-scale-wrapper { transform: scale(.46) !important; }

/* Final-daruma positionné au centre de l'écran indépendamment du flexbox */
#final-daruma {
    position: fixed !important;
    left: 50% !important;
    top: 45% !important;
    transform: translate(-50%, -50%) scale(0.55) !important;
    transform-origin: center center !important;
    display: none;
}

/* ============================================================
   SCÈNE MIKOS
   ============================================================ */

/* Respiration idle en vague */
.miko-doll {
    animation: mikoBreathe 2.8s ease-in-out infinite;
}
.miko-doll:nth-child(2) { animation-delay: 0.2s; }
.miko-doll:nth-child(3) { animation-delay: 0.4s; }
.miko-doll:nth-child(4) { animation-delay: 0.6s; }
.miko-doll:nth-child(5) { animation-delay: 0.8s; }
.miko-doll:nth-child(6) { animation-delay: 1.0s; }
.miko-doll:nth-child(7) { animation-delay: 1.2s; }
.miko-doll:nth-child(8) { animation-delay: 1.4s; }

@keyframes mikoBreathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-5px) scale(1.02); }
}

/* Salut vers Ava */
.miko-bow-anim {
    animation: mikoSalut 0.8s cubic-bezier(0.17,0.89,0.32,1.2) forwards !important;
}
@keyframes mikoSalut {
    0%   { transform: translateY(0) rotate(0deg); }
    35%  { transform: translateY(4px) rotate(-8deg); }
    65%  { transform: translateY(2px) rotate(-5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}


/* ============================================================
   ÉCRAN 4 — CHÂTEAU RENAÎT
   ============================================================ */
.castle-victory-wrap {
    position: relative;
    width: 280px;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: castleVictoryEnter 1s cubic-bezier(0.17,0.89,0.32,1.2) forwards;
}
@keyframes castleVictoryEnter {
    0%   { transform: translateY(30px) scale(0.85); }
    100% { transform: translateY(0) scale(1); }
}
.castle-victory-halo {
    position: absolute;
    bottom: -30px; left: 50%;
    transform: translateX(-50%);
    width: 320px; height: 130px;
    background: radial-gradient(ellipse, rgba(255,183,197,0.55) 0%, rgba(255,215,0,0.25) 45%, transparent 72%);
    filter: blur(22px);
    animation: castleHaloPulse 2.5s ease-in-out infinite;
    z-index: 0;
}
.castle-victory-aurora {
    position: absolute;
    top: -40px; left: 50%;
    transform: translateX(-50%);
    width: 200px; height: 200px;
    background: radial-gradient(ellipse, rgba(255,183,197,0.2) 0%, rgba(139,26,26,0.1) 50%, transparent 75%);
    filter: blur(30px);
    animation: castleHaloPulse 3s ease-in-out infinite reverse;
    z-index: 0;
}
.castle-victory-svg { position: relative; z-index: 1; }
.castle-victory-crane {
    position: absolute;
    animation: craneFly 8s linear infinite;
}
.castle-victory-crane:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.castle-victory-crane:nth-child(2) { top: 20%; right: 8%; animation-delay: -3s; }
@keyframes craneFly {
    0%   { transform: translateX(-20px); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateX(60px); opacity: 0; }
}
@keyframes castleHaloPulse {
    0%,100% { opacity: 0.65; transform: translateX(-50%) scaleX(0.9); }
    50%      { opacity: 1;    transform: translateX(-50%) scaleX(1.12); }
}

/* ============================================================
   ÉCRAN 5 — YOKAI
   ============================================================ */
.yokai-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 90px;
    position: relative;
    padding-top: 80px;
}
.yokai-petal-container {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    height: 200px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.yokai-petal {
    width: 16px; height: 16px;
    background: radial-gradient(circle at 35% 35%, #ffd6e0, #ffb7c5);
    border-radius: 40% 60% 55% 45%;
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(255,183,197,0.9));
}
.yokai-petal.is-falling {
    animation: yokaiPetalFall 3.2s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes yokaiPetalFall {
    0%   { opacity: 0; transform: translateY(-10px) rotate(0deg); }
    8%   { opacity: 1; }
    85%  { opacity: 1; }
    100% { opacity: 0.5; transform: translateY(160px) rotate(140deg) translateX(12px); }
}

/* ============================================================
   ÉCRAN 6 — NEKO SUPRÊME
   ============================================================ */
.neko-supreme-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.neko-supreme-rainbow {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 260px; height: 260px;
    border-radius: 50%;
    background: conic-gradient(
        rgba(255,100,100,0.18),
        rgba(255,180,50,0.18),
        rgba(255,255,80,0.18),
        rgba(80,220,100,0.18),
        rgba(80,180,255,0.18),
        rgba(180,80,255,0.18),
        rgba(255,80,180,0.18),
        rgba(255,100,100,0.18)
    );
    filter: blur(6px);
    animation: rainbowSpin 6s linear infinite;
    z-index: 0;
}
@keyframes rainbowSpin {
    from { transform: translate(-50%,-50%) rotate(0deg); }
    to   { transform: translate(-50%,-50%) rotate(360deg); }
}
.neko-supreme-stage { position: relative; z-index: 1; }

.yokai-grappe {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ══ MINIJEUX PREMIUM ══ */
@keyframes shockwaveAnim {
    0%   { width: 0; height: 0; opacity: 1; border-width: 3px; }
    100% { width: 120px; height: 120px; opacity: 0; border-width: 1px; }
}

@keyframes petalFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0.8; }
    100% { transform: translateY(300px) rotate(180deg); opacity: 0; }
}

.drum-btn {
    width: 100px; height: 100px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: bold; color: #fff;
    cursor: pointer; user-select: none;
    border: 3px solid rgba(255,255,255,0.4);
    transition: transform 0.08s, filter 0.08s;
    font-family: 'Fredoka One', cursive;
}
.drum-btn:active { transform: scale(0.88); filter: brightness(1.4); }

.mem-btn {
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,215,0,0.3);
    border-radius: 16px; cursor: pointer;
    transition: transform 0.15s, filter 0.15s, background 0.15s;
}
.mem-btn:active, .mem-btn-svg:active { transform: scale(1.2); filter: drop-shadow(0 0 12px #ffd700); background: rgba(255,215,0,0.15); }

#circle-progress { filter: drop-shadow(0 0 6px rgba(255,215,0,0.4)); }

.catch-target { cursor: pointer; }

/* ══ ÉCRAN DE DÉCOUVERTE ══ */
@keyframes discoveryHaloSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes discoveryParticle {
    0%   { transform: translate(-50%,-50%) scale(1); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0); opacity: 0; }
}
#discovery-overlay { overflow: hidden; }

/* Scanner — texte amélioré */
#scan-overlay .scan-text {
    font-family: 'Ma Shan Zheng', cursive;
    letter-spacing: 2px;
    font-size: 17px;
}

/* ============================================================
   KODAMAS — SURGISSEMENT + ÉTINCELLES + LUEUR SOL
   ============================================================ */
@keyframes kd-surge {
    0%   { opacity:0; transform:scale(var(--kd-s,1)) translateY(80px); }
    60%  { opacity:1; transform:scale(calc(var(--kd-s,1)*1.12)) translateY(-10px); }
    80%  { transform:scale(calc(var(--kd-s,1)*0.96)) translateY(4px); }
    100% { opacity:1; transform:scale(var(--kd-s,1)) translateY(0); }
}
.kd-surging { animation: kd-surge 0.65s cubic-bezier(0.17,0.89,0.32,1.49) forwards !important; }

/* Étincelles d'apparition */
@keyframes kd-spark {
    0%   { transform:translate(0,0) scale(1); opacity:1; }
    100% { transform:translate(var(--sx),var(--sy)) scale(0); opacity:0; }
}
.kd-spark {
    position:absolute; width:6px; height:6px; border-radius:50%;
    pointer-events:none; z-index:50;
    animation: kd-spark 0.5s ease-out forwards;
}

/* Lueur de sol */
@keyframes kd-glow-pulse {
    0%,100% { opacity:0.4; transform:scaleX(1); }
    50%      { opacity:0.7; transform:scaleX(1.15); }
}
.kd-ground-glow {
    position:absolute; bottom:-8px; left:50%;
    transform:translateX(-50%);
    width:180px; height:30px;
    background:radial-gradient(ellipse, rgba(255,183,197,0.55) 0%, rgba(200,150,255,0.25) 50%, transparent 75%);
    border-radius:50%;
    animation: kd-glow-pulse 2.5s ease-in-out infinite;
    pointer-events:none; z-index:0;
}

/* Reflet au sol */
.kd-reflect {
    position:absolute; bottom:-20px; left:50%;
    transform:translateX(-50%) scaleY(-0.15);
    transform-origin:top center;
    opacity:0.18; filter:blur(3px);
    pointer-events:none; z-index:0;
    width:100px; height:80px;
    background:radial-gradient(ellipse, rgba(255,255,255,0.6) 0%, transparent 70%);
}

/* Page miroir — prénoms pluie */
/* Pluie de prénoms — vitesses variées + lueur au centre */
@keyframes name-rain {
    0%   { transform:translateY(-40px) rotate(var(--nr,0deg)); opacity:0; }
    8%   { opacity:var(--no,0.6); }
    45%  { opacity:var(--no,0.6); text-shadow: 0 0 var(--glow,8px) var(--col,#ffb7c5); }
    55%  { opacity:calc(var(--no,0.6)*1.4); text-shadow: 0 0 20px var(--col,#ffb7c5), 0 0 40px var(--col,#ffb7c5); }
    65%  { opacity:var(--no,0.6); text-shadow: 0 0 var(--glow,8px) var(--col,#ffb7c5); }
    92%  { opacity:var(--no,0.6); }
    100% { transform:translateY(110vh) rotate(calc(var(--nr,0deg)*2)); opacity:0; }
}
.mirror-name-rain {
    position:fixed; pointer-events:none; z-index:9050;
    font-family:'Fredoka One',cursive;
    animation: name-rain var(--nd,8s) cubic-bezier(0.25,0.1,0.25,1) var(--delay,0s) infinite;
}

/* Portail cercle — intérieur nacré animé */
@keyframes portal-pulse {
    0%,100% { box-shadow:0 0 40px rgba(255,215,0,0.2), 0 0 80px rgba(255,183,197,0.1); opacity:0.6; }
    50%      { box-shadow:0 0 70px rgba(255,215,0,0.45), 0 0 140px rgba(255,183,197,0.25); opacity:0.85; }
}
@keyframes portal-inner-shimmer {
    0%   { background-position: 0% 50%; opacity:0.18; }
    50%  { background-position: 100% 50%; opacity:0.28; }
    100% { background-position: 0% 50%; opacity:0.18; }
}
@keyframes portal-ring-spin {
    0% { transform:translate(-50%,-50%) rotate(0deg); }
    100% { transform:translate(-50%,-50%) rotate(360deg); }
}
.mirror-portal {
    position:fixed; left:50%; top:50%; transform:translate(-50%,-50%);
    width:min(380px,76vmin); height:min(380px,76vmin);
    border-radius:50%;
    border:2px solid rgba(255,215,0,0.35);
    animation:portal-pulse 3s ease-in-out infinite;
    pointer-events:none; z-index:9050;
    overflow:hidden;
}
/* Reflet nacré intérieur */
.mirror-portal::before {
    content:'';
    position:absolute; inset:0; border-radius:50%;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0) 0%,
        rgba(196,181,253,0.15) 20%,
        rgba(255,183,197,0.22) 40%,
        rgba(255,255,255,0.28) 50%,
        rgba(161,213,255,0.18) 65%,
        rgba(255,215,0,0.08) 80%,
        rgba(255,255,255,0) 100%
    );
    background-size:300% 300%;
    animation:portal-inner-shimmer 5s ease-in-out infinite;
}
/* Halo central doux */
.mirror-portal::after {
    content:'';
    position:absolute; inset:0; border-radius:50%;
    background:radial-gradient(circle at 40% 38%, rgba(255,255,255,0.12) 0%, rgba(196,181,253,0.06) 40%, transparent 70%);
}
/* Quand la caméra est active dans le portail — désactiver le shimmer nacré */
.mirror-portal-camera::before { animation: none !important; opacity: 0 !important; }
.mirror-portal-camera::after  { opacity: 0 !important; }
.mirror-portal-camera { overflow: hidden; }

.mirror-portal-ring {
    position:fixed; left:50%; top:50%;
    width:min(450px,86vmin); height:min(450px,86vmin);
    border-radius:50%;
    border:1.5px dashed rgba(255,215,0,0.2);
    animation:portal-ring-spin 22s linear infinite;
    pointer-events:none; z-index:9049;
}
.mirror-portal-relic {
    position:absolute; width:32px; height:32px;
    left:50%; top:50%;
    transform-origin:0 0;
    pointer-events:none;
}

/* Bouton sobre style btn-grad + flash photo */
@keyframes btn-camera-flash {
    0%,85%,100% { background:linear-gradient(90deg,#ffb7c5 0%,#ffd700 100%); }
    88%          { background:rgba(255,255,255,0.95); }
    92%          { background:linear-gradient(90deg,#ffb7c5 0%,#ffd700 100%); }
}
#btn-download-mirror {
    position:fixed; bottom:max(60px,8vh); left:50%; transform:translateX(-50%);
    padding:16px 36px; border-radius:50px;
    border:4px solid white;
    color:var(--deep,#12011a); font-family:'Fredoka One',cursive;
    font-size:16px; font-weight:900; cursor:pointer; z-index:9060;
    text-transform:uppercase; letter-spacing:1px;
    box-shadow:0 4px 20px rgba(0,0,0,0.3);
    animation:btn-camera-flash 4s ease-in-out infinite;
    pointer-events:auto;
    width:auto; height:auto; border-radius:50px;
}
#btn-download-mirror:hover { filter:brightness(1.1); transform:translateX(-50%) scale(1.03); }

/* Kanji intro miroir */
@keyframes kanji-mirror-in {
    0%   { opacity:0; transform:translate(-50%,-50%) scale(2); }
    30%  { opacity:0.5; }
    60%  { opacity:0.7; transform:translate(-50%,-50%) scale(1); }
    100% { opacity:0; transform:translate(-50%,-50%) scale(0.8); }
}
.mirror-kanji-intro {
    position:fixed; left:50%; top:45%;
    transform:translate(-50%,-50%);
    font-family:'Ma Shan Zheng',cursive;
    font-size:min(180px,35vmin);
    color:rgba(255,215,0,0.55);
    text-shadow:0 0 40px rgba(255,215,0,0.4);
    pointer-events:none; z-index:9055;
    animation:kanji-mirror-in 1.8s ease-in-out forwards;
}

/* Pétales sakura dans le portail caméra */
@keyframes portal-petal-fall {
    0%   { transform:translateY(-10px) rotate(0deg); opacity:0; }
    10%  { opacity:0.7; }
    90%  { opacity:0.5; }
    100% { transform:translateY(calc(min(420px,80vmin) + 10px)) rotate(180deg); opacity:0; }
}

/* ── OPT-02 : Neko Suprême scale explicite mobile ── */
@media (max-width: 480px) {
    .neko-supreme-stage .neko-scale-wrapper { transform: scale(0.38) !important; }
}

/* ── VIS-04 : Portal miroir breakpoints ── */
@media (min-width: 600px) {
    .mirror-portal { width: min(440px, 58vmin) !important; height: min(440px, 58vmin) !important; }
    .mirror-portal-ring { width: min(470px, 62vmin) !important; height: min(470px, 62vmin) !important; }
}

/* ── will-change sur animations critiques outro ── */
.kd-container, .miko-doll, .mirror-portal, .mirror-portal-ring,
.mystic-pop-relic, .mystic-pop-neko-wrap, .neko-supreme-wrap,
.kd-ground-glow, .mirror-name-rain {
    will-change: transform, opacity;
}


/* ===============================
   SPRINT 3 — reveal / rewards / assists
   =============================== */
.discovery-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(255,255,255,0.03), rgba(10,0,16,0.96));
    opacity: 0;
    transition: opacity .32s ease;
    overflow: hidden;
}
.discovery-overlay.show { opacity: 1; }
.discovery-bg {
    position:absolute; inset:0;
    background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--reveal-color) 38%, transparent), transparent 60%);
    opacity:.9;
}
.discovery-kanji-bg {
    position:absolute; left:50%; top:50%; transform:translate(-50%,-56%);
    font-family:'Ma Shan Zheng',cursive;
    font-size:min(50vw,320px); line-height:1;
    color:var(--reveal-color); opacity:.08; pointer-events:none;
}
.discovery-card {
    position:relative; z-index:2;
    width:min(92vw, 430px);
    padding:32px 26px 26px;
    border-radius:30px;
    border:1px solid rgba(255,255,255,.09);
    background:
        linear-gradient(180deg, rgba(28,12,42,.88), rgba(10,3,18,.95)),
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--reveal-color) 16%, transparent), transparent 56%);
    box-shadow:0 24px 80px rgba(0,0,0,.38), 0 0 0 1px rgba(255,255,255,.04) inset;
    text-align:center;
    transform:translateY(18px) scale(.98);
    transition:transform .42s ease;
    overflow:hidden;
}
.discovery-card::before {
    content:''; position:absolute; inset:0; pointer-events:none;
    background:radial-gradient(circle at 50% 18%, rgba(255,255,255,.06), transparent 40%);
    opacity:.9;
}
.discovery-overlay.show .discovery-card { transform:translateY(0) scale(1); }
.discovery-halo { position:relative; width:220px; height:220px; margin:0 auto 14px; display:flex; align-items:center; justify-content:center; opacity:0; transform:scale(.92); }
.discovery-halo-ring {
    position:absolute; inset:0; border-radius:50%;
    background:conic-gradient(from 0deg, var(--reveal-color), var(--reveal-dark), rgba(255,255,255,.9), var(--reveal-color));
    filter:blur(12px); opacity:.52; animation:discoveryHaloSpin 6s linear infinite;
}
.discovery-relic { position:relative; z-index:1; width:172px; height:172px; filter:drop-shadow(0 0 30px var(--reveal-color)); }
.discovery-relic svg { width:172px; height:172px; }
.discovery-name {
    font-family:'Fredoka One',cursive; font-size:42px; line-height:1.05; color:#fff6db;
    letter-spacing:.2px; text-shadow:0 0 24px color-mix(in srgb, var(--reveal-color) 45%, transparent);
    margin-top:2px; opacity:0; transform:translateY(8px);
}
.discovery-kanji-small { font-family:'Ma Shan Zheng',cursive; color:var(--reveal-dark); font-size:24px; margin:4px 0 14px; opacity:0; transform:translateY(8px); }
.discovery-text {
    min-height:84px; margin-bottom:20px;
    display:flex; flex-direction:column; gap:8px; align-items:center; justify-content:center;
}
.discovery-line {
    margin:0; max-width:30ch; color:rgba(255,255,255,.9); line-height:1.55; font-size:17px;
    font-family:'Fredoka One',cursive; letter-spacing:.15px; opacity:0; transform:translateY(10px);
}
.ritual-cta {
    border:none; border-radius:999px; padding:14px 28px; cursor:pointer;
    font-family:'Fredoka One',cursive; font-size:18px; color:white; letter-spacing:.2px;
    background:linear-gradient(135deg, var(--reveal-dark, #8b5cf6), var(--reveal-color, #f472b6));
    box-shadow:0 12px 30px rgba(0,0,0,.22);
    opacity:0; transform:translateY(10px);
}
.ritual-cta:hover { transform:translateY(-1px) scale(1.01); }
.discovery-overlay.staged .discovery-halo { animation:revealStudioIn .55s cubic-bezier(.2,.9,.2,1) .28s forwards; }
.discovery-overlay.staged .discovery-name { animation:revealTextIn .44s ease .78s forwards; }
.discovery-overlay.staged .discovery-kanji-small { animation:revealTextIn .44s ease .94s forwards; }
.discovery-overlay.staged .discovery-line-1 { animation:revealTextIn .42s ease 1.12s forwards; }
.discovery-overlay.staged .discovery-line-2 { animation:revealTextIn .42s ease 1.32s forwards; }
.discovery-overlay.staged .ritual-cta { animation:revealTextIn .42s ease 1.56s forwards; }
@keyframes revealStudioIn {
    from { opacity:0; transform:scale(.92); }
    to { opacity:1; transform:scale(1); }
}
@keyframes revealTextIn {
    from { opacity:0; transform:translateY(10px); }
    to { opacity:1; transform:translateY(0); }
}
.milestone-overlay {
    position:fixed; inset:0; z-index:9600; display:flex; align-items:center; justify-content:center;
    opacity:0; transition:opacity .28s ease; pointer-events:none;
}
.milestone-overlay.show { opacity:1; pointer-events:auto; }
.milestone-backdrop { position:absolute; inset:0; background:rgba(6,0,10,.76); backdrop-filter: blur(8px); }
.milestone-panel {
    position:relative; z-index:1; width:min(92vw,460px); padding:30px 24px 24px;
    border-radius:28px; text-align:center;
    background:linear-gradient(180deg, rgba(25,11,37,.96), rgba(12,3,20,.98));
    border:1px solid rgba(255,255,255,.08); box-shadow:0 28px 90px rgba(0,0,0,.45);
}
.milestone-badge { color:#ffd700; font-size:12px; letter-spacing:2px; margin-bottom:10px; font-weight:700; font-family:'Fredoka One',cursive; text-transform:uppercase; }
.milestone-title { font-family:'Fredoka One',cursive; font-size:40px; color:#fff2c6; margin-bottom:8px; line-height:1.1; }
.milestone-subtitle { color:rgba(255,255,255,.86); font-size:18px; margin-bottom:12px; font-family:'Fredoka One',cursive; }
.milestone-body { color:rgba(255,255,255,.72); line-height:1.7; margin-bottom:18px; font-family:'Fredoka One',cursive; }
.milestone-cta { font-family:'Fredoka One',cursive; font-size:18px; letter-spacing:.2px; }
.milestone-overlay.theme-rose .milestone-title { color:#ffd7ea; text-shadow:0 0 24px rgba(255,183,197,.35); }
.milestone-overlay.theme-gold .milestone-title { color:#ffe69a; text-shadow:0 0 24px rgba(255,215,0,.35); }
.milestone-overlay.theme-violet .milestone-title { color:#d9c6ff; text-shadow:0 0 24px rgba(167,139,250,.35); }
.quiz-assist {
    margin:14px auto 0; max-width:420px; min-height:24px; padding:0 10px;
    color:rgba(255,242,198,.86); text-align:center; line-height:1.5; font-size:15px; opacity:0;
    transform:translateY(6px); transition:opacity .22s ease, transform .22s ease;
}
.quiz-assist.visible { opacity:1; transform:translateY(0); }
.btn-ema.option-guided { border-color:rgba(255,215,0,.45) !important; box-shadow:0 0 0 1px rgba(255,215,0,.16) inset; }
.btn-ema.option-guided-strong { border-color:#ffd700 !important; box-shadow:0 0 18px rgba(255,215,0,.25); background:rgba(255,215,0,.10) !important; }
:root[data-shrine-level="1"] #screen-hub::before,
:root[data-shrine-level="2"] #screen-hub::before,
:root[data-shrine-level="3"] #screen-hub::before {
    content:''; position:absolute; inset:0; pointer-events:none;
    background:radial-gradient(circle at 50% 10%, rgba(255,215,0,.06), transparent 46%);
}
:root[data-shrine-level="2"] #screen-hub::after,
:root[data-shrine-level="3"] #screen-hub::after {
    content:''; position:absolute; inset:0; pointer-events:none;
    background-image:radial-gradient(circle, rgba(255,215,0,.22) 0 1px, transparent 1.2px);
    background-size:26px 26px; opacity:.16; animation:rewardDust 14s linear infinite;
}
:root[data-shrine-level="3"] .slot.unlocked { box-shadow:0 0 20px rgba(255,215,0,.18), inset 0 0 12px rgba(255,255,255,.04); }
@keyframes rewardDust { from { transform:translateY(0); } to { transform:translateY(26px); } }


/* ===== Rituel de Réinitialisation ===== */
.compass-sakura-trigger { cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.compass-sakura-trigger.ritual-armed { animation: ritual-sakura-pulse 0.35s ease; }
@keyframes ritual-sakura-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.debug-ritual-overlay {
  position: fixed; inset: 0; z-index: 11000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(255,183,197,0.12), rgba(10,6,18,0.92) 55%, rgba(4,2,10,0.97));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 24px;
}
.debug-ritual-panel {
  width: min(92vw, 440px);
  padding: 24px 22px 20px;
  border-radius: 26px;
  border: 2px solid rgba(255,183,197,0.45);
  background: linear-gradient(180deg, rgba(34,10,38,0.96), rgba(16,6,24,0.96));
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 34px rgba(255,183,197,0.12), inset 0 0 26px rgba(255,255,255,0.03);
  color: #fff; text-align: center;
}
.debug-ritual-kanji {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 34px; line-height: 1; color: var(--sakura); opacity: 0.9;
  text-shadow: 0 0 16px rgba(255,183,197,0.4); margin-bottom: 10px;
}
.debug-ritual-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(24px, 4.8vw, 31px);
  color: #fff; margin: 0 0 10px; letter-spacing: 0.4px;
  text-shadow: 0 0 18px rgba(255,183,197,0.16);
}
.debug-ritual-copy {
  font-family: 'Fredoka One', cursive;
  font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.92);
  margin: 0 auto 18px; max-width: 320px;
}
.debug-ritual-note {
  font-family: 'Fredoka One', cursive;
  font-size: 12px; line-height: 1.45; color: rgba(255,183,197,0.85);
  margin: 0 auto 18px; max-width: 320px; opacity: 0.9;
}
.debug-ritual-actions { display: grid; gap: 12px; }
.debug-ritual-btn {
  appearance: none; border: 0; border-radius: 999px; padding: 14px 18px;
  font-family: 'Fredoka One', cursive; font-size: 15px; letter-spacing: 0.2px; cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.debug-ritual-btn:hover { transform: translateY(-1px); }
.debug-ritual-btn:active { transform: translateY(1px) scale(0.99); }
.debug-ritual-btn--purify {
  color: #2d0a20; background: linear-gradient(180deg, #ffe3eb, #ffb7c5);
  box-shadow: 0 10px 24px rgba(255,183,197,0.22);
}
.debug-ritual-btn--refresh {
  color: #fff; background: linear-gradient(180deg, rgba(255,215,0,0.24), rgba(122,86,0,0.58));
  border: 1px solid rgba(255,215,0,0.35);
}
.debug-ritual-btn--close {
  color: rgba(255,255,255,0.92); background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
