:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #232635;
    --border: #2e3247;
    --primary: #f97316;
    --primary-dark: #ea6c0a;
    --text: #e8eaf0;
    --text-muted: #8b90a8;
    --success: #22c55e;
    --error: #ef4444;
    --selected: #1e3a5f;
    --selected-border: #3b82f6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { font-size: 1.1rem; font-weight: 700; }
nav { display: flex; align-items: center; gap: 0.75rem; }
.user-greeting { font-size: 0.875rem; color: var(--text-muted); }

/* Buttons */
.btn {
    padding: 0.45rem 1rem;
    border-radius: 6px;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-vote { background: var(--surface2); color: var(--text); border: 1px solid var(--border); width: 100%; margin-top: 0.75rem; padding: 0.5rem; }
.btn-vote:hover { border-color: var(--primary); color: var(--primary); }
.btn-selected { background: var(--selected); color: #60a5fa; border: 1px solid var(--selected-border); width: 100%; margin-top: 0.75rem; padding: 0.5rem; }
.btn-full { width: 100%; margin-top: 1rem; padding: 0.65rem; font-size: 1rem; }

/* Main */
main { flex: 1; max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; width: 100%; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.alert-success { background: #14532d55; border: 1px solid #22c55e55; color: #86efac; }
.alert-error { background: #7f1d1d55; border: 1px solid #ef444455; color: #fca5a5; }

/* Hero */
.hero {
    text-align: center;
    padding: 2.5rem 1rem 2rem;
}
.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #f97316, #fb923c, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}
.subtitle { color: var(--text-muted); font-size: 1rem; line-height: 1.7; max-width: 680px; margin: 0 auto 2rem; }
.subtitle strong { color: var(--text); }

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.stat-number { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Bets section */
.bets-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.login-prompt {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.login-prompt a { color: var(--primary); text-decoration: none; }
.login-prompt a:hover { text-decoration: underline; }

.bets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.bet-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s;
}
.bet-card:hover { border-color: #4a4f6a; }
.bet-card.selected {
    background: var(--selected);
    border-color: var(--selected-border);
}

.bet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.bet-header h3 { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.vote-count {
    font-size: 0.75rem;
    background: var(--surface2);
    color: var(--text-muted);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.bet-card.selected .vote-count { background: #1e3a5f; color: #93c5fd; }

.bet-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; flex: 1; }

.voters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}
.voter-chip {
    font-size: 0.75rem;
    background: var(--surface2);
    color: var(--text);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* Auth */
.auth-card {
    max-width: 420px;
    margin: 3rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
}
.auth-card h2 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.auth-card > p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    margin-top: 1rem;
}
label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}
input:focus { border-color: var(--primary); }

.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.auth-switch a { color: var(--primary); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* Lock banner */
.lock-banner {
    background: #3b1f1f;
    border: 1px solid #ef444455;
    color: #fca5a5;
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.lock-banner--open {
    background: #1a2e1a;
    border-color: #22c55e55;
    color: #86efac;
}
.lock-banner--open strong { color: #4ade80; }

/* Disabled button */
button[disabled] {
    opacity: 0.7;
    cursor: default;
}

@media (max-width: 640px) {
    .hero h1 { font-size: 1.4rem; }
    .hero { padding: 1.5rem 0 1rem; }
    .subtitle { font-size: 0.9rem; }
    .stats { gap: 0.75rem; }
    .stat-number { font-size: 1.2rem; }
    .bets-grid { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0; height: auto; }
    header { padding: 0.5rem 1rem; }
    nav { gap: 0.5rem; }
    .btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
    main { padding: 1.25rem 1rem; }
    .auth-card { margin: 1.5rem auto; }
}
