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

html {
    background: #1a0a2e;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #1a0a2e 0%, #3d1f6d 50%, #7b2d8e 100%);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    overflow-x: hidden;
}

header {
    text-align: center;
    padding: 1.5rem 1rem 0.5rem;
}

header h1 {
    font-size: 2rem;
    background: linear-gradient(to right, #f9d423, #ff4e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

header p {
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    margin-top: 0.3rem;
}

.wheel-container {
    position: relative;
    width: min(85vw, 380px);
    height: min(85vw, 380px);
    margin: 0.5rem auto;
}

canvas {
    width: 100%;
    height: 100%;
}

.pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 36px solid #f9d423;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    z-index: 10;
}

.spin-btn {
    display: block;
    margin: 1rem auto;
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    background: linear-gradient(to right, #f9d423, #ff4e50);
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 20px rgba(249, 212, 35, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.spin-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(249, 212, 35, 0.6);
}

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

.email-gate {
    text-align: center;
    margin: 1rem 0;
}

.email-gate input::placeholder { color: rgba(255,255,255,0.4); }

.claim-btn {
    margin-top: 1.25rem;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background: linear-gradient(to right, #f9d423, #ff4e50);
    color: white;
    cursor: pointer;
    width: 100%;
}
.claim-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.error-msg {
    color: #ff6b6b;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Flip card */
.ticket-container {
    display: none;
    text-align: center;
    padding: 2rem 1rem;
    width: 100%;
    perspective: 1000px;
}

.flip-card {
    max-width: 380px;
    margin: 0 auto;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped {
    transform: rotateY(180deg);
}

.flip-front, .flip-back {
    background: linear-gradient(135deg, #2d1b4e, #1a0a2e);
    border: 2px solid #f9d423;
    border-radius: 1rem;
    padding: 2rem;
    backface-visibility: hidden;
}

.flip-front {
    position: relative;
}

.flip-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: rotateY(180deg);
}

.flip-front h2, .flip-back h2 { color: #f9d423; margin-bottom: 0.5rem; }

.prize-image {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin: 1rem auto;
    display: block;
    border: 2px solid rgba(249, 212, 35, 0.4);
    background: rgba(255,255,255,0.1);
}

.flip-back .attendee-label { color: rgba(255,255,255,0.7); }

#ticket-qr {
    margin: 1.5rem auto;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    display: inline-block;
}

.ticket-note {
    color: rgba(255,255,255,0.5);
    font-size: 0.95rem;
    margin-top: 1rem;
}

.confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 200;
}
