:root {
    --bg: #0f0f1a;
    --card: #1a1a2e;
    --accent: #ff6b6b;
    --accent2: #4ecdc4;
    --accent3: #ffe66d;
    --text: #f0f0f0;
    --muted: #aaa;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo { font-size: 1.8rem; font-weight: 900; color: var(--accent); text-decoration: none; }
.nav-links a { color: var(--text); text-decoration: none; margin-left: 1.5rem; }
.btn-nav { background: var(--accent); padding: 0.5rem 1rem; border-radius: 20px; }

.hero { text-align: center; padding: 4rem 2rem; }
.hero h1 { font-size: 3.5rem; font-weight: 900; background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.subtitle { font-size: 1.3rem; color: var(--muted); max-width: 600px; margin: 1rem auto 2rem; }
.hero-buttons .btn { margin: 0.5rem; }

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.btn-primary { background: linear-gradient(90deg, var(--accent), #ff8e53); color: white; }
.btn-secondary { background: var(--card); color: white; border: 2px solid var(--accent2); }
.btn-spin { background: linear-gradient(90deg, #ff6b6b, #ffe66d); color: #111; font-size: 1.4rem; padding: 1rem 2.5rem; margin-top: 1rem; }
.btn-small { padding: 0.5rem 1rem; font-size: 0.9rem; }

.auth-box, .dashboard, .room-page {
    max-width: 800px;
    margin: 2rem auto;
    background: var(--card);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.auth-box form, .create-room { display: flex; flex-direction: column; gap: 1rem; }
input[type="text"], input[type="password"] {
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    background: #252540;
    color: white;
    font-size: 1rem;
}

.rooms-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.room-card { background: #252540; padding: 1.5rem; border-radius: 15px; text-align: center; }
.room-card h3 { color: var(--accent2); }

.room-layout { display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center; }
.wheel-container { position: relative; text-align: center; }
#wheel-canvas { border-radius: 50%; box-shadow: 0 0 40px rgba(255,107,107,0.4); background: #111; }
.pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    color: var(--accent);
    text-shadow: 0 0 10px black;
    z-index: 10;
    pointer-events: none;
}
.result-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    z-index: 20;
    animation: pop 0.5s ease;
}
.result-popup.hidden { display: none; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.result-popup h2 { color: var(--accent3); font-size: 2rem; margin-bottom: 0.5rem; }

.options-panel { flex: 1; min-width: 280px; background: #252540; padding: 1.5rem; border-radius: 15px; }
#options-list, #history-list { list-style: none; max-height: 300px; overflow-y: auto; }
#options-list li, #history-list li { padding: 0.5rem; border-bottom: 1px solid #333; display: flex; justify-content: space-between; }
#add-option-form { display: flex; gap: 0.5rem; margin: 1rem 0; }

.flashes { max-width: 600px; margin: 1rem auto; }
.flash { padding: 0.8rem; border-radius: 10px; margin-bottom: 0.5rem; }
.flash.success { background: #4ecdc4; color: #111; }
.flash.error { background: #ff6b6b; }

footer { text-align: center; padding: 2rem; color: var(--muted); }

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .room-layout { flex-direction: column; }
    #wheel-canvas { width: 100%; height: auto; }
}
