/* ============================================
   VARIABLES & BASE STYLES
   ============================================ */
:root {
    /* Couleurs principales */
    --color-bg-start: #a8e6cf;
    --color-bg-end: #ffd3b6;
    --color-primary: #ff6b6b;
    --color-secondary: #4ecdc4;
    --color-accent: #ffe66d;
    --color-text: #2c3e50;
    --color-text-light: #ffffff;

    /* Couleurs des monstres */
    --color-blobby: #5dade2;
    --color-ziggy: #58d68d;
    --color-puff: #f5b7b1;
    --color-spark: #f39c12;
    --color-glub: #9b59b6;

    /* Ombres */
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.2);

    /* Bordures */
    --radius-small: 12px;
    --radius-medium: 20px;
    --radius-large: 30px;
    --radius-round: 50%;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Typographie */
    --font-family: 'Nunito', sans-serif;
    --font-numbers: 'Fredoka', 'Baloo 2', 'Nunito', sans-serif;
    --font-size-small: 1rem;
    --font-size-medium: 1.5rem;
    --font-size-large: 2.5rem;
    --font-size-xl: 4rem;
    --font-size-xxl: 8rem;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
    height: 100%;
    width: 100%;
    overflow: hidden;
    color: var(--color-text);
    position: fixed;
    touch-action: none;
    overscroll-behavior: none;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* ============================================
   ÉCRANS
   ============================================ */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--transition-medium);
    overflow: hidden;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ============================================
   ÉCRAN DU MENU DES EXERCICES
   ============================================ */
#menu-screen {
    padding-top: 80px;
}

.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    max-width: 600px;
}

.exercise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

.exercise-btn {
    background: white;
    border: none;
    border-radius: var(--radius-large);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.exercise-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.exercise-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-strong);
}

.exercise-btn:active {
    transform: translateY(0) scale(0.98);
}

.exercise-btn.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.exercise-btn.locked::before {
    background: #ccc;
}

.exercise-btn.locked:hover {
    transform: none;
    box-shadow: var(--shadow-medium);
}

.exercise-icon {
    font-size: 3rem;
    line-height: 1;
}

.exercise-number {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.exercise-btn.locked .exercise-number {
    background: #ccc;
}

.exercise-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
}

.exercise-desc {
    font-size: 0.9rem;
    color: #888;
    font-weight: 500;
}

/* Responsive menu */
@media (max-width: 400px) {
    .exercise-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .exercise-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        padding: 20px;
    }

    .exercise-icon {
        font-size: 2.5rem;
    }

    .exercise-number {
        top: 50%;
        transform: translateY(-50%);
    }
}

/* ============================================
   ÉCRAN D'ACCUEIL
   ============================================ */
.welcome-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.welcome-title {
    font-family: var(--font-numbers);
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 700;
    color: var(--color-primary);
    text-shadow:
        0 6px 0 #c0392b,
        0 8px 0 rgba(0,0,0,0.15),
        0 12px 30px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    animation: bounceIn 1s ease;
}

.welcome-subtitle {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--color-text);
    margin-bottom: 40px;
    font-weight: 600;
}

.welcome-monsters {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
}

.welcome-monsters .monster-container {
    width: 100px;
    height: 100px;
}

/* ============================================
   EN-TÊTE DE JEU
   ============================================ */
.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    z-index: 100;
}

.screen-title {
    font-size: var(--font-size-medium);
    font-weight: 700;
    color: var(--color-text);
    flex: 1;
    text-align: center;
}

.stars-container {
    display: flex;
    gap: 5px;
}

.star {
    font-size: 1.8rem;
    color: #ddd;
    transition: all var(--transition-medium);
}

.star.filled {
    color: var(--color-accent);
    text-shadow: 0 0 10px var(--color-accent);
    animation: starPop 0.5s ease;
}

/* ============================================
   BOUTONS
   ============================================ */
.btn-primary {
    background: linear-gradient(145deg, var(--color-primary), #ff5252);
    color: var(--color-text-light);
    border: none;
    padding: 18px 50px;
    font-size: var(--font-size-medium);
    font-weight: 700;
    font-family: var(--font-family);
    border-radius: var(--radius-large);
    cursor: pointer;
    box-shadow: var(--shadow-medium),
                inset 0 2px 0 rgba(255,255,255,0.3);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-strong);
}

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

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-round);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-fast);
    color: var(--color-text);
}

.btn-icon:hover {
    transform: scale(1.1);
    background: white;
}

/* Bouton plein écran - toujours visible */
.btn-fullscreen {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid var(--color-primary);
    border-radius: var(--radius-round);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all var(--transition-fast);
    color: var(--color-primary);
    z-index: 9999;
}

.btn-fullscreen:hover {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.btn-fullscreen:active {
    transform: scale(0.95);
}

/* Icône différente en mode plein écran */
body:fullscreen .btn-fullscreen svg path,
body:-webkit-full-screen .btn-fullscreen svg path {
    d: path("M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z");
}

.btn-wheel {
    background: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-round);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-fast);
    color: var(--color-primary);
}

.btn-wheel:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-strong);
}

.btn-wheel:active {
    transform: scale(0.95);
}

.btn-speak {
    background: linear-gradient(145deg, var(--color-secondary), #3dbdb5);
    border: none;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-round);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-fast);
    color: white;
    margin: 20px 0;
}

.btn-speak:hover {
    transform: scale(1.1);
}

.btn-speak:active {
    transform: scale(0.95);
}

.btn-speak.speaking {
    animation: pulse 0.5s ease infinite;
}

/* ============================================
   ROUE DE SÉLECTION
   ============================================ */
#selection-screen {
    padding-top: 80px;
}

.wheel-container {
    width: 100%;
    max-width: 800px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.number-wheel {
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0 50px;
}

.wheel-item {
    flex-shrink: 0;
    width: 120px;
    height: 150px;
    background: white;
    border-radius: var(--radius-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: all var(--transition-medium);
    opacity: 0.6;
    transform: scale(0.85);
}

.wheel-item.active {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: var(--shadow-strong);
}

.wheel-item:hover {
    opacity: 0.9;
}

.wheel-item .number {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-primary);
}

.wheel-item .word {
    font-size: var(--font-size-small);
    font-weight: 600;
    color: var(--color-text);
    opacity: 0.8;
}

.wheel-item .mini-monster {
    width: 40px;
    height: 40px;
    margin-top: 5px;
}

.wheel-controls {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

/* ============================================
   ÉCRAN D'APPRENTISSAGE
   ============================================ */
#learning-screen {
    padding-top: 100px;
}

.learning-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeInUp 0.5s ease;
}

.number-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.big-number {
    font-size: clamp(6rem, 25vw, 12rem);
    font-weight: 800;
    color: var(--color-primary);
    text-shadow: 6px 6px 0 var(--color-accent),
                 10px 10px 0 rgba(0,0,0,0.1);
    line-height: 1;
    animation: numberPop 0.6s ease;
}

.number-word {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 700;
    color: var(--color-secondary);
    text-transform: lowercase;
}

.monster-quantity {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 500px;
    padding: 20px;
}

.monster-quantity .monster-container {
    width: 60px;
    height: 60px;
    animation: monsterAppear 0.5s ease backwards;
}

.monster-quantity .monster-container:nth-child(1) { animation-delay: 0.1s; }
.monster-quantity .monster-container:nth-child(2) { animation-delay: 0.2s; }
.monster-quantity .monster-container:nth-child(3) { animation-delay: 0.3s; }
.monster-quantity .monster-container:nth-child(4) { animation-delay: 0.4s; }
.monster-quantity .monster-container:nth-child(5) { animation-delay: 0.5s; }
.monster-quantity .monster-container:nth-child(6) { animation-delay: 0.6s; }
.monster-quantity .monster-container:nth-child(7) { animation-delay: 0.7s; }
.monster-quantity .monster-container:nth-child(8) { animation-delay: 0.8s; }
.monster-quantity .monster-container:nth-child(9) { animation-delay: 0.9s; }
.monster-quantity .monster-container:nth-child(10) { animation-delay: 1.0s; }

/* ============================================
   ZONE DE PUZZLE
   ============================================ */
#puzzle-screen {
    padding-top: 60px;
}

.puzzle-header {
    background: transparent;
    box-shadow: none;
}

.puzzle-header .btn-icon {
    background: rgba(255,255,255,0.9);
}

.puzzle-area {
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.puzzle-instruction {
    font-size: var(--font-size-medium);
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
}

.puzzle-target {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.puzzle-slot {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.5);
    border: 4px dashed var(--color-secondary);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.puzzle-slot.highlight {
    border-color: var(--color-primary);
    background: rgba(255, 107, 107, 0.2);
    transform: scale(1.05);
}

.puzzle-slot.filled {
    background: white;
    border-style: solid;
    border-color: var(--color-secondary);
}

.puzzle-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.puzzle-piece {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-large);
    font-weight: 800;
    color: var(--color-primary);
    cursor: grab;
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-fast);
    user-select: none;
    touch-action: none;
}

.puzzle-piece:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-strong);
}

.puzzle-piece:active {
    cursor: grabbing;
    transform: scale(1.15);
}

.puzzle-piece.dragging {
    opacity: 0.8;
    z-index: 1000;
}

.puzzle-piece.placed {
    opacity: 0.3;
    pointer-events: none;
}

/* Puzzle de quantité */
.quantity-puzzle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.quantity-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 300px;
}

.quantity-monster {
    width: 50px;
    height: 50px;
}

.number-options {
    display: flex;
    gap: 20px;
}

.number-option {
    width: 90px;
    height: 90px;
    background: white;
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-primary);
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-fast);
    border: 4px solid transparent;
}

.number-option:hover {
    transform: scale(1.1);
    border-color: var(--color-secondary);
}

.number-option.correct {
    background: #d5f4e6;
    border-color: #27ae60;
    animation: correctPop 0.5s ease;
}

.number-option.wrong {
    animation: shake 0.5s ease;
    border-color: var(--color-primary);
}

/* Puzzle d'addition */
.addition-puzzle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.addition-equation {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: var(--font-size-xl);
    font-weight: 800;
}

.addition-num {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    box-shadow: var(--shadow-soft);
}

.addition-op {
    color: var(--color-secondary);
    font-size: var(--font-size-large);
}

.addition-result {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.5);
    border: 4px dashed var(--color-secondary);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: all var(--transition-fast);
}

/* ============================================
   PUZZLE DES NOMBRES - ENDLESS NUMBERS STYLE
   ============================================ */
.endless-numbers-puzzle {
    width: 100%;
    height: 85vh;
    position: relative;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr !important;
    overflow: hidden;
}

/* Slots pour les nombres en haut - toujours horizontal */
.numbers-slots {
    display: grid !important;
    grid-template-columns: repeat(10, 1fr) !important;
    gap: clamp(3px, 0.4vw, 6px);
    padding: 8px clamp(4px, 0.8vw, 10px);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0 0 var(--radius-large) var(--radius-large);
    box-shadow: var(--shadow-medium);
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.number-slot {
    aspect-ratio: 1 / 1.15;
    background: rgba(78, 205, 196, 0.15);
    border: 4px dashed var(--color-secondary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.number-slot.expected {
    border-color: var(--color-primary);
    background: rgba(255, 107, 107, 0.2);
    animation: slotPulse 1s ease-in-out infinite;
}

.number-slot.slot-hover {
    transform: scale(1.2);
    border-color: var(--color-accent);
    background: rgba(255, 230, 109, 0.5);
    box-shadow: 0 0 30px rgba(255, 230, 109, 0.8);
}

.number-slot.filled {
    background: white;
    border-style: solid;
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-soft);
}

.number-slot.filled .slot-number {
    animation: letterPop 0.4s ease;
}

.slot-number {
    font-family: var(--font-numbers);
    font-size: clamp(1.8rem, 7vw, 6rem);
    font-weight: 600;
    color: var(--color-primary);
    text-shadow: 0 2px 0 rgba(0,0,0,0.1);
}

/* Zone des nombres éparpillés */
.scattered-numbers {
    position: relative;
    width: 100%;
    min-height: 0;
    margin: 8px auto 0;
    background: none;
    border: none;
    pointer-events: none;
    overflow: visible;
    z-index: 20;
    box-sizing: border-box;
}

/* Container nombre + monstre */
.draggable-number-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    pointer-events: all;
    transition: transform 0.2s ease;
    z-index: 50;
}

.draggable-number-container:hover {
    transform: scale(1.08) !important;
}

.draggable-number-container.dragging {
    cursor: grabbing;
    z-index: 9999 !important;
    position: fixed;
}

.draggable-number-container.placed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0) !important;
    transition: all 0.4s ease;
}

.draggable-number-container.wrong-number {
    animation: shake 0.4s ease;
}

/* Monstre sur le nombre - masqué */
.number-monster {
    display: none;
}

.number-monster .monster {
    width: 100%;
    height: 100%;
}

.draggable-number-container.dragging .number-monster {
    animation: monsterExcited 0.3s ease-in-out infinite;
}

/* Le nombre draggable - Style Endless Numbers bubbly */
.draggable-number {
    width: clamp(60px, 14vw, 120px);
    height: clamp(70px, 16vw, 135px);
    background: linear-gradient(180deg,
        rgba(255,255,255,0.5) 0%,
        rgba(255,255,255,0) 40%,
        rgba(0,0,0,0.08) 100%),
        var(--color-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-numbers);
    font-size: clamp(2.5rem, 10vw, 5.5rem);
    font-weight: 600;
    color: white;
    box-shadow:
        0 7px 0 rgba(0, 0, 0, 0.2),
        0 10px 25px rgba(0, 0, 0, 0.25),
        inset 0 -5px 12px rgba(0, 0, 0, 0.12),
        inset 0 5px 12px rgba(255, 255, 255, 0.35);
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
    user-select: none;
    touch-action: none;
}

.draggable-number-container.dragging .draggable-number {
    box-shadow:
        0 15px 0 rgba(0, 0, 0, 0.15),
        0 22px 55px rgba(0, 0, 0, 0.35),
        inset 0 -6px 15px rgba(0, 0, 0, 0.12),
        inset 0 6px 15px rgba(255, 255, 255, 0.35);
}

/* ============================================
   EXERCICE 2 : PUZZLE TOUS LES CHIFFRES
   ============================================ */
.puzzle2-container {
    width: 100%;
    height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Slots en haut - chiffres en pointillé */
.puzzle2-slots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0 0 var(--radius-large) var(--radius-large);
    box-shadow: var(--shadow-medium);
    z-index: 10;
}

.puzzle2-slot {
    width: clamp(65px, 15vw, 120px);
    height: clamp(80px, 18vw, 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.puzzle2-slot-number {
    font-family: var(--font-numbers);
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 600;
    -webkit-text-stroke: 4px currentColor;
    -webkit-text-fill-color: transparent;
    opacity: 0.35;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.puzzle2-slot.expected .puzzle2-slot-number {
    opacity: 0.6;
    animation: slotPulse2 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px currentColor);
}

.puzzle2-slot.slot-hover .puzzle2-slot-number {
    opacity: 0.8;
    transform: scale(1.15);
    filter: drop-shadow(0 0 25px currentColor);
}

.puzzle2-slot.filled .puzzle2-slot-number {
    opacity: 1;
    -webkit-text-fill-color: currentColor;
    -webkit-text-stroke: 0;
    text-shadow: 0 4px 0 rgba(0,0,0,0.2);
    animation: numberFillPop 0.5s ease;
}

@keyframes slotPulse2 {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes numberFillPop {
    0% { transform: scale(0.5); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Zone des chiffres à glisser */
.puzzle2-numbers {
    position: relative;
    width: 100%;
    flex: 1;
    margin: 15px auto 0;
    background: none;
    border: none;
    pointer-events: none;
    overflow: visible;
    z-index: 20;
}

/* Chiffre draggable - MEME STYLE que le slot mais rempli */
.puzzle2-draggable {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    pointer-events: all;
    z-index: 50;
    transition: transform 0.2s ease;
    animation: floatBounce 3s ease-in-out infinite;
}

.puzzle2-draggable:hover {
    animation: none;
    transform: scale(1.08);
}

.puzzle2-draggable.dragging {
    cursor: grabbing;
    animation: none;
    z-index: 9999 !important;
    position: fixed;
}

.puzzle2-draggable.placed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0) !important;
    transition: all 0.4s ease;
}

.puzzle2-draggable.wrong-number {
    animation: shake 0.4s ease;
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Monstre sur le chiffre - masqué */
.puzzle2-monster {
    display: none;
}

.puzzle2-monster .monster {
    width: 100%;
    height: 100%;
}

.puzzle2-draggable.dragging .puzzle2-monster {
    animation: monsterExcited 0.25s ease-in-out infinite;
}

/* Le chiffre - même style que slot mais REMPLI */
.puzzle2-number {
    font-family: var(--font-numbers);
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 600;
    text-shadow:
        0 5px 0 rgba(0,0,0,0.25),
        0 10px 20px rgba(0,0,0,0.2);
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.15));
    transition: all 0.2s ease;
}

.puzzle2-draggable.dragging .puzzle2-number {
    transform: scale(1.1);
    filter: drop-shadow(0 12px 30px rgba(0,0,0,0.3));
}

/* Responsive */
@media (max-width: 600px) {
    .puzzle2-slots {
        gap: 8px;
        padding: 12px;
    }

    .puzzle2-slot {
        width: 55px;
        height: 70px;
    }

    .puzzle2-slot-number {
        font-size: 3.5rem;
        -webkit-text-stroke: 3px currentColor;
    }

    .puzzle2-monster {
        width: 55px;
        height: 55px;
    }

    .puzzle2-number {
        font-size: 3.5rem;
    }
}

/* Tablette Samsung A9+ (1920x1200) */
@media (min-width: 768px) and (max-width: 1400px) {
    .puzzle2-slots {
        gap: 4px;
        padding: 10px;
    }

    .puzzle2-slot {
        width: 110px;
        height: 130px;
    }

    .puzzle2-slot-number {
        font-size: 6.5rem;
        -webkit-text-stroke: 5px currentColor;
    }

    .puzzle2-number {
        font-size: 6.5rem;
    }
}

/* Grand écran desktop */
@media (min-width: 1400px) {
    .puzzle2-slots {
        gap: 4px;
    }

    .puzzle2-slot {
        width: 100px;
        height: 120px;
    }

    .puzzle2-slot-number {
        font-size: 6rem;
        -webkit-text-stroke: 5px currentColor;
    }

    .puzzle2-monster {
        width: 65px;
        height: 65px;
    }

    .puzzle2-number {
        font-size: 6rem;
    }
}

/* ============================================
   EXERCICE 2 : PUZZLE DES COULEURS
   ============================================ */
.colors-puzzle {
    width: 100%;
    height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sorcières avec pomme colorée */
.color-slots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 var(--radius-large) var(--radius-large);
    box-shadow: var(--shadow-medium);
    z-index: 10;
    flex-wrap: wrap;
}

.color-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 5px;
}

.witch-svg {
    width: clamp(70px, 12vw, 120px);
    height: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.color-slot-label {
    font-family: var(--font-numbers);
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.color-slot.slot-hover {
    transform: scale(1.1);
}

.color-slot.slot-hover .witch-svg {
    filter: drop-shadow(0 0 15px rgba(255, 230, 109, 0.8));
}

.color-slot.filled .witch-svg circle:last-of-type,
.color-slot.filled .witch-svg line,
.color-slot.filled .witch-svg ellipse:last-of-type {
    opacity: 1;
}

.color-slot.filled .color-slot-label {
    opacity: 1;
    animation: numberFillPop 0.5s ease;
}

/* Zone des couleurs draggables */
.colors-area {
    position: relative;
    width: 100%;
    flex: 1;
    margin: 15px auto 0;
    background: none;
    border: none;
    pointer-events: none;
    overflow: visible;
    z-index: 20;
}

/* Couleur draggable avec monstre */
.color-draggable {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    pointer-events: all;
    z-index: 50;
    transition: transform 0.2s ease;
    animation: floatBounce 3s ease-in-out infinite;
}

.color-draggable:hover {
    animation: none;
    transform: scale(1.08);
}

.color-draggable.dragging {
    cursor: grabbing;
    animation: none;
    z-index: 9999 !important;
    position: fixed;
}

.color-draggable.placed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0) !important;
    transition: all 0.4s ease;
}

.color-draggable.wrong-color {
    animation: shake 0.4s ease;
}

/* Monstre sur la couleur - masqué */
.color-monster {
    display: none;
}

.color-monster .monster {
    width: 100%;
    height: 100%;
}

.color-draggable.dragging .color-monster {
    animation: monsterExcited 0.25s ease-in-out infinite;
}

/* Le cercle de couleur */
.color-circle {
    width: clamp(45px, 9vw, 65px);
    height: clamp(45px, 9vw, 65px);
    border-radius: 50%;
    box-shadow:
        0 5px 0 rgba(0, 0, 0, 0.2),
        0 8px 18px rgba(0, 0, 0, 0.3),
        inset 0 -5px 15px rgba(0, 0, 0, 0.2),
        inset 0 5px 15px rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.color-draggable.dragging .color-circle {
    transform: scale(1.15);
    box-shadow:
        0 12px 0 rgba(0, 0, 0, 0.15),
        0 18px 40px rgba(0, 0, 0, 0.35),
        inset 0 -6px 20px rgba(0, 0, 0, 0.2),
        inset 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* Responsive couleurs */
@media (max-width: 600px) {
    .color-slots {
        gap: 4px;
        padding: 8px;
    }

    .witch-svg {
        width: 60px;
    }

    .color-circle {
        width: 50px;
        height: 50px;
    }
}

@media (min-width: 768px) {
    .witch-svg {
        width: 90px;
    }

    .color-slot-label {
        font-size: 1rem;
    }

    .color-circle {
        width: 60px;
        height: 60px;
    }
}

/* ============================================
   PUZZLE DE LETTRES (ancien, gardé pour compatibilité)
   ============================================ */
.endless-puzzle {
    width: 100%;
    height: 80vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.endless-number-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    z-index: 10;
}

.endless-big-number {
    font-size: clamp(8rem, 30vw, 16rem);
    font-weight: 800;
    color: var(--color-primary);
    text-shadow:
        8px 8px 0 var(--color-accent),
        12px 12px 0 rgba(0,0,0,0.15);
    line-height: 1;
    animation: numberBounce 2s ease-in-out infinite;
}

@keyframes numberBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.endless-word-slots {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    background: rgba(255,255,255,0.85);
    padding: 15px 25px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-medium);
}

.letter-slot {
    width: clamp(45px, 10vw, 70px);
    height: clamp(55px, 12vw, 80px);
    background: rgba(78, 205, 196, 0.15);
    border: 4px dashed var(--color-secondary);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.letter-slot.expected {
    border-color: var(--color-primary);
    background: rgba(255, 107, 107, 0.2);
    animation: slotPulse 1s ease-in-out infinite;
}

.letter-slot.slot-hover {
    transform: scale(1.15);
    border-color: var(--color-accent);
    background: rgba(255, 230, 109, 0.5);
    box-shadow: 0 0 30px rgba(255, 230, 109, 0.7);
}

.letter-slot.filled {
    background: white;
    border-style: solid;
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-soft);
}

.letter-slot.filled .slot-letter {
    animation: letterPop 0.4s ease;
}

.letter-slot.celebrate {
    animation: celebrateLetter 0.5s ease;
    background: linear-gradient(135deg, #fff, var(--color-accent));
}

.slot-letter {
    font-size: clamp(1.8rem, 6vw, 3rem);
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
}

/* Zone des lettres éparpillées */
.endless-letters-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Container lettre + monstre */
.draggable-letter-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    pointer-events: all;
    transition: transform 0.2s ease;
    z-index: 50;
}

.draggable-letter-container:hover {
    transform: scale(1.05);
}

.draggable-letter-container.dragging {
    cursor: grabbing;
    z-index: 1000 !important;
}

.draggable-letter-container.placed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0) !important;
    transition: all 0.4s ease;
}

.draggable-letter-container.wrong-letter {
    animation: shake 0.4s ease;
}

/* Le monstre au-dessus de la lettre */
.letter-monster {
    width: clamp(50px, 12vw, 80px);
    height: clamp(50px, 12vw, 80px);
    margin-bottom: -10px;
    z-index: 2;
    animation: monsterWiggle 2s ease-in-out infinite;
}

.letter-monster .monster {
    width: 100%;
    height: 100%;
}

.draggable-letter-container.dragging .letter-monster {
    animation: monsterExcited 0.3s ease-in-out infinite;
}

@keyframes monsterWiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes monsterExcited {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-10deg); }
    75% { transform: scale(1.1) rotate(10deg); }
}

/* La lettre draggable */
.draggable-letter {
    width: clamp(55px, 13vw, 85px);
    height: clamp(60px, 14vw, 90px);
    background: linear-gradient(165deg, #ffffff 0%, #f8f8f8 50%, #eeeeee 100%);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 800;
    color: var(--color-secondary);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255,255,255,0.8);
    user-select: none;
    touch-action: none;
}

.draggable-letter-container.dragging .draggable-letter {
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255,255,255,0.8);
}

/* Animations pour le puzzle */
@keyframes slotPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(255, 107, 107, 0);
        transform: scale(1.02);
    }
}

@keyframes letterPop {
    0% { transform: scale(0) rotate(-10deg); }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes celebrateLetter {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-8deg); }
    75% { transform: scale(1.15) rotate(8deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .endless-word-slots {
        gap: 5px;
        padding: 10px 15px;
    }

    .letter-slot {
        width: 40px;
        height: 50px;
    }

    .slot-letter {
        font-size: 1.5rem;
    }

    .letter-monster {
        width: 45px;
        height: 45px;
    }

    .draggable-letter {
        width: 50px;
        height: 55px;
        font-size: 1.8rem;
    }
}

@media (min-width: 768px) and (max-width: 1920px) {
    .letter-slot {
        width: 75px;
        height: 90px;
    }

    .letter-monster {
        width: 85px;
        height: 85px;
    }

    .draggable-letter {
        width: 90px;
        height: 100px;
        font-size: 4rem;
    }
}

/* ============================================
   ÉCRAN DE SÉQUENCE
   ============================================ */
#sequence-screen {
    padding-top: 100px;
}

.sequence-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    animation: fadeInUp 0.5s ease;
}

.sequence-numbers {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.sequence-item {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-large);
    font-weight: 800;
    color: var(--color-primary);
    box-shadow: var(--shadow-soft);
}

.sequence-item.missing {
    background: rgba(255, 255, 255, 0.5);
    border: 4px dashed var(--color-secondary);
    color: transparent;
}

.sequence-item.missing.highlight {
    border-color: var(--color-primary);
    background: rgba(255, 107, 107, 0.2);
}

.sequence-options {
    display: flex;
    gap: 15px;
}

.sequence-option {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-large);
    font-weight: 800;
    color: var(--color-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-fast);
}

.sequence-option:hover {
    transform: scale(1.1);
}

/* ============================================
   CÉLÉBRATION
   ============================================ */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.celebration-overlay.hidden {
    display: none;
}

.celebration-content {
    background: white;
    border-radius: var(--radius-large);
    padding: 40px 60px;
    text-align: center;
    box-shadow: var(--shadow-strong);
    animation: celebrationPop 0.5s ease;
    position: relative;
    overflow: hidden;
}

.celebration-text {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease 0.2s backwards;
}

.celebration-monsters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.celebration-monsters .monster-container {
    width: 100px;
    height: 100px;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

/* ============================================
   UTILITAIRES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .wheel-item {
        width: 100px;
        height: 130px;
    }

    .wheel-item .number {
        font-size: var(--font-size-large);
    }

    .btn-primary {
        padding: 15px 40px;
        font-size: 1.2rem;
    }

    .puzzle-slot, .puzzle-piece {
        width: 60px;
        height: 60px;
    }

    .puzzle-piece {
        font-size: var(--font-size-medium);
    }

    .number-option {
        width: 70px;
        height: 70px;
        font-size: var(--font-size-large);
    }
}

@media (max-width: 480px) {
    .welcome-monsters {
        gap: 15px;
    }

    .welcome-monsters .monster-container {
        width: 70px;
        height: 70px;
    }

    .wheel-container {
        height: 300px;
    }

    .wheel-item {
        width: 80px;
        height: 110px;
    }

    .monster-quantity .monster-container {
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   MODE TABLETTE (OPTIMISÉ)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .wheel-item {
        width: 140px;
        height: 180px;
    }

    .wheel-item .number {
        font-size: 5rem;
    }

    .monster-quantity .monster-container {
        width: 70px;
        height: 70px;
    }

    .btn-speak {
        width: 100px;
        height: 100px;
    }

    .puzzle-slot, .puzzle-piece {
        width: 90px;
        height: 90px;
    }
}

/* ============================================
   SAMSUNG GALAXY TAB A9+ (1920x1200, 11 pouces)
   ============================================ */
@media (min-width: 1024px) and (max-width: 1920px) {
    /* Exercice 1 - Nombres */
    .number-slot {
        border-radius: 18px;
    }

    .slot-number {
        font-size: clamp(3rem, 5vw, 5rem);
    }

    .draggable-number {
        width: 105px;
        height: 120px;
        font-size: 5rem;
        border-radius: 20px;
    }

    /* Exercice 2 - Chiffres */
    .puzzle2-slot {
        width: 110px;
        height: 130px;
    }

    .puzzle2-slot-number {
        font-size: 6.5rem;
        -webkit-text-stroke: 5px currentColor;
    }

    .puzzle2-number {
        font-size: 6.5rem;
    }

    /* Lettres puzzle */
    .letter-slot {
        width: 75px;
        height: 90px;
    }

    .slot-letter {
        font-size: 3.2rem;
    }

    .draggable-letter {
        width: 90px;
        height: 100px;
        font-size: 4rem;
    }

    .letter-monster {
        width: 85px;
        height: 85px;
    }

    /* Roue de sélection */
    .wheel-item {
        width: 160px;
        height: 200px;
    }

    .wheel-item .number {
        font-size: 5.5rem;
    }

    .wheel-item .word {
        font-size: 1.3rem;
    }

    .wheel-item .mini-monster {
        width: 55px;
        height: 55px;
    }

    /* Boutons */
    .btn-speak {
        width: 110px;
        height: 110px;
    }

    .monster-quantity .monster-container {
        width: 80px;
        height: 80px;
    }
}

/* ============================================
   EXERCICE 3 : PUZZLE PARTIES DU CORPS
   Style "mijn lichaam" - poster éducatif flamand
   ============================================ */
.body-puzzle {
    width: 100%;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
}

/* Container du bonhomme - GRAND pour enfant */
.girl-figure {
    position: relative;
    width: clamp(220px, 42vw, 380px);
    flex-shrink: 0;
    margin-top: 5px;
}

/* SVG du bonhomme */
.girl-svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* ---- Zones cibles (slots) positionnées par-dessus le SVG ---- */
.body-slot {
    position: absolute;
    border: 3px dashed rgba(100, 100, 100, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: bodySlotPulse 2s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.15);
    z-index: 5;
}

/* Haar (cheveux) - dôme au-dessus de la tête
   SVG viewBox 300x480 : cheveux ~y18-95, x78-222 */
.body-slot-haar {
    width: 52%;
    height: 17%;
    top: 2%;
    left: 24%;
    border-radius: 50% 50% 15% 15%;
}

/* Ogen (yeux) - sur le visage
   SVG: yeux ~y78-106, x104-196 */
.body-slot-ogen {
    width: 36%;
    height: 7%;
    top: 16%;
    left: 32%;
    border-radius: 30%;
}

/* Neus - centre du visage
   SVG: nez ~y110-128, x140-160 */
.body-slot-neus {
    width: 10%;
    height: 5%;
    top: 22.5%;
    left: 45%;
    border-radius: 50%;
}

/* Mond (bouche) - bas du visage
   SVG: bouche ~y133-162, x125-175 */
.body-slot-mond {
    width: 20%;
    height: 6%;
    top: 27.5%;
    left: 40%;
    border-radius: 0 0 50% 50%;
}

/* Oren (oreilles) - côtés de la tête
   SVG: oreilles ~y83-127, x52-248 */
.body-slot-oren {
    width: 62%;
    height: 10%;
    top: 17%;
    left: 19%;
    border-radius: 40%;
}

/* ---- Slots corps (viewBox 300x480) ---- */

/* Armen (bras) - côtés du torse, y200-275 */
.body-slot-armen {
    width: 70%;
    height: 17%;
    top: 41%;
    left: 15%;
    border-radius: 30%;
}

/* Handen (mains) - bouts des bras, y258-288 */
.body-slot-handen {
    width: 80%;
    height: 8%;
    top: 54%;
    left: 10%;
    border-radius: 40%;
}

/* Buik (ventre) - centre du t-shirt, y240-300 */
.body-slot-buik {
    width: 26%;
    height: 12%;
    top: 50%;
    left: 37%;
    border-radius: 50%;
}

/* Benen (jambes) - sous le torse, y330-430 */
.body-slot-benen {
    width: 34%;
    height: 21%;
    top: 68.5%;
    left: 33%;
    border-radius: 15%;
}

/* Voeten (pieds/chaussures) - en bas, y420-460 */
.body-slot-voeten {
    width: 40%;
    height: 9%;
    top: 87.5%;
    left: 30%;
    border-radius: 30%;
}

.body-slot-label {
    font-family: var(--font-numbers);
    font-size: clamp(0.55rem, 1.5vw, 0.75rem);
    color: rgba(0, 0, 0, 0.35);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
}

@keyframes bodySlotPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 107, 107, 0);
    }
}

.body-slot.slot-hover {
    border-color: var(--color-accent);
    background: rgba(255, 230, 109, 0.45);
    box-shadow: 0 0 20px rgba(255, 230, 109, 0.8);
    transform: scale(1.08);
}

.body-slot.filled {
    border: none;
    background: transparent;
    animation: none;
    overflow: visible;
    pointer-events: none;
}

.body-slot.filled .body-slot-label {
    display: none;
}

/* Animation d'apparition des parties dans le SVG */
.svg-part-appear {
    animation: svgPartPop 0.5s ease;
}

@keyframes svgPartPop {
    0% { opacity: 0; transform: scale(0.5); }
    60% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* ---- Zone des pièces draggables en bas ---- */
.body-parts-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(6px, 1.5vw, 14px);
    padding: 10px;
    margin-top: auto;
    width: 100%;
    max-width: 650px;
}

/* Pièce du corps draggable */
.body-draggable {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    transition: transform 0.2s ease;
    animation: floatBounce 3s ease-in-out infinite;
    z-index: 50;
    user-select: none;
    touch-action: none;
}

.body-draggable:nth-child(2) { animation-delay: 0.3s; }
.body-draggable:nth-child(3) { animation-delay: 0.6s; }
.body-draggable:nth-child(4) { animation-delay: 0.9s; }
.body-draggable:nth-child(5) { animation-delay: 1.2s; }
.body-draggable:nth-child(6) { animation-delay: 1.5s; }
.body-draggable:nth-child(7) { animation-delay: 1.8s; }
.body-draggable:nth-child(8) { animation-delay: 2.1s; }
.body-draggable:nth-child(9) { animation-delay: 2.4s; }
.body-draggable:nth-child(10) { animation-delay: 2.7s; }

.body-draggable:hover {
    animation: none;
    transform: scale(1.1);
}

.body-draggable.dragging {
    cursor: grabbing;
    animation: none;
    z-index: 1000 !important;
    transform: scale(1.15);
}

.body-draggable.placed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0) !important;
    transition: all 0.4s ease;
}

/* Monstre au-dessus de la pièce */
.body-part-monster {
    width: clamp(22px, 5vw, 40px);
    height: clamp(22px, 5vw, 40px);
    margin-bottom: -6px;
    z-index: 2;
    animation: monsterWiggle 2s ease-in-out infinite;
}

.body-part-monster .monster {
    width: 100%;
    height: 100%;
}

.body-draggable.dragging .body-part-monster {
    animation: monsterExcited 0.25s ease-in-out infinite;
}

/* Le visuel SVG de la pièce (dans une carte blanche) */
.body-part-visual {
    width: clamp(50px, 11vw, 75px);
    height: clamp(35px, 7.5vw, 48px);
    background: white;
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.15),
        0 6px 14px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

.body-part-svg {
    width: 92%;
    height: 92%;
}

.body-draggable.dragging .body-part-visual {
    box-shadow:
        0 12px 0 rgba(0, 0, 0, 0.1),
        0 16px 35px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

/* Mot néerlandais sous la pièce */
.body-part-word {
    font-family: var(--font-numbers);
    font-size: clamp(0.75rem, 2.2vw, 1.05rem);
    font-weight: 700;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Responsive body puzzle ---- */

/* Petit mobile */
@media (max-width: 400px) {
    .girl-figure {
        width: 200px;
    }

    .body-parts-area {
        gap: 4px;
        padding: 6px;
    }

    .body-part-visual {
        width: 45px;
        height: 30px;
        padding: 2px;
    }

    .body-part-monster {
        width: 20px;
        height: 20px;
    }

    .body-part-word {
        font-size: 0.55rem;
    }

    .body-slot-label {
        font-size: 0.45rem;
    }
}

/* Tablette */
@media (min-width: 768px) {
    .girl-figure {
        width: clamp(320px, 40vw, 420px);
        margin-top: 5px;
    }

    .body-parts-area {
        gap: 14px;
        padding: 15px;
        max-width: 800px;
    }

    .body-part-visual {
        width: 80px;
        height: 52px;
        padding: 5px;
    }

    .body-part-monster {
        width: 38px;
        height: 38px;
    }

    .body-part-word {
        font-size: 0.95rem;
    }
}

/* Grand écran */
@media (min-width: 1200px) {
    .girl-figure {
        width: 440px;
    }

    .body-part-visual {
        width: 90px;
        height: 58px;
    }
}

/* ============================================
   EXERCICE 4 : PUZZLE DES VÊTEMENTS
   ============================================ */

/* Layout principal */
.clothing-puzzle {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
}

/* ---- Zones cibles (slots) positionnées par-dessus le SVG ---- */
.clothing-slot {
    position: absolute;
    border: 3px dashed rgba(100, 100, 100, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: clothingSlotPulse 2s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.15);
    z-index: 5;
}

@keyframes clothingSlotPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 107, 107, 0);
    }
}

.clothing-slot.slot-hover {
    border-color: var(--color-accent);
    background: rgba(255, 230, 109, 0.45);
    box-shadow: 0 0 20px rgba(255, 230, 109, 0.8);
    transform: scale(1.08);
}

.clothing-slot.filled {
    border: none;
    background: transparent;
    animation: none;
    overflow: visible;
    pointer-events: none;
}

.clothing-slot.filled .clothing-slot-label {
    display: none;
}

.clothing-slot-label {
    font-family: var(--font-numbers);
    font-size: clamp(0.45rem, 1.2vw, 0.65rem);
    color: rgba(0, 0, 0, 0.35);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
    text-align: center;
    line-height: 1.1;
}

/* ---- Positions des slots (viewBox 300x480) ---- */

/* Muts (bonnet) - sommet de la tête */
.clothing-slot-muts {
    width: 50%;
    height: 14%;
    top: 0%;
    left: 25%;
    border-radius: 50% 50% 15% 15%;
}

/* Zonnebril (lunettes) - yeux */
.clothing-slot-zonnebril {
    width: 40%;
    height: 7%;
    top: 16%;
    left: 30%;
    border-radius: 30%;
}

/* Sjaal (écharpe) - cou */
.clothing-slot-sjaal {
    width: 30%;
    height: 8%;
    top: 33%;
    left: 35%;
    border-radius: 30%;
}

/* T-shirt - torse */
.clothing-slot-tshirt {
    width: 42%;
    height: 22%;
    top: 37%;
    left: 29%;
    border-radius: 15%;
}

/* Trui (pull) - torse */
.clothing-slot-trui {
    width: 46%;
    height: 22%;
    top: 37%;
    left: 27%;
    border-radius: 15%;
}

/* Jas (manteau) - par-dessus torse */
.clothing-slot-jas {
    width: 50%;
    height: 24%;
    top: 36%;
    left: 25%;
    border-radius: 15%;
}

/* Jurk (robe) - torse + hanches */
.clothing-slot-jurk {
    width: 50%;
    height: 38%;
    top: 36%;
    left: 25%;
    border-radius: 15%;
}

/* Rok (jupe) - hanches */
.clothing-slot-rok {
    width: 50%;
    height: 16%;
    top: 58%;
    left: 25%;
    border-radius: 10% 10% 40% 40%;
}

/* Broek (pantalon) - jambes */
.clothing-slot-broek {
    width: 38%;
    height: 22%;
    top: 60%;
    left: 31%;
    border-radius: 10%;
}

/* Handschoenen (gants) - mains */
.clothing-slot-handschoenen {
    width: 80%;
    height: 8%;
    top: 54%;
    left: 10%;
    border-radius: 40%;
}

/* Sokken (chaussettes) - chevilles */
.clothing-slot-sokken {
    width: 36%;
    height: 7%;
    top: 84%;
    left: 32%;
    border-radius: 20%;
}

/* Schoenen (chaussures) - pieds */
.clothing-slot-schoenen {
    width: 38%;
    height: 8%;
    top: 88%;
    left: 31%;
    border-radius: 30%;
}

/* Laarzen (bottes) - pieds + chevilles */
.clothing-slot-laarzen {
    width: 38%;
    height: 15%;
    top: 80%;
    left: 31%;
    border-radius: 10%;
}

/* Rugzak (sac à dos) - côté droit du dos */
.clothing-slot-rugzak {
    width: 22%;
    height: 14%;
    top: 40%;
    left: 68%;
    border-radius: 20%;
}

/* ---- Zone des pièces draggables en bas ---- */
.clothing-parts-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(6px, 1.5vw, 14px);
    padding: 10px;
    margin-top: auto;
    width: 100%;
    max-width: 700px;
}

/* Pièce de vêtement draggable */
.clothing-draggable {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    transition: transform 0.2s ease;
    animation: floatBounce 3s ease-in-out infinite;
    z-index: 50;
    user-select: none;
    touch-action: none;
}

.clothing-draggable:nth-child(2) { animation-delay: 0.2s; }
.clothing-draggable:nth-child(3) { animation-delay: 0.4s; }
.clothing-draggable:nth-child(4) { animation-delay: 0.6s; }
.clothing-draggable:nth-child(5) { animation-delay: 0.8s; }
.clothing-draggable:nth-child(6) { animation-delay: 1.0s; }
.clothing-draggable:nth-child(7) { animation-delay: 1.2s; }
.clothing-draggable:nth-child(8) { animation-delay: 1.4s; }
.clothing-draggable:nth-child(9) { animation-delay: 1.6s; }
.clothing-draggable:nth-child(10) { animation-delay: 1.8s; }
.clothing-draggable:nth-child(11) { animation-delay: 2.0s; }
.clothing-draggable:nth-child(12) { animation-delay: 2.2s; }
.clothing-draggable:nth-child(13) { animation-delay: 2.4s; }
.clothing-draggable:nth-child(14) { animation-delay: 2.6s; }

.clothing-draggable:hover {
    animation: none;
    transform: scale(1.1);
}

.clothing-draggable.dragging {
    cursor: grabbing;
    animation: none;
    z-index: 1000 !important;
    transform: scale(1.15);
}

.clothing-draggable.placed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0) !important;
    transition: all 0.4s ease;
}

/* Monstre au-dessus de la pièce */
.clothing-part-monster {
    width: clamp(22px, 5vw, 40px);
    height: clamp(22px, 5vw, 40px);
    margin-bottom: -6px;
    z-index: 2;
    animation: monsterWiggle 2s ease-in-out infinite;
}

.clothing-part-monster .monster {
    width: 100%;
    height: 100%;
}

.clothing-draggable.dragging .clothing-part-monster {
    animation: monsterExcited 0.25s ease-in-out infinite;
}

/* Le visuel SVG de la pièce (dans une carte blanche) */
.clothing-part-visual {
    width: clamp(50px, 11vw, 75px);
    height: clamp(35px, 7.5vw, 48px);
    background: white;
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.15),
        0 6px 14px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

.clothing-part-svg {
    width: 92%;
    height: 92%;
}

.clothing-draggable.dragging .clothing-part-visual {
    box-shadow:
        0 12px 0 rgba(0, 0, 0, 0.1),
        0 16px 35px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

/* Mot néerlandais sous la pièce */
.clothing-part-word {
    font-family: var(--font-numbers);
    font-size: clamp(0.65rem, 1.8vw, 0.95rem);
    font-weight: 700;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Responsive clothing puzzle ---- */

/* Petit mobile */
@media (max-width: 400px) {
    .clothing-puzzle .girl-figure {
        width: 200px;
    }

    .clothing-parts-area {
        gap: 4px;
        padding: 6px;
    }

    .clothing-part-visual {
        width: 45px;
        height: 30px;
        padding: 2px;
    }

    .clothing-part-monster {
        width: 20px;
        height: 20px;
    }

    .clothing-part-word {
        font-size: 0.5rem;
    }

    .clothing-slot-label {
        font-size: 0.35rem;
    }
}

/* Tablette */
@media (min-width: 768px) {
    .clothing-puzzle .girl-figure {
        width: clamp(320px, 40vw, 420px);
        margin-top: 5px;
    }

    .clothing-parts-area {
        gap: 14px;
        padding: 15px;
        max-width: 850px;
    }

    .clothing-part-visual {
        width: 80px;
        height: 52px;
        padding: 5px;
    }

    .clothing-part-monster {
        width: 38px;
        height: 38px;
    }

    .clothing-part-word {
        font-size: 0.95rem;
    }
}

/* Grand écran */
@media (min-width: 1200px) {
    .clothing-puzzle .girl-figure {
        width: 440px;
    }

    .clothing-part-visual {
        width: 90px;
        height: 58px;
    }
}

/* ============================================
   MODE PAYSAGE TABLETTE (1280x659, DPR 1.5)
   ============================================ */
@media (min-width: 1000px) and (max-height: 900px) {

    /* --- Général --- */
    .screen {
        height: 100vh;
        padding: 0;
        overflow: hidden;
    }

    #puzzle-screen {
        padding-top: 0;
    }

    .puzzle-area {
        min-height: auto;
        height: 100vh;
        padding: 0;
    }

    .game-header {
        padding: 5px 15px;
        position: absolute;
    }

    .btn-fullscreen {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 10px;
    }

    /* --- Exercice 1 : Nombres (Endless Numbers) --- */
    .endless-numbers-puzzle {
        height: 100vh !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto 1fr !important;
    }

    .numbers-slots {
        display: grid !important;
        grid-template-columns: repeat(10, 1fr) !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        border-radius: 0 0 var(--radius-large) var(--radius-large) !important;
        padding: 6px 10px !important;
        gap: 6px !important;
        box-sizing: border-box !important;
    }

    .number-slot {
        height: 50px !important;
        aspect-ratio: auto !important;
        border-radius: 14px !important;
    }

    .slot-number {
        font-size: 2.3rem !important;
    }

    .scattered-numbers {
        margin: 8px 0 0 0 !important;
        width: 100% !important;
    }

    .draggable-number {
        width: 100px !important;
        height: 110px !important;
        font-size: 4.5rem !important;
        border-radius: 20px !important;
    }

    /* --- Exercice 2 : Tous les chiffres --- */
    .puzzle2-container {
        height: 100vh;
        flex-direction: row;
    }

    .puzzle2-slots {
        flex-direction: column;
        flex-wrap: wrap;
        max-height: 100vh;
        width: auto;
        border-radius: 0 var(--radius-large) var(--radius-large) 0;
        padding: 8px;
        gap: 6px;
    }

    .puzzle2-slot {
        width: 60px;
        height: 65px;
    }

    .puzzle2-slot-number {
        font-size: 3.5rem;
        -webkit-text-stroke: 3px currentColor;
    }

    .puzzle2-numbers {
        flex: 1;
        margin: 0 0 0 10px;
        height: 100vh;
    }

    .puzzle2-number {
        font-size: 4.5rem;
    }

    .puzzle2-draggable {
        transform: none;
    }

    /* --- Exercice Couleurs --- */
    .colors-puzzle {
        height: 100vh;
        flex-direction: row;
    }

    .color-slots {
        flex-direction: column;
        flex-wrap: wrap;
        max-height: 100vh;
        width: auto;
        border-radius: 0 var(--radius-large) var(--radius-large) 0;
        padding: 5px;
        gap: 2px;
    }

    .witch-svg {
        width: 65px;
    }

    .color-slot-label {
        font-size: 0.65rem;
    }

    .colors-area {
        flex: 1;
        margin: 0 0 0 10px;
        height: 100vh;
    }

    .color-circle {
        width: 60px;
        height: 60px;
    }

    /* --- Exercice Lettres --- */
    .endless-puzzle {
        height: 100vh;
        flex-direction: row;
        align-items: stretch;
    }

    .endless-number-display {
        margin-top: 0;
        justify-content: center;
        padding: 10px;
    }

    .endless-big-number {
        font-size: 7rem;
    }

    .endless-word-slots {
        padding: 10px 15px;
    }

    .endless-letters-area {
        flex: 1;
    }

    .letter-slot {
        width: 50px;
        height: 55px;
    }

    .slot-letter {
        font-size: 2rem;
    }

    .draggable-letter {
        width: 80px;
        height: 85px;
        font-size: 3.5rem;
    }

    .letter-monster {
        width: 70px;
        height: 70px;
    }

    /* --- Exercice Parties du corps --- */
    .body-puzzle {
        min-height: auto;
        height: 100vh;
        flex-direction: row;
        align-items: center;
        overflow: hidden;
        padding: 0;
    }

    .girl-figure {
        width: auto;
        height: 95vh;
        margin-top: 0;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .girl-svg {
        height: 95vh;
        width: auto;
    }

    .body-parts-area {
        flex: 1;
        height: 100%;
        margin-top: 0;
        padding: 10px;
        overflow-y: auto;
        align-content: center;
    }

    .body-part-visual {
        width: 70px;
        height: 45px;
    }

    /* --- Exercice Vêtements --- */
    .clothing-puzzle {
        min-height: auto;
        height: 100vh;
        flex-direction: row;
        align-items: center;
        overflow: hidden;
        padding: 0;
    }

    .clothing-puzzle .girl-figure {
        width: auto;
        height: 95vh;
        margin-top: 0;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .clothing-puzzle .girl-svg {
        height: 95vh;
        width: auto;
    }

    .clothing-parts-area {
        flex: 1;
        height: 100%;
        margin-top: 0;
        padding: 10px;
        overflow-y: auto;
        align-content: center;
    }

    .clothing-part-visual {
        width: 70px;
        height: 45px;
    }

    /* --- Accueil --- */
    #welcome-screen {
        padding: 10px;
    }

    .welcome-title {
        font-size: 4rem;
        margin-bottom: 5px;
    }

    .welcome-subtitle {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .welcome-monsters {
        margin-bottom: 20px;
        gap: 20px;
    }

    .welcome-monsters .monster-container {
        width: 70px;
        height: 70px;
    }

    /* --- Menu --- */
    #menu-screen {
        padding-top: 10px;
    }

    .menu-content {
        padding: 10px;
    }

    .exercise-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .exercise-btn {
        padding: 15px;
    }

    .exercise-icon {
        font-size: 2.2rem;
    }

    .exercise-title {
        font-size: 1rem;
    }

    .exercise-desc {
        font-size: 0.75rem;
    }

    /* --- Roue de sélection --- */
    #selection-screen {
        padding-top: 10px;
    }

    .wheel-container {
        height: 250px;
    }

    .wheel-item {
        width: 110px;
        height: 140px;
    }

    /* --- Apprentissage --- */
    #learning-screen {
        padding-top: 10px;
        flex-direction: row;
        gap: 30px;
    }

    .learning-content {
        flex-direction: row;
        align-items: center;
        gap: 40px;
    }

    .big-number {
        font-size: 10rem;
    }

    .number-word {
        font-size: 2.5rem;
    }

    .btn-speak {
        width: 70px;
        height: 70px;
    }

    .monster-quantity .monster-container {
        width: 50px;
        height: 50px;
    }

    /* --- Célébration --- */
    .celebration-content {
        padding: 25px 40px;
    }

    .celebration-text {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    .celebration-monsters .monster-container {
        width: 70px;
        height: 70px;
    }
}
