:root {
    /* "Tel & Taal" Palette */
    --color-sky: #E0F7FA;
    --color-grass: #AED581;
    --color-primary: #FF7043;
    /* Playful Orange */
    --color-secondary: #42A5F5;
    /* Sky Blue */
    --color-accent: #FFEB3B;
    /* Sunshine Yellow */
    --color-text: #37474F;
    --color-white: #ffffff;

    --font-main: 'Fredoka', sans-serif;

    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-pop: 0 8px 0 rgba(0, 0, 0, 0.15);
    /* Clicky button shadow */
}

* {
    box-sizing: border-box;
    user-select: none;
    /* Prevent selection on touch */
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--color-sky);
    color: var(--color-text);
    overflow: hidden;
    /* App-like feel */
    height: 100vh;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    background: var(--color-sky);
}

.view.hidden {
    transform: translateX(100%);
    pointer-events: none;
}

.view.active {
    transform: translateX(0);
}

/* Landing Page */
#landing-view {
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--color-sky) 0%, var(--color-grass) 100%);
}

.logo-container h1 {
    font-size: 4rem;
    color: var(--color-primary);
    text-shadow: 2px 2px 0 var(--color-white);
    margin: 0;
    animation: bounce 2s infinite;
}

.logo-container p {
    font-size: 1.5rem;
    text-align: center;
    color: var(--color-white);
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 1rem 3rem;
    font-size: 2rem;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 600;
    margin-top: 2rem;
    cursor: pointer;
    box-shadow: var(--shadow-pop);
    transition: transform 0.1s;
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

/* Map View */
.top-bar {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: flex-end;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 10;
}

.stars-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary);
    background: var(--color-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.map-container {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    overflow-y: auto;
    width: 100%;
    padding-bottom: 100px;
    /* Space for scrolling */
    position: relative;
    /* Base for absolute decorations */
}

/* Zone Specific Backgrounds */
.map-container.zone-sandput {
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 30%, #F4D03F 40%, #F4D03F 100%);
    overflow-x: hidden;
}

.map-container.zone-sandput::before {
    content: '';
    position: absolute;
    top: 38%;
    left: 5%;
    right: 5%;
    bottom: 50px;
    border: 12px solid #8B4513;
    /* Brown wood */
    border-radius: 15px;
    box-shadow:
        inset 0 4px 10px rgba(0, 0, 0, 0.3),
        0 8px 15px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 0;
}

.map-container.zone-sandput::after {
    content: '';
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.7"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.05"/></svg>'), #F4D03F;
    z-index: -1;
    pointer-events: none;
}

/* Plaas Zone Background */
.map-container.zone-plaas {
    background: linear-gradient(to bottom,
            #87CEEB 0%,
            /* sky blue */
            #87CEEB 40%,
            #7CFC00 40%,
            /* grass green */
            #32CD32 75%,
            /* mid green */
            #8B4513 100%
            /* brown soil */
        );
    overflow-x: hidden;
}

/* Barn and Fence using pseudo elements */
.map-container.zone-plaas::before {
    content: '🏠';
    /* Barn Emoji as fallback */
    position: absolute;
    top: 25%;
    right: 8%;
    font-size: 5rem;
    z-index: 0;
    opacity: 0.9;
}

.map-container.zone-plaas::after {
    content: '';
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    height: 30px;
    background: repeating-linear-gradient(to right,
            #8B4513 0, #8B4513 10px,
            transparent 10px, transparent 40px);
    border-top: 5px solid #8B4513;
    border-bottom: 5px solid #8B4513;
    z-index: 1;
    opacity: 0.5;
}

.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.items-flow {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

/* Activity View */
.activity-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

/* Animations */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Map Styling */
.map-node {
    width: 120px;
    height: 120px;
    background: var(--color-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
    font-size: 3rem;
    font-weight: bold;
    color: var(--color-text);
    position: relative;
    z-index: 10;
    transition: background 0.2s, box-shadow 0.3s ease;
    cursor: pointer;
    border: 4px solid var(--color-white);
    margin: 8px;
    /* Consistent margin */
}

.map-node.locked {
    background: #cfd8dc;
    /* Gray */
    color: #90a4ae;
    box-shadow: none;
    cursor: default;
    border-color: #b0bec5;
}

.map-node.unlocked {
    background: var(--color-white);
    border-color: var(--color-secondary);
    animation: pulse 2s infinite;
}

.map-node.completed {
    background: var(--color-accent);
    /* Yellow means done */
    border-color: #FBC02D;
    color: #F57F17;
    z-index: 20;
    /* Bring completed items to front visually */
    box-shadow:
        0 0 20px rgba(255, 200, 0, 0.4),
        0 8px 0 rgba(0, 0, 0, 0.1);
}

.map-node.completed:hover,
.map-node.completed:active {
    box-shadow:
        0 0 30px rgba(255, 200, 0, 0.6),
        0 8px 0 rgba(0, 0, 0, 0.1);
    /* NO transform, NO scale */
}

/* Word & Number Nodes (Rectangular) */
.map-node-wide {
    width: 100px;
    height: 120px;
    /* Same height as circles */
    border-radius: 15px;
    background: #673AB7;
    /* Deep Purple */
}

.map-node-wide.completed {
    background: #FFD54F;
    /* Yellow */
}

.map-node:active:not(.locked) {
    /* Subtle depth feedback only, no scaling */
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    top: 4px;
}

.node-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stars {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    /* Space inside the card flow */
}

.map-path {
    width: 6px;
    height: 60px;
    background: repeating-linear-gradient(to bottom,
            var(--color-secondary),
            var(--color-secondary) 10px,
            transparent 10px,
            transparent 20px);
    opacity: 0.6;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 165, 245, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(66, 165, 245, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(66, 165, 245, 0);
    }
}

/* Activity Steps */
.step-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    width: 100%;
}

.big-letter {
    font-size: 10rem;
    font-weight: bold;
    color: var(--color-primary);
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.animate-pop {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.instruction {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-top: 1rem;
}

/* Touch Step - Bubbles */
.bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through if needed, but bubbles need events */
}

.bubble {
    width: 60px;
    height: 60px;
    background: rgba(66, 165, 245, 0.6);
    border: 2px solid var(--color-secondary);
    border-radius: 50%;
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    animation: float 3s infinite ease-in-out;
    transform: translate(-50%, -50%);
    /* Center on coordinate */
}

.bubble.popped {
    transform: scale(1.5) translate(-50%, -50%);
    opacity: 0;
    transition: all 0.2s;
}

/* Trace Step */
.trace-area {
    width: 100%;
    max-width: 600px;
    height: auto;
    background: var(--color-white);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    position: relative;
    /* Anchor for start dot */
    margin: 0 auto;
    padding: 10px;
    /* Reduced padding for cleaner alignment */
}

.trace-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Progress Dots */
.progress-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    background: #ccc;
    border-radius: 50%;
    transition: background 0.3s;
}

.dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-10px);
    }
}

/* Victory Overlay */
#victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

#victory-overlay.hidden {
    display: none;
}

/* Trace Step Styles */
.trace-step svg {
    width: 100%;
    height: 100%;
    touch-action: none;
}

.start-point {
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #4CAF50;
    animation: pulse 1.5s infinite;
    z-index: 10;
    pointer-events: none;
    /* Let touches pass through to svg/sensor if needed */
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Error Feedback */
.trace-path.error {
    stroke: #f44336 !important;
    transition: stroke 0.2s;
}

#error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

#error-overlay.flash {
    animation: error-flash 0.3s ease-out;
}

@keyframes error-flash {
    0% {
        background-color: rgba(244, 67, 54, 0);
    }

    50% {
        background-color: rgba(244, 67, 54, 0.4);
    }

    100% {
        background-color: rgba(244, 67, 54, 0);
    }
}

.victory-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90%;
}

.victory-title {
    font-size: 3rem;
    color: var(--color-primary);
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 0 var(--color-accent);
}

.ticket-reward {
    width: 150px;
    height: 80px;
    background: var(--color-accent);
    border: 2px dashed var(--color-primary);
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--color-primary);
    font-size: 1.5rem;
    transform: rotate(-5deg);
    animation: wiggle 2s infinite ease-in-out;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

@keyframes zoomIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes unlockPop {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0.7);
        filter: grayscale(100%);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(255, 235, 59, 0);
        filter: grayscale(0%);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0);
        filter: grayscale(0%);
    }
}

.map-node.animate-unlock {
    animation: unlockPop 1s ease-out forwards;
}

/* ZONE CARDS */
.zone-card {
    background: white;
    border-radius: 25px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    border: 4px solid white;
    position: relative;
    overflow: hidden;
}

.zone-card.locked {
    filter: grayscale(1);
    opacity: 0.7;
    cursor: not-allowed;
    background: #eceff1;
}

.zone-card.unlocked:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 0 rgba(0, 0, 0, 0.08);
    border-color: var(--color-secondary);
}

.zone-icon {
    font-size: 4rem;
    background: var(--color-sky);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

.zone-info h3 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--color-text);
}

.zone-stats {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    font-weight: bold;
    color: var(--color-primary);
}

.lock-tag {
    position: absolute;
    bottom: 10px;
    right: 15px;
    background: #546e7a;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Zone-specific titles/headers */
.zone-content-title {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
}

.group-header {
    position: relative;
    z-index: 10;
}

.zone-content-title h2 {
    font-size: 3rem;
    color: white;
    margin: 0;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.zone-content-title p {
    color: white;
    font-weight: 600;
}

.plaas-mini-farm {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 100px;
    border: 3px dashed white;
}

/* MILESTONE OVERLAY */
/* MILESTONE OVERLAY */
#milestone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#milestone-overlay.hidden {
    display: none;
}

.milestone-card {
    background: white;
    padding: 30px;
    border-radius: 30px;
    text-align: center;
    max-width: 85%;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    animation: pop-bounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.milestone-badge {
    font-size: 6rem;
    margin: 20px 0;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

/* BADGES IN FARM/ALBUM */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-top: 20px;
}

.badge-item {
    width: 80px;
    text-align: center;
}

.badge-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    border: 3px solid #FFD54F;
    box-shadow: 0 3px 0 #FBC02D;
}

.badge-label {
    font-size: 0.7rem;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
}

/* ANIMAL ANIMATIONS */
.animal {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
    animation: idle-float 3s ease-in-out infinite;
}

@keyframes idle-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pop-bounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* SPARKLE TRACE */
.sparkle-trace {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: sparkle-fade-up 0.8s ease-out forwards;
}

@keyframes sparkle-fade-up {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }

    30% {
        transform: translate(0, -10px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(0, -30px) scale(0.5);
        opacity: 0;
    }
}

/* SANDBOX DECORATIONS */
.sandbox-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    /* Below map nodes but above background */
}

.sandbox-toy {
    position: absolute;
    filter: drop-shadow(2px 4px 4px rgba(0, 0, 0, 0.2));
    animation: idle-rotate 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes idle-rotate {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

.toy-bucket {
    bottom: 10%;
    right: 5%;
    font-size: 5rem;
}

.toy-shell {
    bottom: 15%;
    left: 5%;
    font-size: 4rem;
}

.toy-teddy {
    top: 45%;
    right: 2%;
    font-size: 4.5rem;
}

.toy-ball {
    bottom: 5%;
    left: 25%;
    font-size: 3.5rem;
}

.toy-castle {
    bottom: 20%;
    right: 20%;
    font-size: 5.5rem;
}

/* SANDBOX COMPLETION REWARD */
.sandbox-reward {
    position: relative;
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    animation: zoomIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.completion-message {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 3px solid #8B4513;
}

.completion-message h2 {
    color: #8B4513;
    font-size: 2rem;
    margin: 0 0 10px 0;
    font-weight: 900;
}

.completion-message p {
    color: #5D4037;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

/* Wooden frame (brown border) */
.sandbox-frame {
    position: relative;
    background: #8B4513;
    /* wood brown */
    border-radius: 20px;
    padding: 18px;
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.4),
        inset 0 -6px 10px rgba(0, 0, 0, 0.3);
}

/* Sand inside (Matching reference image) */
.sandbox-sand {
    position: relative;
    background: radial-gradient(circle at center, #F7DC6F 0%, #F4D03F 60%, #D4AC0D 100%);
    min-height: 350px;
    border-radius: 12px;
    overflow: hidden;
    /* Keep toys inside */
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Sand Mound (visual effect) */
.sandbox-sand::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 60%;
    background: rgba(255, 255, 255, 0.2);
    top: 20%;
    left: 10%;
    border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
}

/* Toys inside sandbox */
.sandbox-reward .toy {
    position: absolute;
    font-size: 4rem;
    filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.3));
    z-index: 2;
    transition: transform 0.2s;
    cursor: pointer;
}

.sandbox-reward .toy:hover {
    transform: scale(1.1) rotate(5deg) !important;
}

/* Position toys based on reference images provided */
.toy-bucket-red {
    bottom: 10%;
    right: 10%;
    font-size: 5rem;
}

.toy-shovel-blue {
    top: 20%;
    left: 45%;
    transform: rotate(-15deg);
    font-size: 4.5rem;
}

.toy-teddy-bear {
    top: 12%;
    right: 10%;
    font-size: 4.5rem;
    transform: rotate(5deg);
}

.toy-ball-orange {
    bottom: 15%;
    left: 20%;
    font-size: 4rem;
}

.toy-rake-green {
    bottom: 25%;
    left: 8%;
    transform: rotate(25deg);
    font-size: 4.5rem;
}

.toy-castle-main {
    top: 45%;
    left: 18%;
    font-size: 6rem;
}

/* INTERACTIVE SANDBOX EFFECTS */
.sand-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #F4D03F 0%, #E8B923 100%);
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.5s ease-out;
    z-index: 100;
}

.sand-trail {
    position: absolute;
    width: 30px;
    height: 4px;
    background: rgba(232, 185, 35, 0.4);
    border-radius: 2px;
    pointer-events: none;
    animation: fadeTrail 2s ease-out forwards;
}

@keyframes fadeTrail {
    to {
        opacity: 0;
        transform: scaleX(1.5);
    }
}

.sand-ripple {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(232, 185, 35, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: rippleExpand 0.6s ease-out forwards;
}

@keyframes rippleExpand {
    to {
        width: 100px;
        height: 100px;
        opacity: 0;
        border-width: 1px;
    }
}

.sparkle {
    position: absolute;
    font-size: 20px;
    pointer-events: none;
    z-index: 100;
}

.sandcastle-built {
    position: absolute;
    font-size: 40px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
    cursor: grab;
    z-index: 5;
}

/* Toy States */
.sandbox-reward .toy:active {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.sandbox-reward .toy.dragging {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
    z-index: 100 !important;
}

.sandbox-reward .toy {
    user-select: none;
    touch-action: none;
    /* Critical for dragging on mobile */
}

/* FARM ANIMAL DECORATIONS */
.plaas-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.farm-animal-deco {
    position: absolute;
    font-size: 4rem;
    pointer-events: none;
    will-change: transform;
}

/* Animal Animations */
.cow-deco {
    bottom: 25%;
    left: 5%;
    animation: graze 5s ease-in-out infinite;
}

.sheep-deco {
    bottom: 22%;
    right: 10%;
    animation: bounce-animal 4s ease-in-out infinite;
}

.chicken-deco {
    bottom: 18%;
    left: 35%;
    animation: peck 2s ease-in-out infinite;
    font-size: 2rem;
}

.pig-deco {
    bottom: 15%;
    right: 35%;
    animation: wiggle-animal 6s ease-in-out infinite;
    font-size: 3rem;
}

.horse-deco {
    bottom: 30%;
    left: 55%;
    animation: nod 4s ease-in-out infinite;
}

@keyframes graze {

    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }

    50% {
        transform: translateX(15px) rotate(2deg);
    }
}

@keyframes bounce-animal {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes peck {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(8px) rotate(-10deg);
    }
}

@keyframes wiggle-animal {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(2deg);
    }

    75% {
        transform: rotate(-2deg);
    }
}

@keyframes nod {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* INTERACTIVE FARM PLAY AREA */
.farm-play-area {
    position: relative;
    width: 95%;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    animation: zoomIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.farm-background {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 35%, #7CFC00 35%, #32CD32 60%, #228B22 100%);
    border-radius: 30px;
    border: 12px solid #5D4037;
    /* Dark wood border */
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    touch-action: none;
}

.farm-pond {
    position: absolute;
    bottom: 20px;
    right: 30px;
    width: 220px;
    height: 120px;
    background: radial-gradient(circle, #4FC3F7 0%, #039BE5 100%);
    border-radius: 50%;
    border: 4px solid #0288D1;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.farm-barn {
    position: absolute;
    top: 40%;
    left: 40px;
    font-size: 6rem;
    z-index: 1;
    filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.1));
}

.farm-field {
    position: absolute;
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 15px;
}

.field-north {
    top: 45%;
    left: 20%;
    width: 30%;
    height: 20%;
}

.field-south {
    bottom: 40px;
    left: 50px;
    width: 40%;
    height: 25%;
}

.farmer-char {
    position: absolute;
    font-size: 4rem;
    z-index: 100;
    transition: left 0.6s linear, top 0.6s linear;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
    pointer-events: none;
    user-select: none;
}

.animal-farm {
    position: absolute;
    font-size: 5rem;
    cursor: grab;
    z-index: 50;
    user-select: none;
    touch-action: none;
    transition: transform 0.2s;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2));
}

.animal-farm.dragging {
    transform: scale(1.15);
    z-index: 110;
    cursor: grabbing;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4));
}

.animal-farm.swimming {
    animation: swim-duck 2s ease-in-out infinite;
}

.food-item {
    position: absolute;
    font-size: 3rem;
    cursor: grab;
    z-index: 60;
    user-select: none;
    touch-action: none;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

/* Animations & Particles */
@keyframes swim-duck {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(-5deg);
    }

    75% {
        transform: translateY(5px) rotate(5deg);
    }
}

.water-ripple {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: ripple-water 0.8s ease-out forwards;
}

@keyframes ripple-water {
    to {
        width: 120px;
        height: 120px;
        opacity: 0;
        border-width: 1px;
    }
}

.heart-float {
    position: absolute;
    font-size: 2rem;
    pointer-events: none;
    z-index: 120;
    animation: heart-fade-up 1s ease-out forwards;
}

@keyframes heart-fade-up {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateY(-30px) scale(1.5);
        opacity: 1;
    }

    100% {
        transform: translateY(-60px) scale(1);
        opacity: 0;
    }
}

.farm-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-farm {
    padding: 12px 24px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 #388E3C;
    transition: transform 0.1s;
}

.btn-farm:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #388E3C;
}

/* SPEELPARK ZONE THEME */
.map-container.zone-speelpark {
    background: linear-gradient(to bottom,
            #1E90FF 0%,
            #87CEEB 20%,
            #FFD700 20%,
            #FF4500 25%,
            #32CD32 25%,
            #FFD700 30%,
            #FF4500 35%,
            #1E90FF 35%,
            #FFD700 40%,
            #32CD32 45%,
            #87CEEB 45%,
            #FFFFFF 100%);
    overflow-x: hidden;
}

.carnival-flags {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    height: 40px;
    background-image: repeating-linear-gradient(90deg,
            #FF0000,
            #FF0000 25px,
            #FFD700 25px,
            #FFD700 50px,
            #1E90FF 50px,
            #1E90FF 75px,
            #32CD32 75px,
            #32CD32 100px);
    clip-path: polygon(0% 100%, 2% 0%, 4% 100%, 6% 0%, 8% 100%, 10% 0%, 12% 100%, 14% 0%, 16% 100%, 18% 0%,
            20% 100%, 22% 0%, 24% 100%, 26% 0%, 28% 100%, 30% 0%, 32% 100%, 34% 0%, 36% 100%, 38% 0%,
            40% 100%, 42% 0%, 44% 100%, 46% 0%, 48% 100%, 50% 0%, 52% 100%, 54% 0%, 56% 100%, 58% 0%,
            60% 100%, 62% 0%, 64% 100%, 66% 0%, 68% 100%, 70% 0%, 72% 100%, 74% 0%, 76% 100%, 78% 0%,
            80% 100%, 82% 0%, 84% 100%, 86% 0%, 88% 100%, 90% 0%, 92% 100%, 94% 0%, 96% 100%, 98% 0%, 100% 100%);
    z-index: 5;
    pointer-events: none;
}

/* Merry-Go-Round */
.carousel-container {
    position: relative;
    width: 300px;
    height: 320px;
    margin: 60px auto 40px;
    z-index: 10;
}

.carousel-pole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 220px;
    background: linear-gradient(to bottom, #8B4513, #A0522D, #8B4513);
    border-radius: 10px;
    z-index: 2;
}

.carousel-platform {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFD700 0%, #FF8C00 30%, #8B4513 100%);
    border: 6px solid #FF4500;
    z-index: 1;
    transition: transform 0.5s ease-out;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.carousel-animal {
    position: absolute;
    font-size: 3.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
    pointer-events: none;
    transition: transform 0.2s;
}

/* Radial positions for 6 animals */
.ani-0 {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
}

.ani-1 {
    top: 25%;
    right: 5%;
}

.ani-2 {
    bottom: 25%;
    right: 5%;
}

.ani-3 {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
}

.ani-4 {
    bottom: 25%;
    left: 5%;
}

.ani-5 {
    top: 25%;
    left: 5%;
}

.carousel-riding .carousel-platform {
    animation: rotateCarousel 15s linear infinite;
}

.carousel-riding .carousel-animal {
    animation: bounceAnimal 1s ease-in-out infinite alternate;
}

@keyframes rotateCarousel {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes bounceAnimal {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-15px);
    }
}

.ride-button {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    background: linear-gradient(45deg, #FF4500, #FFD700);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 0 #E64A19;
    z-index: 20;
    white-space: nowrap;
}

.ride-button:active {
    transform: translateX(-50%) translateY(3px);
    box-shadow: 0 3px 0 #E64A19;
}

/* Lights */
.carnival-lights {
    position: absolute;
    top: 100px;
    left: 0;
    right: 0;
    height: 100px;
    pointer-events: none;
    z-index: 1;
}

.carnival-light {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: twinkle-light 1.5s infinite alternate;
}

@keyframes twinkle-light {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
        filter: blur(1px);
    }

    100% {
        opacity: 1;
        transform: scale(1.3);
        filter: blur(0);
    }
}

/* Balloons */
.balloon-deco {
    position: absolute;
    font-size: 3.5rem;
    cursor: pointer;
    z-index: 30;
    animation: floatBalloon 12s infinite ease-in-out;
    user-select: none;
}

@keyframes floatBalloon {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-150px) rotate(5deg);
    }
}

.balloon-deco.popped {
    animation: popBalloon 0.3s forwards;
}

@keyframes popBalloon {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.6);
        opacity: 0.5;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* DOLLHOUSE THEME */
.dollhouse-container {
    position: relative;
    width: 95%;
    max-width: 800px;
    margin: 40px auto;
    padding: 25px;
    background: #FFECB3;
    /* Warm sun-lit house */
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 8px solid #8B4513;
    z-index: 10;
}

.dollhouse-exterior {
    background: #FFF8E1;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    min-height: 500px;
}

.dollhouse-roof {
    width: 100%;
    height: 100px;
    background: linear-gradient(45deg, #B71C1C, #D32F2F);
    clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
}

.dollhouse-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 400px;
    background: #8B4513;
    gap: 10px;
    padding: 10px;
}

.room {
    position: relative;
    background: #FAF0E6;
    border-radius: 5px;
    transition: filter 0.4s ease, background-color 0.2s;
    overflow: hidden;
    touch-action: none;
}

.room-grid {
    width: 100%;
    height: 100%;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.room.lights-off {
    filter: brightness(0.4) saturate(0.8);
}

.room-label {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #8B4513;
    background: rgba(255, 255, 255, 0.7);
    padding: 1px 4px;
    border-radius: 3px;
    z-index: 5;
}

.living-room {
    background: #E1F5FE;
}

.kitchen {
    background: #F1F8E9;
}

.bedroom {
    background: #F3E5F5;
}

.bathroom {
    background: #E0F2F1;
}

.dollhouse-garden {
    height: 120px;
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
    border-top: 5px solid #388E3C;
    position: relative;
    padding: 10px;
}

/* Furniture Styles */
.furniture-toolbar {
    margin-top: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    border: 3px dashed #8B4513;
}

.furniture-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 10px;
}

.furniture-item {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    background: white;
    border: 2px solid #8B4513;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
}

.furniture-item:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.furniture-item:active {
    cursor: grabbing;
}

.furniture-item.selected {
    border: 4px solid #4CAF50 !important;
    background: rgba(76, 175, 80, 0.2) !important;
    transform: scale(1.15) !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5) !important;
}

.furniture-item.dragging {
    opacity: 0.5 !important;
    transform: scale(0.9) !important;
}

.furniture-item::after {
    content: attr(title);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 1000;
}

.furniture-item:hover::after {
    opacity: 1;
}

.dragging-visual {
    animation: floatDrag 0.5s infinite alternate;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

@keyframes floatDrag {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-5px);
    }
}

.room-grid.drag-over {
    background-color: rgba(255, 255, 0, 0.2) !important;
    border: 3px dashed #FFD700 !important;
}

@keyframes pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.placement-feedback {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: rgba(0, 255, 0, 0.4);
    border-radius: 50%;
    animation: pulse 0.5s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
}

.room-grid:hover {
    background: rgba(255, 255, 0, 0.1);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.dollhouse-hint {
    pointer-events: none;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.placed-furniture {
    position: absolute;
    font-size: 3rem;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: move;
    z-index: 10;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    user-select: none;
    touch-action: none;
    transition: transform 0.2s ease, left 0.1s ease, top 0.1s ease;
}

.placed-furniture:hover {
    transform: scale(1.1);
    z-index: 20;
}

.placed-furniture.dragging {
    z-index: 1000 !important;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.5));
    transform: scale(1.1);
}

/* Lighting Controls */
.lighting-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.light-btn {
    padding: 10px;
    border: none;
    border-radius: 15px;
    background: #FFD54F;
    color: #8B4513;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 #FBC02D;
}

.light-btn.off {
    background: #90A4AE;
    box-shadow: 0 4px 0 #546E7A;
    color: white;
}

.house-controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-control {
    padding: 12px 24px;
    background: #607D8B;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 #455A64;
    transition: transform 0.1s;
}

.btn-control:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #455A64;
}

.furniture-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    width: 100%;
}

.category {
    background: white;
    padding: 10px;
    border-radius: 15px;
    border: 2px solid #D2B48C;
}

.category h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #8B4513;
    text-align: center;
    border-bottom: 1px solid #EEE;
    padding-bottom: 5px;
}

/* ========== CRITICAL FIXES ========== */

/* 1. PROTECT LEARNING ACTIVITIES FROM CLASSROOM STYLES */
.learning-activities-container {
    position: relative !important;
    z-index: 1000 !important;
    background: white !important;
    border-radius: 15px !important;
    padding: 20px !important;
    margin-bottom: 30px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    isolation: isolate !important;
    /* Prevent style leakage */
}

/* Force reset zone-item styles */
.learning-activities-container .map-node {
    all: unset !important;
    width: 80px !important;
    height: 80px !important;
    background: white !important;
    border: 2px solid #2196F3 !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    font-weight: bold !important;
    color: #333 !important;
    margin: 10px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    z-index: 10 !important;
    cursor: pointer !important;
}

.learning-activities-container .map-node.completed {
    background: #FFD93D !important;
    border-color: #FFC107 !important;
    box-shadow: 0 0 20px rgba(255, 200, 0, 0.4) !important;
    z-index: 20 !important;
}

.learning-activities-container .map-node .char {
    font-size: 2.5rem !important;
    font-weight: bold !important;
}

/* 2. VISUAL SEPARATOR */
.zone-separator {
    height: 3px;
    background: linear-gradient(90deg, #4CAF50, #2196F3, #FF9800);
    margin: 40px 0;
    position: relative;
    border-radius: 2px;
}

.zone-separator span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 20px;
    color: #4CAF50;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

/* 3. CLASSROOM STYLES (ISOLATED) */
.classroom-play-area {
    position: relative;
    z-index: 1;
    /* Below learning activities */
    background: #F9F9F9;
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
    border: 3px solid #4CAF50;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Prevent classroom styles from leaking out */
.classroom-play-area * {
    box-sizing: border-box;
}

.classroom-play-area .play-header {
    text-align: center;
    margin-bottom: 25px;
}

.classroom-play-area h3 {
    color: #2196F3;
    margin: 0 0 10px 0;
}

.classroom-play-area .instructions {
    color: #666;
    font-style: italic;
    margin: 0;
}

/* Chalkboard */
.simple-chalkboard {
    background: #2E7D32;
    border: 15px solid #5D4037;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.chalkboard-surface {
    background: #2E7D32;
    height: 200px;
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: crosshair;
    overflow: hidden;
    touch-action: none;
}

.default-text {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.chalk-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}

.chalk-btn,
.eraser-btn,
.clear-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: white;
    border: 2px solid #ddd;
    transition: all 0.2s;
}

.chalk-btn.active {
    border: 3px solid #FFD700;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.chalk-btn:hover,
.eraser-btn:hover,
.clear-btn:hover {
    transform: scale(1.05);
}

/* FIXED: Blue chalk button */
.chalk-btn[data-color="blue"] {
    color: #2196F3;
}

/* Grid */
.classroom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
    background: #FFF8E1;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #FFD54F;
}

.grid-cell {
    aspect-ratio: 1;
    background: white;
    border: 2px dashed #BDBDBD;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    min-height: 100px;
}

.grid-cell:hover {
    background: #F1F8E9;
    border-color: #8BC34A;
}

/* Toolbar */
.simple-toolbar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #2196F3;
}

.toolbar-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.tool-item {
    width: 60px;
    height: 60px;
    background: white;
    border: 2px solid #607D8B;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background: #E3F2FD;
    border-color: #2196F3;
}

/* Controls */
.classroom-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.reset-btn,
.save-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.reset-btn:hover,
.save-btn:hover {
    transform: scale(1.05);
}

.reset-btn {
    background: linear-gradient(45deg, #ff4444, #ff8888);
    color: white;
}

.save-btn {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: white;
}

/* Chalk marks */
.chalk-mark {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0.9;
    pointer-events: none;
}

/* Classroom items */
.classroom-item {
    font-size: 40px;
    cursor: grab;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.classroom-item:hover {
    transform: scale(1.1);
    cursor: grabbing;
}

/* Animation for messages */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Huis Zone Refined Aesthetic (User Requested Theme) */
.huis-container.single-scroll-view {
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: #FDF5E6;
    /* Old Lace background */
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* Huis Sections */
.huis-section {
    padding: 20px;
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.section-header h2 {
    color: #8B4513;
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 1px 1px 0 white;
}

.section-header p {
    color: #556B2F;
    font-weight: 600;
}

.dollhouse-top-section {
    background: linear-gradient(180deg, #E0F7FA 0%, #FDF5E6 100%);
    border-bottom: 4px dashed #D2B48C;
    padding-bottom: 40px;
}

/* Learning Area Styling */
.huis-learning-area {
    padding: 40px 20px 100px;
}

.area-intro {
    text-align: center;
    margin-bottom: 40px;
}

.area-intro h2 {
    color: #8B4513;
    font-size: 2rem;
    background: white;
    display: inline-block;
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.learning-section {
    margin-bottom: 60px;
    background: white;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    border: 2px solid #F5F5DC;
}

.learning-section .group-header {
    margin-top: 0 !important;
    margin-bottom: 25px !important;
    font-size: 1.5rem;
    color: #8B4513 !important;
    border-bottom: 3px solid #D2B48C !important;
}

/* Alphabet Horizontal Flow */
.horizontal-flow {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

/* Horizontal Flow for all Learning Sections */
.alphabet-grid.horizontal-flow,
.numbers-grid.horizontal-flow,
.items-flow.horizontal-flow {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding: 10px;
}

/* Unified Card Style for Letters, Numbers, and Words */
.letter-card {
    width: 130px;
    min-height: 180px;
    background: #FFF;
    border: 5px solid #DAA520;
    border-radius: 20px;
    box-shadow: 0 8px 0 rgba(218, 165, 32, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 15px 10px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 100;
    /* Ensure it stays above background elements */
}

.letter-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 25px rgba(218, 165, 32, 0.3);
    z-index: 101;
}

.letter-card.completed {
    border-color: #4CAF50;
    background: #F1F8E9;
}

/* Specific Word Card Styling with Images */
.word-card {
    width: 160px;
    min-height: 220px;
    border-color: #4682B4;
}

.word-icon-top {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.word-image-container {
    width: 100%;
    min-height: 80px;
    background: #F0F8FF;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
    overflow: hidden;
    border: 2px dashed #B0C4DE;
}

.word-image-container img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.word-text {
    font-size: 1.2rem;
    font-weight: 800;
    color: #2F4F4F;
    margin-bottom: 10px;
}

/* Number Card Styling */
.number-card {
    width: 110px;
    min-height: 150px;
    border-color: #6A5ACD;
    /* SlateBlue for numbers */
}

.number-card .number-val {
    font-size: 3rem;
    font-weight: 900;
    color: #483D8B;
}

/* Improved Speak Button */
.btn-speak {
    width: 100%;
    background: #FF7043;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 #D84315;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.1s;
    z-index: 10;
}

.btn-speak:active {
    transform: translateY(3px);
    box-shadow: none;
}

.btn-speak:hover {
    background: #FF8A65;
}

/* Legacy UI Cleanups */
.number-item {
    display: none;
}

/* Replaced by number-card */

/* Dollhouse Container Fixes for Single View */
.dollhouse-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 900px) {
    .dollhouse-container {
        grid-template-columns: 1.2fr 1fr;
        /* House on left, toolbar on right */
        align-items: start;
    }
}

.dollhouse-exterior {
    margin: 0 auto;
    width: 100%;
    max-width: 500px;
}

.tab-content {
    display: none;
}

/* Cleanup legacy */
.tab-content.active {
    display: block;
}

/* Animations */

@keyframes pulse-highlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px 10px rgba(255, 235, 59, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0);
    }
}

.pulse-active {
    animation: pulse-highlight 0.6s ease-out;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.anim-bounce {
    animation: bounce 0.5s ease;
}

.huis-learning-area .map-node {
    background: #8B4513;
    color: white;
    border-color: #D2B48C;
}

.huis-learning-area .map-node.completed {
    background: #DAA520;
    color: #8B4513;
}