/* ===== RESET & FONTS ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #1abc9c, #3498db, #9b59b6);
    background-size: 400% 400%;
    animation: bgFlow 10s ease infinite;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

@keyframes bgFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Base App Container */
#app {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* Glassmorphism */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 450px;
    margin: auto;
}

/* Screens */
.screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 1;
}
.screen.active {
    visibility: visible;
    opacity: 1;
    z-index: 10;
}

/* Headings */
h1, h2, h3 { font-family: 'Fredoka One', cursive; letter-spacing: 1px; text-shadow: 1px 2px 4px rgba(0,0,0,0.3); }

/* Inputs & Buttons */
.input-group { margin: 1.5rem 0; text-align: left; }
.input-group label { display: block; font-weight: 700; margin-bottom: 0.5rem; }
input[type="text"] {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 700;
    color: #2d3436;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-family: 'Fredoka One', cursive;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.95); }
.btn-primary {
    background: linear-gradient(135deg, #FF9F43, #EE5A24);
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.4);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255,255,255,0.4);
}
.btn-full { width: 100%; font-size: 1.3rem; }

/* Mode Cards */
.mode-cards { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.mode-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
    border: 2px solid transparent;
}
.mode-card:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.3); border-color: #fff; }
.mode-card-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.mode-card-title { font-size: 1.3rem; font-family: 'Fredoka One', cursive; margin-bottom: 0.5rem; }
.mode-card-desc { font-size: 0.95rem; line-height: 1.4; opacity: 0.9; }

/* Game HUD */
#gameScreen { justify-content: flex-start; padding: 1rem; }
.game-hud {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 0.8rem 1rem;
    border-radius: 16px;
    font-weight: 700;
}
.hud-item { display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; }

/* Progress Bar */
.progress-container { width: 100%; margin-bottom: 1.5rem; text-align: center; }
.progress-text { font-family: 'Fredoka One', cursive; margin-bottom: 0.5rem; font-size: 1.2rem; }
.progress-bar-bg { width: 100%; height: 20px; background: rgba(0,0,0,0.3); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: #00d2d3; border-radius: 10px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

/* Game Arena */
.game-arena { width: 100%; max-width: 600px; display: flex; flex-direction: column; gap: 2rem; margin: auto; }
.question-box {
    background: rgba(255, 255, 255, 0.95);
    color: #2d3436;
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    font-size: 1.4rem;
    line-height: 1.4;
}

/* Options */
.options-container { display: flex; flex-direction: column; gap: 1rem; }
.option-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1.2rem;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.option-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.3); transform: scale(1.02); }
.option-btn:active:not(:disabled) { transform: scale(0.98); }

.option-btn.correct { background: #10ac84; border-color: #1dd1a1; animation: pop 0.4s ease; box-shadow: 0 0 15px #1dd1a1; }
.option-btn.wrong { background: #ee5253; border-color: #ff6b6b; animation: shake 0.4s ease; box-shadow: 0 0 15px #ff6b6b; }

/* Particles */
.particles-container { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.particle { position: absolute; top: -50px; opacity: 0.4; font-size: 2rem; animation: floatDown linear infinite; }
@keyframes floatDown {
    100% { transform: translateY(110vh) rotate(360deg); }
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Result Stats */
#resultScreen .glass-card { max-width: 500px; }
.result-icon { font-size: 4rem; margin-bottom: 1rem; animation: pop 1s infinite alternate; }
.result-stats { display: flex; gap: 0.5rem; justify-content: space-around; margin: 1.5rem 0; width: 100%; }
.stat-box { background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 12px; min-width: 80px; flex: 1; margin: 0 5px; }
.stat-value { font-family: 'Fredoka One'; font-size: 2rem; }
.stat-label { font-size: 0.8rem; opacity: 0.9; font-weight: 700; }
.stat-value.green { color: #1dd1a1; }
.stat-value.red { color: #ff6b6b; }
.stat-value.blue { color: #00d2d3; }
.result-buttons { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
