:root {
    --bg-top: #0f0c29;
    --bg-bot: #302b63;
    --leaf-color: #1a4d2e;
    --ground-color: #020202;
    --particle-color: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Lora', serif;
    background: #000;
    transition: all 1.5s ease;
    perspective: 1000px;
}

.scene {
    position: relative;
    width: 100%;
    height: 100%;
    transform: scale(1.05);
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* --- 2. BẦU TRỜI & THIÊN THỂ --- */
.sky-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--bg-top), var(--bg-bot));
    transition: background 1.5s ease;
    z-index: 0;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(white, rgba(255, 255, 255, .2) 2px, transparent 3px),
        radial-gradient(white, rgba(255, 255, 255, .15) 1px, transparent 2px);
    background-size: 550px 550px, 350px 350px;
    background-position: 0 0, 40px 60px;
    opacity: 0.8;
    z-index: 1;
    animation: twinkle 4s infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.celestial-body {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #fdfbf7;
    top: 15%;
    right: 20%;
    box-shadow: 0 0 60px 20px rgba(255, 255, 255, 0.3);
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
}

/* --- 3. ĐỊA HÌNH & CÂY --- */
.mountains {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40%;
    z-index: 3;
    pointer-events: none;
}

.mountain {
    position: absolute;
    bottom: 0;
    background: #141426;
    border-radius: 100% 100% 0 0;
    opacity: 0.8;
}

.m-1 {
    width: 70%;
    height: 50%;
    left: -10%;
}

.m-2 {
    width: 80%;
    height: 80%;
    right: -20%;
    opacity: 0.6;
}

.hill {
    position: absolute;
    bottom: -120px;
    left: -10%;
    width: 120%;
    height: 350px;
    background: var(--ground-color);
    border-radius: 50% 50% 0 0;
    z-index: 10;
    transition: background 1.5s ease;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.5);
}

.tree-container {
    position: absolute;
    bottom: 180px;
    left: 20%;
    z-index: 11;
    transform: scale(1.3);
    transform-origin: bottom center;
}

.trunk {
    width: 24px;
    height: 220px;
    background: #050505;
    border-radius: 5px;
    position: relative;
}

.branch {
    position: absolute;
    background: #050505;
    border-radius: 5px;
}

.b-1 {
    top: 70px;
    left: -40px;
    width: 50px;
    height: 10px;
    transform: rotate(-35deg);
}

.b-2 {
    top: 50px;
    right: -30px;
    width: 40px;
    height: 8px;
    transform: rotate(30deg);
}

.b-3 {
    top: 10px;
    left: -10px;
    width: 20px;
    height: 50px;
    transform: rotate(-15deg);
}

.leaves-group {
    position: absolute;
    top: -100px;
    left: -70px;
    width: 180px;
    height: 180px;
    transform-origin: bottom center;
    transition: opacity 1s, transform 1s;
    animation: swayTree 4s ease-in-out infinite alternate;
}

@keyframes swayTree {
    0% {
        transform: rotate(-2deg);
    }

    100% {
        transform: rotate(2deg);
    }
}

.leaf {
    position: absolute;
    background: var(--leaf-color);
    border-radius: 50%;
    transition: background 1.5s;
}

.l-1 {
    width: 120px;
    height: 120px;
    top: 0;
    left: 20px;
}

.l-2 {
    width: 90px;
    height: 90px;
    top: 40px;
    left: -20px;
}

.l-3 {
    width: 100px;
    height: 100px;
    top: 30px;
    right: -10px;
}

/* --- 4. NHÂN VẬT & UI --- */
.character {
    position: absolute;
    bottom: 200px;
    left: 28%;
    z-index: 12;
    transform: scale(0.9);
    opacity: 0.9;
}

.head {
    width: 24px;
    height: 24px;
    background: #000;
    border-radius: 50%;
    margin-left: 6px;
}

.body {
    width: 36px;
    height: 50px;
    background: #000;
    border-radius: 18px 18px 0 0;
    margin-top: -2px;
}

.ui-layer {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #e0e0e0;
    pointer-events: none;
}

.time {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.date {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.quote {
    font-size: 1.2rem;
    margin-bottom: 5px;
    text-align: center;
    font-style: italic;
}

.season-tag {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.7;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 10px;
    margin-top: 10px;
}

.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 40%, #000 100%);
    z-index: 20;
    opacity: 0.7;
    pointer-events: none;
}

/* --- 5. HỆ THỐNG HẠT (Particles) --- */
#particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    top: -20px;
    background: var(--particle-color);
    border-radius: 50%;
    opacity: 0.8;
    pointer-events: none;
}

@keyframes fallDown {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* --- CÁC CLASS MÙA (THEME) --- */
body.winter {
    --bg-top: #0b1023;
    --bg-bot: #2b32b2;
    --ground-color: #cfd9df;
    --particle-color: #fff;
}

body.winter .leaves-group {
    opacity: 0;
}

body.winter .hill {
    background: linear-gradient(to top, #cfd9df, #a1c4fd);
}

body.autumn {
    --bg-top: #3e5151;
    --bg-bot: #decba4;
    --leaf-color: #d35400;
    --particle-color: #e67e22;
    --ground-color: #1a1a1a;
}

body.spring {
    --bg-top: #2c3e50;
    --bg-bot: #bdc3c7;
    --leaf-color: #ff9a9e;
    --particle-color: #fad0c4;
    --ground-color: #0f2027;
}

body.summer {
    --bg-top: #000428;
    --bg-bot: #004e92;
    --leaf-color: #004d00;
    --ground-color: #000;
}

/* --- Controls & Music Button --- */
.controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    pointer-events: auto;
    display: flex;
    gap: 10px;
}

.btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 12px;
    transition: all 0.3s;
}

.btn:hover {
    background: white;
    color: black;
}

.music-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50px;
    font-size: 14px;
    pointer-events: auto;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}