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

:root {
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --red: #E31837;
    --red-dark: #A01025;
    --blue: #0066CC;
    --blue-dark: #004499;
    --green: #228B22;
    --purple: #6B2D7B;
    --orange: #FF6B00;
    --bg-dark: #1a1a2e;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Header */
header {
    text-align: center;
    padding: clamp(0.5rem, 2vh, 1rem) clamp(0.5rem, 2vw, 1rem);
    background: linear-gradient(180deg, rgba(255,215,0,0.2) 0%, transparent 100%);
    flex-shrink: 0;
}

header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: var(--gold);
    text-shadow: 
        2px 2px 0 var(--red),
        4px 4px 0 rgba(0,0,0,0.3);
    letter-spacing: 2px;
    animation: title-glow 2s ease-in-out infinite alternate;
    margin: 0;
}

@keyframes title-glow {
    from {
        filter: drop-shadow(0 0 10px rgba(255,215,0,0.5));
    }
    to {
        filter: drop-shadow(0 0 30px rgba(255,215,0,0.8));
    }
}

.subtitle {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: white;
    margin-top: clamp(0.25rem, 1vh, 0.5rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: clamp(2px, 1vw, 4px);
}

/* Price Mode Toggle */
.price-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, 1vw, 0.75rem);
    margin-top: clamp(0.25rem, 1vh, 0.5rem);
    flex-wrap: wrap;
}

.toggle-label {
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toggle-switch {
    position: relative;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    padding: 4px;
    cursor: pointer;
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.toggle-slider:hover {
    border-color: rgba(255, 215, 0, 0.6);
}

.toggle-option {
    padding: clamp(0.3rem, 1vh, 0.5rem) clamp(0.8rem, 2vw, 1.2rem);
    border-radius: 25px;
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    font-weight: 700;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.5);
}

.toggle-option.left {
    background: var(--gold);
    color: var(--bg-dark);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.toggle-input:checked + .toggle-slider .toggle-option.left {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.toggle-input:checked + .toggle-slider .toggle-option.right {
    background: var(--gold);
    color: var(--bg-dark);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

/* Main Game Container */
main {
    padding: clamp(0.5rem, 1vh, 1rem);
    max-width: 100vw;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1 0 auto;
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
}

.game-container {
    display: flex;
    flex-wrap: wrap;
    gap: calc(max(4rem, 8vw) + 24px);
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Wheel Section */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: max(24px, 3vh);
    flex: 0 0 auto;
    min-width: min-content;
    justify-content: center;
}

.wheel-wrapper {
    position: relative;
    width: clamp(300px, 35vw, 450px);
    height: clamp(300px, 35vw, 450px);
    aspect-ratio: 1;
    max-width: 100%;
    flex-shrink: 0;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    box-shadow: 
        0 0 0 8px var(--gold),
        0 0 0 12px var(--gold-dark),
        0 0 40px rgba(255,215,0,0.4);
    overflow: hidden;
}

.wheel canvas {
    display: block;
}

.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--red);
    z-index: 20;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

.pointer::after {
    content: '';
    position: absolute;
    top: -38px;
    left: -12px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 24px solid var(--red-dark);
}

/* Spin Button */
.spin-btn {
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
    border: none;
    padding: clamp(0.5rem, 1vh, 0.8rem) clamp(1rem, 3vw, 2rem);
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 1vw, 0.5rem);
    box-shadow: 
        0 4px 0 var(--red-dark),
        0 6px 15px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    max-width: min(100%, 350px);
    justify-content: center;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 
        0 5px 0 var(--red-dark),
        0 8px 20px rgba(0,0,0,0.4);
}

.spin-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 var(--red-dark),
        0 4px 8px rgba(0,0,0,0.3);
}

.spin-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spin-icon {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.spin-btn:disabled .spin-icon {
    animation: none;
}

/* Result Section */
.result-section {
    flex: 0 0 auto;
    width: clamp(300px, 35vw, 450px);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.result-card {
    background: linear-gradient(145deg, #2a2a4a 0%, #1a1a2e 100%);
    border-radius: 15px;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    text-align: center;
    box-shadow: 
        0 15px 30px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    border: 2px solid rgba(255,215,0,0.3);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-image {
    width: min(150px, 25vw, 20vh);
    height: min(150px, 25vw, 20vh);
    margin: 0 auto clamp(0.5rem, 1.5vh, 0.75rem);
    background: linear-gradient(135deg, #3a3a5a 0%, #2a2a4a 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2.5rem, 8vw, 4rem);
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,215,0,0.2);
    overflow: hidden;
}

.result-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.result-name {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--gold);
    margin-bottom: clamp(0.5rem, 1.5vh, 0.75rem);
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

/* Price Reveal */
.price-reveal {
    display: none;
    max-width: 100%;
}

.price-reveal.active {
    display: block;
}

.reveal-btn {
    background: linear-gradient(180deg, var(--green) 0%, #1a6b1a 100%);
    border: none;
    padding: clamp(0.5rem, 1vh, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 
        0 3px 0 #145214,
        0 6px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    max-width: 100%;
}

.reveal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 0 #145214,
        0 8px 15px rgba(0,0,0,0.4);
}

.reveal-btn:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 0 #145214,
        0 4px 8px rgba(0,0,0,0.3);
}

.price-display {
    display: none;
    flex-direction: column;
    gap: clamp(0.625rem, 1vh, 0.75rem);
    margin-top: clamp(0.625rem, 1vh, 0.75rem);
    animation: price-pop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.price-display.visible {
    display: flex;
}

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

.price-label {
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-amount {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.3rem, 4vw, 2rem);
    color: var(--gold);
    text-shadow: 
        1px 1px 0 var(--gold-dark),
        2px 2px 8px rgba(0,0,0,0.3);
    animation: price-glow 1s ease-in-out infinite alternate;
}

@keyframes price-glow {
    from {
        filter: drop-shadow(0 0 5px rgba(255,215,0,0.5));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(255,215,0,0.8));
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    font-size: 1.5rem;
    color: var(--gold);
    font-family: 'Poppins', sans-serif;
    letter-spacing: 4px;
}

/* Spinning animation */
.wheel.spinning {
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Responsive */
@media (max-width: 1024px) {
    .game-container {
        flex-direction: column !important;
        gap: calc(max(1.5rem, 3vh) + 24px);
        align-items: center;
    }
    
    .wheel-wrapper {
        width: clamp(250px, 70vw, 480px);
        height: clamp(250px, 70vw, 480px);
        max-width: calc(100vw - 2rem);
    }
    
    .result-section {
        width: clamp(250px, 70vw, 480px);
        max-width: calc(100vw - 2rem);
    }
}

@media (max-width: 1200px) {
    .game-container {
        flex-direction: column !important;
        align-items: center;
        gap: calc(max(1.5rem, 3vh) + 24px);
    }
    
    .wheel-section {
        width: 100%;
        max-width: 100%;
    }
    
    .wheel-wrapper {
        width: clamp(220px, 70vw, 500px);
        height: clamp(220px, 70vw, 500px);
        max-width: calc(100vw - 2rem);
    }
    
    .result-section {
        width: clamp(220px, 70vw, 500px);
        max-width: calc(100vw - 2rem);
    }
    
    .spin-btn {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem;
    }
    
    header h1 {
        letter-spacing: 1px;
    }
    
    .subtitle {
        letter-spacing: 2px;
    }
    
    .price-mode-toggle {
        flex-direction: row;
        gap: 0.5rem;
        transform: scale(0.9);
    }
    
    .toggle-label {
        font-size: 0.75rem;
    }
    
    .game-container {
        gap: calc(max(1rem, 2.5vh) + 24px);
        padding: 0.5rem;
        flex-direction: column !important;
    }
    
    .wheel-wrapper {
        width: clamp(200px, 80vw, 350px);
        height: clamp(200px, 80vw, 350px);
        max-width: calc(100vw - 1rem);
    }
    
    .result-section {
        width: clamp(200px, 80vw, 350px);
        max-width: calc(100vw - 1rem);
    }
    
    .result-card {
        padding: 0.75rem;
    }
    
    .result-image {
        width: clamp(100px, 40vw, 150px);
        height: clamp(100px, 40vw, 150px);
    }
}

@media (min-width: 1400px) {
    .game-container {
        gap: calc(max(6rem, 8vw) + 24px);
        justify-content: center;
    }
    
    .wheel-wrapper {
        width: clamp(350px, 35vw, 500px);
        height: clamp(350px, 35vw, 500px);
    }
    
    .wheel-section {
        flex: 0 0 auto;
        gap: max(24px, 3vh);
    }
    
    .result-section {
        flex: 0 0 auto;
        width: clamp(350px, 35vw, 500px);
    }
}

/* Responsive - Very Small Mobile */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }
    
    .game-container {
        gap: calc(max(1rem, 3vh) + 24px);
        flex-direction: column !important;
        padding: 0.5rem;
    }
    
    .wheel-wrapper {
        width: clamp(180px, 85vw, 300px);
        height: clamp(180px, 85vw, 300px);
        max-width: calc(100vw - 1rem);
    }
    
    .result-section {
        width: clamp(180px, 85vw, 300px);
        max-width: calc(100vw - 1rem);
    }
    
    .spin-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .result-image {
        width: clamp(90px, 40vw, 130px);
        height: clamp(90px, 40vw, 130px);
        font-size: 2rem;
    }
    
    .result-name {
        font-size: 0.85rem;
    }
    
    .price-amount {
        font-size: 1.1rem;
    }
}

/* Responsive - Height based (for landscape mobile and short screens) */
@media (max-height: 700px) {
    header {
        padding: 0.3rem 0.5rem;
    }
    
    header h1 {
        font-size: clamp(1.2rem, 4vh, 1.8rem);
    }
    
    .subtitle {
        font-size: clamp(0.6rem, 1.5vh, 0.8rem);
        margin-top: 0.15rem;
    }
    
    .price-mode-toggle {
        margin-top: 0.25rem;
        transform: scale(0.85);
    }
    
    main {
        padding: 0.3rem;
    }
    
    .game-container {
        gap: calc(max(0.625rem, 2vw) + 24px);
    }
    
    .wheel-section {
        gap: max(24px, 1.5vh);
    }
    
    .wheel-wrapper {
        width: clamp(180px, 28vw, 260px);
        height: clamp(180px, 28vw, 260px);
    }
    
    .result-section {
        width: clamp(180px, 28vw, 260px);
    }
    
    .result-card {
        padding: 0.5rem;
    }
    
    .result-image {
        width: clamp(80px, 20vw, 110px);
        height: clamp(80px, 20vw, 110px);
        font-size: clamp(1.8rem, 6vh, 2.5rem);
        margin-bottom: 0.3rem;
    }
    
    .result-name {
        font-size: clamp(0.8rem, 2.5vh, 1rem);
        margin-bottom: 0.3rem;
    }
    
    .spin-btn {
        padding: 0.35rem 0.8rem;
        font-size: clamp(0.75rem, 2vh, 0.9rem);
    }
}

/* Responsive - Very short screens (landscape phones) */
@media (max-height: 500px) {
    header {
        padding: 0.2rem 0.3rem;
    }
    
    header h1 {
        font-size: 1rem;
    }
    
    .subtitle {
        font-size: 0.55rem;
    }
    
    .price-mode-toggle {
        margin-top: 0.15rem;
        transform: scale(0.75);
    }
    
    .game-container {
        flex-direction: row;
        align-items: center;
        gap: calc(max(0.625rem, 2vw) + 24px);
    }
    
    .wheel-wrapper {
        width: clamp(150px, 22vw, 220px);
        height: clamp(150px, 22vw, 220px);
    }
    
    .wheel-section {
        gap: max(24px, 1vh);
    }
    
    .spin-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .result-section {
        width: clamp(150px, 22vw, 220px);
    }
    
    .result-card {
        padding: 0.4rem;
    }
    
    .result-image {
        width: clamp(70px, 15vw, 100px);
        height: clamp(70px, 15vw, 100px);
        font-size: 1.5rem;
        margin-bottom: 0.2rem;
    }
    
    .result-name {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }
    
    .reveal-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .price-amount {
        font-size: 1rem;
    }
    
    .price-label {
        font-size: 0.6rem;
    }
}

/* Winner animation */
.winner-animation {
    animation: winner-pulse 0.5s ease-in-out 3;
}

@keyframes winner-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Very tall screens - ensure content stays centered */
@media (min-height: 900px) {
    .wheel-wrapper {
        width: clamp(350px, 35vw, 500px);
        height: clamp(350px, 35vw, 500px);
    }
    
    .result-section {
        width: clamp(350px, 35vw, 500px);
    }
    
    .result-image {
        width: clamp(150px, 25vw, 200px);
        height: clamp(150px, 25vw, 200px);
    }
    
    .wheel-section {
        gap: max(24px, 3vh);
    }
}

/* Very wide screens - extra spacing */
@media (min-width: 1600px) {
    .game-container {
        gap: calc(max(7rem, 10vw) + 24px);
    }
    
    .wheel-section {
        gap: max(24px, 3vh);
    }
    
    .wheel-wrapper {
        width: clamp(400px, 35vw, 550px);
        height: clamp(400px, 35vw, 550px);
    }
    
    .result-section {
        width: clamp(400px, 35vw, 550px);
    }
}

