/* ============================================
   CLOUD KEEPER — Gentle Sky Play | PNEUOMA
   The gentlest game for the youngest players
   ============================================ */

:root {
    /* Soft Pastel Sky */
    --sky-top: #87CEEB;
    --sky-bottom: #E0F4FF;
    --sky-sunset: #FFB6C1;
    --sky-dawn: #FFEFD5;
    
    /* Cloud Colors */
    --cloud-white: #FFFFFF;
    --cloud-shadow: #E8E8E8;
    --cloud-highlight: #FFF;
    
    /* Sun Colors */
    --sun-yellow: #FFD93D;
    --sun-orange: #FF9F45;
    --sun-glow: rgba(255, 217, 61, 0.4);
    
    /* UI Colors */
    --text-dark: #4A5568;
    --text-light: #718096;
    --accent-pink: #FF6B9D;
    --accent-purple: #9F7AEA;
    --accent-blue: #63B3ED;
    
    /* Soft Shadows */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'SF Pro Rounded', 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
    color: var(--text-dark);
    line-height: 1.5;
}

/* Game Container */
.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Navigation */
.game-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
}

.back-link {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.9);
}

.cloud-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    font-weight: 600;
}

.cloud-count {
    font-size: 1.2rem;
    color: var(--accent-blue);
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* ========== TITLE SCREEN ========== */
.title-screen {
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

.sky-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sun {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: var(--sun-yellow);
    border-radius: 50%;
    box-shadow: 0 0 60px var(--sun-glow), 0 0 100px var(--sun-glow);
    animation: sun-pulse 4s ease-in-out infinite;
}

@keyframes sun-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 60px var(--sun-glow); }
    50% { transform: scale(1.05); box-shadow: 0 0 80px var(--sun-glow); }
}

.floating-cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    animation: float 8s ease-in-out infinite;
}

.cloud-1 {
    width: 120px;
    height: 50px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.cloud-2 {
    width: 150px;
    height: 60px;
    top: 35%;
    right: 20%;
    animation-delay: -2s;
}

.cloud-3 {
    width: 100px;
    height: 40px;
    bottom: 30%;
    left: 25%;
    animation-delay: -4s;
}

.floating-cloud::before,
.floating-cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.floating-cloud::before {
    width: 50%;
    height: 100%;
    top: -40%;
    left: 20%;
}

.floating-cloud::after {
    width: 40%;
    height: 80%;
    top: -30%;
    right: 25%;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-10px) translateX(5px); }
    75% { transform: translateY(10px) translateX(-5px); }
}

.title-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.title-cloud {
    margin-bottom: 20px;
}

.big-cloud {
    width: 200px;
    height: 120px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    animation: cloud-bounce 3s ease-in-out infinite;
}

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

.game-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    text-shadow: 2px 2px 0 white;
    margin-bottom: 8px;
}

.game-tagline {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.title-description {
    margin-bottom: 30px;
}

.title-description p {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Buttons */
.btn-start {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(159, 122, 234, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-start:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(159, 122, 234, 0.5);
}

.btn-cloud {
    font-size: 1.5rem;
    animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.btn-secondary {
    display: inline-block;
    padding: 14px 30px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-dark);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: white;
    transform: translateY(-2px);
}

.title-footer {
    display: flex;
    gap: 12px;
    margin-top: 40px;
}

.badge {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ========== HOW TO PLAY SCREEN ========== */
.howto-screen {
    background: linear-gradient(180deg, var(--sky-dawn) 0%, var(--sky-bottom) 100%);
}

.howto-content {
    text-align: center;
    padding: 20px;
    max-width: 400px;
}

.howto-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 30px;
}

.howto-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    font-size: 3rem;
}

.demo-face {
    animation: blow-face 2s ease-in-out infinite;
}

@keyframes blow-face {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.demo-wind {
    animation: wind-blow 2s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes wind-blow {
    0% { transform: translateX(0); opacity: 0; }
    50% { transform: translateX(20px); opacity: 1; }
    100% { transform: translateX(40px); opacity: 0; }
}

.demo-cloud {
    animation: cloud-move 2s ease-in-out infinite;
}

@keyframes cloud-move {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(30px); }
}

.howto-text {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.howto-subtext {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.control-choice {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 30px;
    background: white;
    border: 3px solid var(--accent-blue);
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-choice:hover {
    background: var(--accent-blue);
    color: white;
    transform: scale(1.02);
}

.choice-icon {
    font-size: 1.5rem;
}

/* ========== GAME SCREEN ========== */
.game-screen {
    background: transparent;
}

#skyCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Breath Bubble */
.breath-bubble {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    z-index: 50;
    overflow: hidden;
}

.bubble-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    transition: height 0.1s ease;
    border-radius: 50%;
}

.bubble-emoji {
    position: relative;
    z-index: 2;
    font-size: 2.5rem;
}

.breath-bubble.blowing .bubble-emoji {
    animation: blow-emoji 0.5s ease-in-out infinite;
}

@keyframes blow-emoji {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Encouragement */
.encouragement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    padding: 20px 40px;
    background: white;
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
}

.encouragement.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.encourage-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-purple);
}

/* Stars Found */
.stars-found {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 50;
}

.star {
    font-size: 2rem;
    opacity: 0.3;
    transition: all 0.5s ease;
    filter: grayscale(1);
}

.star.found {
    opacity: 1;
    filter: grayscale(0);
    animation: star-pop 0.5s ease;
}

@keyframes star-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Pause Button */
.btn-pause {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.btn-pause:hover {
    background: white;
    transform: scale(1.1);
}

/* ========== CELEBRATION SCREEN ========== */
.celebration-screen {
    background: linear-gradient(180deg, var(--sky-dawn) 0%, var(--sun-glow) 50%, var(--sky-bottom) 100%);
}

.celebration-content {
    text-align: center;
    padding: 20px;
}

.celebration-sun {
    position: relative;
    margin-bottom: 30px;
}

.sun-face {
    font-size: 6rem;
    animation: sun-spin 10s linear infinite;
}

@keyframes sun-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.celebration-title {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.celebration-message {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.celebration-stars {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.big-star {
    font-size: 3rem;
    animation: star-dance 1s ease-in-out infinite;
}

.big-star:nth-child(2) { animation-delay: 0.2s; }
.big-star:nth-child(3) { animation-delay: 0.4s; }

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

.clouds-moved {
    margin-bottom: 40px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-purple);
}

.stat-label {
    display: block;
    font-size: 1rem;
    color: var(--text-light);
}

.celebration-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .game-title {
        font-size: 2.5rem;
    }

    .btn-start {
        padding: 16px 30px;
        font-size: 1.1rem;
    }

    .howto-demo {
        font-size: 2.5rem;
    }

    .breath-bubble {
        width: 70px;
        height: 70px;
    }

    .bubble-emoji {
        font-size: 2rem;
    }
}

