/* =====================================================
   STYLE.CSS — Décorations & Immersion Thématique
   🌿 Mode Clair  : Forêt / Aventure / École
   🌙 Mode Sombre : Nuit de Camp / Étoiles / Ours
   ===================================================== */

/* ══════════════════════════════════════════════════
   ANIMATIONS DÉCORATIVES
   ══════════════════════════════════════════════════ */

@keyframes float-decor {
    0%,100% { transform: translateY(0px)   rotate(0deg);  }
    33%      { transform: translateY(-14px) rotate( 6deg); }
    66%      { transform: translateY(-6px)  rotate(-4deg); }
}

@keyframes sway-leaf {
    0%,100% { transform: rotate(-12deg) scale(1);   }
    50%      { transform: rotate( 12deg) scale(1.1); }
}

@keyframes twinkle {
    0%,100% { opacity: 0.2; transform: scale(0.7); }
    50%      { opacity: 1.0; transform: scale(1.3); }
}

@keyframes flame-flicker {
    0%,100% { transform: scaleX(1)    scaleY(1)    skewX(  0deg); filter: brightness(1);    }
    20%      { transform: scaleX(0.9)  scaleY(1.06) skewX(  4deg); filter: brightness(1.1);  }
    50%      { transform: scaleX(1.08) scaleY(0.95) skewX(- 3deg); filter: brightness(0.95); }
    75%      { transform: scaleX(0.95) scaleY(1.08) skewX(  2deg); filter: brightness(1.05); }
}

@keyframes campfire-glow-pulse {
    0%,100% { box-shadow: 0 0 35px rgba(255,110,0,0.10), 0 0 70px  rgba(255,160,0,0.05);  }
    50%      { box-shadow: 0 0 55px rgba(255,160,0,0.20), 0 0 110px rgba(255,200,0,0.10); }
}

@keyframes shooting-star {
    0%   { transform: translateX(0)     translateY(0)    scaleX(1) rotate(-30deg); opacity: 0; }
    4%   { opacity: 1; }
    18%  { transform: translateX(280px) translateY(90px) scaleX(5) rotate(-30deg); opacity: 0; }
    100% { opacity: 0; }
}

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

@keyframes owl-blink {
    0%,90%,100% { transform: scaleY(1);   }
    95%          { transform: scaleY(0.1); }
}

@keyframes firefly {
    0%   { opacity: 0;   transform: translate(  0,   0); }
    25%  { opacity: 0.9; transform: translate( 18px,-14px); }
    50%  { opacity: 0.5; transform: translate( -8px,-28px); }
    75%  { opacity: 0.8; transform: translate(-22px, -9px); }
    100% { opacity: 0;   transform: translate(  0,   0); }
}

/* ══════════════════════════════════════════════════
   SILHOUETTE PAYSAGE EN BAS DE PAGE
   ══════════════════════════════════════════════════ */

/* 🌳 Forêt & collines (mode clair) */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 230px;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 230' preserveAspectRatio='none'%3E%3Cpath d='M0,190 Q80,150 160,170 Q240,130 320,155 Q400,115 480,145 Q560,105 640,140 Q720,110 800,145 Q880,120 960,155 Q1040,125 1120,158 Q1200,135 1280,165 Q1360,145 1440,175 L1440,230 L0,230 Z' fill='%232d6a4f' opacity='0.12'/%3E%3Crect x='60' y='120' width='18' height='70' rx='3' fill='%235c3d1e' opacity='0.28'/%3E%3Cellipse cx='69' cy='110' rx='32' ry='38' fill='%231b4332' opacity='0.22'/%3E%3Cellipse cx='69' cy='118' rx='26' ry='30' fill='%232d6a4f' opacity='0.20'/%3E%3Cellipse cx='69' cy='100' rx='18' ry='22' fill='%2352b788' opacity='0.16'/%3E%3Crect x='210' y='128' width='14' height='60' rx='2' fill='%235c3d1e' opacity='0.26'/%3E%3Cellipse cx='217' cy='118' rx='26' ry='32' fill='%231b4332' opacity='0.20'/%3E%3Cellipse cx='217' cy='108' rx='20' ry='24' fill='%2352b788' opacity='0.18'/%3E%3Crect x='420' y='115' width='20' height='75' rx='3' fill='%235c3d1e' opacity='0.28'/%3E%3Cellipse cx='430' cy='104' rx='36' ry='42' fill='%231b4332' opacity='0.22'/%3E%3Cellipse cx='430' cy='114' rx='28' ry='32' fill='%232d6a4f' opacity='0.18'/%3E%3Cellipse cx='430' cy='95' rx='20' ry='25' fill='%2352b788' opacity='0.16'/%3E%3Cellipse cx='340' cy='185' rx='45' ry='25' fill='%2352b788' opacity='0.15'/%3E%3Cellipse cx='560' cy='190' rx='38' ry='20' fill='%2352b788' opacity='0.13'/%3E%3Crect x='720' y='122' width='16' height='66' rx='2' fill='%235c3d1e' opacity='0.26'/%3E%3Cellipse cx='728' cy='112' rx='30' ry='36' fill='%231b4332' opacity='0.20'/%3E%3Cellipse cx='728' cy='102' rx='22' ry='26' fill='%2352b788' opacity='0.16'/%3E%3Crect x='880' y='135' width='12' height='55' rx='2' fill='%235c3d1e' opacity='0.24'/%3E%3Cellipse cx='886' cy='126' rx='22' ry='28' fill='%232d6a4f' opacity='0.18'/%3E%3Cellipse cx='886' cy='116' rx='15' ry='18' fill='%2352b788' opacity='0.14'/%3E%3Crect x='1080' y='118' width='20' height='72' rx='3' fill='%235c3d1e' opacity='0.28'/%3E%3Cellipse cx='1090' cy='106' rx='35' ry='40' fill='%231b4332' opacity='0.22'/%3E%3Cellipse cx='1090' cy='118' rx='27' ry='31' fill='%232d6a4f' opacity='0.18'/%3E%3Cellipse cx='1090' cy='96' rx='19' ry='23' fill='%2352b788' opacity='0.15'/%3E%3Crect x='1300' y='130' width='15' height='62' rx='2' fill='%235c3d1e' opacity='0.26'/%3E%3Cellipse cx='1307' cy='120' rx='27' ry='33' fill='%231b4332' opacity='0.20'/%3E%3Cellipse cx='1307' cy='110' rx='20' ry='24' fill='%2352b788' opacity='0.15'/%3E%3Cpath d='M0,210 Q360,200 720,207 Q1080,200 1440,208 L1440,230 L0,230 Z' fill='%2352b788' opacity='0.10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* 🏔️ Montagnes & sapins nocturnes (mode sombre) */
[data-theme="dark"] body::after {
    height: 260px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 260' preserveAspectRatio='none'%3E%3Cpath d='M0,260 L0,180 L100,90 L200,160 L320,50 L440,150 L560,30 L680,140 L800,60 L920,150 L1040,40 L1160,140 L1280,80 L1440,170 L1440,260 Z' fill='%23112240' opacity='0.9'/%3E%3Cpath d='M320,50 L295,75 L345,75 Z' fill='%23e8f4f8' opacity='0.22'/%3E%3Cpath d='M560,30 L530,62 L590,62 Z' fill='%23e8f4f8' opacity='0.20'/%3E%3Cpath d='M800,60 L776,88 L824,88 Z' fill='%23e8f4f8' opacity='0.22'/%3E%3Cpath d='M1040,40 L1016,68 L1064,68 Z' fill='%23e8f4f8' opacity='0.20'/%3E%3Crect x='42' y='155' width='10' height='65' fill='%230a1628'/%3E%3Cpolygon points='47,110 22,168 72,168' fill='%231a3a5c'/%3E%3Cpolygon points='47,130 26,168 68,168' fill='%23112240'/%3E%3Crect x='140' y='148' width='12' height='70' fill='%230a1628'/%3E%3Cpolygon points='146,98 118,160 174,160' fill='%231a3a5c'/%3E%3Cpolygon points='146,120 121,160 171,160' fill='%23112240'/%3E%3Crect x='258' y='152' width='10' height='66' fill='%230a1628'/%3E%3Cpolygon points='263,108 241,162 285,162' fill='%231a3a5c'/%3E%3Crect x='460' y='146' width='12' height='72' fill='%230a1628'/%3E%3Cpolygon points='466,100 440,158 492,158' fill='%231a3a5c'/%3E%3Cpolygon points='466,122 443,158 489,158' fill='%23112240'/%3E%3Crect x='640' y='150' width='10' height='68' fill='%230a1628'/%3E%3Cpolygon points='645,106 623,160 667,160' fill='%231a3a5c'/%3E%3Crect x='758' y='144' width='13' height='74' fill='%230a1628'/%3E%3Cpolygon points='764,96 738,156 790,156' fill='%231a3a5c'/%3E%3Cpolygon points='764,118 741,156 787,156' fill='%23112240'/%3E%3Crect x='950' y='148' width='11' height='70' fill='%230a1628'/%3E%3Cpolygon points='955,104 932,160 978,160' fill='%231a3a5c'/%3E%3Crect x='1090' y='146' width='12' height='72' fill='%230a1628'/%3E%3Cpolygon points='1096,102 1070,158 1122,158' fill='%231a3a5c'/%3E%3Cpolygon points='1096,124 1073,158 1119,158' fill='%23112240'/%3E%3Crect x='1250' y='150' width='11' height='68' fill='%230a1628'/%3E%3Cpolygon points='1255,106 1232,162 1278,162' fill='%231a3a5c'/%3E%3Crect x='1370' y='152' width='10' height='66' fill='%230a1628'/%3E%3Cpolygon points='1375,108 1353,162 1397,162' fill='%231a3a5c'/%3E%3Crect x='0' y='218' width='1440' height='42' fill='%230a1628' opacity='0.85'/%3E%3C/svg%3E");
}

/* ══════════════════════════════════════════════════
   🌙 LUNE CSS Art — position fixe (mode sombre)
   ══════════════════════════════════════════════════ */

.container::before {
    content: '';
    position: fixed;
    top: 4.5rem;
    right: 5rem;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #ffd60a;
    box-shadow:
        inset -22px -6px 0 0 #0a1628,
        0 0 30px rgba(255,214,10,0.45),
        0 0 60px rgba(255,214,10,0.18);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transform: scale(0) translateY(20px);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.34,1.56,0.64,1);
}

[data-theme="dark"] .container::before {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: float-decor 9s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════
   🔥 FEU DE CAMP — emoji animé (mode sombre)
   ══════════════════════════════════════════════════ */

.container::after {
    content: '🔥';
    position: fixed;
    bottom: 240px;
    left: 3rem;
    font-size: 4rem;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.8s ease, transform 0.8s ease;
    animation: flame-flicker 1.4s ease-in-out infinite;
    filter: drop-shadow(0 0 18px rgba(255,120,0,0.7));
}

[data-theme="dark"] .container::after {
    opacity: 0.88;
    transform: scale(1);
}

/* ══════════════════════════════════════════════════
   🍃 FEUILLE / 🦉 HIBOU — Coin du titre hero (sous l'image)
   ══════════════════════════════════════════════════ */

.hero-content::before {
    content: '🍃';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    opacity: 0.45;
    pointer-events: none;
    z-index: 2;
    animation: sway-leaf 5s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(45,106,79,0.25));
}

[data-theme="dark"] .hero-content::before {
    content: '🦉';
    opacity: 0.50;
    animation: owl-blink 5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(100,255,218,0.3));
}

/* Étoile filante supprimée de l'image hero (positionnement conflictuel) */

/* ══════════════════════════════════════════════════
   📌 PUNAISE / ⭐ ÉTOILE — Décoration cartes
   ══════════════════════════════════════════════════ */

.card { position: relative; }

.card::before {
    content: '📌';
    position: absolute;
    top: -1rem;
    right: 1.8rem;
    font-size: 1.7rem;
    z-index: 10;
    pointer-events: none;
    animation: float-decor 5s ease-in-out infinite;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}

[data-theme="dark"] .card::before {
    content: '⭐';
    filter: drop-shadow(0 0 10px rgba(255,214,10,0.7));
    animation: twinkle 3s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════
   🌿 COIN BAS DES CARTES
   ══════════════════════════════════════════════════ */

.card::after {
    content: '🌿';
    position: absolute;
    bottom: 0.6rem;
    right: 0.8rem;
    font-size: 1.5rem;
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
    transform: rotate(20deg);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card:hover::after {
    opacity: 0.45;
    transform: rotate(5deg) scale(1.15);
}

[data-theme="dark"] .card::after {
    content: '✨';
    opacity: 0.22;
    transform: rotate(0deg);
    filter: drop-shadow(0 0 5px rgba(100,255,218,0.5));
}

[data-theme="dark"] .card:hover::after {
    opacity: 0.60;
    filter: drop-shadow(0 0 10px rgba(100,255,218,0.8));
}

/* ══════════════════════════════════════════════════
   🐻 OURS — Coin hero content (mode sombre)
   ══════════════════════════════════════════════════ */

[data-theme="dark"] .hero-content::after {
    content: '🐻';
    position: absolute;
    bottom: 0.8rem;
    left: 1.5rem;
    font-size: 2.2rem;
    opacity: 0.30;
    pointer-events: none;
    animation: bear-breathe 4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255,214,10,0.25));
}

/* ══════════════════════════════════════════════════
   💫 LUCIOLES — Quiz cards (mode sombre)
   ══════════════════════════════════════════════════ */

[data-theme="dark"] .quiz-card:nth-child(odd)::after {
    content: '✨';
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    font-size: 1rem;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    animation: firefly 5s ease-in-out infinite;
}

[data-theme="dark"] .quiz-card:nth-child(even)::after {
    content: '💫';
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    animation: firefly 6s ease-in-out infinite 2s;
}

/* ══════════════════════════════════════════════════
   ✨ REFLET BRILLANT — Quiz cards
   ══════════════════════════════════════════════════ */

.quiz-card::before {
    background: linear-gradient(
        130deg,
        transparent    0%,
        transparent   42%,
        rgba(255,255,255,0.13) 50%,
        transparent   58%,
        transparent  100%
    ) !important;
    background-size: 200% 200% !important;
    background-position: 200% 200% !important;
    opacity: 1 !important;
    transition: background-position 0.7s ease !important;
}

.quiz-card:hover::before {
    background-position: -100% -100% !important;
}

/* ══════════════════════════════════════════════════
   ✏️ SÉPARATEUR QUIZ — Objets scolaires
   ══════════════════════════════════════════════════ */

.quiz-separator::before {
    content: '✏️  📚  ✏️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    letter-spacing: 0.6rem;
    z-index: 5;
    pointer-events: none;
}

[data-theme="dark"] .quiz-separator::before {
    content: '⭐  🌙  ⭐';
    filter: drop-shadow(0 0 6px rgba(255,214,10,0.7));
}

/* ══════════════════════════════════════════════════
   🗺️ ICÔNE SCORE
   ══════════════════════════════════════════════════ */

.score-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.score-zone::before {
    content: '🗺️';
    font-size: 1.5rem;
}

[data-theme="dark"] .score-zone::before {
    content: '🌙';
    filter: drop-shadow(0 0 8px rgba(255,214,10,0.6));
}

/* ══════════════════════════════════════════════════
   📐 OBJETS SCOLAIRES — Au-dessus de la grille quiz
   ══════════════════════════════════════════════════ */

.quiz-grid {
    position: relative;
}

.quiz-grid::before {
    content: '📐  📏  🖍️  ✂️  📎  📚  🎒';
    position: absolute;
    top: -2.8rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 1.35rem;
    letter-spacing: 0.5rem;
    opacity: 0.16;
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
    overflow: hidden;
}

[data-theme="dark"] .quiz-grid::before {
    content: '🌟  🔭  🌙  ⭐  🪐  ✨  💫';
    opacity: 0.22;
    filter: drop-shadow(0 0 4px rgba(100,255,218,0.4));
}

/* Image hero : pas d'overlay — l'illustration est affichée sans filtre */
.hero-img-container {
    position: relative;
}

/* ══════════════════════════════════════════════════
   🔥 GLOW FEU DE CAMP SUR LES CARTES (mode sombre)
   ══════════════════════════════════════════════════ */

[data-theme="dark"] .card {
    animation: campfire-glow-pulse 4s ease-in-out infinite;
}

[data-theme="dark"] .card:hover {
    animation: none;
}

/* ══════════════════════════════════════════════════
   🗺️ RESULT MODAL — Icône parchemin
   ══════════════════════════════════════════════════ */

.result-modal::before {
    content: '🗺️';
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: float-decor 3s ease-in-out infinite;
}

[data-theme="dark"] .result-modal::before {
    content: '🌙';
    filter: drop-shadow(0 0 15px rgba(255,214,10,0.6));
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ══════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .container::before,
    .container::after { display: none; }

    body::after { height: 100px; }

    .card::before { top: -0.8rem; font-size: 1.3rem; }

    .quiz-grid::before { display: none; }

    .hero-img-container::before { display: none; }
}
