/* Math Monsters - Style CSS Complet */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #FF6B9D; --secondary: #4ECDC4; --accent: #FFE66D;
    --success: #95E1D3; --danger: #F38181; --dark: #2C3E50; --light: #FFF8F0;
    --darker:brightness(50%)
}

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    min-height: 100vh; overflow-x: hidden; position: relative;
}

body::before {
    content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 107, 157, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.1) 0%, transparent 50%);
    pointer-events: none; z-index: 0;
}

#app { position: relative; z-index: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* LOGIN */
.login-screen { display: flex; justify-content: center; align-items: center; min-height: 100vh; animation: fadeIn 0.5s ease-in; }
.login-box { background: white; border-radius: 30px; padding: 50px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
             text-align: center; max-width: 450px; width: 100%; animation: slideUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.logo { font-size: 3.5em; margin-bottom: 10px; animation: bounce 2s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

h1 { color: var(--primary); font-size: 2.5em; margin-bottom: 10px; font-weight: 700; }
.subtitle { color: #666; margin-bottom: 30px; font-size: 1.1em; }
.input-group { margin-bottom: 20px; text-align: left; }
label { display: block; margin-bottom: 8px; color: var(--dark); font-weight: 600; }
input { width: 100%; padding: 15px 20px; border: 3px solid #E8E8E8; border-radius: 15px;
        font-size: 1.1em; font-family: 'Fredoka', sans-serif; transition: all 0.3s ease; }
input:focus { outline: none; border-color: var(--primary); transform: scale(1.02); }

.btn { background: linear-gradient(135deg, var(--primary),  var(--primary)); color: white; border: none;
       padding: 18px 40px; font-size: 1.2em; font-weight: 700; border-radius: 15px; cursor: pointer;
       font-family: 'Fredoka', sans-serif; width: 100%; margin-top: 10px; transition: all 0.3s ease;
       box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(255, 107, 157, 0.6); }
.btn:active { transform: translateY(-1px); }
.btn-secondary { background: linear-gradient(135deg, var(--secondary), #6FE0D7);
                  box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4); }
.btn-secondary:hover { box-shadow: 0 8px 25px rgba(78, 205, 196, 0.6); }
.toggle-link { color: var(--secondary); cursor: pointer; text-decoration: underline;
               font-weight: 600; margin-top: 15px; display: inline-block; }

/* HEADER */
.header { background: white; border-radius: 25px; padding: 11px 22px; margin-bottom: 5px;
          box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); display: flex; justify-content: space-between;
          align-items: center;  gap: 20px; /*border-bottom-left-radius: 0px;border-bottom-right-radius: 0px;*/padding:20px;}
.user-info { display: flex; align-items: center; gap: 15px; }
.avatar-display { cursor: pointer; transition: transform 0.3s ease; }
.avatar-display:hover { transform: scale(1.1); }
.avatar-preview { width: 70px; height: 70px; position: relative; display: flex;
                  align-items: center; justify-content: center; }
.avatar-animal { font-size: 3em; position: relative; z-index: 1; }
.avatar-hat, .avatar-glasses, .avatar-mustache { position: absolute; font-size: 1.5em; z-index: 2; }
.avatar-hat { top: -10px; left: 50%; transform: translateX(-50%); }
.avatar-glasses { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.avatar-mustache { bottom: 5px; left: 50%; transform: translateX(-50%); }

.user-details h2 { color: var(--dark); font-size: 1.5em; margin-bottom: 5px; }
.level-badge { display: inline-block; background: linear-gradient(135deg, var(--accent), #FFD93D);
               padding: 5px 15px; border-radius: 20px; font-size: 0.9em; font-weight: 700;
               color: var(--dark); margin-bottom: 5px; }
.level-info { font-size: 0.9em; color: #666; margin-bottom: 5px; }
.xp-bar { background: #E8E8E8; height: 12px; border-radius: 10px; overflow: hidden; width: 250px; }
.xp-fill { background: linear-gradient(90deg, var(--success), var(--secondary)); height: 100%;
           border-radius: 10px; transition: width 0.5s ease; box-shadow: 0 0 10px rgba(78, 205, 196, 0.5); }

.logout-btn, .back-btn { background: white; color: var(--danger); border: 3px solid var(--danger);
                         padding: 12px 25px; border-radius: 12px; cursor: pointer; font-weight: 600;
                         font-family: 'Fredoka', sans-serif; transition: all 0.3s ease; font-size: 1em; }
.logout-btn:hover, .back-btn:hover { background: var(--danger); color: white; transform: scale(1.05); }

.header-simple { background: white; border-radius: 25px; padding: 25px 35px; margin-bottom: 30px;
                 box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); display: flex;
                 justify-content: space-between; align-items: center; }
.header-simple h2 { color: var(--dark); font-size: 2em; }

/* MENU */
.menu-screen { animation: fadeIn 0.5s ease-in; }
.menu-content { /*background: white; border-radius: 30px; padding: 19px;
                box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2); */}
.menu-title { text-align: center; color: #fff; font-size: 2.5em; margin-bottom: 40px; }
.game-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
              gap: 25px; margin-bottom: 40px; }
.game-mode-card { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);background:#fff;
                  border-radius: 20px;padding: 13px 20px; text-align: center; cursor: pointer;
                  transition: all 0.3s ease; /*border: 4px solid transparent; */}
.game-mode-card:hover { transform: translateY(-10px) scale(1.05); border-color: var(--primary);
                        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3); }
.mode-icon { font-size: 5em; margin-bottom: 15px; }
.game-mode-card h3 { color: var(--dark); font-size: 1.8em; margin-bottom: 10px; }
.game-mode-card p { color: #666; font-size: 1.1em; }
.menu-buttons { display: flex; gap: 5px; flex-wrap: wrap; }
.menu-btn { 
        flex: 1;
        min-width: 190px;
        background: linear-gradient(135deg, var(--primary),  var(--primary));
        color: var(--dark);
        color:#fff;
        border: none;
        padding: 7px 10px;
        font-size: 1.0em;
        font-weight: normal;
        border-radius: 15px;
        cursor: pointer;
        font-family: 'Fredoka', sans-serif;
        transition: all 0.3s ease;
        box-shadow: 0 5px 15px rgba(255, 230, 109, 0.4);
        }
.menu-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(255, 230, 109, 0.6); }

/* TRAINING */
.training-screen { animation: fadeIn 0.5s ease-in; }
.training-selection { display: flex; flex-direction: column; gap: 30px; }
.training-mode { background: white; border-radius: 25px; padding: 30px;
                 box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
.training-mode h3 { color: var(--dark); font-size: 2em; margin-bottom: 20px; text-align: center; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; }
.table-btn { background: linear-gradient(135deg, var(--secondary), #6FE0D7); color: white; border: none;
             padding: 20px; font-size: 1.2em; font-weight: 700; border-radius: 15px; cursor: pointer;
             font-family: 'Fredoka', sans-serif; transition: all 0.3s ease;
             box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3); }
.table-btn:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 8px 25px rgba(78, 205, 196, 0.5); }

/* NUMBER HOUSES */
.houses-screen { animation: fadeIn 0.5s ease-in; }

.houses-info {
    background: linear-gradient(135deg, #FFE66D 0%, #FFB347 100%);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 230, 109, 0.4);
}

.houses-info p {
    color: var(--dark);
    font-size: 1.3em;
    font-weight: 600;
    margin: 10px 0;
}

.houses-example {
    background: white;
    display: inline-block;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.5em !important;
    font-weight: 700 !important;
    color: var(--primary);
    margin-top: 15px;
}

.houses-selection {
    background: white;
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.houses-selection h3 {
    color: var(--dark);
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
}

.houses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.house-btn {
    background: linear-gradient(135deg, #FF6B9D 0%, #FFB347 100%);
    border: none;
    padding: 30px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.house-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 107, 157, 0.5);
}

.house-icon {
    font-size: 3.5em;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
}

.house-number {
    font-size: 2.5em;
    font-weight: 700;
    color: white;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* FRACTIONS */
.fractions-screen { animation: fadeIn 0.5s ease-in; }

.fractions-info {
    background: linear-gradient(135deg, #9B59B6 0%, #E74C3C 100%);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.4);
}

.fractions-info p {
    color: white;
    font-size: 1.3em;
    font-weight: 600;
    margin: 10px 0;
}

.fractions-example {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: inline-block;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.5em !important;
    font-weight: 700 !important;
    color: white;
    margin-top: 15px;
}

.fractions-selection {
    background: white;
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.fractions-selection h3 {
    color: var(--dark);
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.difficulty-btn {
    background: white;
    border: 4px solid transparent;
    padding: 30px 25px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.difficulty-btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.difficulty-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.difficulty-btn h4 {
    color: var(--dark);
    font-size: 1.8em;
    margin-bottom: 10px;
}

.difficulty-btn p {
    color: #666;
    font-size: 1.1em;
    margin: 8px 0;
}

.difficulty-example {
    background: linear-gradient(135deg, #FF6B9D 0%, #FFB347 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    margin-top: 15px;
    font-weight: 600 !important;
}

/* FRACTION DISCOVERY */
.fraction-discovery-screen { animation: fadeIn 0.5s ease-in; }

.discovery-info {
    background: linear-gradient(135deg, #FFB347 0%, #FF6B9D 100%);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.4);
}

.discovery-info p {
    color: white;
    font-size: 1.3em;
    font-weight: 600;
    margin: 10px 0;
}

.discovery-example {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: inline-block;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.5em !important;
    font-weight: 700 !important;
    color: white;
    margin-top: 15px;
}

.discovery-start {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.start-discovery-btn {
    background: linear-gradient(135deg, #FFB347 0%, #FF6B9D 100%);
    border: none;
    padding: 40px 60px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.start-discovery-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 157, 0.6);
}

.start-discovery-btn .btn-icon {
    font-size: 5em;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.start-discovery-btn .btn-text {
    font-size: 2em;
    font-weight: 700;
    color: white;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Fraction Visual (Cake) */
.fraction-visual-container {
    background: white;
    border-radius: 25px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.fraction-visual-title {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.cake-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.cake-svg {
    width: 300px;
    height: 300px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.cake-label {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--dark);
    background: linear-gradient(135deg, #FFE66D 0%, #FFB347 100%);
    padding: 15px 30px;
    border-radius: 15px;
    color: white;
}

/* Fullscreen Button */
.fullscreen-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary));
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
    margin-right: 15px;
}

.fullscreen-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.5);
}

/* AVATAR */
.avatar-screen { animation: fadeIn 0.5s ease-in; }
.avatar-customization { display: grid; grid-template-columns: 300px 1fr; gap: 30px; }
.avatar-preview-large { background: white; border-radius: 25px; padding: 40px;
                        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); height: fit-content;
                        position: sticky; top: 20px; display: flex; align-items: center;
                        justify-content: center; position: relative; }
.avatar-animal-large { font-size: 12em; position: relative; z-index: 1; }
.avatar-hat-large, .avatar-glasses-large, .avatar-mustache-large { position: absolute; font-size: 6em; z-index: 2; }
.avatar-hat-large { top: 20px; left: 50%; transform: translateX(-50%); }
.avatar-glasses-large { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.avatar-mustache-large { bottom: 60px; left: 50%; transform: translateX(-50%); }

.customization-sections { display: flex; flex-direction: column; gap: 30px; }
.customization-section { background: white; border-radius: 25px; padding: 15px;
                         box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
.customization-section h3 { color: var(--dark); font-size: 1.8em; margin-bottom: 7px; }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; }
.item-card { background: #f8f8f8; border: 3px solid #E8E8E8; border-radius: 15px;
             padding: 20px; text-align: center; cursor: pointer; transition: all 0.3s ease; position: relative; }
.item-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.item-card.selected { border-color: var(--primary); background: linear-gradient(135deg, #FFE0EB, #FFF); }
.item-card.locked { opacity: 0.5; cursor: not-allowed; }
.item-emoji { font-size: 3em; margin-bottom: 10px; }
.item-name { font-size: 0.9em; color: #666; font-weight: 600; }
.locked-overlay { position: absolute; top: 10px; right: 10px; font-size: 1.5em; }

/* BADGES */
.badges-screen { animation: fadeIn 0.5s ease-in; }
.badges-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px; }
.badge-card { background: white; border-radius: 20px; padding: 25px;
              box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); display: flex; gap: 20px;
              align-items: center; transition: all 0.3s ease; position: relative; opacity: 0.6; }
.badge-card.unlocked { opacity: 1; border: 3px solid var(--accent); }
.badge-card:hover { transform: translateY(-5px); }
.badge-icon { font-size: 4em; }
.badge-info { flex: 1; }
.badge-info h3 { color: var(--dark); font-size: 1.5em; margin-bottom: 5px; }
.badge-info p { color: #666; margin-bottom: 10px; }
.badge-reward { background: var(--accent); color: var(--dark); padding: 5px 12px;
                border-radius: 10px; font-size: 0.9em; font-weight: 600; display: inline-block; }
.badge-progress { color: var(--secondary); font-weight: 600; font-size: 0.9em; }
.badge-locked { position: absolute; top: 15px; right: 15px; font-size: 2em; }

/* GAME */
.game-screen { animation: fadeIn 0.5s ease-in; }
.game-header { background: white; border-radius: 25px; padding: 20px 30px; margin-bottom: 30px;
               box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); display: flex;
               justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.game-mode-indicator { font-size: 1.3em; font-weight: 700; color: var(--dark); }
.difficulty-badge { background: var(--accent); padding: 3px 12px; border-radius: 10px;
                    font-size: 0.8em; margin-left: 10px; }
.game-stats { display: flex; gap: 20px; font-weight: 600; color: var(--dark);display: flex;
    align-items: center; }

.battle-arena { /*background: white;*/ border-radius: 30px; padding: 17px;
                /*box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);*/ }
.monster-container { text-align: center; }
.monster { font-size: 10em; display: inline-block; animation: monsterFloat 3s ease-in-out infinite;
           filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2)); }
@keyframes monsterFloat { 0%, 100% { transform: translateY(0) rotate(-5deg); }
                          50% { transform: translateY(-20px) rotate(5deg); } }
.monster.hit { animation: monsterHit 0.5s ease; }
@keyframes monsterHit { 0%, 100% { transform: translateX(0); }
                        25% { transform: translateX(-20px) rotate(-10deg); filter: hue-rotate(180deg); }
                        75% { transform: translateX(20px) rotate(10deg); filter: hue-rotate(180deg); } }
.monster.defeated { animation: monsterDefeat 1s ease forwards; }
@keyframes monsterDefeat { 0% { transform: scale(1) rotate(0deg); opacity: 1; }
                           100% { transform: scale(0) rotate(360deg); opacity: 0; } }

.monster-name { font-size: 2em; color: var(--primary); font-weight: 700; margin-bottom: 15px; }
.health-bar-container { max-width: 500px; margin: 0 auto; }
.health-bar { background: #FFE0E0; height: 30px; border-radius: 15px; overflow: hidden;
              border: 4px solid var(--danger); position: relative; }
.health-fill { background: linear-gradient(90deg, #FF6B6B, var(--danger)); height: 100%;
               border-radius: 10px; transition: width 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
               box-shadow: 0 0 20px rgba(243, 129, 129, 0.6); }
.health-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
               font-weight: 700; color: var(--dark); font-family: 'Space Mono', monospace; }

.question-section { text-align: center; margin-bottom: 30px; }
.question { font-size: 3.5em; color: var(--dark); font-weight: 700; margin-bottom: 16px;
            font-family: 'Space Mono', monospace;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            -webkit-background-clip: text; /*-webkit-text-fill-color: transparent;*/ background-clip: text; 
            position: relative; }

.revision-badge {
    display: inline-block;
    font-size: 0.4em;
    background: linear-gradient(135deg, #FF6B9D, #FFE66D);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    margin-left: 15px;
    font-weight: 700;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

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

.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
           gap: 20px; max-width: 600px; margin: 0 auto; }
.answer-btn { background: white; border: 4px solid var(--secondary); padding: 25px; font-size: 2em;
              font-weight: 700; border-radius: 20px; cursor: pointer; font-family: 'Space Mono', monospace;
              transition: all 0.3s ease; color: var(--dark); 
              min-height: 80px; display: flex; align-items: center; justify-content: center;
              text-align: center; word-wrap: break-word; overflow-wrap: break-word; }
.answer-btn:hover:not(:disabled) { background: var(--secondary); color: white;
                                    transform: scale(1.1) rotate(-2deg);
                                    box-shadow: 0 10px 30px rgba(78, 205, 196, 0.5); }
.answer-btn:disabled { cursor: not-allowed; }
.answer-btn.correct { animation: correct 0.6s ease; background: var(--success);
                      border-color: var(--success); color: white; }
@keyframes correct { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.answer-btn.wrong { animation: wrong 0.6s ease; background: var(--danger);
                    border-color: var(--danger); color: white; }
@keyframes wrong { 0%, 100% { transform: translateX(0); }
                   25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.answer-btn.selected { background: var(--secondary); color: white; border-color: var(--secondary);
                       box-shadow: 0 5px 20px rgba(78, 205, 196, 0.6); }

/* Boutons de réponse plus petits pour le texte long en mode découverte */
.fraction-visual-container ~ .question-section .answer-btn {
    font-size: 1.5em;
    padding: 20px 15px;
    line-height: 1.3;
}

.feedback { min-height: 50px; display: flex; align-items: center; justify-content: center;
            font-size: 1.8em; font-weight: 700; animation: fadeIn 0.3s ease; }
.feedback.success { color: var(--success); }
.feedback.error { color: var(--danger); }

/* POPUPS */
.score-popup, .level-up-popup { position: fixed; top: 50%; left: 50%;
                                 transform: translate(-50%, -50%) scale(0); background: white;
                                 padding: 50px; border-radius: 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
                                 text-align: center; z-index: 1000; animation: popupAppear 0.5s ease forwards;
                                 max-width: 500px; width: 90%; }
@keyframes popupAppear { to { transform: translate(-50%, -50%) scale(1); } }
.score-popup h2, .level-up-popup h2 { font-size: 3em; color: var(--primary); margin-bottom: 20px; }
.score-popup .emoji { font-size: 5em; margin-bottom: 20px; animation: bounce 1s infinite; }
.stats { background: #F8F8F8; border-radius: 20px; padding: 30px; margin: 20px 0; text-align: left; }
.stat-row { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 1.3em; }
.stat-label { color: #fff; }
.stat-value { font-weight: 700; color: #fff; font-family: 'Space Mono', monospace; }

.new-rewards { background: linear-gradient(135deg, #FFE66D, #FFD93D); border-radius: 20px;
               padding: 20px; margin: 20px 0; }
.new-rewards h3 { color: var(--dark); margin-bottom: 15px; }
.unlocked-item { background: white; padding: 10px 20px; border-radius: 10px;
                 margin-bottom: 10px; font-weight: 600; color: var(--dark); }

.level-up-content { text-align: center; }
.level-up-icon { font-size: 8em; animation: spin 2s linear infinite; margin-bottom: 20px; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.level-title { font-size: 2em; color: var(--secondary); font-weight: 700; margin-bottom: 30px; }

/* EFFECTS */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.floating-xp { position: fixed; font-size: 2em; font-weight: 700; color: var(--accent);
               animation: floatUp 2s ease forwards; pointer-events: none; z-index: 1000;
               text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); }
@keyframes floatUp { from { transform: translateY(0); opacity: 1; }
                     to { transform: translateY(-100px); opacity: 0; } }
.particle { position: fixed; width: 10px; height: 10px; border-radius: 50%;
            pointer-events: none; z-index: 999; animation: particleFloat 1s ease forwards; }
@keyframes particleFloat { from { transform: translate(0, 0) scale(1); opacity: 1; }
                           to { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; } }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .avatar-customization { grid-template-columns: 1fr; }
    .avatar-preview-large { position: static; }
}
@media (max-width: 768px) {
    .login-box { padding: 30px; }
    h1 { font-size: 2em; }
    .monster { font-size: 6em; }
    .question { font-size: 2.5em; }
    .answer-btn { font-size: 1.5em; padding: 20px; }
    .header, .header-simple { flex-direction: column; text-align: center; }
    .xp-bar { width: 100%; }
    .game-modes { grid-template-columns: 1fr; }
    .menu-buttons { flex-direction: column; }
    .badges-content { grid-template-columns: 1fr; }
    .game-header { flex-direction: column; }
    .table-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-height: 900px) {
    body{
        zoom:0.85;
         min-height: 150vh;
    }
}
@media (max-height: 768px) {
    body{
        zoom:0.75;
        
        min-height: 100vh;
    }
}
/* ============================================
   AVATAR SVG STYLES
   ============================================ */
.avatar-preview svg {
    width: 100%;
    height: 100%;
}

.avatar-preview-large svg {
    width: 250px;
    height: 275px;
}

.item-preview {
    width: 60px;
    height: 66px;
    margin: 0 auto 10px;
}

.item-preview svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   GAME MODE SELECTION
   ============================================ */
.gamemode-screen { animation: fadeIn 0.5s ease-in; }

.gamemode-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.gamemode-card {
    background: white;
    border-radius: 25px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 4px solid transparent;
}

.gamemode-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.gamemode-emoji {
    font-size: 5em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.gamemode-card h3 {
    color: var(--dark);
    font-size: 1.8em;
    margin-bottom: 15px;
}

.gamemode-card p {
    color: #666;
    font-size: 1.1em;
}

/* ============================================
   ICE CREAM TOWER MODE
   ============================================ */
.icecream-mode {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tower-score {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.tower-container {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    min-height: 300px;
    position: relative;
}

.scoop-wrapper {
    animation: scoopDrop 0.5s ease;
}

@keyframes scoopDrop {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ice-scoop {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: -10px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: wobble 2s ease-in-out infinite;
}

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

.ice-scoop.vanilla { background: linear-gradient(135deg, #FFF8DC, #F5DEB3); }
.ice-scoop.chocolate { background: linear-gradient(135deg, #8B4513, #654321); }
.ice-scoop.strawberry { background: linear-gradient(135deg, #FFB6C1, #FF69B4); }
.ice-scoop.mint { background: linear-gradient(135deg, #98FF98, #00FF7F); }
.ice-scoop.lemon { background: linear-gradient(135deg, #FFFFE0, #FFD700); }
.ice-scoop.blueberry { background: linear-gradient(135deg, #E0E6FF, #4169E1); }

.ice-cone {
    font-size: 4em;
    margin-top: 10px;
}

/* ============================================
   ROCKET MODE
   ============================================ */
.rocket-mode {
    min-height: 450px;
    background: linear-gradient(180deg, #000033 0%, #000066 50%, #1a1a3e 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.space-scene {
    position: relative;
    height: 450px;
    width: 100%;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.moon {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 5em;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 255, 200, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 255, 200, 0.8)); }
}

.rocket {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4em;
    transition: bottom 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 5px 10px rgba(255, 100, 0, 0.5));
}

.rocket-progress {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
}

.progress-text {
    color: white;
    font-size: 1.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-bar-rocket {
    background: rgba(255, 255, 255, 0.2);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.progress-fill-rocket {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
}

/* ============================================
   TREASURE MODE
   ============================================ */
.treasure-mode {
    min-height: 400px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.treasure-chest {
    font-size: 5em;
    margin-bottom: 20px;
    position: relative;
}

.treasure-chest.opening {
    animation: chestOpen 0.5s ease;
}

@keyframes chestOpen {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
}

.treasure-counter {
    font-size: 2em;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

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

.treasure-item {
    font-size: 2em;
    animation: treasurePop 0.5s ease;
}

@keyframes treasurePop {
    from { transform: scale(0) rotate(0deg); }
    to { transform: scale(1) rotate(360deg); }
}

/* ============================================
   CASTLE MODE
   ============================================ */
.castle-mode {
    min-height: 400px;
    background: linear-gradient(135deg, #87CEEB 0%, #4682B4 100%);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.castle-scene {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.castle-counter {
    position: absolute;
    top: 20px;
    font-size: 2em;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.castle-container {
    position: relative;
    width: 300px;
    height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.castle-level {
    position: absolute;
    font-size: 4em;
    animation: castleBuild 0.5s ease;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

@keyframes castleBuild {
    from { transform: translateY(-50px) scale(0); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.castle-ground {
    font-size: 2em;
    margin-top: 10px;
}

/* ============================================
   OCEAN MODE
   ============================================ */
.ocean-mode {
    min-height: 400px;
    background: linear-gradient(135deg, #00CED1 0%, #000080 100%);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.ocean-scene {
    width: 100%;
    height:336px;
    position: relative;
}

.ocean-surface {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 3em;
    text-align: center;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.submarine {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4em;
    transition: top 0.5s ease;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}

.ocean-creatures {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.ocean-fish {
    position: absolute;
    font-size: 2em;
    animation: swim 6s ease-in-out infinite;
}

@keyframes swim {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(30px); }
}

.ocean-depth {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 1.8em;
    font-weight: 700;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 15px;
}

.ocean-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 2em;
}

/* ============================================
   FOREST MODE
   ============================================ */
.forest-mode {
    min-height: 400px;
    background: linear-gradient(135deg, #228B22 0%, #006400 100%);
    border-radius: 20px;
    padding: 30px;
    position: relative;
}

.forest-scene {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.forest-trees {
    font-size: 3em;
    margin-bottom: 20px;
    animation: sway 3s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(2deg); }
}

.forest-counter {
    font-size: 2em;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.forest-creatures {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 600px;
}

.forest-creature {
    font-size: 2.5em;
    animation: creatureAppear 0.6s ease;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

@keyframes creatureAppear {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ============================================
   CIRCUS MODE
   ============================================ */
.circus-mode {
    min-height: 400px;
    background: linear-gradient(135deg, #FF1493 0%, #FF69B4 100%);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.circus-scene {
    width: 100%;
    text-align: center;
}

.circus-tent {
    font-size: 6em;
    margin-bottom: 20px;
    animation: tentShake 2s ease-in-out infinite;
}

@keyframes tentShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

.circus-counter {
    font-size: 2em;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.circus-performer {
    font-size: 5em;
    margin: 20px 0;
    animation: juggle 1s ease-in-out infinite;
}

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

.circus-audience {
    font-size: 2em;
    margin-top: 20px;
    animation: clap 1s ease-in-out infinite;
}

@keyframes clap {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   MOUNTAIN MODE
   ============================================ */
.mountain-mode {
    min-height: 400px;
    background: linear-gradient(135deg, #D3D3D3 0%, #696969 100%);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.mountain-scene {
    width: 100%;
    height: 400px;
    position: relative;
}

.mountain-bg {
    position: absolute;
    font-size: 15em;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    z-index: 0;
}

.climber {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4em;
    transition: bottom 0.5s ease;
    z-index: 2;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}

.mountain-height {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8em;
    font-weight: 700;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 15px;
    z-index: 3;
}

.mountain-progress-bar {
    position: absolute;
    left: 20px;
    bottom: 20px;
    top: 20px;
    width: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    overflow: hidden;
    z-index: 1;
}

.mountain-progress-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(0deg, #4CAF50 0%, #8BC34A 100%);
    transition: height 0.5s ease;
    border-radius: 15px;
}

.mountain-summit {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3em;
    z-index: 4;
    animation: flagWave 2s ease-in-out infinite;
}

@keyframes flagWave {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(10deg); }
}

/* ============================================
   NOTIFICATION DIALOG
   ============================================ */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.notification-dialog {
    background: white;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popupAppear 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-icon {
    font-size: 5em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.notification-dialog h3 {
    color: var(--dark);
    font-size: 2em;
    margin-bottom: 15px;
}

.notification-dialog p {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 25px;
}

/* ============================================
   SETTINGS SCREEN
   ============================================ */
.settings-screen { animation: fadeIn 0.5s ease-in; }

/* Settings Layout with Sidebar */
.settings-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.settings-sidebar {
    width: 250px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 600;
}

.settings-menu-item:hover {
    background: rgba(149, 225, 211, 0.1);
    transform: translateX(5px);
}

.settings-menu-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 5px 15px rgba(149, 225, 211, 0.3);
}

.menu-icon {
    font-size: 1.5em;
}

.menu-label {
    font-size: 1.1em;
}

.settings-content {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.settings-panel h3 {
    color: var(--primary);
    font-size: 2em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary);
}

.settings-panel h4 {
    color: var(--dark);
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 15px;
}

.account-info {
    background: linear-gradient(135deg, rgba(149, 225, 211, 0.1), rgba(255, 230, 109, 0.1));
    padding: 25px;
    border-radius: 15px;
    border: 2px solid var(--primary);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(149, 225, 211, 0.3);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--dark);
    font-size: 1.1em;
}

.info-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2em;
}

/* Responsive */
@media (max-width: 768px) {
    .settings-layout {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        position: static;
        display: flex;
        overflow-x: auto;
        padding: 15px;
    }
    
    .settings-menu-item {
        flex-direction: column;
        min-width: 100px;
        text-align: center;
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .menu-label {
        font-size: 0.9em;
    }
    
    .settings-content {
        max-height: none;
    }
}

/* ============================================
   DAILY CHALLENGE COMPLETION POPUP
   ============================================ */
.daily-challenge-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn 0.4s ease;
}

.daily-challenge-content {
    background: linear-gradient(135deg, #FFD93D 0%, #FF6B9D 50%, #9B59B6 100%);
    padding: 50px 40px;
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: dailyChallengeAppear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

@keyframes dailyChallengeAppear {
    0% {
        transform: scale(0.3) rotate(-15deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.daily-challenge-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.daily-challenge-icon {
    font-size: 7em;
    margin-bottom: 20px;
    animation: dailyChallengeIconBounce 0.8s ease infinite;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

@keyframes dailyChallengeIconBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-20px) scale(1.1);
    }
    50% {
        transform: translateY(0) scale(1);
    }
    75% {
        transform: translateY(-10px) scale(1.05);
    }
}

.daily-challenge-content h2 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    font-weight: 700;
    animation: textPulse 2s ease infinite;
}

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

.daily-challenge-title {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 20px;
    font-size: 1.5em;
    font-weight: 600;
    color: #9B59B6;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.daily-challenge-reward {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.daily-challenge-reward .xp-amount {
    font-size: 3em;
    font-weight: 700;
    color: white;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    display: block;
    margin-bottom: 5px;
    animation: xpPulse 1s ease infinite;
}

@keyframes xpPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.2);
    }
}

.daily-challenge-reward .xp-label {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.daily-challenge-streak {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.daily-challenge-streak span {
    color: white;
    font-size: 1.3em;
    font-weight: 600;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.daily-challenge-content .btn {
    position: relative;
    z-index: 1;
    background: white;
    color: #9B59B6;
    font-size: 1.4em;
    padding: 18px 50px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.daily-challenge-content .btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Confetti particles */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    animation: confettiFall 3s linear infinite;
    opacity: 0.8;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(600px) rotate(720deg);
        opacity: 0;
    }
}

.confetti:nth-child(1) { left: 10%; animation-delay: 0s; background: #FF6B9D; }
.confetti:nth-child(2) { left: 20%; animation-delay: 0.2s; background: #FFD93D; }
.confetti:nth-child(3) { left: 30%; animation-delay: 0.4s; background: #4ECDC4; }
.confetti:nth-child(4) { left: 40%; animation-delay: 0.6s; background: #9B59B6; }
.confetti:nth-child(5) { left: 50%; animation-delay: 0.8s; background: #FF6B9D; }
.confetti:nth-child(6) { left: 60%; animation-delay: 1s; background: #FFD93D; }
.confetti:nth-child(7) { left: 70%; animation-delay: 1.2s; background: #4ECDC4; }
.confetti:nth-child(8) { left: 80%; animation-delay: 1.4s; background: #9B59B6; }
.confetti:nth-child(9) { left: 90%; animation-delay: 1.6s; background: #FF6B9D; }
.confetti:nth-child(10) { left: 15%; animation-delay: 1.8s; background: #FFD93D; }

/* ============================================
   SETTINGS SCREEN (original section kept)
   ============================================ */

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.setting-section {
    background: white;
    border-radius: 25px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.setting-section h3 {
    color: var(--dark);
    font-size: 2em;
    margin-bottom: 25px;
    text-align: center;
}

/* Theme Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.theme-card {
    height: 120px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 4px solid transparent;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.theme-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.theme-card.selected {
    border-color: var(--dark);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.theme-name {
    color: white;
    font-weight: 700;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.theme-check {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    color: var(--success);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Audio Controls */
.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.audio-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
}

.audio-label {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--dark);
}

.toggle-btn {
    background: #ccc;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    min-width: 130px;
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--success), var(--secondary));
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.toggle-btn:hover {
    transform: scale(1.05);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 1em;
    opacity: 0.95;
    font-weight: 600;
}

/* Accessibility Controls */
.accessibility-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-description {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 15px;
    font-style: italic;
}

.option-description {
    color: var(--success);
    font-size: 1em;
    margin-top: 10px;
    font-weight: 600;
    padding: 8px 20px;
    background: rgba(149, 225, 211, 0.2);
    border-radius: 10px;
}

.revision-count {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    margin-left: 8px;
    font-weight: 700;
}

/* Dys Color Mode - Unités en bleu, dizaines en rouge */
.dys-unit {
    color: #2196F3;
    font-weight: 700;
}

.dys-ten {
    color: #F44336;
    font-weight: 700;
}

/* Number Line (Réglette de nombres) */
.number-line-container {
    background: white;
    border-radius: 20px;
    padding: 10px;
    margin: 7px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.number-line {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    min-width: fit-content;
    padding: 10px;
}

.number-line-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 40px;
}

.number-line-number {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--primary);
    background: linear-gradient(135deg, #FFE66D 0%, #FF6B9D 100%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    color: white;
    transition: all 0.3s ease;
}

.number-line-number:hover {
    transform: scale(1.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.number-line-dot {
    width: 12px;
    height: 12px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Responsive pour la réglette */
@media (max-width: 768px) {
    .number-line {
        justify-content: flex-start;
    }
    
    .number-line-number {
        font-size: 1.2em;
        width: 35px;
        height: 35px;
    }
}


.stat-value {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ============================================
   DAILY CHALLENGE SCREEN
   ============================================ */
.daily-screen { animation: fadeIn 0.5s ease-in; }

.daily-content {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.daily-header {
    background: white;
    border-radius: 25px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-bottom-right-radius: 0px;
    border-bottom-left-radius: 0px;
}

.daily-header h3 {
    color: var(--dark);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.daily-date {
    color: #666;
    font-size: 1.2em;
    font-weight: 600;
}

.challenge-card {
    background: white;
    border-radius: 0px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.challenge-icon {
    font-size: 6em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.challenge-description {
    font-size: 1.4em;
    color: var(--dark);
    margin-bottom: 30px;
    font-weight: 600;
}

.challenge-progress {
    margin: 30px 0;
}

.progress-bar-challenge {
    background: #E8E8E8;
    height: 25px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-fill-challenge {
    background: linear-gradient(90deg, var(--success), var(--secondary));
    height: 100%;
    border-radius: 15px;
    transition: width 0.5s ease;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.6);
}

.progress-text {
    margin-top: 15px;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--dark);
}

.challenge-completed {
    background: linear-gradient(135deg, var(--success), var(--secondary));
    color: white;
    padding: 14px;
    border-radius: 20px;
    margin: 0px 0;
}

.completed-icon {
    font-size: 5em;
    margin-bottom: 6px;
    animation: spin 1s ease;
}

.completed-text {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.reward-text {
    font-size: 1.5em;
    opacity: 0.95;
}

.btn-large {
    padding: 20px 50px;
    font-size: 1.4em;
}

.daily-streak {
    background: white;
    border-radius: 25px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.daily-streak h4 {
    color: var(--dark);
    font-size: 1.8em;
    margin-bottom: 0px;
}

.streak-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

.streak-number {
    font-size: 5em;
    font-weight: 700;
    background: linear-gradient(135deg, #FF6B6B, #FFA07A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.streak-label {
    font-size: 1.3em;
    color: #666;
    font-weight: 600;
}
 /*custom css*/


.score-popup {
    overflow-y: auto;
    max-height: 90vh;
}

.chest-top {
    display: flex;
    align-items: center;
    justify-content: center;
}

.treasure-counter {
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-preview-large {
    position: sticky;
}
.ice-cone {
    position: fixed;
    z-index: 0;
}
.game-visual.icecream-mode {
    margin-bottom: 76px;
}
.scoop-wrapper {
    z-index: 1;
    margin-bottom: -19px;
}

.question-section {
    text-align: center;
    margin-bottom: 6px;
}

.rocket.png img {
    height: 111px;
}
.logo img {
    width: 203px;
}

.user-title {
    display: flex;
    gap: 10px;
}
.daily-streak {
    border-top-right-radius: 0px;
    border-top-left-radius: 0px;
}
.number-line-dot {
    display: none;
}
.footer {
    background: white;
    border-radius: 30px;
    padding: 19px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    margin-top: 30px;
}
.setting-section.home-page {
    padding: 20px;
   /*border-top-left-radius: 0px;
    border-top-right-radius: 0px;*/
    margin-bottom:20px;
}
.setting-section.home-page .stat-card {
    padding: 10px;
    background: var(--success);
}
.setting-section.home-page h3 {
    font-size: 1.5em;
    margin-bottom: 9px;
}
.setting-section.home-page .stat-value{
    margin-bottom: 0px;
}
.settings-content .setting-section {
    box-shadow: unset;
}

.setting-section.home-page  .stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    font-weight:normal;
}
.setting-section.home-page .stats-grid {
    gap: 5px;
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}
.setting-section.home-page .stat-value {
    font-size: 1.5em;

}
.score-popup .stats {
    background: var(--primary);
}

.score-popup .stat-row {
    align-items: center;
    border-bottom: 1px solid #ffffff33;
}
.score-popup .stat-value {
    font-size: 2em;

}
.score-popup .stats {
    padding: 20px;

}
.stat-row:last-child {
    border-bottom: unset;
}


.setting-section.home-page h3 {
    font-size: 1.5em;
    margin-bottom: 9px;
}
.setting-section.home-page .stat-value{
    margin-bottom: 0px;
}

/* Player Health Bar (Hardcore Mode) */
/* ============================================
   PLAYER HEALTH BAR (MODE HARDCORE)
   ============================================ */

.player-health-bar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 240, 245, 0.95));
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 0 0 3px rgba(255, 107, 157, 0.2);
    border: 3px solid #FF6B9D;
    position: relative;
    overflow: hidden;
}

.player-health-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.player-health-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.health-icon {
    font-size: 1.8em;
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.health-title {
    font-size: 1.4em;
    font-weight: 800;
    color: #FF6B9D;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Progress Bar */
.player-health-progress {
    position: relative;
}

.health-progress-bg {
    background: linear-gradient(135deg, #E0E0E0, #F0F0F0);
    height: 35px;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid rgba(255, 107, 157, 0.3);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.health-progress-fill {
    height: 100%;
    border-radius: 17px;
    position: relative;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 20px rgba(255, 107, 157, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

/* Health Bar Colors by State */
.health-high {
    background: linear-gradient(135deg, #4CAF50, #66BB6A, #81C784);
}

.health-medium {
    background: linear-gradient(135deg, #FFA726, #FFB74D, #FFCC80);
}

.health-low {
    background: linear-gradient(135deg, #FF7043, #FF8A65, #FFAB91);
}

.health-critical {
    background: linear-gradient(135deg, #E53935, #EF5350, #FF6B6B);
    animation: healthCritical 0.8s ease-in-out infinite;
}

@keyframes healthCritical {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(229, 57, 53, 0.8),
            inset 0 2px 4px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(229, 57, 53, 1),
            0 0 60px rgba(229, 57, 53, 0.6),
            inset 0 2px 4px rgba(255, 255, 255, 0.5);
    }
}

/* Shine Effect */
.health-progress-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 17px 17px 0 0;
}

/* Pulse Effect */
.health-progress-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Health Text */
.player-health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.health-current {
    font-size: 1.6em;
    color: #FFFFFF;
}

.health-separator {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.8);
}

.health-max {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.9);
}

.health-label {
    font-size: 1em;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 3px;
}

/* Damage Indicator */
.damage-indicator {
    margin-top: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(201, 42, 42, 0.1));
    border-left: 4px solid #FF6B6B;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.damage-icon {
    font-size: 1.3em;
    animation: swordPulse 2s ease-in-out infinite;
}

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

.damage-text {
    color: #666;
    font-weight: 600;
}

.damage-value {
    color: #FF6B6B;
    font-weight: 800;
    font-size: 1.2em;
    text-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

/* Question Timer */
.question-timer {
    margin-top: 15px;
}

.timer-bar {
    background: #E0E0E0;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #FFD700;
    position: relative;
}

.timer-fill {
    background: linear-gradient(90deg, #4CAF50, #FFD700, #FF6B6B);
    height: 100%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.timer-text {
    text-align: center;
    font-size: 1.2em;
    font-weight: 700;
    color: #FF6B9D;
    margin-top: 8px;
    font-family: 'Space Mono', monospace;
}

/* Expert Mode Card */
.expert-mode {
    background: linear-gradient(135deg, #FF6B6B 0%, #C92A2A 50%, #8B0000 100%) !important;
    border: 3px solid #FFD700;
    position: relative;
    overflow: hidden;
}

.expert-mode::before {
    content: '⚡';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 100px;
    opacity: 0.1;
    animation: pulse 2s ease-in-out infinite;
}

.expert-mode .mode-icon {
    animation: shake 0.8s ease-in-out infinite;
}

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

.expert-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 215, 0, 0.9);
    color: #8B0000;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.expert-mode h3,
.expert-mode p {
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.expert-mode:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.5);
}

/* Monster Attack Animation */
.monster.attacking {
    animation: monsterAttack 0.6s ease-out;
}

@keyframes monsterAttack {
    0% {
        transform: scale(1) translateX(0);
    }
    25% {
        transform: scale(1.2) translateX(-30px) rotate(-10deg);
    }
    50% {
        transform: scale(1.3) translateX(50px) rotate(5deg);
        filter: brightness(1.5) drop-shadow(0 0 30px rgba(255, 0, 0, 0.8));
    }
    75% {
        transform: scale(1.1) translateX(-10px) rotate(-3deg);
    }
    100% {
        transform: scale(1) translateX(0) rotate(0);
    }
}

/* Screen Shake on Monster Attack */
.game-container.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Red Flash Effect on Player Hit */
.game-visual.player-hit {
    animation: redFlash 0.5s ease-out;
}

@keyframes redFlash {
    0%, 100% { 
        background: transparent;
        border-color: transparent;
    }
    50% { 
        background: rgba(255, 0, 0, 0.3);
        box-shadow: inset 0 0 50px rgba(255, 0, 0, 0.5);
    }
}

/* Monster Roar Effect */
.monster.roaring::after {
    content: '💥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    animation: roarEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes roarEffect {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* Heart Loss Animation */
.heart-icon.losing {
    animation: heartLoss 0.8s ease-out;
}

@keyframes heartLoss {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    25% {
        transform: scale(1.5) translateY(-20px);
    }
    50% {
        transform: scale(1.3) rotate(20deg);
        opacity: 0.7;
    }
    75% {
        transform: scale(0.8) rotate(-10deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   GAME OVER POPUP (MODE DIFFICILE)
   ============================================ */

.game-over-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease-out;
}

.game-over-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d0a0a 50%, #1a1a1a 100%);
    border: 4px solid #ff0000;
    border-radius: 30px;
    padding: 50px 40px;
    max-width: 600px;
    width: 90%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 50px rgba(255, 0, 0, 0.5),
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 100px rgba(255, 0, 0, 0.1);
    animation: gameOverAppear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes gameOverAppear {
    0% {
        transform: scale(0.5) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Effet d'arrière-plan */
.game-over-bg-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 0, 0, 0.1) 0%, transparent 50%);
    animation: bgPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Crâne animé */
.game-over-skull {
    font-size: 120px;
    text-align: center;
    margin-bottom: 20px;
    animation: skullFloat 2s ease-in-out infinite, skullShake 0.5s ease-in-out;
    filter: drop-shadow(0 10px 30px rgba(255, 0, 0, 0.5));
}

@keyframes skullFloat {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes skullShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Titre Game Over */
.game-over-title {
    font-size: 3.5em;
    font-weight: 900;
    text-align: center;
    margin: 0 0 10px 0;
    background: linear-gradient(45deg, #ff0000, #ff6b6b, #ff0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    letter-spacing: 8px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(255, 0, 0, 0.5),
            0 0 20px rgba(255, 0, 0, 0.3);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(255, 0, 0, 0.8),
            0 0 40px rgba(255, 0, 0, 0.5),
            0 0 60px rgba(255, 0, 0, 0.3);
    }
}

.game-over-subtitle {
    text-align: center;
    font-size: 1.2em;
    color: #ff6b6b;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Stats de la partie */
.game-over-stats {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    gap: 20px;
}

.game-over-stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    animation: statAppear 0.6s ease-out backwards;
}

.game-over-stat-item:nth-child(1) { animation-delay: 0.2s; }
.game-over-stat-item:nth-child(2) { animation-delay: 0.3s; }
.game-over-stat-item:nth-child(3) { animation-delay: 0.4s; }

@keyframes statAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-over-stat-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 0, 0, 0.6);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.3);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 5px;
}

.stat-info {
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Message d'encouragement */
.game-over-message {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #ff6b6b;
    border-radius: 10px;
    animation: messageSlide 0.6s ease-out 0.5s backwards;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.game-over-message p {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #ffb3b3;
}

/* Boutons d'action */
.game-over-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    animation: buttonsAppear 0.6s ease-out 0.6s backwards;
}

@keyframes buttonsAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-retry {
    flex: 1;
    background: linear-gradient(135deg, #ff6b6b, #c92a2a);
    color: white;
    border: 2px solid #ff0000;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.btn-retry:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, #ff8787, #e03131);
}

.btn-retry:active {
    transform: translateY(-1px);
}

.btn-menu {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-menu:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
}

.btn-menu:active {
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .game-over-content {
        padding: 40px 25px;
        max-width: 95%;
    }
    
    .game-over-skull {
        font-size: 80px;
    }
    
    .game-over-title {
        font-size: 2.5em;
        letter-spacing: 4px;
    }
    
    .game-over-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-over-buttons {
        flex-direction: column;
    }
    
    .stat-icon {
        font-size: 30px;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .game-over-skull {
        font-size: 60px;
    }
    
    .game-over-title {
        font-size: 2em;
        letter-spacing: 2px;
    }
    
    .game-over-subtitle {
        font-size: 1em;
    }
    
    .game-over-stat-item {
        padding: 15px;
    }
}


.setting-section.home-page .stat-card .stat-label {
    color: #fff;
    text-transform: unset;
}
.setting-section.home-page .stat-value {
    color: #fff;
}
/* ============================================
   LEGENDARY VICTORY POPUP (MODE HARDCORE)
   ============================================ */

.legendary-victory-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.5s ease-out;
}

.legendary-victory-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d0a 50%, #1a1a1a 100%);
    border: 4px solid #FFD700;
    border-radius: 30px;
    padding: 50px 40px;
    max-width: 700px;
    width: 90%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 60px rgba(255, 215, 0, 0.8),
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 100px rgba(255, 215, 0, 0.1);
    animation: legendaryAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes legendaryAppear {
    0% {
        transform: scale(0.5) rotate(20deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.15) rotate(-10deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Confetti d'or */
.confetti.gold {
    background: linear-gradient(45deg, #FFD700, #FFA500);
}

/* Couronne animée */
.legendary-crown {
    font-size: 150px;
    text-align: center;
    margin-bottom: 20px;
    animation: crownFloat 2s ease-in-out infinite, crownRotate 4s linear infinite;
    filter: drop-shadow(0 10px 40px rgba(255, 215, 0, 0.8));
}

@keyframes crownFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-30px) scale(1.1);
    }
}

@keyframes crownRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Titre Legendary */
.legendary-title {
    font-size: 4em;
    font-weight: 900;
    text-align: center;
    margin: 0 0 10px 0;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    letter-spacing: 10px;
    animation: legendaryGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(255, 215, 0, 0.8),
            0 0 40px rgba(255, 215, 0, 0.5);
    }
    50% {
        text-shadow: 
            0 0 40px rgba(255, 215, 0, 1),
            0 0 80px rgba(255, 215, 0, 0.8),
            0 0 120px rgba(255, 215, 0, 0.5);
    }
}

.legendary-subtitle {
    text-align: center;
    font-size: 1.3em;
    color: #FFD700;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Badge débloqué */
.legendary-badge-unlock {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
    animation: badgeAppear 0.8s ease-out 0.3s backwards;
}

@keyframes badgeAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.badge-icon {
    font-size: 80px;
    margin-bottom: 15px;
    /*animation: pulse 2s ease-in-out infinite;*/
}

.badge-name {
    font-size: 1.5em;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 10px;
}

.badge-description {
    font-size: 1em;
    color: #FFA500;
    opacity: 0.9;
}

/* Avatar débloqué */
.legendary-avatar-unlock {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.15));
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    animation: avatarAppear 0.8s ease-out 0.5s backwards;
}

@keyframes avatarAppear {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.avatar-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.avatar-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 8px;
}

.avatar-description {
    font-size: 0.95em;
    color: #FFA500;
    opacity: 0.9;
}

/* Stats de la run */
.legendary-stats {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    gap: 15px;
}

.legendary-stat-item {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    flex: 1;
    text-align: center;
    animation: statSlide 0.6s ease-out backwards;
}

.legendary-stat-item:nth-child(1) { animation-delay: 0.6s; }
.legendary-stat-item:nth-child(2) { animation-delay: 0.7s; }
.legendary-stat-item:nth-child(3) { animation-delay: 0.8s; }

@keyframes statSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legendary-stat-item .stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.legendary-stat-item .stat-label {
    font-size: 0.9em;
    color: #FFA500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Message de félicitations */
.legendary-message {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: rgba(255, 215, 0, 0.05);
    border-left: 4px solid #FFD700;
    border-radius: 10px;
    animation: messageAppear 0.8s ease-out 0.9s backwards;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.legendary-message p {
    margin: 10px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #FFD700;
}

/* Bouton légendaire */
.btn-legendary {
    width: 100%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: 3px solid #FFD700;
    padding: 20px 40px;
    font-size: 1.3em;
    font-weight: 900;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.5);
    animation: buttonAppear 0.8s ease-out 1s backwards;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes buttonAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-legendary:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.8);
    background: linear-gradient(135deg, #FFA500, #FFD700);
}

.btn-legendary:active {
    transform: translateY(-2px) scale(1.02);
}

/* Responsive */
@media (max-width: 768px) {
    .legendary-victory-content {
        padding: 40px 25px;
        max-width: 95%;
    }
    
    .legendary-crown {
        font-size: 100px;
    }
    
    .legendary-title {
        font-size: 2.8em;
        letter-spacing: 5px;
    }
    
    .legendary-stats {
        flex-direction: column;
    }
    
    .badge-icon {
        font-size: 60px;
    }
    
    .avatar-icon {
        font-size: 50px;
    }
}

@media (max-width: 480px) {
    .legendary-crown {
        font-size: 80px;
    }
    
    .legendary-title {
        font-size: 2em;
        letter-spacing: 3px;
    }
    
    .legendary-subtitle {
        font-size: 1.1em;
    }
    
    .badge-icon {
        font-size: 50px;
    }
    
    .btn-legendary {
        font-size: 1.1em;
        padding: 15px 30px;
    }
}

/* Responsive pour la barre de vie */
@media (max-width: 768px) {
    .player-health-bar {
        padding: 20px 15px;
    }
    
    .health-title {
        font-size: 1.2em;
    }
    
    .health-icon {
        font-size: 1.5em;
    }
    
    .health-progress-bg {
        height: 30px;
    }
    
    .health-current {
        font-size: 1.4em;
    }
    
    .health-separator,
    .health-max {
        font-size: 1.1em;
    }
    
    .damage-indicator {
        font-size: 1em;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .player-health-bar {
        padding: 15px 10px;
    }
    
    .health-title {
        font-size: 1em;
    }
    
    .health-icon {
        font-size: 1.3em;
    }
    
    .health-progress-bg {
        height: 25px;
    }
    
    .health-current {
        font-size: 1.2em;
    }
    
    .health-separator,
    .health-max {
        font-size: 1em;
    }
    
    .damage-indicator {
        font-size: 0.9em;
        padding: 8px 12px;
        flex-direction: column;
        gap: 5px;
    }
    
    .damage-text {
        font-size: 0.9em;
    }
}

/* ============================================
   AVATARS SPÉCIAUX (MONSTRES, MINI-JEUX, ETC.)
   ============================================ */

.special-avatar {
    position: relative;
    transition: all 0.3s ease;
}

.special-avatar.locked {
    opacity: 0.5;
    background: rgba(100, 100, 100, 0.2);
    border: 2px solid #666 !important;
    cursor: not-allowed;
}

.special-avatar:not(.locked):hover {
    transform: translateY(-8px) scale(1.05);
}

.item-emoji.special-emoji {
    font-size: 3em;
    animation: specialPulse 2s ease-in-out infinite;
}

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

.special-avatar.selected {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

.item-unlock-hint {
    font-size: 0.75em;
    text-align: center;
    margin-top: 5px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.item-unlocked-badge {
    font-size: 0.75em;
    color: #FFD700;
    text-align: center;
    margin-top: 5px;
    padding: 5px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 5px;
    font-weight: 700;
}

.special-avatar.locked .item-emoji {
    filter: grayscale(100%) opacity(0.5);
    animation: none;
}

/* === AVATARS MONSTRES === */
.monster-avatar {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.1), rgba(255, 0, 0, 0.1));
    border: 3px solid #FF4444 !important;
}

.monster-avatar:not(.locked):hover {
    box-shadow: 0 15px 40px rgba(255, 68, 68, 0.5);
    border-color: #FF0000 !important;
}

.monster-avatar.selected {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.3), rgba(255, 0, 0, 0.3));
    border: 4px solid #FF0000 !important;
}

/* === AVATARS GLACE === */
.icecream-avatar {
    background: linear-gradient(135deg, rgba(135, 206, 250, 0.1), rgba(173, 216, 230, 0.1));
    border: 3px solid #87CEEB !important;
}

.icecream-avatar:not(.locked):hover {
    box-shadow: 0 15px 40px rgba(135, 206, 250, 0.5);
    border-color: #00BFFF !important;
}

.icecream-avatar.selected {
    background: linear-gradient(135deg, rgba(135, 206, 250, 0.3), rgba(173, 216, 230, 0.3));
    border: 4px solid #00BFFF !important;
}

/* === AVATARS FUSÉE === */
.rocket-avatar {
    background: linear-gradient(135deg, rgba(25, 25, 112, 0.1), rgba(138, 43, 226, 0.1));
    border: 3px solid #8A2BE2 !important;
}

.rocket-avatar:not(.locked):hover {
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.5);
    border-color: #9400D3 !important;
}

.rocket-avatar.selected {
    background: linear-gradient(135deg, rgba(25, 25, 112, 0.3), rgba(138, 43, 226, 0.3));
    border: 4px solid #9400D3 !important;
}

/* === AVATARS TRÉSOR === */
.treasure-avatar {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(218, 165, 32, 0.1));
    border: 3px solid #FFD700 !important;
}

.treasure-avatar:not(.locked):hover {
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.5);
    border-color: #FFA500 !important;
}

.treasure-avatar.selected {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(218, 165, 32, 0.3));
    border: 4px solid #FFA500 !important;
}

/* === AVATARS CHÂTEAU/PRINCESS === */
.castle-avatar {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.1), rgba(255, 105, 180, 0.1));
    border: 3px solid #FF69B4 !important;
}

.castle-avatar:not(.locked):hover {
    box-shadow: 0 15px 40px rgba(255, 105, 180, 0.5);
    border-color: #FF1493 !important;
}

.castle-avatar.selected {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3), rgba(255, 105, 180, 0.3));
    border: 4px solid #FF1493 !important;
}

/* === AVATARS LÉGENDAIRES (SPÉCIAUX) === */
.legendary-avatar {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    border: 3px solid #FFD700 !important;
}

.legendary-avatar:not(.locked):hover {
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.5);
    border-color: #FFA500 !important;
}

.legendary-avatar.selected {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.3));
    border: 4px solid #FFD700 !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

.item-emoji.legendary {
    font-size: 3em;
    filter: drop-shadow(0 5px 15px rgba(255, 215, 0, 0.6));
    animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 5px 15px rgba(255, 215, 0, 0.6));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 8px 25px rgba(255, 215, 0, 0.9));
    }
}
.score-popup .stat-row span.stat-label {
    color: #fff;
}
.score-popup .stat-row span.stat-value {
    color: #fff;
}
.header .avatar-preview img {
    height: 73px;
}

.settings-panel .stat-value {
    color: #fff;
}
.settings-panel .stat-label {
    color: #fff;
}
.game-visual.ocean-mode {
    background-image: url("../assets/marine2.png");
        background-size: cover;
}
.game-visual.rocket-mode{
    background-image: url("../assets/espace.png");
        background-size: cover;
}
.game-visual.forest-mode{
    background-image: url("../assets/forest.png");
        background-size: cover;
}
.game-visual.forest-mode{
    background-image: url("../assets/forest.png");
        background-size: cover;
}
.forest-creature {
    font-size: 3.5em;

}

.monster-container{
    background-image: url("../assets/arena.png");
    background-size: cover;
    height: 84vh;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.game-visual.icecream-mode{
background-image: url("../assets/glace.png");
        background-size: cover;
}
.game-visual.treasure-mode{
background-image: url("../assets/cave.png");
        background-size: cover;
}
.game-visual.castle-mode{
background-image: url("../assets/village.png");
        background-size: cover;
}

.game-visual.castle-mode{
background-image: url("../assets/village.png");
        background-size: cover;
}
.game-visual.circus-mode{
background-image: url("../assets/circus.png");
        background-size: cover;
}
.game-visual.circus-mode{
background-image: url("../assets/circus.png");
        background-size: cover;
}

.setting-section.home-page .stat-card {
    padding: 5px;
    background: var(--primary);
}

.game-visual.mountain-mode{
background-image: url("../assets/montagne.png");
        background-size: cover;
}

.question-section {
    position: fixed;
    bottom: 42px;
    width: 1100px;
    left: calc(50% - 550px);
    background: #ffffffe0;
    border-radius: 20px;
    padding:20px;
}
.feedback {
    /*position: fixed;*/
    bottom: 238px;
    left: calc(50% - 250px);
}
.battle-arena {
    min-height: 84vh;
}
.game-visual {
    min-height: 84vh;
    margin-bottom: unset !important;
    border-radius: 20px;
}
.battle-arena{
    padding:0px;
}
.tower-container {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
min-height: 421px;

    position: relative;
}
.icecream-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: unset;
}
.ice-cone {
    position: fixed;
    z-index: 0;
    margin-bottom: -70px;
}

.space-scene {
    position: relative;
    height: 533px;
    width: 100%;
}
.progress-bar-rocket {
    background: rgb(255 255 255 / 88%);

}
.progress-text {

    color: #ffffff;
}
.menu-title {
    text-align: center;
    color: #fff;
    font-size: 1.5em;
    margin-bottom: 20px;
    margin-top: 19px;
}
.mode-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.game-mode-card {

    width: 223px;

}
.game-modes {
    display: flex;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 35px;
}

.setting-section.home-page .stat-card {
    padding: 11px;
    background: var(--primary);
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}
.setting-section.home-page .stats-grid {
    gap: 5px;
    display: flex;
    flex-wrap: wrap;
}
.setting-section.home-page .stat-card {
    padding: 15px;
    background: var(--primary);
    display: flex;
    align-items: center;
    flex-direction: column;
    border-radius: 5px;
    justify-content: center;
    width: 135px;
}
.chest-top {
    display: none;
}
.treasure-item {
    font-size: 5em;
    background: #fef37abd;
    border-radius: 20px;
}
.treasure-scene {
    margin-bottom: 450px;
}
.monster {
    margin-top: 130px;
}

@media (max-height: 900px) {
    .game-visual {
        min-height: 112vh;

    }
    .tower-container {

        min-height: 387px;

    }
    .monster-container {

    height: 112vh;

    }
}