:root {
    --primary: #ff66a3; /* Pink */
    --secondary: #b366ff; /* Purple */
    --tertiary: #66ccff; /* Blue */
    --bg-top: #ffe6f2;
    --bg-bottom: #e6e6ff;
    --text-dark: #4a235a;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(150, 100, 200, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
    user-select: none;
}

body {
    background: linear-gradient(135deg, var(--bg-top), var(--bg-bottom));
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#app-container {
    width: 100%;
    max-width: 600px;
    height: 100%;
    max-height: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

/* Typography */
.rainbow-text {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 40px;
}

/* Buttons */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 80%;
}

.btn {
    padding: 15px 20px;
    border: none;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(0,0,0,0.1);
    transition: transform 0.1s, box-shadow 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 rgba(0,0,0,0.1);
}

.btn-primary { background: linear-gradient(45deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); color: var(--text-dark); }
.btn-secondary { background: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%); color: var(--text-dark); }
.btn-tertiary { background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%); color: var(--text-dark); }

.emoji { font-size: 2rem; }

/* Top Bar */
.top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-back {
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 8px 15px;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
}

.score {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffd700;
    background: rgba(255,255,255,0.8);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Gameplay Common */
.speaker-btn {
    width: 100px;
    height: 100px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 0 #cc3377, 0 15px 20px rgba(0,0,0,0.2);
    margin: 20px 0;
    transition: all 0.1s;
}

.speaker-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 #cc3377, 0 5px 10px rgba(0,0,0,0.2);
}

.speaker-btn.small {
    width: 50px;
    height: 50px;
    font-size: 1rem;
    box-shadow: 0 4px 0 #cc3377;
    position: absolute;
    bottom: -10px;
    right: -10px;
}

.hidden-word {
    font-size: 2rem;
    color: var(--text-dark);
    background: white;
    padding: 5px 20px;
    border-radius: 15px;
    letter-spacing: 2px;
}

.target-display {
    position: relative;
    background: white;
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.huge-emoji {
    font-size: 5rem;
}

/* Mode 1: Balloons */
#balloon-container {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding-bottom: 120px;
}

.balloon {
    width: 100px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #fff, var(--secondary));
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    cursor: pointer;
    box-shadow: inset -10px -10px 20px rgba(0,0,0,0.1), 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    animation: float 3s ease-in-out infinite alternate;
}

.balloon:active { transform: scale(0.9); }
.balloon::after {
    content: '';
    position: absolute;
    bottom: -15px;
    width: 2px;
    height: 30px;
    background: rgba(0,0,0,0.3);
}

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

/* Mode 2: Conveyor */
#conveyor-belt {
    width: 100%;
    height: 150px;
    background: rgba(0,0,0,0.1);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    margin-top: 50px;
}

.word-card {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-dark);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background 0.2s;
}

.word-card:active { background: #ffe6f2; }

/* Mode 3: Spelling */
#magic-circles-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.magic-circle {
    width: 50px;
    height: 50px;
    border: 3px dashed var(--secondary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    background: rgba(255,255,255,0.5);
}

#letters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px;
}

.letter-btn {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-dark);
    box-shadow: 0 6px 0 #ddd, 0 10px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.1s;
}

.letter-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #ddd;
}

/* Mascot styles */
.mascot {
    position: absolute;
    bottom: -20px;
    width: 150px;
    height: auto;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.2));
    transition: transform 0.3s ease-out;
    z-index: 10;
    pointer-events: none;
    mix-blend-mode: multiply;
}

#mascot-listen { right: 10px; }
#mascot-catch { left: 10px; }
#mascot-spell { right: 10px; }

.mascot.happy {
    animation: happyJump 0.5s ease-in-out;
}

.mascot.sad {
    animation: sadShake 0.5s ease-in-out;
}

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

@keyframes sadShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}
