/* --- Harvest Season Theme Variables --- */
:root {
    --sky-blue: #ade8f4;
    --hay-gold: #f4d35e;
    --hay-straw: #faf0ca;
    --dirt-path: #d4a373;
    --fence-brown: #8b5e3c;
    --paper-antique: #fdf0d5;
    --radiant-sun: #ffee32;
    --sun-glow-outer: rgba(255, 238, 50, 0.4);
    
    --hill-dark: #6e8d42;
    --hill-mid: #90be6d;
    --hill-light: #a7c957;
    
    --text-earth: #3d2b1f;
    --text-soft: #634d3e;
}

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

body {
    background-color: var(--sky-blue);
    color: var(--text-earth);
    font-family: 'Fredoka One', cursive;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- Natural Backdrop & Realism --- */
.harvest-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(var(--sky-blue) 0%, #e0f2f1 50%, var(--hill-light) 90%);
    overflow: hidden;
}

/* Radiant Floating Sun - Realistic Effects */
.sun {
    position: absolute;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, #fff 0%, var(--radiant-sun) 30%, #f9a825 70%);
    border-radius: 50%;
    top: 15vh;
    right: 15%;
    z-index: 5;
    animation: sun-float 8s ease-in-out infinite;
    box-shadow: 
        0 0 120px var(--radiant-sun), 
        0 0 250px var(--sun-glow-outer),
        inset 0 0 20px rgba(255, 255, 255, 0.8);
}

.sun-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 238, 50, 0.3) 0%, transparent 70%);
    top: 5vh;
    right: 8%;
    z-index: 1;
    animation: sun-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

/* Lens Flare / Rays */
.sun-flare {
    position: absolute;
    width: 1000px;
    height: 1000px;
    background: 
        conic-gradient(from 0deg, transparent 40deg, rgba(255, 255, 255, 0.05) 45deg, transparent 50deg),
        conic-gradient(from 120deg, transparent 40deg, rgba(255, 255, 255, 0.05) 45deg, transparent 50deg),
        conic-gradient(from 200deg, transparent 40deg, rgba(255, 255, 255, 0.05) 45deg, transparent 50deg);
    top: -200px;
    right: -200px;
    z-index: 4;
    animation: sun-rays-rotate 30s linear infinite;
    pointer-events: none;
}

@keyframes sun-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

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

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

/* Cloud Animations */
.cloud { position: absolute; background: #fff; border-radius: 50px; opacity: 0.9; filter: blur(2px); }
.c1 { width: 150px; height: 60px; top: 10%; left: 5%; animation: float-cloud 50s linear infinite; }
.c2 { width: 220px; height: 80px; top: 25%; left: 30%; animation: float-cloud 75s linear infinite; }
.c3 { width: 130px; height: 50px; top: 15%; left: 65%; animation: float-cloud 60s linear infinite; }

@keyframes float-cloud {
    from { margin-left: -30%; }
    to { margin-left: 130%; }
}

/* Animated Honeybees */
.bee-container { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.bee {
    position: absolute;
    width: 14px;
    height: 12px;
    background: #ffcc00;
    border-radius: 4px;
    border: 1px solid #111;
    box-shadow: inset -3px 0 0 #111, inset 3px 0 0 #111;
}
.bee::after {
    content: '';
    position: absolute;
    top: -5px; left: 3px;
    width: 8px; height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: wings-flap 0.1s linear infinite;
}

@keyframes wings-flap {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.4); }
}

/* Bee Varieties with Different Paths */
.bee.b1 { animation: bee-p1 15s linear infinite; top: 20%; left: 10%; }
.bee.b2 { animation: bee-p2 20s linear infinite; top: 40%; left: 50%; }
.bee.b3 { animation: bee-p3 18s linear infinite; top: 10%; left: 80%; }
.bee.b4 { animation: bee-p4 25s linear infinite; top: 60%; left: 30%; }
.bee.b5 { animation: bee-p1 22s linear infinite; top: 15%; left: 40%; animation-delay: -2s; }
.bee.b6 { animation: bee-p2 16s linear infinite; top: 80%; left: 70%; animation-delay: -4s; }

@keyframes bee-p1 {
    0% { transform: translate(0, 0) scaleX(1); }
    50% { transform: translate(300px, 100px) scaleX(1); }
    51% { transform: translate(300px, 100px) scaleX(-1); }
    100% { transform: translate(0, 0) scaleX(-1); }
}

@keyframes bee-p2 {
    0% { transform: translate(0, 0) scaleX(-1); }
    50% { transform: translate(-400px, -150px) scaleX(-1); }
    51% { transform: translate(-400px, -150px) scaleX(1); }
    100% { transform: translate(0, 0) scaleX(1); }
}

@keyframes bee-p3 {
    0% { transform: translate(0, 0) scaleX(1); }
    33% { transform: translate(100px, 150px) scaleX(1); }
    66% { transform: translate(-200px, 50px) scaleX(1); }
    100% { transform: translate(0, 0) scaleX(1); }
}

@keyframes bee-p4 {
    0% { transform: translate(0, 0) rotate(0); }
    100% { transform: rotate(360deg) translate(300px) rotate(-360deg); }
}

/* Realistic Multi-layered Hills */
.hill { position: absolute; bottom: 0; width: 120%; left: -10%; border-radius: 50% 50% 0 0; }
.h1 { height: 180px; background: var(--hill-dark); z-index: 5; bottom: -30px; }
.h2 { height: 210px; background: var(--hill-mid); z-index: 4; bottom: -50px; margin-left: 10%; }
.h3 { height: 250px; background: var(--hill-light); z-index: 3; bottom: -80px; margin-left: -15%; }

/* --- Application Layout --- */
.app-container {
    display: flex;
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    gap: 30px;
    z-index: 50;
    justify-content: center;
    align-items: center;
}

.harvest-panel {
    flex: 0 0 350px;
    background: var(--paper-antique);
    border: 8px solid var(--fence-brown);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    box-shadow: 12px 12px 0px rgba(0,0,0,0.1);
    height: 100%;
}

header h1 { font-family: 'Press Start 2P'; font-size: 1.4rem; color: var(--text-earth); line-height: 1.4; }
.tagline { color: var(--fence-brown); font-size: 0.8rem; margin-bottom: 5px; }

.stat-box { border: 4px solid var(--dirt-path); background: #fff; }

/* --- Hay Field Area --- */
.game-area {
    flex: 1;
    height: 100%;
    background: var(--hay-straw);
    border: 12px solid var(--fence-brown);
    border-radius: 24px;
    position: relative;
    box-shadow: inset 0 0 60px rgba(139, 94, 60, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-wrapper { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 20px; 
    position: relative;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    border: 4px solid rgba(139, 94, 60, 0.1);
}

/* --- Banner Overlay - Fixed --- */
.banner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(139, 94, 60, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.banner-overlay.hidden { display: none; }

.banner-content {
    background: var(--paper-antique);
    padding: 60px;
    border-radius: 30px;
    text-align: center;
    border: 10px solid var(--hay-gold);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: banner-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.banner-content h2 { font-family: 'Press Start 2P'; color: var(--text-earth); font-size: 1.4rem; margin-bottom: 20px; }
.banner-content p { font-size: 1.2rem; color: var(--text-soft); margin-bottom: 30px; }

.harvest-btn {
    background: var(--hay-gold);
    border: none;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 6px 0 var(--fence-brown);
    cursor: pointer;
}

.harvest-btn .btn-face { background: #fff; padding: 15px; border-radius: 4px; font-family: 'Press Start 2P'; font-size: 0.85rem; color: var(--text-earth); }
.harvest-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--fence-brown); }

@keyframes banner-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 1000px) { .app-container { flex-direction: column; height: auto; } .harvest-panel, .game-area { width: 100%; height: auto; } }
