/* ============================================
   Spring Spikefest — Tournament Styles
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --gold: #f59e0b;
    --gold-dark: #d97706;
    --silver: #94a3b8;
    --silver-dark: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --live-red: #ef4444;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main, [id^="view-"] { flex: 1; }

/* ── Hero Section ── */
.hero-section { position: relative; height: 300px; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(26,26,46,0.2) 0%, rgba(26,26,46,0.88) 100%); z-index: 1; }
.hero-content { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; z-index: 2; color: #fff; }
.hero-badge { display: inline-block; background: var(--gold); color: #1a1a2e; font-weight: 800; font-size: 0.72rem; padding: 4px 14px; border-radius: 20px; letter-spacing: 0.08em; margin-bottom: 8px; }
.hero-title { font-size: 2.8rem; font-weight: 900; letter-spacing: -0.02em; text-shadow: 0 2px 12px rgba(0,0,0,0.4); margin: 0; line-height: 1; }
.hero-subtitle { font-size: 1rem; font-weight: 500; opacity: 0.85; margin-top: 4px; margin-bottom: 2px; }
.hero-venue { font-size: 0.82rem; opacity: 0.7; margin: 0; }

/* ── Navbar ── */
.brand-icon { font-size: 1.4rem; margin-right: 6px; }
.navbar-dark .nav-link { font-weight: 500; font-size: 0.85rem; padding: 6px 10px !important; border-radius: 8px; transition: background 0.2s; }
.navbar-dark .nav-link:hover, .navbar-dark .nav-link.active { background: rgba(255,255,255,0.12); }

/* ── Info Cards (event details) ── */
.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.info-card i { font-size: 1.5rem; color: var(--primary); margin-bottom: 4px; display: block; }
.info-value { font-size: 1.1rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.info-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Phase Tracker ── */
.phase-tracker { display: flex; align-items: center; justify-content: center; gap: 0; padding: 12px 0; }
.phase-step { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); padding: 6px 14px; border-radius: 20px; transition: all 0.3s; }
.phase-step.active { color: var(--primary); background: rgba(99,102,241,0.1); }
.phase-step.done { color: var(--success); }
.phase-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: all 0.3s; }
.phase-step.active .phase-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.phase-step.done .phase-dot { background: var(--success); }
.phase-line { width: 30px; height: 2px; background: var(--border); margin: 0 2px; }

/* ── Quick Cards ── */
.quick-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 16px 10px; text-align: center; cursor: pointer;
    transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.quick-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.quick-card i { font-size: 1.6rem; color: var(--primary); margin-bottom: 6px; display: block; }
.quick-label { font-weight: 700; font-size: 0.92rem; }
.quick-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* ── Pool Mini Labels ── */
.pool-label-mini {
    display: inline-block; font-size: 0.7rem; font-weight: 800; color: #fff;
    padding: 2px 10px; border-radius: 10px; margin-bottom: 8px; letter-spacing: 0.04em;
}
.pool-label-mini.pool-a { background: var(--primary); }
.pool-label-mini.pool-b { background: #0ea5e9; }
.team-item { padding: 4px 0; font-size: 0.88rem; font-weight: 600; }

/* ── Live Banner ── */
.live-banner {
    background: linear-gradient(135deg, #1a1a2e, #2d1b69);
    border-radius: 12px; padding: 14px 18px; margin-bottom: 1rem;
    display: flex; align-items: center; gap: 12px;
    animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
.live-badge { background: var(--live-red); color: #fff; font-size: 0.72rem; font-weight: 800; padding: 3px 10px; border-radius: 12px; letter-spacing: 0.05em; animation: blink 1.5s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.live-text { color: #fff; font-weight: 600; font-size: 0.92rem; }

/* ── Champion Banner ── */
#champion-banner { display: flex; gap: 12px; margin-bottom: 1rem; }
.champion-card {
    flex: 1; position: relative; border-radius: 14px; padding: 20px 16px; text-align: center;
    overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.champion-card.gold-champion {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 40%, #fbbf24 100%);
    border: 2px solid #f59e0b;
}
.champion-card.silver-champion {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 40%, #cbd5e1 100%);
    border: 2px solid #94a3b8;
}
.champion-confetti {
    position: absolute; top: 6px; right: 12px; font-size: 1.4rem;
    animation: confettiFloat 2s ease-in-out infinite;
}
@keyframes confettiFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(15deg); }
}
.champion-trophy { font-size: 2rem; margin-bottom: 4px; }
.champion-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #92400e; margin-bottom: 2px; }
.silver-champion .champion-label { color: #475569; }
.champion-name { font-size: 1rem; font-weight: 900; color: #78350f; }
.silver-champion .champion-name { color: #1e293b; }

/* Bracket winner crown */
.bracket-match.champion-crowned { border-color: #f59e0b; box-shadow: 0 0 12px rgba(245,158,11,0.3); }
.bracket-match.champion-crowned .bracket-match-label { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }

@media (max-width: 576px) {
    #champion-banner { flex-direction: column; }
    .champion-card { padding: 16px 12px; }
    .champion-name { font-size: 0.9rem; }
    .champion-trophy { font-size: 1.6rem; }
}

/* ── Pool Winners (Brackets page) ── */
.pool-winners-row { display: flex; gap: 12px; }
.pool-winner-card {
    flex: 1; text-align: center; border-radius: 12px; padding: 16px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.pool-winner-card.gold-champ-card {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
}
.pool-winner-card.silver-champ-card {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border: 2px solid #94a3b8;
}
.pw-pool-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #92400e; margin-bottom: 2px; }
.silver-champ-card .pw-pool-label { color: #475569; }
.pw-icon { font-size: 1.4rem; }
.pw-team { font-size: 0.95rem; font-weight: 800; color: #1e293b; }
.pw-record { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
@media (max-width: 576px) {
    .pool-winners-row { flex-direction: column; }
    .pool-winner-card { padding: 12px 10px; }
}
/* ── Cards ── */
.card { border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.card-header { background: var(--card-bg); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.88rem; padding: 12px 16px; }

/* ── Pool Headers ── */
.pool-header { color: #fff; font-size: 0.95rem; font-weight: 800; letter-spacing: 0.03em; }
.pool-a { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.pool-b { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }

/* ── Tables ── */
.table { margin-bottom: 0; font-size: 0.85rem; }
.table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; background: #f8fafc; border-bottom: 2px solid var(--border); padding: 8px 10px; white-space: nowrap; }
.table td { padding: 10px; vertical-align: middle; }
.table .team-name { font-weight: 700; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 800; font-size: 0.78rem; color: #fff; }
.rank-1 { background: var(--gold); }
.rank-2 { background: #94a3b8; }
.rank-3 { background: #cd7f32; }
.rank-4, .rank-default { background: #e2e8f0; color: #475569; }

/* ── Match Cards ── */
.match-card { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 0.85rem; transition: background 0.15s; flex-wrap: wrap; gap: 4px; }
.match-card:last-child { border-bottom: none; }
.match-card:hover { background: #f8fafc; }
.match-label { font-size: 0.7rem; font-weight: 800; color: var(--text-muted); background: #f1f5f9; padding: 2px 8px; border-radius: 4px; margin-right: 8px; min-width: 28px; text-align: center; }
.match-time-badge { font-size: 0.7rem; font-weight: 700; color: var(--primary); margin-right: 8px; white-space: nowrap; }
.match-teams { flex: 1; min-width: 0; }
.match-team { font-weight: 600; }
.match-vs { color: var(--text-muted); font-size: 0.75rem; margin: 0 4px; }
.match-scores { text-align: right; font-weight: 700; white-space: nowrap; }
.match-scores .set-score { display: inline-block; background: #f1f5f9; padding: 2px 8px; border-radius: 4px; font-size: 0.82rem; margin-left: 4px; }
.match-scores .set-score.winner { background: #dcfce7; color: #166534; }
.match-status { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-left: 8px; }
.status-pending { color: var(--text-muted); }
.status-live { color: var(--live-red); }
.status-complete { color: var(--success); }
.match-work { font-size: 0.72rem; color: #b45309; font-weight: 600; width: 100%; padding-left: 36px; margin-top: 2px; }

/* ── Schedule Page ── */
.timeline-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.timeline-item { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.timeline-item:last-child { border-bottom: none; }
.timeline-item.highlight { background: #fef3c7; }
.timeline-time { font-weight: 800; min-width: 80px; color: var(--primary); font-size: 0.85rem; }
.timeline-desc { flex: 1; font-weight: 500; }

.schedule-round { margin-bottom: 12px; }
.schedule-round-header {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 800; font-size: 0.88rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9); border: 1px solid var(--border); border-radius: 10px 10px 0 0;
    color: var(--text);
}
.schedule-round-header .round-time { color: var(--primary); min-width: 80px; }
.schedule-round-body { background: var(--card-bg); border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; }
.schedule-match { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; }
.schedule-match:last-child { border-bottom: none; }
.schedule-court { font-size: 0.7rem; font-weight: 800; color: var(--text-muted); background: #f1f5f9; padding: 2px 8px; border-radius: 4px; margin-right: 10px; min-width: 60px; text-align: center; }
.schedule-teams { flex: 1; font-weight: 600; }
.schedule-work { font-size: 0.75rem; color: #b45309; font-weight: 600; background: #FEF3C7; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.schedule-status { margin-left: 8px; }

/* ── View Title ── */
.view-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 1rem; color: var(--text); }

/* ── Bracket Viz ── */
.bracket-section { margin-bottom: 1.5rem; }
.bracket-title { font-size: 1.2rem; font-weight: 800; padding: 12px 18px; border-radius: 10px; margin-bottom: 12px; }
.bracket-title.gold { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border: 1px solid #fcd34d; }
.bracket-title.silver { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); color: #475569; border: 1px solid #cbd5e1; }

.bracket { display: flex; align-items: center; justify-content: center; gap: 0; overflow-x: auto; padding: 10px 0; }
.bracket-round { display: flex; flex-direction: column; justify-content: center; gap: 16px; min-width: 160px; }
.bracket-connector { width: 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.bracket-match { background: var(--card-bg); border: 2px solid var(--border); border-radius: 8px; overflow: hidden; min-width: 150px; transition: box-shadow 0.2s; }
.bracket-match.live { border-color: var(--live-red); box-shadow: 0 0 0 2px rgba(239,68,68,0.2); }
.bracket-match.complete { border-color: var(--success); }
.bracket-match-label { font-size: 0.65rem; font-weight: 800; color: var(--text-muted); text-align: center; padding: 3px; background: #f8fafc; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.06em; }
.bracket-match-time { font-size: 0.6rem; color: var(--primary); font-weight: 700; text-align: center; padding: 2px; background: #eef2ff; }
.bracket-team { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 0.82rem; font-weight: 600; border-bottom: 1px solid #f1f5f9; }
.bracket-team:last-child { border-bottom: none; }
.bracket-team.winner { background: #f0fdf4; color: #166534; }
.bracket-team.loser { opacity: 0.5; }
.bracket-team .team-name-bracket { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bracket-team .team-score-bracket { font-weight: 800; min-width: 20px; text-align: right; }
.bracket-team.tbd { color: var(--text-muted); font-style: italic; font-weight: 400; }
.bracket-match.placeholder-match { border-style: dashed; border-color: #cbd5e1; opacity: 0.85; }

/* ── Rules Page ── */
.rules-highlight {
    display: flex; align-items: center; gap: 14px; padding: 14px 18px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2); border: 1px solid #fecaca;
    border-radius: 10px; margin-bottom: 16px;
}
.rules-list { list-style: none; padding: 0; margin: 0; }
.rules-list li {
    padding: 8px 0; border-bottom: 1px solid #f1f5f9;
    line-height: 1.5;
}
.rules-list li:last-child { border-bottom: none; }
.rules-list li > i { margin-right: 8px; vertical-align: middle; }
.rules-list.compact li { padding: 5px 0; font-size: 0.85rem; }

/* ── Refresh Indicator ── */
.refresh-indicator { position: fixed; bottom: 16px; right: 16px; background: rgba(26,26,46,0.85); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 6px 14px; border-radius: 20px; opacity: 0; transition: opacity 0.3s; z-index: 100; }
.refresh-indicator.show { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1s linear infinite; }

/* ── Admin Styles ── */
.pin-screen { max-width: 320px; margin: 80px auto; text-align: center; }
.pin-input { font-size: 2rem; text-align: center; letter-spacing: 0.5em; font-weight: 800; border: 2px solid var(--border); border-radius: 12px; padding: 12px 0; width: 100%; }
.admin-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.score-input { width: 60px; text-align: center; font-size: 1.2rem; font-weight: 700; border: 2px solid var(--border); border-radius: 8px; padding: 6px; }

/* ── Scoreboard Styles ── */
.scoreboard-team { text-align: center; padding: 20px; }
.scoreboard-name { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.scoreboard-score { font-size: 4rem; font-weight: 900; line-height: 1; color: var(--primary); }
.scoreboard-btn { width: 70px; height: 70px; border-radius: 50%; border: none; font-size: 1.8rem; font-weight: 900; cursor: pointer; transition: transform 0.1s; display: inline-flex; align-items: center; justify-content: center; }
.scoreboard-btn:active { transform: scale(0.92); }
.scoreboard-btn.plus { background: var(--success); color: #fff; box-shadow: 0 3px 10px rgba(16,185,129,0.3); }
.scoreboard-btn.minus { background: #fee2e2; color: var(--danger); }
.set-indicator { text-align: center; font-weight: 800; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 12px 0; }

/* ── Responsive ── */
@media (max-width: 576px) {
    .hero-section { height: 240px; }
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 0.88rem; }
    .table th, .table td { padding: 6px 8px; font-size: 0.78rem; }
    .match-card { padding: 8px 10px; font-size: 0.8rem; }
    .bracket-match { min-width: 120px; }
    .bracket-team { padding: 6px 8px; font-size: 0.74rem; }
    .bracket-round { min-width: 120px; gap: 10px; }
    .bracket-connector { width: 14px; }
    .info-card { padding: 12px 8px; }
    .info-value { font-size: 0.95rem; }
    .quick-card { padding: 12px 8px; }
    .quick-card i { font-size: 1.3rem; }
    .quick-label { font-size: 0.82rem; }
    .schedule-match { flex-wrap: wrap; }
}
