:root {
    --sidebar-width: 180px;
    --bg-pastel-pink: #FFE5EC;
    --bg-pastel-lavender: #E8D5F5;
    --bg-pastel-mint: #D5F5E3;
    --bg-pastel-yellow: #FFF8DC;
    --bg-pastel-blue: #D5E8F5;
    --bg-pastel-peach: #FFE5CC;
    --btn-pink: #FFB3C6;
    --btn-lavender: #C8A2E8;
    --btn-mint: #8ED9A6;
    --btn-yellow: #FFD780;
    --btn-blue: #8BC8E8;
    --btn-peach: #FFB380;
    --text-dark: #4A3347;
    --sidebar-bg: linear-gradient(180deg, #F5E6FF 0%, #FFE5F0 100%);
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(255, 180, 200, 0.4);
    --border-radius: 16px;
    --transition-speed: 0.2s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Comic Sans MS', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--bg-pastel-lavender), var(--bg-pastel-pink), var(--bg-pastel-mint));
    background-attachment: fixed;
    min-height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

/* SIDEBAR */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 3px solid rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    gap: 8px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    z-index: 100;
}

.sidebar-title {
    font-size: 2.5rem;
    text-align: center;
    padding: 10px 0;
    animation: pulse 2s ease-in-out infinite;
}

.game-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-soft);
}

.game-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
    background: rgba(255, 255, 255, 0.95);
}

.game-btn:active {
    transform: scale(0.98);
}

.game-btn:nth-child(2) { border-left: 5px solid var(--btn-pink); }
.game-btn:nth-child(3) { border-left: 5px solid var(--btn-lavender); }
.game-btn:nth-child(4) { border-left: 5px solid var(--btn-mint); }
.game-btn:nth-child(5) { border-left: 5px solid var(--btn-yellow); }
.game-btn:nth-child(6) { border-left: 5px solid var(--btn-blue); }
.game-btn:nth-child(7) { border-left: 5px solid var(--btn-peach); }

.game-btn.active {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-glow);
}

.game-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.game-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

/* GAME AREA */
#game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.game-screen {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.game-screen.active {
    display: flex;
}

/* GAME HEADER */
.game-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 10px;
}

.game-header-icon {
    font-size: 2.5rem;
}

.game-header-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.game-hint {
    font-size: 1.2rem;
    color: #7A6577;
    margin-bottom: 15px;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 20px;
    border-radius: 20px;
}

/* WELCOME SCREEN */
.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.welcome-emoji {
    font-size: 6rem;
    animation: bounce 2s ease-in-out infinite;
}

.welcome-content h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #FF6B9D, #C084FC, #60A5FA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    font-size: 1.8rem;
    color: #8A6B8A;
}

.welcome-decorations {
    position: relative;
    width: 300px;
    height: 100px;
}

.float-emoji {
    position: absolute;
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

/* CANVAS WRAPPER */
.canvas-wrapper {
    flex: 1;
    max-height: 80vh;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 4px solid rgba(255, 255, 255, 0.8);
}

.canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* BUBBLES */
#bubbles-container {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    animation: floatUp linear;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: transform 0.1s;
}

.bubble:hover {
    transform: scale(1.1);
}

.bubble.pop {
    animation: popEffect 0.4s ease-out forwards;
}

@keyframes floatUp {
    from { transform: translateY(100vh); }
    to { transform: translateY(-150px); }
}

@keyframes popEffect {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.5; }
    100% { transform: scale(2.5); opacity: 0; }
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    animation: confettiFall 1s ease-out forwards;
}

@keyframes confettiFall {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--cx), var(--cy)) scale(0.3); opacity: 0; }
}

/* MONSTER GAME */
#monster-game-area {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    position: relative;
}

#monster-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#monster-face {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(200, 162, 232, 0.3), transparent);
    border-radius: 50%;
}

#monster-emoji {
    font-size: 8rem;
    transition: transform 0.2s;
    cursor: default;
    user-select: none;
}

#monster-emoji.eating {
    animation: munch 0.4s ease-in-out;
}

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

#monster-mouth {
    width: 140px;
    height: 60px;
    border: 4px dashed var(--btn-lavender);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #9A6B9A;
    transition: all 0.2s;
}

#monster-mouth.drag-over {
    background: rgba(200, 162, 232, 0.3);
    border-color: var(--btn-mint);
    transform: scale(1.1);
}

#food-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.food-item {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    cursor: grab;
    user-select: none;
    transition: transform 0.15s;
}

.food-item:hover {
    transform: scale(1.15);
}

.food-item:active, .food-item.dragging {
    cursor: grabbing;
    transform: scale(1.2);
    opacity: 0.8;
    position: fixed;
    pointer-events: none;
    z-index: 1000;
}

.food-item.eaten {
    animation: foodEat 0.5s ease-out forwards;
}

@keyframes foodEat {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.3); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

/* BUNNY GRID */
#bunny-grid {
    display: grid;
    gap: 4px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
}

.grid-cell {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.grid-cell:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* XYLOPHONE */
#xylophone-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    width: 100%;
}

.xylo-key {
    flex: 1;
    max-width: 100px;
    height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-radius: 50px;
    background: white;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
}

.xylo-key:active {
    transform: scale(0.95) translateY(10px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.xylo-emoji {
    font-size: 3rem;
}

.xylo-note {
    font-weight: 800;
    color: rgba(0,0,0,0.3);
}

/* STICKER BOOK */
#sticker-game-area {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#sticker-canvas-area {
    flex: 1;
    background: linear-gradient(180deg, #D5E8F5 0%, #98FB98 100%);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.05);
    cursor: crosshair;
}

#sticker-toolbar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    flex-wrap: wrap;
}

.sticker-tool {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    border: 3px solid transparent;
}

.sticker-tool:hover {
    transform: scale(1.1);
}

.sticker-tool.active {
    background: var(--btn-pink);
    border-color: white;
    transform: scale(1.1);
}

.placed-sticker {
    position: absolute;
    font-size: 4rem;
    user-select: none;
    pointer-events: none;
    animation: stickerPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stickerPop {
    0% { transform: scale(0) rotate(-20deg); }
    100% { transform: scale(1) rotate(var(--rotation)); }
}

/* BALLOON FLOAT */
#balloon-area {
    flex: 1;
    width: 100%;
    position: relative;
    background: skyblue;
    border-radius: var(--border-radius);
    overflow: hidden;
}

#balloon-element {
    position: absolute;
    font-size: 6rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1));
}

#balloon-floor {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.3);
}

/* RESPONSIVE ADAPTATIONS */
@media (max-width: 768px) {
    .xylo-key {
        height: 250px;
    }
    .xylo-emoji {
        font-size: 2rem;
    }
    .sticker-tool {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
}

/* STAR CATCHER */
#star-area {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.falling-letter {
    position: absolute;
    font-size: 7rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s;
    user-select: none;
}

.falling-letter.caught {
    animation: starCatch 0.8s ease-out forwards;
}

@keyframes starCatch {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    25% { transform: scale(1.4) rotate(10deg); }
    50% { transform: scale(1.6) rotate(-10deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

#target-letter {
    font-size: 10rem;
    font-weight: 900;
    padding: 10px 30px;
    background: linear-gradient(135deg, #FF6B9D, #C084FC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    user-select: none;
}

/* SPARKLE EFFECTS */
.sparkle {
    position: absolute;
    pointer-events: none;
    animation: sparkleFade 0.8s ease-out forwards;
}

@keyframes sparkleFade {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0) rotate(180deg); opacity: 0; }
}

/* CONFETTI BURST */
.confetti-burst {
    position: absolute;
    pointer-events: none;
}

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

@keyframes confettiBurst {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(var(--cx), var(--cy)) rotate(360deg) scale(0); opacity: 0; }
}

/* ANIMATIONS */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

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

/* RESPONSIVE */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 120px;
    }
    .game-name {
        display: none;
    }
    .game-icon {
        font-size: 2.2rem;
    }
    .game-btn {
        justify-content: center;
        padding: 12px;
    }
    .game-header-text {
        font-size: 1.4rem;
    }
    .falling-letter {
        font-size: 5rem;
    }
    #target-letter {
        font-size: 7rem;
    }
    .grid-cell {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
}
