/* ══════════════════════════════════════════════════════════════
   SUNBEAM CURRENCY - Large Sun Character
   1930s cartoon style sun positioned to straddle sky and grass
   ══════════════════════════════════════════════════════════════ */

.sunbeam-counter {
    position: absolute;
    /* Fixed position in normal mode. weather_test=1 overrides via JS */
    top: 12%;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 50;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.sunbeam-counter:hover {
    transform: scale(1.05);
}

.sunbeam-counter:active {
    transform: scale(0.98);
}

/* Warm glow behind the sun */
.sunbeam-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    background: radial-gradient(circle,
        rgba(255, 220, 100, 0.5) 0%,
        rgba(255, 180, 50, 0.3) 40%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* The sun character - 20% smaller than before (140px -> 112px) */
.sunbeam-icon {
    width: 112px;
    height: 112px;
    object-fit: contain;
    position: relative;
    filter: drop-shadow(0 0 16px rgba(255, 200, 0, 0.7));
    animation: sun-pulse 3s ease-in-out infinite;
}

@keyframes sun-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 200, 0, 0.7));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(255, 200, 0, 0.9));
        transform: scale(1.03);
    }
}

/* Moon icon - dedicated moon_icon.webp asset */
.moon-icon {
    width: 112px;
    height: 112px;
    object-fit: contain;
    position: relative;
    filter: drop-shadow(0 0 16px rgba(180, 200, 255, 0.7));
    animation: moon-pulse 4s ease-in-out infinite;
    display: none; /* Toggled by weather.js */
}

@keyframes moon-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 16px rgba(180, 200, 255, 0.6));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 24px rgba(180, 200, 255, 0.9));
        transform: scale(1.02);
    }
}

/* Moon glow - silver/blue radial instead of golden */
.sunbeam-glow.moon-glow {
    background: radial-gradient(circle,
        rgba(180, 200, 255, 0.4) 0%,
        rgba(140, 170, 230, 0.25) 40%,
        transparent 70%
    );
}

/* ══════════════════════════════════════════════════════════════
   SKY CLOUD OVERLAY - Partially covers sun/moon when cloudy
   ══════════════════════════════════════════════════════════════ */

.sky-cloud {
    position: absolute;
    /* Offset from the sun/moon center */
    top: -10px;
    left: 50%;
    transform: translateX(-30%);
    width: 140px;
    height: 70px;
    pointer-events: none;
    z-index: 51;
    opacity: 0;
    transition: opacity 1s ease;
}

.sky-cloud.visible {
    opacity: 1;
}

/* Cloud shape using CSS */
.sky-cloud-body {
    position: relative;
    width: 100%;
    height: 50px;
    background: #c8c8c8;
    border-radius: 25px;
    top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sky-cloud-body::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background: #c8c8c8;
    border-radius: 50%;
    top: -25px;
    left: 20px;
}

.sky-cloud-body::after {
    content: '';
    position: absolute;
    width: 36px;
    height: 36px;
    background: #c8c8c8;
    border-radius: 50%;
    top: -18px;
    left: 60px;
}

/* Rain drops from cloud */
.sky-cloud-rain {
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 30px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.sky-cloud.raining .sky-cloud-rain {
    opacity: 1;
}

.sky-cloud-rain::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent 0px,
        transparent 6px,
        rgba(150, 180, 220, 0.5) 6px,
        rgba(150, 180, 220, 0.5) 8px
    );
    animation: cloud-rain-fall 0.4s linear infinite;
}

@keyframes cloud-rain-fall {
    from { transform: translateY(-8px); }
    to { transform: translateY(0px); }
}

/* Sunbeam amount badge - positioned below sun */
.sunbeam-amount {
    background: linear-gradient(180deg, #f8f0e0 0%, #ece0c8 100%);
    font-size: 16px;
    font-weight: bold;
    color: #5a4010;
    padding: 6px 14px;
    border-radius: 14px;
    border: 3px solid #8b7355;
    box-shadow: 0 3px 8px rgba(40, 30, 20, 0.3);
    min-width: 36px;
    text-align: center;
    margin-top: 4px;
}

/* Bounce animation when earning */
.sunbeam-counter.earning {
    animation: counter-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes counter-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* +N indicator when earning */
.sunbeam-plus {
    position: absolute;
    top: 0;
    right: 0;
    background: #2d6e33;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 10px;
    border: 2px solid #1f5424;
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
}

.sunbeam-plus.show {
    animation: plus-pop 1.5s ease-out forwards;
}

@keyframes plus-pop {
    0% { opacity: 0; transform: translateY(5px) scale(0.5); }
    20% { opacity: 1; transform: translateY(-10px) scale(1.1); }
    40% { transform: translateY(-15px) scale(1); }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* ══════════════════════════════════════════════════════════════
   FLOATING SUNBEAM ANIMATION (when earning)
   ══════════════════════════════════════════════════════════════ */

.floating-sunbeam {
    position: absolute;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #ffd700 0%, #ffb800 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 60;
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.8);
}

.floating-sunbeam.animate {
    animation: float-to-counter 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes float-to-counter {
    0% {
        opacity: 1;
        transform: scale(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) translate(var(--end-x), var(--end-y));
    }
}

/* ══════════════════════════════════════════════════════════════
   SUNBEAM BURST - Appears on milestones
   ══════════════════════════════════════════════════════════════ */

.sunbeam-burst {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    background: radial-gradient(circle at 85% 25%,
        rgba(255, 255, 200, 0.6) 0%,
        rgba(255, 220, 100, 0.3) 30%,
        transparent 60%
    );
}

.sunbeam-burst.active {
    animation: sunbeam-fade 3s ease-out forwards;
}

@keyframes sunbeam-fade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}
