body {
    margin: 0;
    overflow: hidden;
    /* Nền vũ trụ gradient sâu thẳm */
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #02040a 100%); 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none;
}

/* Biến CSS lưu góc quay ngược lại của Camera (Billboarding) */
:root {
    --inv-rot-x: 0deg;
    --inv-rot-y: 0deg;
}

/* --- SAO LẤP LÁNH TĨNH BẰNG CSS (ĐẢM BẢO HIỂN THỊ 100%) --- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(1px 1px at 20px 30px, #ffffff, transparent),
        radial-gradient(1px 1px at 40px 70px, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 50px 160px, #ffffff, transparent),
        radial-gradient(1px 1px at 90px 40px, #ffffff, transparent),
        radial-gradient(2px 2px at 130px 80px, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 160px 120px, #ffffff, transparent),
        radial-gradient(1px 1px at 180px 50px, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 10px 180px, #ffffff, transparent),
        radial-gradient(1px 1px at 100px 100px, #ffffff, transparent),
        radial-gradient(2px 2px at 190px 190px, rgba(255,255,255,0.8), transparent);
    background-size: 180px 180px;
    background-repeat: repeat;
    z-index: -3;
    opacity: 0.7; /* Chấm trắng xa xăm */
}

/* --- MẶT TRĂNG --- */
#moon {
    position: absolute;
    top: 50px;
    right: 100px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #fffdf0;
    box-shadow: 
        0 0 40px 10px #fffdf0,
        0 0 100px 30px rgba(255, 253, 240, 0.6),
        inset -15px -15px 30px rgba(0,0,0,0.1);
    z-index: -1;
    animation: floatMoon 8s ease-in-out infinite;
    will-change: transform;
}

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


/* --- KHÔNG GIAN 3D --- */
#scene {
    width: 100vw;
    height: 100vh;
    perspective: 1200px; 
}

#world {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    will-change: transform;
}

/* CHỮ NỔI 3D */
.text-item {
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    transform-style: preserve-3d;
    text-align: center;
    user-select: none;
    pointer-events: none;
    font-weight: bold;
    will-change: transform; 
    -webkit-text-stroke: 0.5px rgba(0,0,0,0.3);
}

.long-text {
    white-space: normal;
    width: 400px;
    line-height: 1.6;
    font-size: 20px !important;
}

/* Màu sắc Neon */
.glow-pink { color: #ffd1e8; text-shadow: 0 0 5px #ff007f, 0 0 15px #ff007f, 0 0 30px #ff007f, 0 0 50px #ff007f; }
.glow-purple { color: #e6ccff; text-shadow: 0 0 5px #9d00ff, 0 0 15px #9d00ff, 0 0 30px #9d00ff, 0 0 50px #9d00ff; }
.glow-red { color: #ffcccc; text-shadow: 0 0 5px #ff0000, 0 0 15px #ff0000, 0 0 30px #ff0000, 0 0 50px #ff0000; }
.glow-orange { color: #ffe6cc; text-shadow: 0 0 5px #ff6600, 0 0 15px #ff6600, 0 0 30px #ff6600, 0 0 50px #ff6600; }

/* CHỮ CÁO VÀ THỎ GIỮA TÂM */
.center-text {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 70px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px #ff007f, 0 0 25px #ff007f, 0 0 45px #ff007f;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.heartbeat {
    display: inline-block;
    color: #ff1a1a;
    animation: heartBeatAnim 1.2s infinite;
    will-change: transform, filter;
}

@keyframes heartBeatAnim {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px #ff0000) drop-shadow(0 0 20px #ff0000); }
    15% { transform: scale(1.35); filter: drop-shadow(0 0 25px #ff0000) drop-shadow(0 0 50px #ff0000); }
    30% { transform: scale(1); filter: drop-shadow(0 0 10px #ff0000) drop-shadow(0 0 20px #ff0000); }
    45% { transform: scale(1.35); filter: drop-shadow(0 0 25px #ff0000) drop-shadow(0 0 50px #ff0000); }
    60%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px #ff0000) drop-shadow(0 0 20px #ff0000); }
}

/* LỒNG ĐÈN VÀ NGÔI SAO BAY */
.flying-item {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    user-select: none;
    will-change: transform;
}

.glowing-lantern { font-size: 45px; filter: drop-shadow(0 0 15px #ff5500) drop-shadow(0 0 35px #ff1a00); }
.glowing-star { font-size: 35px; filter: drop-shadow(0 0 15px #ffff00) drop-shadow(0 0 30px #ffffff); color: #fff9e6; }

@media (max-width: 600px) {
    .center-text { font-size: 40px; margin-top: -100px; }
    #moon { width: 80px; height: 80px; top: 30px; right: 30px; }
}


/* --- UI --- */
#ui-layer {
    position: fixed;
    bottom: 30px;
    width: 100%;
    text-align: center;
    z-index: 999;
}

button {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #ff007f;
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px #ff007f;
    transition: all 0.3s ease;
}

button:hover {
    background: rgba(255, 0, 127, 0.5);
    transform: scale(1.05);
}

button.playing {
    border-color: #9d00ff;
    box-shadow: 0 0 15px #9d00ff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 15px #9d00ff; }
    50% { box-shadow: 0 0 25px #9d00ff, 0 0 10px #fff; }
    100% { box-shadow: 0 0 15px #9d00ff; }
}
