/* Font for Kids Theme */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;700&display=swap');

:root {
    --kids-blue: #00d4ff;
    --kids-purple: #9b59b6;
    --kids-yellow: #f1c40f;
    --kids-green: #2ecc71;
    --kids-red: #e74c3c;
    --kids-bg: #f9f9f9;
}

body.kids-theme {
    font-family: 'Nunito', sans-serif;
    background-color: #fff;
    color: #333;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.kids-font {
    font-family: 'Fredoka One', cursive;
    color: var(--kids-purple);
}

/* HERO SECTION */
.kids-hero {
    position: relative;
    width: 100%;
    height: 80vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kids-hero video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.kids-hero-overlay {
    background: rgba(0, 0, 0, 0.3);
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.kids-hero h1 {
    font-size: 4rem;
    color: #fff;
    text-shadow: 3px 3px 0px var(--kids-purple);
    margin: 0;
    letter-spacing: 2px;
}

.kids-hero p {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 10px;
}

/* PRODUCT SECTION */
.kids-products {
    padding: 60px 20px;
    background: #fff url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="10" fill="%23f0f0f0" opacity="0.5"/></svg>') repeat;
    text-align: center;
}

.kids-products h2 {
    font-size: 3rem;
    color: var(--kids-blue);
    margin-bottom: 40px;
}

.kids-prod-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.kids-prod-card {
    background: #fff;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    border: 3px dashed var(--kids-yellow);
    max-width: 350px;
}

.kids-prod-card:hover {
    transform: translateY(-10px) rotate(2deg);
}

.kids-prod-card img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    margin-bottom: 20px;
}

.kids-prod-card h3 {
    font-size: 1.5rem;
    color: var(--kids-green);
}

.kids-prod-card p {
    color: #666;
    font-size: 1.1rem;
}

/* GAMES SECTION */
.kids-games {
    padding: 60px 20px;
    background: #eef9ff;
    text-align: center;
}

.game-container {
    background: #fff;
    border-radius: 30px;
    padding: 30px;
    margin: 40px auto;
    max-width: 1000px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 4px solid var(--kids-purple);
    position: relative;
    overflow: hidden;
}

.game-title {
    font-size: 2.5rem;
    color: var(--kids-red);
    margin-bottom: 20px;
}

/* Coloring Game */
.coloring-tools {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    cursor: pointer;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.color-btn:hover,
.color-btn.active {
    transform: scale(1.2);
    border-color: #333;
}

#drawingCanvas {
    border: 3px solid #ccc;
    border-radius: 10px;
    cursor: crosshair;
    background: #fff;
    touch-action: none;
}

.canvas-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-kids {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    color: #fff;
    transition: transform 0.2s;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
}

.btn-kids:active {
    transform: translateY(3px);
    box-shadow: none;
}

.btn-save {
    background: var(--kids-green);
}

.btn-send {
    background: var(--kids-blue);
}

.btn-clear {
    background: var(--kids-red);
}

/* Word Search */
#wordSearchGrid {
    display: grid;
    gap: 5px;
    justify-content: center;
    margin: 20px auto;
    user-select: none;
}

.ws-cell {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid var(--kids-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    font-family: 'Fredoka One';
    cursor: pointer;
    transition: 0.2s;
}

.ws-cell.selected {
    background: var(--kids-yellow);
    color: #fff;
}

.ws-cell.found {
    background: var(--kids-green);
    color: #fff;
    border-color: var(--kids-green);
}

.ws-words {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.ws-word {
    padding: 5px 15px;
    background: #ddd;
    border-radius: 15px;
    font-weight: bold;
}

.ws-word.found {
    background: var(--kids-green);
    color: #fff;
    text-decoration: line-through;
}

/* Spot 7 Errors */
.errors-game {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.error-img-container {
    position: relative;
    width: 400px;
    height: 300px;
    background: #fff;
    border: 3px solid #333;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.error-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Changed to contain to fit standard images */
}

.error-spot {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--kids-red);
    display: none;
    pointer-events: none;
    /* Let clicks pass through to container logic if needed, or handle on spot */
    transform: translate(-50%, -50%);
    /* Center on coordinate */
}

.error-spot.found {
    display: block;
}

/* Maze */
#mazeCanvas {
    background: #fff;
    border: 3px solid var(--kids-blue);
    border-radius: 10px;
}

@media(max-width: 768px) {
    .kids-hero h1 {
        font-size: 2.5rem;
    }

    .color-btn {
        width: 30px;
        height: 30px;
    }

    .ws-cell {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

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

/* Difficulty Badges */
.game-desc {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.badge {
    padding: 5px 15px;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}

.badge.easy {
    background-color: #2ecc71;
    /* Green */
}

.badge.medium {
    background-color: #f39c12;
    /* Orange */
}

.badge.hard {
    background-color: #e74c3c;
    /* Red */
}

@media(max-width: 768px) {
    .game-desc {
        flex-direction: column;
        gap: 5px;
    }
}