/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gold: #D4AF37;
    --gold-dark: #9A7A0A;
    --black: #0a0a0a;
    --dark: #111111;
    --card: #181818;
    --border: #2a2a2a;
    --text: #e0e0e0;
    --text-muted: #777;
    --danger-bg: #1a0808;
    --danger-border: #4a1010;
    --radius: 8px;
}

body {
    background: var(--black);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ── Navbar ── */
.navbar {
    background: var(--dark);
    border-bottom: 3px solid var(--gold);
    padding: 0 1.5rem;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    color: var(--gold);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skull { font-size: 1.5rem; }

/* ── Container ── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.97); }

.btn-gold { background: var(--gold); color: #000; }
.btn-dark { background: #222; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #4a1010; color: #fca5a5; border: 1px solid #7f1d1d; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: 6px; }

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card-danger {
    border-color: var(--danger-border);
    background: var(--danger-bg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Typography ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
}

.page-title {
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
}
.back-link:hover { color: var(--gold); }

/* ── Flash messages ── */
.flash-container {
    max-width: 960px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
}

.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.flash-success { background: #052e16; color: #86efac; border: 1px solid #14532d; }
.flash-error   { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }

/* ── Forms ── */
input[type="text"],
input[type="number"],
input[type="email"],
select {
    background: #1e1e1e;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.15s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--gold);
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.form-group { margin-bottom: 0.75rem; }

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.form-row .form-group { flex: 1; margin-bottom: 0; }

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-open   { background: #052e16; color: #86efac; border: 1px solid #14532d; }
.badge-drawn  { background: #1e1b4b; color: #a5b4fc; border: 1px solid #3730a3; }

/* ── Index draw list ── */
.draw-list { display: flex; flex-direction: column; gap: 0.6rem; }

.draw-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: border-color 0.15s;
}

.draw-card:hover { border-color: #444; }

.draw-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    display: block;
    margin-bottom: 0.2rem;
}

.draw-name:hover { text-decoration: underline; }

.draw-meta { font-size: 0.82rem; color: var(--text-muted); }
.draw-meta strong { color: var(--text); }

.draw-card-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }

/* ── Stats row ── */
.stats-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    flex: 1;
}

.stat-card-charity { border-color: #2a3040; }

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 0.2rem;
}

.stat-card-charity .stat-value { color: #9ca3af; }

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Detail grid ── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 720px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* ── Buyers list ── */
.buyers-list { display: flex; flex-direction: column; gap: 0.75rem; }

.buyer-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #1e1e1e;
}

.buyer-row:last-child { border-bottom: none; padding-bottom: 0; }

.buyer-info { flex-shrink: 0; min-width: 100px; }
.buyer-name { font-weight: 700; color: #fff; display: block; font-size: 0.92rem; }
.buyer-count { font-size: 0.75rem; color: var(--text-muted); }

.number-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    flex: 1;
}

.chip {
    background: var(--gold);
    color: #000;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}

.chip-won {
    background: #2a2a00;
    color: #888;
    border: 1px solid #444;
    text-decoration: line-through;
}

/* ── Prizes list ── */
.prizes-list { display: flex; flex-direction: column; gap: 0.5rem; }

.prize-row-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #1e1e1e;
    gap: 0.75rem;
}

.prize-row-display:last-child { border-bottom: none; }

.prize-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.prize-pos {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.prize-desc { font-weight: 600; font-size: 0.9rem; color: #fff; }
.prize-val  { font-size: 0.78rem; color: var(--gold-dark); font-weight: 600; }

/* ── Results list ── */
.results-list { display: flex; flex-direction: column; gap: 0.4rem; }

.result-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #1e1e1e;
    font-size: 0.88rem;
}

.result-num {
    background: var(--gold);
    color: #000;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.result-name { font-weight: 600; color: #fff; flex: 1; }
.result-prize { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

/* ── Danger zone ── */
.danger-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
