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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8a8 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#back-btn {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 12px;
    transition: background 0.2s;
}

#back-btn:hover {
    background: rgba(255,255,255,0.35);
}

#star-area {
    font-size: 1.8rem;
}

#prompt {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    text-align: center;
}

/* === Scene area === */

#scene-area {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
}

/* === Colour objects === */

.colour-object {
    position: absolute;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.15s;
}

.colour-object:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.colour-object:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.colour-object.coloured {
    cursor: default;
}

.colour-object.coloured:hover {
    transform: translate(-50%, -50%) scale(1);
}

/* Pop animation */

@keyframes pop-anim {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.colour-object.pop {
    animation: pop-anim 0.3s ease-out;
}

/* === Progress dots === */

#progress-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.progress-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.6);
    transition: all 0.2s;
}

.progress-dot.filled {
    background: white;
    border-color: white;
    transform: scale(1.2);
}

/* === Colour palette === */

#palette {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.palette-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.4);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

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

.palette-btn.selected {
    border: 4px solid white;
    box-shadow: 0 0 12px rgba(255,255,255,0.6);
    transform: scale(1.15);
}

/* === Next button === */

#next-btn {
    background: white;
    color: #00b894;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 14px 36px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

#next-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

#next-btn:active {
    transform: scale(0.97);
}

/* === Celebration overlay === */

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: rgba(0,0,0,0.3);
}

#overlay.hidden {
    display: none;
}

#overlay-content {
    background: white;
    border-radius: 30px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.25);
    animation: bounce-in 0.4s ease-out;
    z-index: 101;
}

#overlay-message {
    font-size: 2.5rem;
    font-weight: 700;
    color: #00b894;
}

@keyframes bounce-in {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

/* === Confetti === */

#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
}

.confetti-piece {
    position: absolute;
    width: 12px;
    height: 12px;
    top: -20px;
    border-radius: 3px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* === Session break overlay === */

#break-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    background: rgba(0,0,0,0.4);
}

#break-overlay.hidden {
    display: none;
}

#break-content {
    background: white;
    border-radius: 30px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.25);
    animation: bounce-in 0.4s ease-out;
    max-width: 350px;
}

.break-character {
    font-size: 4rem;
    margin-bottom: 10px;
}

.break-message {
    font-size: 1.5rem;
    font-weight: 600;
    color: #00b894;
    margin-bottom: 20px;
    line-height: 1.4;
}

#break-dismiss {
    font-size: 1.3rem;
    padding: 12px 30px;
    min-height: auto;
}

/* === Answer/Break button styles (for session break dismiss) === */

.answer-btn {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 14px 30px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.answer-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.answer-btn:active {
    transform: scale(0.97);
}

.btn-color-1 {
    background: #0984e3;
}

/* === Hidden utility === */

.hidden {
    display: none !important;
}

/* === Responsive === */

@media (max-width: 400px) {
    .colour-object {
        width: 55px;
        height: 55px;
    }

    .palette-btn {
        width: 44px;
        height: 44px;
    }

    #prompt {
        font-size: 1.5rem;
    }

    .progress-dot {
        width: 16px;
        height: 16px;
    }

    #next-btn {
        font-size: 1.2rem;
        padding: 12px 28px;
    }
}
