:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --accent-gold: #f0c755;
    --accent-coral: #ff6b6b;
    --accent-teal: #4ecdc4;
    --accent-purple: #a855f7;
    --accent-blue: #3b82f6;
    --accent-pink: #ec4899;
    --text-primary: #ffffff;
    --text-muted: #9ca3af;
    --border-subtle: rgba(255,255,255,0.08);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

.bg-pattern {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(240, 199, 85, 0.08) 0%, transparent 60%);
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header { text-align: center; margin-bottom: 2rem; }
.logo-img { max-width: 180px; height: auto; margin-bottom: 0.5rem; }

.social-links { display: flex; justify-content: center; gap: 1.25rem; margin-bottom: 1rem; }
.social-links a { color: var(--text-muted); transition: color 0.2s ease, transform 0.2s ease; }
.social-links a:hover { color: var(--accent-gold); transform: translateY(-2px); }

.tagline { color: var(--text-muted); font-size: 1rem; }

.section { display: none; animation: fadeSlideIn 0.5s ease-out; }
.section.active { display: block; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.card-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.card-subtitle { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.95rem; }

.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
    margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-input {
    width: 100%; padding: 1rem 1.25rem; background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle); border-radius: 12px; color: var(--text-primary);
    font-family: inherit; font-size: 1rem; transition: all 0.2s ease;
}
.form-input:focus {
    outline: none; border-color: var(--accent-gold); background: rgba(255,255,255,0.05);
    box-shadow: 0 0 0 3px rgba(240, 199, 85, 0.1);
}
.form-input::placeholder { color: var(--text-muted); opacity: 0.6; }

.btn {
    width: 100%; padding: 1rem 2rem; border: none; border-radius: 12px;
    font-family: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer;
    transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #e6b84d 100%);
    color: var(--bg-dark); box-shadow: 0 4px 20px rgba(240, 199, 85, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(240, 199, 85, 0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.error-message {
    background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--accent-coral); padding: 1rem; border-radius: 12px; margin-bottom: 1rem;
    font-size: 0.9rem; display: none;
}
.error-message.show { display: block; animation: shake 0.4s ease; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.wheel-container { display: flex; flex-direction: column; align-items: center; padding: 1rem; }
.player-name { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.player-name strong { color: var(--accent-gold); }

.wheel-wrapper { position: relative; width: 320px; height: 320px; margin-bottom: 2rem; --label-offset: 100px; }

.wheel-pointer {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%); z-index: 10;
    width: 0; height: 0; border-left: 20px solid transparent; border-right: 20px solid transparent;
    border-top: 40px solid var(--accent-gold); filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.wheel-pointer::after {
    content: ''; position: absolute; top: -45px; left: 50%; transform: translateX(-50%);
    width: 16px; height: 16px; background: var(--accent-gold); border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.wheel {
    width: 100%; height: 100%; border-radius: 50%; position: relative;
    box-shadow: 0 0 0 8px var(--bg-card), 0 0 0 12px var(--accent-gold),
        0 0 40px rgba(240, 199, 85, 0.3), inset 0 0 30px rgba(0,0,0,0.3);
    overflow: hidden;
}
.wheel.spinning { transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99); }
.wheel-segment { position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none; }

.spin-btn {
    width: 200px; padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--accent-coral) 0%, #ff5252 100%);
    border: none; border-radius: 50px; color: white; font-family: inherit; font-size: 1.25rem;
    font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: 2px;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4); transition: all 0.3s ease;
}
.spin-btn:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 6px 30px rgba(255, 107, 107, 0.5); }
.spin-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.result-container { text-align: center; padding: 2rem; }
.result-icon {
    width: 120px; height: 120px; margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-coral) 100%);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem; box-shadow: 0 10px 40px rgba(240, 199, 85, 0.3); animation: bounce 0.6s ease;
}
@keyframes bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.result-title {
    font-size: 2rem; font-weight: 900; margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-coral) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.result-prize {
    font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1.5rem;
    padding: 1rem 2rem; background: rgba(255,255,255,0.05); border-radius: 16px; display: inline-block;
}
.result-message { color: var(--text-muted); font-size: 1rem; line-height: 1.6; max-width: 350px; margin: 0 auto; }
.result-message strong { color: var(--accent-teal); }

.already-played { text-align: center; padding: 3rem 2rem; }
.already-played-icon { font-size: 4rem; margin-bottom: 1rem; }
.already-played h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.already-played p { color: var(--text-muted); }

.loading {
    display: inline-block; width: 20px; height: 20px; border: 2px solid transparent;
    border-top-color: currentColor; border-radius: 50%; animation: spin 0.8s linear infinite;
    margin-right: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.confetti {
    position: fixed; width: 10px; height: 10px; top: -10px; pointer-events: none;
    animation: confetti-fall linear forwards;
}
@keyframes confetti-fall { to { top: 105vh; transform: rotate(720deg) translateX(100px); } }

.offline-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 24px;
    padding: 3rem 2rem; backdrop-filter: blur(10px); text-align: center; margin-top: 2rem;
}
.offline-icon { font-size: 4rem; margin-bottom: 1.5rem; }
.offline-title {
    font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-coral) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.offline-message { color: var(--text-muted); font-size: 1.1rem; line-height: 1.6; max-width: 350px; margin: 0 auto; }

.footer { margin-top: auto; padding: 2rem 0 1rem; text-align: center; }
.footer a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s ease; }
.footer a:hover { color: var(--accent-gold); }

@media (prefers-color-scheme: light) {
    :root {
        --bg-dark: #f0f0f8; --bg-card: #ffffff; --text-primary: #1a1a2e;
        --text-muted: #6b7280; --border-subtle: rgba(0, 0, 0, 0.1);
    }
    .bg-pattern {
        background:
            radial-gradient(circle at 20% 80%, rgba(168, 85, 247, 0.07) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.06) 0%, transparent 50%),
            radial-gradient(circle at 50% 50%, rgba(240, 199, 85, 0.05) 0%, transparent 60%);
    }
    .form-input { background: rgba(0, 0, 0, 0.03); }
    .form-input:focus { background: rgba(0, 0, 0, 0.05); }
    .result-prize { background: rgba(0, 0, 0, 0.05); }
}

@media (max-width: 400px) {
    .wheel-wrapper { width: 280px; height: 280px; --label-offset: 85px; }
    .container { padding: 1rem; }
}
