body{
    margin: 0;
    background-color: rgb(37, 12, 25);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    font-family: Arial, Helvetica, sans-serif;
    min-height: 220vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('CandyLandBackground.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.game-container {
    margin-top: 120vh;
    position: relative;
    width: 900px;
    height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-selector {
    position: absolute;
    top: 20px;
    z-index: 1000;
    background: rgba(20, 10, 15, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 182, 193, 0.5);
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.avatar-selector-left {
    left: -200px;
}

.avatar-selector-right {
    right: -200px;
    min-width: 150px;
    max-width: 150px;
}

.avatar-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255, 182, 193, 0.9);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.avatar-selector select {
    color: rgba(255, 182, 193, 0.95);
    font-weight: 600;
    padding: 12px 16px;
    border: 1px solid rgba(255, 182, 193, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='rgba(255,182,193,0.8)' viewBox='0 0 16 16'%3e%3cpath d='m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
}

.avatar-selector select:hover {
    border-color: rgba(255, 182, 193, 0.6);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 182, 193, 0.2);
}

.avatar-selector select:focus {
    outline: none;
    border-color: rgba(255, 182, 193, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.2);
}

.avatar-selector select option {
    background-color: rgb(37, 12, 25);
    color: rgba(255, 182, 193, 0.9);
    padding: 8px;
}

.welcome-text {
    position: absolute;
    top: 50vh;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.9);
    text-shadow: 0 0 15px rgba(255, 182, 193, 0.6);
    z-index: 1500;
    pointer-events: none;
    font-family: 'Arial Black', Arial, sans-serif;
    user-select: none;
    white-space: nowrap;
}

.welcome-text span {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

.welcome-text span:nth-child(1) { animation-delay: 0s; }
.welcome-text span:nth-child(2) { animation-delay: 0.1s; }
.welcome-text span:nth-child(3) { animation-delay: 0.2s; }
.welcome-text span:nth-child(4) { animation-delay: 0.3s; }
.welcome-text span:nth-child(5) { animation-delay: 0.4s; }
.welcome-text span:nth-child(6) { animation-delay: 0.5s; }
.welcome-text span:nth-child(7) { animation-delay: 0.6s; }
.welcome-text span:nth-child(8) { animation-delay: 0.7s; }
.welcome-text span:nth-child(9) { animation-delay: 0.8s; }
.welcome-text span:nth-child(10) { animation-delay: 0.9s; }
.welcome-text span:nth-child(11) { animation-delay: 1s; }
.welcome-text span:nth-child(12) { animation-delay: 1.1s; }
.welcome-text span:nth-child(13) { animation-delay: 1.2s; }
.welcome-text span:nth-child(14) { animation-delay: 1.3s; }
.welcome-text span:nth-child(15) { animation-delay: 1.4s; }
.welcome-text span:nth-child(16) { animation-delay: 1.5s; }
.welcome-text span:nth-child(17) { animation-delay: 1.6s; }
.welcome-text span:nth-child(18) { animation-delay: 1.7s; }
.welcome-text span:nth-child(19) { animation-delay: 1.8s; }

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

.ball-knowledge-video {
    position: absolute;
    top: 65vh;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-width: 80%;
    z-index: 1600;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 182, 193, 0.3);
}

.ball-knowledge-video video {
    width: 100%;
    height: auto;
    display: block;
}

.countdown-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    font-weight: bold;
    color: rgba(255, 0, 43, 0.8);
    text-shadow: 0 0 20px rgba(255, 182, 193, 0.8);
    z-index: 9999;
    pointer-events: none;
    letter-spacing: 10px;
    font-family: 'Arial Black', Arial, sans-serif;
    user-select: none;
}


.candy-castle {
    position: absolute;
    left: 17.5%;
    top: -10%;
    width: 150px;
    margin-bottom: 20px;
    z-index: 500;
}

.CandyLandRoad{
    position: absolute;
    width: 100%;
    max-width: 700px;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    z-index: 200;
}

.road{
    width: 900px;
}

.huck{
    position: absolute;
    
    animation: bounce 2s ease infinite;
}

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

.character{
    position: absolute;
    z-index: 999;
    width: 100px;
    left: 29%;
    top: -4%;
    transform: translateX(-50%);
    animation: bounce 1s ease-in-out infinite;
}

/* Spinning candy canes background */
.candycane {
    position: absolute;
    width: 100px;
    opacity: 0.4;
    z-index: 50;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Scattered candy canes - from road edge to browser edge */
.candycane-1 {
    left: -35%;
    top: 15%;
    animation: spin 8s infinite;
    transform: rotate(45deg);
}

.candycane-2 {
    right: 15%;
    top: 8%;
    animation: spin 12s infinite reverse;
    width: 80px;
    transform: rotate(-20deg);
}

.candycane-3 {
    left: 5%;
    top: 35%;
    animation: spin 6s infinite;
    width: 90px;
    transform: rotate(70deg);
}

.candycane-4 {
    right: -40%;
    top: 92%;
    animation: spin 10s infinite reverse;
    width: 70px;
    transform: rotate(15deg);
}

.candycane-5 {
    left: -8%;
    top: 88%;
    animation: spin 7s infinite reverse;
    width: 95px;
    transform: rotate(-35deg);
}

.candycane-6 {
    right: 8%;
    top: 25%;
    animation: spin 11s infinite;
    width: 85px;
    transform: rotate(55deg);
}

.candycane-7 {
    left: 12%;
    top: 95%;
    animation: spin 9s infinite reverse;
    transform: rotate(-10deg);
}

.candycane-8 {
    right: -25%;
    top: 12%;
    animation: spin 5s infinite;
    width: 75px;
    transform: rotate(25deg);
}

/* Spinning candy lollipops background */
.candyloli {
    position: absolute;
    width: 80px;
    opacity: 0.3;
    z-index: 40;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Scattered lollipops - from road edge to browser edge */
.candyloli-1 {
    left: 10%;
    top: 5%;
    animation: spin 6s infinite;
    width: 70px;
    transform: rotate(120deg);
}

.candyloli-2 {
    right: -35%;
    top: 18%;
    animation: spin 9s infinite reverse;
    transform: rotate(-45deg);
}

.candyloli-3 {
    left: -45%;
    top: 75%;
    animation: spin 5s infinite;
    width: 90px;
    transform: rotate(85deg);
}

.candyloli-4 {
    right: 5%;
    top: 85%;
    animation: spin 7s infinite reverse;
    width: 75px;
    transform: rotate(30deg);
}

.candyloli-5 {
    left: -2%;
    top: 8%;
    animation: spin 8s infinite;
    width: 85px;
    transform: rotate(-60deg);
}

.candyloli-6 {
    right: -15%;
    top: 98%;
    animation: spin 4s infinite reverse;
    width: 65px;
    transform: rotate(40deg);
}

/* Spinning candy pieces background */
.candy {
    position: absolute;
    width: 60px;
    opacity: 0.35;
    z-index: 30;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Scattered candy pieces - from road edge to browser edge */
.candy-1 {
    left: 7%;
    top: 22%;
    animation: spin 10s infinite;
    width: 50px;
    transform: rotate(75deg);
}

.candy-2 {
    right: -50%;
    top: 6%;
    animation: spin 7s infinite reverse;
    width: 70px;
    transform: rotate(-30deg);
}

.candy-3 {
    left: -15%;
    top: 12%;
    animation: spin 12s infinite;
    width: 55px;
    transform: rotate(100deg);
}

.candy-4 {
    right: 12%;
    top: 95%;
    animation: spin 8s infinite reverse;
    width: 65px;
    transform: rotate(50deg);
}

.candy-5 {
    left: -40%;
    top: 98%;
    animation: spin 11s infinite;
    width: 45px;
    transform: rotate(-80deg);
}

.candy-6 {
    
    right: 2%;
    top: 15%;
    animation: spin 6s infinite reverse;
    width: 60px;
    transform: rotate(15deg);
}

.candy-6:hover {
    animation: spin 2s infinite reverse;
}

/* Candy elements specifically around the road area - varied distances */
.candycane-road-1 {
    left: 18%;
    top: 42%;
    animation: spin 9s infinite;
    width: 85px;
    transform: rotate(60deg);
}

.candycane-road-2 {
    right: 3%;
    top: 55%;
    animation: spin 7s infinite reverse;
    width: 90px;
    transform: rotate(-40deg);
}

.candyloli-road-1 {
    left: -5%;
    top: 48%;
    animation: spin 5s infinite reverse;
    width: 75px;
    transform: rotate(110deg);
}

.candyloli-road-2 {
    right: -12%;
    top: 38%;
    animation: spin 8s infinite;
    width: 80px;
    transform: rotate(-25deg);
}

.candy-road-1 {
    left: 25%;
    top: 52%;
    animation: spin 11s infinite;
    width: 55px;
    transform: rotate(80deg);
}

.candy-road-2 {
    right: 20%;
    top: 45%;
    animation: spin 6s infinite reverse;
    width: 60px;
    transform: rotate(-70deg);
}


/* iPhone Pro Max viewport (430px width) */
@media only screen and (max-width: 430px) {

    .game-container {
        width: 300px;
        position: relative;
    }
    
    .candy-castle {
        width: 70px;
        top: 45%;
        left: 17.5%;
    }
    
    .character {
        width: 55px;
        top: 10%;
        left: 22%;
    }
    
    .CandyLandRoad {
        margin-top: 30%;
        width: 150%;

        max-width: none;
    }
    
    .road {
        width: 100%;
        max-width: 380px;
    }
    
    .avatar-selector {
        padding: 10px;
        top: -60px;
        border-radius: 8px;
        max-width: 140px;
        background: rgba(20, 10, 15, 0.95);
    }
    
    .avatar-selector-left {
        left: 5px;
    }
    
    .avatar-selector-right {
        right: 5px;
        max-width: 110px;
        min-width: 110px;
    }
    
    .avatar-selector label {
        font-size: 9px;
        margin-bottom: 4px;
    }
    
    .avatar-selector select {
        font-size: 9px;
        padding: 6px 8px;
        border-radius: 6px;
        padding-right: 20px;
        background-size: 10px;
    }
    
    .welcome-text {
        font-size: 28px;
    }
    
    .ball-knowledge-video {
        width: 280px;
        top: 60vh;
    }
    
    @keyframes wave {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-10px);
        }
    }
    
    .countdown-timer {
        font-size: 48px;
        letter-spacing: 4px;
        width: 90%;
        text-align: center;
        white-space: nowrap;
    }
    
    
   
    /* Adjust bounce animation for smaller screen */
    @keyframes bounce {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-15px);
        }
    }
    
    /* Clickable castle link for mobile */
    .candy-castle-clickable {
        position: absolute;
        left: 6%;
        top: 9%;
        z-index: 500;
    }
}



