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

body {
    width: 100vw;
    height: 100vh;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    overflow: hidden; /* This prevents scrolling to keep it looking like a game screen */
}

.hero-section {
    width: 100%;
    height: 100%;
    /* Here is the background image you requested */
    background-image: url('image.png');
    background-size: cover;
    background-position: center bottom; 
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 20;
}

.back-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 70px;
    height: 70px;
    transition: transform 0.2s ease;
}

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

.back-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bird-container {
    position: absolute;
    left: -40px; /* Moved further left as requested */
    bottom: 30%;
    width: 22%;
    min-width: 150px;
    z-index: 10;
}

.bird-container img {
    width: 100%;
    height: auto;
}

.tree-container {
    position: absolute;
    right: -20px; /* Moved further right as requested */
    bottom: 0;
    width: 25%;
    min-width: 200px;
    z-index: 10;
}

.tree-container img {
    width: 100%;
    height: auto;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 15;
    margin-top: 0; /* Exact center */
    width: 50%;
}

.logo {
    width: 100%;
    max-width: 600px;
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite; /* Adds a nice floating animation to the logo */
}

.custom-play-btn {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffcc00, #ff8c00);
    border: 6px solid #d96600; /* darker orange border */
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2), inset 0 -10px 20px rgba(0,0,0,0.1), inset 0 10px 20px rgba(255,255,255,0.4);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease-in-out;
    overflow: hidden; /* for bubbles */
    margin-top: 20px;
}

.custom-play-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    /* Drawing some subtle bubble/circle details in the background of the button */
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.25) 8%, transparent 9%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.25) 12%, transparent 13%),
        radial-gradient(circle at 60% 80%, rgba(255,255,255,0.2) 6%, transparent 7%),
        radial-gradient(circle at 25% 30%, rgba(255,255,255,0.25) 10%, transparent 11%),
        radial-gradient(circle at 85% 70%, rgba(255,255,255,0.2) 7%, transparent 8%);
    pointer-events: none;
}

.play-icon {
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 35px solid #b32400; /* dark red triangle */
    margin-left: 10px; /* center visually */
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.4));
    z-index: 2;
}

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

/* Subtle floating animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Making it responsive for smaller screens */
@media (max-width: 768px) {
    .bird-container {
        width: 30%;
        bottom: 25%;
    }
    .tree-container {
        width: 35%;
        right: 0;
    }
    .center-content {
        width: 80%;
    }
    .play-btn {
        width: 100px;
        height: 100px;
    }
}

/* --- New Screens Styles --- */
#home-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0; left: 0;
}

#selection-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    top: 0; left: 0;
    z-index: 10;
    overflow-y: auto;
    padding-top: 120px;
    padding-bottom: 50px;
}

#selection-screen::-webkit-scrollbar {
    width: 12px;
}
#selection-screen::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3); 
    border-radius: 10px;
}
#selection-screen::-webkit-scrollbar-thumb {
    background: #ff0055;
    border-radius: 10px;
}

.hidden {
    display: none !important;
}

/* ========================================= */
/* CATEGORY TABS                             */
/* ========================================= */
.category-tabs {
    width: 80%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 0 auto 25px auto; /* Centers the tabs and adds bottom margin */
    flex-wrap: wrap;
    z-index: 20;
}

.category-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 3px solid #ff0055;
    border-radius: 25px;
    padding: 8px 25px;
    font-size: 18px;
    font-weight: bold;
    color: #ff0055;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
    font-family: inherit;
}

.category-btn:hover, .category-btn.active {
    background: #ff0055;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 35px;
    width: 85%;
    max-width: 1200px;
    z-index: 15;
    padding-bottom: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.85);
    padding: 15px;
    border-radius: 30px;
    border: 4px solid #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1), inset 0 0 0 3px rgba(255, 0, 85, 0.15);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 35px rgba(255, 0, 85, 0.25), inset 0 0 0 4px #ff0055;
}

.card-inner {
    background-color: #fff;
    border-radius: 20px;
    width: 100%;
    aspect-ratio: 1; /* Premium square look */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.06);
}

.card-inner img {
    width: 88%;
    height: 88%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.card:hover .card-inner img {
    transform: scale(1.08) rotate(3deg);
}

/* Update Media Query for Grid */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        width: 90%;
    }
}

/* ========================================= */
/* CSS BACK BUTTON                           */
/* ========================================= */
.custom-back-btn {
    width: 60px;
    height: 60px;
    background-color: #ff9800;
    border: 4px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s ease-in-out;
}
.custom-back-btn:hover {
    transform: scale(1.1);
}
.back-icon {
    width: 18px;
    height: 18px;
    border-top: 5px solid white;
    border-left: 5px solid white;
    transform: rotate(-45deg);
    margin-left: 6px;
}

/* ========================================= */
/* ENLARGED DRAWING INTERACTIONS             */
/* ========================================= */
.cards-grid.has-active-card .card:not(.active-card) {
    display: none !important;
}
.cards-grid.has-active-card {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.85); /* Dark background overlay */
    margin: 0;
}
.card.active-card {
    width: 90vw;
    height: 85vh;
    max-width: 1000px;
    max-height: 800px;
    transform: none !important; /* Prevent hover animations when enlarged */
    cursor: pointer;
    z-index: 101;
    margin: auto;
}
.card.active-card .card-inner {
    border-width: 8px;
    height: 100%;
    aspect-ratio: auto; /* Remove aspect ratio constraint so it fills vertically */
}
.card.active-card .card-inner svg {
    width: 95%;
    height: 95%;
}

/* ========================================= */
/* COLOR PALETTE                             */
/* ========================================= */
.color-palette {
    display: none;
    position: fixed;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 15px;
    border-radius: 35px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 200;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    max-height: 80vh; /* Make it scrollable */
    overflow-y: auto;
}

/* Custom Scrollbar for Palette */
.color-palette::-webkit-scrollbar {
    width: 6px;
}
.color-palette::-webkit-scrollbar-thumb {
    background-color: #bbb;
    border-radius: 10px;
}

.color-swatch {
    width: 100px;
    height: 40px;
    background: linear-gradient(to right, var(--c) 0px, var(--c) 15px, #f4c29f 15px, #f4c29f 30px, var(--c) 30px, var(--c) 100%);
    clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 25% 100%, 0% 50%);
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    transform-origin: right center;
    border-radius: 0 10px 10px 0; /* round the back of the pencil */
    flex-shrink: 0;
}
.color-swatch:hover {
    transform: scale(1.1) translateX(-5px);
}
.color-swatch.selected {
    transform: scale(1.15) translateX(-15px);
    filter: drop-shadow(4px 4px 5px rgba(0,0,0,0.3));
}

.color-swatch.eraser {
    background: #ffccbc; /* Eraser color */
    clip-path: none;
    width: 80px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #d84315;
    font-size: 12px;
}
.color-swatch.eraser::after {
    content: 'ERASE';
}

/* Locked / Used Swatches (1-Time Use) */
.color-swatch.used, .color-swatch.locked {
    filter: grayscale(0.85) opacity(0.45) !important;
    cursor: not-allowed !important;
    transform: scale(0.92) !important;
    position: relative;
    pointer-events: auto;
}

.color-swatch.used::after, .color-swatch.locked::after {
    content: '🔒';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.9));
}

.color-swatch.used::before, .color-swatch.locked::before {
    display: none !important; /* disable shimmer gleam once used */
}

.color-swatch.shake {
    animation: swatchShake 0.4s ease forwards !important;
}

@keyframes swatchShake {
    0%, 100% { transform: translateX(0) scale(0.92); }
    20%, 60% { transform: translateX(-6px) scale(0.92); }
    40%, 80% { transform: translateX(6px) scale(0.92); }
}

/* Shining Colors Swatches (10 Sparkling & Gleaming Colors) */
.color-swatch.shine-swatch {
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.25s;
}

.color-swatch.shine-swatch::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0) 60%);
    background-size: 200% 200%;
    animation: shineGleam 2.5s infinite linear;
    pointer-events: none;
    clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 25% 100%, 0% 50%);
}

@keyframes shineGleam {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.color-swatch.shine-gold {
    background: linear-gradient(to right, #ffd700 0px, #ffd700 15px, #f4c29f 15px, #f4c29f 30px, #bf953f 30px, #fcf6ba 60px, #aa771c 100%);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.color-swatch.shine-silver {
    background: linear-gradient(to right, #cfd9df 0px, #cfd9df 15px, #f4c29f 15px, #f4c29f 30px, #cfd9df 30px, #ffffff 60px, #9ea7b0 100%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}
.color-swatch.shine-bronze {
    background: linear-gradient(to right, #cd7f32 0px, #cd7f32 15px, #f4c29f 15px, #f4c29f 30px, #cd7f32 30px, #ffcc99 60px, #8b4513 100%);
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
}
.color-swatch.shine-ruby {
    background: linear-gradient(to right, #ff0844 0px, #ff0844 15px, #f4c29f 15px, #f4c29f 30px, #ff0844 30px, #ffb199 60px, #b3002d 100%);
    box-shadow: 0 0 8px rgba(255, 8, 68, 0.5);
}
.color-swatch.shine-emerald {
    background: linear-gradient(to right, #00f260 0px, #00f260 15px, #f4c29f 15px, #f4c29f 30px, #00f260 30px, #b5ffc8 60px, #0575e6 100%);
    box-shadow: 0 0 8px rgba(0, 242, 96, 0.5);
}
.color-swatch.shine-sapphire {
    background: linear-gradient(to right, #00c6ff 0px, #00c6ff 15px, #f4c29f 15px, #f4c29f 30px, #00c6ff 30px, #e0f7fa 60px, #0072ff 100%);
    box-shadow: 0 0 8px rgba(0, 198, 255, 0.5);
}
.color-swatch.shine-amethyst {
    background: linear-gradient(to right, #da22ff 0px, #da22ff 15px, #f4c29f 15px, #f4c29f 30px, #da22ff 30px, #f8c8ff 60px, #9733ee 100%);
    box-shadow: 0 0 8px rgba(218, 34, 255, 0.5);
}
.color-swatch.shine-rosegold {
    background: linear-gradient(to right, #ff9a9e 0px, #ff9a9e 15px, #f4c29f 15px, #f4c29f 30px, #fecfef 30px, #ff9a9e 60px, #e8637c 100%);
    box-shadow: 0 0 8px rgba(255, 154, 158, 0.5);
}
.color-swatch.shine-aqua {
    background: linear-gradient(to right, #00f5d4 0px, #00f5d4 15px, #f4c29f 15px, #f4c29f 30px, #00f5d4 30px, #e0ffff 60px, #00bbf9 100%);
    box-shadow: 0 0 8px rgba(0, 245, 212, 0.5);
}
.color-swatch.shine-magic {
    background: linear-gradient(to right, #ff007f 0px, #ff007f 15px, #f4c29f 15px, #f4c29f 30px, #ff007f 30px, #00f2fe 50%, #4facfe 75%, #fee140 100%);
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
}
.close-btn {
    margin-top: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #f44336;
    color: white;
    border: 3px solid white;
    font-weight: bold;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.close-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}


/* ========================================= */
/* PURE CSS ART (NO IMAGES / NO URLS)        */
/* ========================================= */

/* 1. Elephant */
.art-elephant { position: relative; width: 100px; height: 100px; margin: auto; }
.art-elephant .head { position: absolute; width: 60px; height: 60px; background: #E0E0E0; border-radius: 50%; top: 20px; left: 20px; z-index: 2; border: 2px solid black; }
.art-elephant .ear { position: absolute; width: 40px; height: 50px; background: #E0E0E0; border-radius: 50%; top: 25px; border: 2px solid black; }
.art-elephant .ear.left { left: 0; transform: rotate(-20deg); }
.art-elephant .ear.right { right: 0; transform: rotate(20deg); }
.art-elephant .trunk { position: absolute; width: 20px; height: 40px; background: #E0E0E0; border-radius: 10px; top: 60px; left: 40px; z-index: 3; border: 2px solid black; border-top: none; }
.art-elephant .eye { position: absolute; width: 8px; height: 8px; background: black; border-radius: 50%; top: 40px; z-index: 3; }
.art-elephant .eye.left { left: 35px; }
.art-elephant .eye.right { right: 55px; }

/* 2. Turtle */
.art-turtle { position: relative; width: 100px; height: 100px; margin: auto; }
.art-turtle .shell { position: absolute; width: 70px; height: 40px; background: #E0E0E0; border-radius: 35px 35px 0 0; bottom: 30px; left: 15px; border: 2px solid black; z-index: 2; }
.art-turtle .head { position: absolute; width: 25px; height: 25px; background: #E0E0E0; border-radius: 50%; bottom: 35px; right: 5px; border: 2px solid black; }
.art-turtle .leg { position: absolute; width: 15px; height: 20px; background: #E0E0E0; border-radius: 10px; bottom: 20px; border: 2px solid black; }
.art-turtle .leg.front { right: 25px; }
.art-turtle .leg.back { left: 25px; }
.art-turtle .eye { position: absolute; width: 4px; height: 4px; background: black; border-radius: 50%; bottom: 48px; right: 12px; z-index: 3; }

/* 3. Car */
.art-car { position: relative; width: 100px; height: 100px; margin: auto; }
.art-car .body-bottom { position: absolute; width: 80px; height: 25px; background: #E0E0E0; bottom: 30px; left: 10px; border-radius: 5px; border: 2px solid black; z-index: 2; }
.art-car .body-top { position: absolute; width: 40px; height: 20px; background: #E0E0E0; bottom: 55px; left: 25px; border-radius: 10px 10px 0 0; border: 2px solid black; border-bottom: none; z-index: 2; }
.art-car .window { position: absolute; width: 15px; height: 12px; background: #FFFFFF; bottom: 55px; left: 45px; border: 2px solid black; z-index: 3; }
.art-car .wheel { position: absolute; width: 20px; height: 20px; background: #333; border-radius: 50%; bottom: 20px; border: 2px solid black; z-index: 3; }
.art-car .wheel.front { right: 20px; }
.art-car .wheel.back { left: 20px; }

/* 4. Tree */
.art-tree { position: relative; width: 100px; height: 100px; margin: auto; }
.art-tree .trunk { position: absolute; width: 20px; height: 40px; background: #E0E0E0; bottom: 15px; left: 40px; border: 2px solid black; }
.art-tree .leaves { position: absolute; width: 60px; height: 60px; background: #E0E0E0; border-radius: 50%; bottom: 40px; left: 20px; border: 2px solid black; z-index: 2; }

/* 5. House */
.art-house { position: relative; width: 100px; height: 100px; margin: auto; }
.art-house .base { position: absolute; width: 60px; height: 50px; background: #E0E0E0; bottom: 20px; left: 20px; border: 2px solid black; }
.art-house .roof { position: absolute; width: 0; height: 0; border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 40px solid #E0E0E0; bottom: 70px; left: 15px; }
.art-house .roof::after { content: ''; position: absolute; border-left: 35px solid transparent; border-right: 35px solid transparent; border-bottom: 40px solid black; top: 2px; left: -35px; z-index: -1; } /* hack for triangle border */
.art-house .door { position: absolute; width: 15px; height: 25px; background: #E0E0E0; bottom: 20px; left: 42px; border: 2px solid black; border-bottom: none; z-index: 2; }
.art-house .window { position: absolute; width: 15px; height: 15px; background: #E0E0E0; bottom: 45px; left: 25px; border: 2px solid black; z-index: 2; }

/* 6. Flower */
.art-flower { position: relative; width: 100px; height: 100px; margin: auto; }
.art-flower .stem { position: absolute; width: 6px; height: 40px; background: #E0E0E0; bottom: 10px; left: 47px; border: 2px solid black; }
.art-flower .center { position: absolute; width: 30px; height: 30px; background: #E0E0E0; border-radius: 50%; top: 35px; left: 35px; z-index: 3; border: 2px solid black; }
.art-flower .petal { position: absolute; width: 25px; height: 25px; background: #E0E0E0; border-radius: 50%; z-index: 2; border: 2px solid black; }
.art-flower .petal-1 { top: 20px; left: 38px; }
.art-flower .petal-2 { top: 55px; left: 38px; }
.art-flower .petal-3 { top: 38px; left: 20px; }
.art-flower .petal-4 { top: 38px; left: 55px; }

/* ========================================= */
/* NAVIGATION BUTTONS                        */
/* ========================================= */
.nav-btn {
    position: fixed;
    bottom: 30px; /* Move to the bottom */
    top: auto;
    transform: none;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #ff0055;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 30px;
    color: #ff0055;
    font-weight: bold;
    cursor: pointer;
    z-index: 250; /* Above active card and palette */
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s, transform 0.2s, color 0.3s;
}

.nav-btn:hover {
    background: #ff0055;
    color: white;
    transform: scale(1.1);
}

.prev-btn {
    left: calc(50% - 80px); /* Center-left */
}

.next-btn {
    left: calc(50% + 20px); /* Center-right */
}

/* Hide navigation buttons when color palette is hidden, managed by JS */

/* Floating Sparkle Particles Effect on Canvas Tap */
.sparkle-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 26px;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.9));
    animation: sparkleFly 0.75s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes sparkleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(calc(var(--dest-x) * 0.5), calc(var(--dest-y) * 0.5)) scale(1.4) rotate(90deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dest-x), var(--dest-y)) scale(0.2) rotate(180deg);
    }
}
