:root {
    --primary-red: #D93025;
    --gold: #FFD700;
    --deep-blue: #0b1026;
    --water-blue: #1a2b4a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Serif SC', serif;
}

body {
    overflow: hidden;
    color: white;
}

/* Landing Page */
.landing-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at center, #1a2b4a 0%, #000 100%);
    transition: opacity 1s ease;
}

.landing-container {
    text-align: center;
    z-index: 10;
}

.lantern {
    position: relative;
    width: 100px;
    height: 140px;
    background: var(--primary-red);
    margin: 0 auto 30px;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 40px rgba(217, 48, 37, 0.6);
    animation: sway 3s ease-in-out infinite alternate;
}

.lantern::before,
.lantern::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 10px;
    background: #333;
    left: 20%;
}

.lantern::before {
    top: -5px;
}

.lantern::after {
    bottom: -5px;
}

.lantern-body {
    font-size: 3rem;
    color: var(--gold);
    font-family: 'Ma Shan Zheng', cursive;
}

.lantern-light {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    animation: flicker 4s infinite;
}

.intro-text h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.chinese-text {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.start-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.start-btn:hover {
    background: var(--gold);
    color: var(--deep-blue);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Animations */
@keyframes sway {
    from {
        transform: rotate(-5deg);
    }

    to {
        transform: rotate(5deg);
    }
}

@keyframes flicker {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.4;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
}

.delay-1 {
    animation-delay: 0.5s;
}

.delay-2 {
    animation-delay: 1s;
}

.delay-3 {
    animation-delay: 1.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Pond Scene */
.pond-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Main Pond (Canvas) */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Above video */
}

/* Background Video */
#bgVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    /* Behind canvas */
    display: block;
    /* Ensure it is visible */
}

.message-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    /* Let clicks pass through to canvas */
    width: 100%;
    z-index: 10;
}

.main-msg {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Ma Shan Zheng', cursive;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 2s ease;
}

.sub-msg {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
    transition: opacity 2s ease;
}

.controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.music-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

/* --- ROULETTE STYLES --- */
.roulette-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    background: rgba(11, 16, 38, 0.85);
    /* Semi-transparent dark background */
    padding: 30px;
    border-radius: 20px;
    border: 2px solid var(--gold);
    backdrop-filter: blur(5px);
}

.roulette-container.visible {
    opacity: 1;
    pointer-events: auto;
}

.roulette-container h2 {
    color: var(--gold);
    margin-bottom: 20px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.wheel-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto 30px;
    border-radius: 50%;
    border: 8px solid #fff;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    color: #fff;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    /* Make pointer point DOWN */
}

/* NEW ROBUST WHEEL CSS */
.wheel {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    /* Use Conic Gradient for perfect segments without gaps */
    background: conic-gradient(var(--primary-red) 0deg 60deg,
            var(--gold) 60deg 120deg,
            var(--primary-red) 120deg 180deg,
            var(--gold) 180deg 240deg,
            var(--primary-red) 240deg 300deg,
            var(--gold) 300deg 360deg);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Independent Text Labels */
.label {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    /* Radius length */
    height: 60px;
    /* Taller container for wrapping */
    margin-top: -30px;
    /* Center vertically around hub */

    transform-origin: left center;
    /* Rotate around the hub */
    /* Rotate around the hub */
    /* Rotate to the middle of the wedge: i * 60 - 60 (compensate for 3 o'clock start) */
    transform: rotate(calc(60deg * var(--i) - 60deg));

    /* Text styling */
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    text-align: right;
    /* Align text to the outward rim */
    padding-right: 20px;
    /* Offset from rim */
    box-sizing: border-box;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.spin-btn {
    background: var(--primary-red);
    color: #fff;
    border: 2px solid var(--gold);
    padding: 10px 30px;
    font-size: 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s;
}

.spin-btn:hover {
    transform: scale(1.1);
    background: var(--gold);
    color: var(--primary-red);
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.spin-hint {
    margin-top: 15px;
    color: var(--gold);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    opacity: 0.9;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

/* Modal */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.result-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    color: #333;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    border: 4px solid var(--gold);
    max-width: 80%;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content h3 {
    color: var(--primary-red);
    font-size: 2rem;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: bold;
}

.modal-content button {
    background: var(--gold);
    border: none;
    padding: 10px 20px;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Hardcoded rotation overrides to ensure perfect alignment */
.wheel .label:nth-child(1) {
    transform: rotate(-60deg) !important;
}

.wheel .label:nth-child(2) {
    transform: rotate(0deg) !important;
}

.wheel .label:nth-child(3) {
    transform: rotate(60deg) !important;
}

.wheel .label:nth-child(4) {
    transform: rotate(120deg) !important;
}

.wheel .label:nth-child(5) {
    transform: rotate(180deg) !important;
}

.wheel .label:nth-child(6) {
    transform: rotate(240deg) !important;
}