/* ============================================================
   WORLD CUP 2026 TRIVIA - STYLESHEET
   Theme: Dark stadium atmosphere with vibrant accents
   ============================================================ */

:root {
    --bg-deep: #0a0a1a;
    --bg-primary: #0f0f23;
    --bg-card: #161637;
    --bg-card-hover: #1c1c45;
    --bg-input: #1a1a3a;
    --accent: #e94560;
    --accent-hover: #ff5a7a;
    --gold: #ffc107;
    --gold-dark: #e6a800;
    --green: #00d97e;
    --green-dark: #00b36b;
    --blue: #3b82f6;
    --text-primary: #ffffff;
    --text-secondary: #a0a0cc;
    --text-muted: #6b6b8a;
    --border: #2a2a50;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);
    --radius: 12px;
    --radius-lg: 20px;
    --font-display: 'Bebas Neue', Impact, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page { background: var(--bg-deep); }

.bg-stadium {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(233,69,96,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(59,130,246,0.08) 0%, transparent 50%),
        var(--bg-deep);
    z-index: 0;
}
.bg-overlay {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.01) 2px, rgba(255,255,255,0.01) 4px);
}

.floating-flags {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.floating-flags span {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: floatFlag 20s infinite linear;
}
.floating-flags span:nth-child(1) { left: 5%; animation-delay: 0s; animation-duration: 18s; }
.floating-flags span:nth-child(2) { left: 15%; animation-delay: -3s; animation-duration: 22s; }
.floating-flags span:nth-child(3) { left: 25%; animation-delay: -6s; animation-duration: 16s; }
.floating-flags span:nth-child(4) { left: 35%; animation-delay: -2s; animation-duration: 24s; }
.floating-flags span:nth-child(5) { left: 45%; animation-delay: -8s; animation-duration: 19s; }
.floating-flags span:nth-child(6) { left: 55%; animation-delay: -4s; animation-duration: 21s; }
.floating-flags span:nth-child(7) { left: 65%; animation-delay: -7s; animation-duration: 17s; }
.floating-flags span:nth-child(8) { left: 75%; animation-delay: -1s; animation-duration: 23s; }
.floating-flags span:nth-child(9) { left: 82%; animation-delay: -5s; animation-duration: 20s; }
.floating-flags span:nth-child(10) { left: 88%; animation-delay: -9s; animation-duration: 25s; }
.floating-flags span:nth-child(11) { left: 92%; animation-delay: -3s; animation-duration: 15s; }
.floating-flags span:nth-child(12) { left: 96%; animation-delay: -6s; animation-duration: 20s; }

@keyframes floatFlag {
    0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.12; }
    90% { opacity: 0.12; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

.login-container {
    position: relative; z-index: 1;
    display: flex; min-height: 100vh;
    max-width: 1100px; margin: 0 auto; padding: 20px;
    align-items: center; gap: 40px;
}

.login-card {
    flex: 1; max-width: 460px;
    background: rgba(22, 22, 55, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}

.login-header { text-align: center; margin-bottom: 32px; }
.trophy-icon { font-size: 3rem; margin-bottom: 8px; filter: drop-shadow(0 0 20px rgba(255,193,7,0.4)); }
.login-header h1 {
    font-family: var(--font-display);
    font-size: 2.8rem;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--gold), #fff8e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.subtitle {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 6px;
    color: var(--accent);
    margin-top: 4px;
}
.host-flags { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.host-flags img { width: 36px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

/* Alerts */
.alert {
    padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px; font-size: 0.9rem;
}
.alert-error { background: rgba(233,69,96,0.15); border: 1px solid rgba(233,69,96,0.3); color: #ff8a9e; }
.alert-success { background: rgba(0,217,126,0.15); border: 1px solid rgba(0,217,126,0.3); color: #66eab7; }
.alert-warning { background: rgba(255,193,7,0.15); border: 1px solid rgba(255,193,7,0.3); color: #ffe066; }
.alert-info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #93bbfd; }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 0.8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-secondary); margin-bottom: 8px;
}
.input-wrapper {
    position: relative; display: flex; align-items: center;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition);
}
.input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,0.15); }
.input-icon { padding: 0 4px 0 14px; font-size: 1.1rem; }
.input-wrapper input, .input-wrapper select {
    flex: 1; background: transparent; border: none; color: var(--text-primary);
    padding: 14px 14px 14px 8px; font-size: 1rem; font-family: var(--font-body);
    outline: none;
}
.input-wrapper input::placeholder { color: var(--text-muted); }
.toggle-password {
    background: none; border: none; cursor: pointer; padding: 0 14px;
    font-size: 1.1rem; opacity: 0.5; transition: var(--transition);
}
.toggle-password:hover { opacity: 1; }

/* Buttons */
.btn-login {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, var(--accent), #c23152);
    border: none; border-radius: var(--radius); color: #fff;
    font-family: var(--font-display); font-size: 1.4rem;
    letter-spacing: 3px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: var(--transition); position: relative; overflow: hidden;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(233,69,96,0.4); }
.btn-login:active { transform: translateY(0); }
.btn-arrow { transition: var(--transition); }
.btn-login:hover .btn-arrow { transform: translateX(4px); }

.btn { 
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
    border-radius: var(--radius); font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: var(--transition); border: none;
    text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #c23152); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(233,69,96,0.4); transform: translateY(-1px); color: #fff; }
.btn-secondary { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--text-primary); }
.btn-success { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; }
.btn-success:hover { box-shadow: 0 4px 20px rgba(0,217,126,0.4); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #1a1a2e; }
.btn-gold:hover { box-shadow: 0 4px 20px rgba(255,193,7,0.4); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; }

/* Login Footer */
.login-footer { margin-top: 28px; text-align: center; }
.scoring-info {
    display: flex; justify-content: center; gap: 20px; align-items: center;
    background: var(--bg-input); border-radius: var(--radius); padding: 16px 24px;
}
.score-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.score-points { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 1px; }
.score-points.exact { color: var(--accent); }
.score-points.winner { color: var(--gold); }
.score-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.score-divider { width: 1px; height: 40px; background: var(--border); }
.login-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 16px; }

/* Login Side Panel */
.login-side {
    flex: 1; max-width: 480px;
    display: flex; align-items: center;
}
.side-content { padding: 20px; }
.side-content h2 {
    font-family: var(--font-display); font-size: 4rem; letter-spacing: 4px;
    color: var(--text-primary); line-height: 1;
}
.side-content h3 {
    font-family: var(--font-display); font-size: 2.4rem; letter-spacing: 3px;
    color: var(--accent); margin-bottom: 16px;
}
.side-content p { color: var(--text-secondary); line-height: 1.7; font-size: 0.95rem; }

.countdown { margin-top: 30px; }
.countdown-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-bottom: 12px; }
.countdown-timer { display: flex; gap: 12px; }
.time-unit {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px; text-align: center; min-width: 70px;
}
.time-unit span { font-family: var(--font-display); font-size: 2rem; color: var(--gold); display: block; }
.time-unit small { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 2px; }
.live-now { font-family: var(--font-display); font-size: 1.5rem; color: var(--accent); letter-spacing: 2px; }

.groups-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.group-badge {
    width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    font-family: var(--font-display); font-size: 1.2rem; color: var(--text-secondary);
    transition: var(--transition);
}
.group-badge:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.1); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 260px; background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; height: 100vh;
    z-index: 100;
    transition: var(--transition);
}
.sidebar-header {
    padding: 24px 20px; border-bottom: 1px solid var(--border);
    text-align: center;
}
.sidebar-header h1 {
    font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 2px;
    background: linear-gradient(135deg, var(--gold), #fff8e1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-header .sub { font-size: 0.7rem; color: var(--accent); letter-spacing: 4px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section { margin-bottom: 24px; }
.nav-section-title {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 2px; color: var(--text-muted); padding: 0 12px; margin-bottom: 8px;
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px; color: var(--text-secondary);
    font-size: 0.9rem; font-weight: 500; transition: var(--transition);
    margin-bottom: 2px;
}
.nav-link:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-link.active { background: rgba(233,69,96,0.12); color: var(--accent); font-weight: 600; }
.nav-link .nav-icon { font-size: 1.15rem; width: 24px; text-align: center; }
.nav-link .nav-badge {
    margin-left: auto; background: var(--accent); color: #fff;
    font-size: 0.7rem; font-weight: 700; padding: 2px 8px;
    border-radius: 20px; min-width: 22px; text-align: center;
}

.sidebar-user {
    padding: 16px 20px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
}
.user-info { flex: 1; }
.user-info .user-name { font-size: 0.85rem; font-weight: 600; }
.user-info .user-role { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Main Content */
.main-content {
    flex: 1; margin-left: 260px; padding: 30px 36px;
    min-height: 100vh;
}

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 30px; flex-wrap: wrap; gap: 16px;
}
.page-title { font-family: var(--font-display); font-size: 2.2rem; letter-spacing: 2px; }
.page-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 2px; }

/* Stats Cards */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 30px;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px;
    transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-card::after {
    content: ''; position: absolute; top: 0; right: 0;
    width: 80px; height: 80px; border-radius: 0 0 0 100%;
    opacity: 0.06;
}
.stat-card.red::after { background: var(--accent); }
.stat-card.gold::after { background: var(--gold); }
.stat-card.green::after { background: var(--green); }
.stat-card.blue::after { background: var(--blue); }
.stat-icon { font-size: 1.5rem; margin-bottom: 12px; }
.stat-value { font-family: var(--font-display); font-size: 2.2rem; letter-spacing: 1px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }

/* Cards */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    margin-bottom: 24px;
}
.card-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 1px; }
.card-body { padding: 24px; }

/* ============================================================
   MATCH CARDS
   ============================================================ */
.matches-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

.match-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition);
}
.match-card:hover { border-color: rgba(233,69,96,0.4); transform: translateY(-2px); box-shadow: var(--shadow); }

.match-card-header {
    background: rgba(255,255,255,0.02); padding: 10px 18px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.75rem; color: var(--text-muted);
}
.match-stage-badge {
    padding: 3px 10px; border-radius: 20px; font-size: 0.7rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.match-stage-badge.group { background: rgba(59,130,246,0.15); color: var(--blue); }
.match-stage-badge.knockout { background: rgba(233,69,96,0.15); color: var(--accent); }

.match-card-body { padding: 20px; }

.match-teams {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.match-team {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.team-flag {
    width: 64px; height: 44px; object-fit: cover;
    border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}
.team-name { font-weight: 600; font-size: 0.85rem; }
.team-code { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; letter-spacing: 1px; }

.match-vs {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-width: 80px;
}
.vs-text {
    font-family: var(--font-display); font-size: 1.2rem;
    color: var(--text-muted); letter-spacing: 2px;
}
.match-score {
    display: flex; align-items: center; gap: 8px;
}
.score-num {
    font-family: var(--font-display); font-size: 2.4rem;
    background: var(--bg-input); width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
}
.score-dash { color: var(--text-muted); font-size: 1.4rem; }

.match-card-footer {
    padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.8rem; color: var(--text-muted);
}
.match-venue { display: flex; align-items: center; gap: 6px; }

/* Prediction Form */
.prediction-form {
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.prediction-inputs {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-bottom: 12px;
}
.pred-input {
    width: 56px; height: 50px; text-align: center;
    background: var(--bg-input); border: 2px solid var(--border);
    border-radius: 10px; color: var(--text-primary);
    font-family: var(--font-display); font-size: 1.6rem;
    transition: var(--transition); outline: none;
}
.pred-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,0.15); }
.pred-input:disabled { opacity: 0.4; cursor: not-allowed; }
.pred-dash { font-size: 1.2rem; color: var(--text-muted); }

.prediction-status {
    text-align: center; padding: 8px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
}
.prediction-status.exact { background: rgba(233,69,96,0.15); color: var(--accent); }
.prediction-status.winner { background: rgba(255,193,7,0.15); color: var(--gold); }
.prediction-status.wrong { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.prediction-status.pending { background: rgba(59,130,246,0.1); color: var(--blue); }
.prediction-status.locked { background: rgba(255,255,255,0.03); color: var(--text-muted); }

/* ============================================================
   LEADERBOARD
   ============================================================ */
.leaderboard-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
}
.leaderboard-table th {
    text-align: left; padding: 14px 16px; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
    border-bottom: 1px solid var(--border); font-weight: 600;
}
.leaderboard-table td {
    padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: var(--transition);
}
.leaderboard-table tr:hover td { background: rgba(255,255,255,0.02); }

.rank-badge {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 700; font-size: 0.85rem;
}
.rank-1 { background: linear-gradient(135deg, #ffd700, #ffb300); color: #1a1a2e; }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #1a1a2e; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #b8690e); color: #fff; }
.rank-default { background: var(--bg-input); color: var(--text-muted); }

.player-cell { display: flex; align-items: center; gap: 12px; }
.player-avatar-sm {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem;
}
.points-cell { font-family: var(--font-display); font-size: 1.4rem; color: var(--gold); }
.highlight-row td { background: rgba(233,69,96,0.06) !important; }

/* ============================================================
   GROUP TABS
   ============================================================ */
.group-tabs {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px;
    padding: 4px; background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border);
}
.group-tab {
    padding: 10px 18px; border-radius: 8px; cursor: pointer;
    font-family: var(--font-display); font-size: 1rem; letter-spacing: 2px;
    color: var(--text-muted); background: transparent;
    border: none; transition: var(--transition);
}
.group-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.group-tab.active { background: var(--accent); color: #fff; }

/* Group Standings Table */
.standings-table {
    width: 100%; border-collapse: collapse; margin-bottom: 20px;
}
.standings-table th {
    padding: 10px 12px; text-align: center; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
.standings-table th:first-child, .standings-table td:first-child { text-align: left; }
.standings-table td {
    padding: 12px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.9rem;
}
.standings-team { display: flex; align-items: center; gap: 10px; }
.standings-team img { width: 28px; border-radius: 3px; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-table {
    width: 100%; border-collapse: collapse;
}
.admin-table th {
    text-align: left; padding: 14px 16px; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
    border-bottom: 2px solid var(--border); font-weight: 600;
}
.admin-table td {
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.9rem; vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
    display: inline-flex; padding: 4px 12px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.badge-active { background: rgba(0,217,126,0.15); color: var(--green); }
.badge-inactive { background: rgba(233,69,96,0.15); color: var(--accent); }
.badge-paid { background: rgba(255,193,7,0.15); color: var(--gold); }
.badge-admin { background: rgba(59,130,246,0.15); color: var(--blue); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px); z-index: 1000;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); max-width: 500px; width: 100%;
    box-shadow: var(--shadow-lg); animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 24px 24px 0; display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 1px; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; transition: var(--transition);
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
}
.modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 0 24px 24px; display: flex; gap: 12px; justify-content: flex-end; }

/* Filter / Search */
.filter-bar {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
    align-items: center;
}
.search-box {
    flex: 1; min-width: 240px;
}
.search-box input {
    width: 100%; padding: 12px 16px 12px 42px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-size: 0.9rem; outline: none; transition: var(--transition);
}
.search-box input:focus { border-color: var(--accent); }

/* ============================================================
   INACTIVE ACCOUNT SCREEN
   ============================================================ */
.inactive-screen {
    display: flex; align-items: center; justify-content: center;
    min-height: calc(100vh - 60px); text-align: center;
}
.inactive-card {
    max-width: 500px; padding: 60px 40px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.inactive-icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.6; }
.inactive-card h2 {
    font-family: var(--font-display); font-size: 2rem;
    letter-spacing: 2px; margin-bottom: 12px; color: var(--gold);
}
.inactive-card p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 8px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
.mobile-menu-btn {
    display: none; background: none; border: none; color: var(--text-primary);
    font-size: 1.5rem; cursor: pointer; padding: 8px;
}

@media (max-width: 1024px) {
    .login-container { flex-direction: column-reverse; }
    .login-side { max-width: 100%; }
    .matches-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 20px 16px; }
    .mobile-menu-btn { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-title { font-size: 1.6rem; }
    .login-card { padding: 30px 24px; }
    .login-header h1 { font-size: 2.2rem; }
    .countdown-timer { flex-wrap: wrap; }
    .match-card { font-size: 0.9rem; }
    .team-flag { width: 48px; height: 34px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-container { padding: 12px; }
    .group-tabs { gap: 4px; }
    .group-tab { padding: 8px 12px; font-size: 0.85rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Loading spinner */
.spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast Notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; }
.toast {
    padding: 14px 20px; border-radius: var(--radius);
    margin-bottom: 10px; font-size: 0.9rem;
    box-shadow: var(--shadow); animation: slideIn 0.3s ease;
    display: flex; align-items: center; gap: 10px;
    min-width: 280px; max-width: 400px;
}
.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--accent); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Settings Page */
@media (max-width: 900px) {
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }
}
.input-wrapper select option { background: var(--bg-input); color: var(--text-primary); }

/* ============================================================
   PWA - STANDALONE MODE & SAFE AREAS
   ============================================================ */

/* iOS safe area insets for notch devices */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .sidebar {
        padding-top: env(safe-area-inset-top);
    }
    .main-content {
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
    }
    .login-container {
        padding-top: calc(20px + env(safe-area-inset-top));
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* Standalone mode adjustments */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        overscroll-behavior-y: contain;
    }
    
    /* Allow text selection in inputs and text areas */
    input, textarea, [contenteditable] {
        -webkit-user-select: text;
        user-select: text;
    }
    
    /* Prevent pull-to-refresh on dashboard (can still scroll normally) */
    .main-content {
        overscroll-behavior-y: contain;
    }
    
    /* Slightly larger touch targets in standalone */
    .nav-link {
        padding: 13px 14px;
        min-height: 44px;
    }
    .btn-sm {
        min-height: 44px;
        padding: 10px 16px;
    }
    .pred-input {
        min-width: 56px;
        min-height: 50px;
    }
    .group-tab {
        min-height: 44px;
        padding: 10px 18px;
    }
}

/* PWA splash screen background color fallback */
@media (display-mode: standalone) {
    html {
        background: #0a0a1a;
    }
}

/* Smooth transitions for page loads in PWA */
@media (display-mode: standalone) {
    .main-content {
        animation: fadeInContent 0.3s ease;
    }
    @keyframes fadeInContent {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* Bottom padding for install banner space */
body.pwa-banner-visible .main-content {
    padding-bottom: 100px;
}

