/* VM 2026 - World Cup Prediction Game
   Clean, modern, highly readable design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
    /* Clean, modern color palette */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-card: #1E293B;
    --bg-card-hover: #263548;
    --bg-input: #0F172A;

    /* Accent - Emerald (football pitch inspired) */
    --accent: #10B981;
    --accent-light: #34D399;
    --accent-dark: #059669;
    --accent-glow: rgba(16, 185, 129, 0.25);

    /* Text - High contrast for readability */
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    --text-dark: #0F172A;

    /* Borders */
    --border: #334155;
    --border-light: #475569;

    /* Status colors */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.15);

    /* Special */
    --gold: #FCD34D;
    --gold-dark: #F59E0B;
    --yellow-card: #FBBF24;
    --red-card: #EF4444;

    /* Spacing & Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.hidden {
    display: none !important;
}

/* ===== LOGIN SCREEN ===== */
.login-box {
    max-width: 440px;
    margin: 80px auto;
    background: var(--bg-card);
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    text-align: center;
}

.login-box .logo {
    margin-bottom: 20px;
}

.login-box .trophy-img {
    width: 100px;
    height: auto;
}

.login-box h1 {
    color: var(--text-primary);
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-box h2 {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.login-box p {
    margin-bottom: 20px;
    color: var(--text-muted);
}

/* Microsoft Login Button */
.ms-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: var(--text-primary);
    color: var(--text-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
}

.ms-login-btn:hover {
    background: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ms-login-btn svg {
    width: 22px;
    height: 22px;
}

.login-info {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Test mode player grid */
.player-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.player-btn {
    padding: 12px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.player-btn:hover {
    background: var(--accent);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* ===== HEADER ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-trophy {
    width: 32px;
    height: auto;
}

.header-logo {
    height: 28px;
    width: auto;
    vertical-align: middle;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

#current-player {
    font-weight: 600;
    color: var(--text-primary);
    padding: 8px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-small:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    overflow-x: auto;
}

.tab {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}

.tab.active {
    color: var(--accent-light);
    background: var(--bg-secondary);
    border-bottom-color: var(--accent);
}

/* ===== TAB CONTENT ===== */
.tab-content {
    background: var(--bg-secondary);
    padding: 28px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    border: 1px solid var(--border);
    border-top: none;
    min-height: 400px;
}

.tab-content h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 700;
}

/* ===== GROUP TABS ===== */
.group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.group-tab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 100px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.group-tab:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.group-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-primary);
}

.group-tab.complete {
    border-color: #22c55e;
    color: #22c55e;
}

.group-tab.complete:hover {
    border-color: #16a34a;
    color: #16a34a;
}

.group-tab.complete.active {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.group-tab.incomplete {
    border-color: #ef4444;
    color: #ef4444;
}

.group-tab.incomplete:hover {
    border-color: #dc2626;
    color: #dc2626;
}

.group-tab.incomplete.active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* ===== MATCH CARDS ===== */
.match-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

.match-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.match-date {
    font-weight: 600;
    color: var(--accent-light);
    background: var(--accent-glow);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.match-group {
    font-weight: 700;
    color: var(--gold);
    background: rgba(252, 211, 77, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.match-venue {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.team-flag {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.team-flag .flag-img {
    width: 56px;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.team-name {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-primary);
}

.score-input-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.score-input {
    width: 56px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    -moz-appearance: textfield;
}

/* Hide number input arrows */
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.score-input:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.score-separator {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* ===== CARD PREDICTIONS ===== */
.cards-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.cards-section h4 {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 14px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cards-row {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.card-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-input-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-input {
    width: 44px;
    height: 38px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.card-input:focus {
    outline: none;
}

.card-input.yellow {
    border-color: var(--yellow-card);
}

.card-input.yellow:focus {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.card-input.red {
    border-color: var(--red-card);
}

.card-input.red:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.card-input:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.card-icon {
    display: inline-block;
    width: 12px;
    height: 16px;
    border-radius: 2px;
    vertical-align: middle;
}

.card-icon.yellow {
    background: var(--yellow-card);
}

.card-icon.red {
    background: var(--red-card);
}

/* ===== BUTTONS ===== */
.match-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-primary {
    padding: 12px 32px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: var(--accent);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== MATCH STATUS ===== */
.match-status {
    text-align: center;
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.match-status.saved {
    background: var(--success-bg);
    color: var(--success);
}

.match-status.locked {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ===== RESULT DISPLAY ===== */
.actual-result {
    background: var(--accent);
    color: var(--text-primary);
    padding: 14px;
    border-radius: var(--radius-md);
    text-align: center;
    margin-top: 16px;
}

.actual-result .result-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.actual-result .result-score {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 4px 0;
}

.actual-result .result-cards {
    font-size: 0.8rem;
    opacity: 0.9;
}

.points-earned {
    margin-top: 14px;
    padding: 12px;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.points-earned.exact {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--text-dark);
}

.points-earned.correct {
    background: var(--success-bg);
    color: var(--success);
}

.points-earned.wrong {
    background: var(--error-bg);
    color: var(--error);
}

.points-earned.partial {
    background: var(--bg-input);
    color: var(--text-secondary);
}

/* ===== GOLDEN BOOT ===== */
.golden-boot-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(252, 211, 77, 0.1) 0%, rgba(252, 211, 77, 0.02) 100%);
    border: 1px solid rgba(252, 211, 77, 0.2);
    border-radius: var(--radius-lg);
}

.golden-boot-img {
    width: 100px;
    height: auto;
}

.golden-boot-header h2 {
    margin-bottom: 6px;
}

.golden-boot-header p {
    color: var(--text-secondary);
    margin: 0;
}

.golden-boot-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
}

.golden-boot-form label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: block;
    font-size: 0.9rem;
}

.golden-boot-form select,
.golden-boot-form input {
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    width: 100%;
}

.golden-boot-form select:focus,
.golden-boot-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.golden-boot-form select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.saved-prediction {
    margin-top: 24px;
    padding: 16px;
    background: var(--success-bg);
    border-radius: var(--radius-md);
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-prediction strong {
    color: var(--text-primary);
}

.saved-prediction .flag-img {
    width: 24px;
    height: auto;
    border-radius: 2px;
}

/* ===== PREDICTED STANDINGS ===== */
.predicted-standings {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.predicted-standings h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.predicted-standings h3 span {
    background: var(--accent);
    color: var(--text-primary);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.standings-table th {
    padding: 10px 6px;
    text-align: center;
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.standings-table th:nth-child(2) {
    text-align: left;
}

.standings-table td {
    padding: 12px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.standings-table td.team-cell {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.standings-table td.position {
    font-weight: 700;
    color: var(--text-secondary);
}

.standings-table td.gd {
    font-weight: 600;
}

.standings-table td.points {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--accent-light);
}

.standings-table tbody tr {
    transition: background var(--transition-fast);
}

.standings-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Qualifying positions */
.standings-table tr.qualify-direct td {
    background: rgba(16, 185, 129, 0.08);
}

.standings-table tr.qualify-direct td.position {
    color: var(--success);
}

.standings-table tr.qualify-direct td:first-child {
    border-left: 3px solid var(--success);
}

.standings-table tr.qualify-possible td {
    background: rgba(245, 158, 11, 0.06);
}

.standings-table tr.qualify-possible td.position {
    color: var(--warning);
}

.standings-table tr.qualify-possible td:first-child {
    border-left: 3px solid var(--warning);
}

/* Small flag in standings */
.team-flag-small {
    display: inline-flex;
    align-items: center;
}

.team-flag-small .flag-img {
    width: 24px;
    height: auto;
    border-radius: 2px;
}

.fifa-rank {
    color: var(--text-muted);
    font-size: 0.8em;
    font-weight: 400;
}

/* Sticky standings */
.predicted-standings.sticky {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    max-width: 1200px;
    z-index: 100;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* Predictions header with save button */
.predictions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.predictions-header h2 {
    margin: 0;
}

#predictions-save-status {
    text-align: center;
    margin-bottom: 15px;
}

.save-status.saving {
    color: var(--accent);
}

/* WC Champion section */
.wc-champ-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.wc-champ-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.wc-champ-img {
    width: 80px;
    height: auto;
}

.wc-champ-header h2 {
    margin: 0;
    color: var(--gold);
}

.wc-champ-header p {
    margin: 5px 0 0;
    color: var(--text-muted);
}

.wc-champ-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
}

.wc-champ-form label {
    font-weight: 600;
}

.wc-champ-form select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Golden Boot section wrapper */
.golden-boot-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
}

/* Predictions lock notice */
.predictions-lock-notice {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
}

.predictions-lock-notice p {
    margin: 0;
    color: var(--warning);
}

/* Play-offs Closed Notice */
.playoffs-closed-notice {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin: 40px auto;
    max-width: 600px;
    text-align: center;
}

.playoffs-closed-notice p {
    margin: 0;
    color: var(--warning);
    font-size: 1.1rem;
}

/* Admin WC Champ */
.admin-wc-champ {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border);
}

.admin-wc-champ h3 {
    margin-top: 0;
    color: var(--gold);
}

.admin-wc-champ select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    margin: 10px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Champ score row highlight */
.score-row.highlight.champ {
    background: linear-gradient(90deg, rgba(252, 211, 77, 0.15) 0%, transparent 100%);
    border-left: 3px solid var(--gold);
}

.standings-info {
    margin-top: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.standings-info::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 2px;
    opacity: 0.7;
}

/* ===== LEADERBOARD ===== */
.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.leaderboard-table th {
    padding: 12px 16px;
    text-align: left;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
}

.leaderboard-table td {
    padding: 14px 16px;
    background: var(--bg-card);
}

.leaderboard-table tbody tr td:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.leaderboard-table tbody tr td:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.leaderboard-table tbody tr:hover td {
    background: var(--bg-card-hover);
}

.leaderboard-table .rank-1 td {
    background: linear-gradient(90deg, rgba(252, 211, 77, 0.15) 0%, var(--bg-card) 100%);
}

.leaderboard-table .rank-1 td:first-child {
    color: var(--gold);
    font-weight: 800;
    font-size: 1rem;
}

.leaderboard-table .rank-2 td {
    background: linear-gradient(90deg, rgba(203, 213, 225, 0.1) 0%, var(--bg-card) 100%);
}

.leaderboard-table .rank-2 td:first-child {
    color: #CBD5E1;
    font-weight: 700;
}

.leaderboard-table .rank-3 td {
    background: linear-gradient(90deg, rgba(180, 130, 100, 0.1) 0%, var(--bg-card) 100%);
}

.leaderboard-table .rank-3 td:first-child {
    color: #CD7F32;
    font-weight: 700;
}

/* ===== ADMIN ===== */
.admin-group-selector {
    margin-bottom: 20px;
}

.admin-golden-boot {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.admin-golden-boot h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
}

.admin-golden-boot label {
    margin-right: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

.admin-golden-boot input {
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-right: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
}

.admin-golden-boot input:focus {
    outline: none;
    border-color: var(--accent);
}

.info-text {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* ===== KNOCKOUT ===== */
.knockout-section {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.knockout-section h2 {
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* ===== HOME TAB ===== */
.home-hero {
    text-align: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.02) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
}

.hero-trophy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.hero-trophy-img {
    width: 120px;
    height: auto;
}

.hero-logo-img {
    width: 90px;
    height: auto;
}

.home-hero h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--accent-light);
    font-weight: 500;
}

/* Rules Grid */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.rule-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all var(--transition-normal);
}

.rule-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.rule-icon {
    margin-bottom: 12px;
}

.rule-icon-img {
    width: 56px;
    height: auto;
}

.rule-card h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.rule-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Scoring Section */
.scoring-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 32px;
}

.scoring-section h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.scoring-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-row {
    display: grid;
    grid-template-columns: 1fr 90px 1.5fr;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    align-items: center;
}

.score-row.highlight {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.score-row.golden {
    background: linear-gradient(90deg, rgba(252, 211, 77, 0.12) 0%, rgba(252, 211, 77, 0.04) 100%);
    border: 1px solid rgba(252, 211, 77, 0.25);
}

.score-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.score-points {
    color: var(--accent-light);
    font-weight: 800;
    font-size: 0.9rem;
    text-align: center;
    background: rgba(16, 185, 129, 0.15);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.score-row.golden .score-points {
    background: rgba(252, 211, 77, 0.2);
    color: var(--gold);
}

.score-example {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Tournament Info */
.tournament-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 32px;
}

.tournament-info h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.format-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 14px;
    text-align: center;
    transition: all var(--transition-fast);
}

.format-card:hover {
    border-color: var(--accent);
}

.format-number {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--accent-light);
    line-height: 1;
    margin-bottom: 6px;
}

.format-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Qualification Rules */
.qualification-rules {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 20px;
}

.qualification-rules h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.qualification-rules ul,
.qualification-rules ol {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.qualification-rules ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qualification-rules ul li:last-child {
    border-bottom: none;
}

.qualification-rules ol {
    counter-reset: item;
    margin-bottom: 0;
}

.qualification-rules ol li {
    counter-increment: item;
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qualification-rules ol li::before {
    content: counter(item);
    background: var(--accent);
    color: var(--text-primary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.qualify-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.75rem;
    min-width: 50px;
}

.qualify-badge.direct {
    background: var(--success-bg);
    color: var(--success);
}

.qualify-badge.possible {
    background: var(--warning-bg);
    color: var(--warning);
}

.qualify-badge.total {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-light);
}

/* Dates Timeline */
.dates-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.dates-section h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.dates-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 16px;
}

.dates-timeline::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: var(--accent);
}

.date-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.date-marker {
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
    margin-bottom: 12px;
}

.date-content {
    text-align: center;
}

.date-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.date-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== BRACKET TAB ===== */
.bracket-header {
    text-align: center;
    margin-bottom: 20px;
}

.bracket-header h2 {
    margin-bottom: 6px;
}

.bracket-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bracket-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.legend-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-box.winner {
    background: var(--success);
}

.legend-box.runner-up {
    background: #3B82F6;
}

.legend-box.third-place {
    background: var(--warning);
}

/* Tournament Bracket Tree Layout */
.tournament-bracket {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding: 20px 0;
    margin-bottom: 20px;
}

.bracket-side {
    display: flex;
    flex: 1;
}

.left-side {
    flex-direction: row;
}

.right-side {
    flex-direction: row;
}

.bracket-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0 4px;
    min-width: 160px;
    flex-shrink: 0;
}

.column-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.bracket-column .bracket-match {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    margin: 4px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-slot {
    padding: 6px 8px;
    background: var(--bg-input);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
}

.team-slot.tbd {
    color: var(--text-muted);
    border: 1px dashed var(--border);
    background: transparent;
}

.team-slot.winner {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--success);
}

.team-slot.runner-up {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: #60A5FA;
}

.team-slot.third-place {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
    color: var(--warning);
}

.team-slot .flag-img {
    width: 18px;
    height: auto;
    border-radius: 2px;
}

.team-slot .team-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
}

/* Final */
.bracket-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    min-width: 140px;
    flex-shrink: 0;
}

.final-trophy {
    margin-bottom: 8px;
}

.final-trophy-img {
    width: 56px;
    height: auto;
}

.final-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.bracket-final .bracket-match {
    background: linear-gradient(135deg, rgba(252, 211, 77, 0.1) 0%, rgba(252, 211, 77, 0.02) 100%);
    border: 2px solid var(--gold);
    border-radius: var(--radius-md);
    padding: 12px;
    width: 100%;
}

.bracket-final .team-slot {
    padding: 10px 12px;
    font-size: 0.85rem;
}

.vs-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 0;
}

.bracket-instructions {
    text-align: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Slot Labels */
.slot-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.slot-label.third-place {
    color: var(--warning);
}

/* Third Place Qualifiers Display */
.third-place-qualifiers {
    text-align: center;
}

.third-place-qualifiers h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.third-place-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.third-place-team {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-primary);
}

.third-place-team .flag-img {
    width: 18px;
    height: auto;
    border-radius: 2px;
}

/* Knockout Match Styling */
.knockout-team {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg-input);
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 2px 0;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.knockout-team .flag-img {
    width: 18px;
    height: auto;
    border-radius: 2px;
    flex-shrink: 0;
}

.knockout-team .team-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 90px;
}

.knockout-team .ko-score {
    width: 32px;
    padding: 3px 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    flex-shrink: 0;
    -moz-appearance: textfield;
}

/* Hide number input arrows */
.knockout-team .ko-score::-webkit-outer-spin-button,
.knockout-team .ko-score::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.knockout-team .ko-score:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.knockout-team .ko-score:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Winner highlight */
.knockout-team.winner-highlight {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
}

.knockout-team.winner-highlight .team-name {
    color: var(--success);
}

/* Final match special styling */
.bracket-final .knockout-team {
    padding: 10px 12px;
    font-size: 0.85rem;
}

.bracket-final .knockout-team .ko-score {
    width: 44px;
    padding: 6px 8px;
    font-size: 0.9rem;
}

.bracket-final .knockout-team .flag-img {
    width: 24px;
}

/* Champion display */
.champion-display {
    text-align: center;
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(252, 211, 77, 0.15) 0%, rgba(252, 211, 77, 0.05) 100%);
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
}

.champion-display h4 {
    color: var(--gold);
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.champion-team {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.champion-team .flag-img {
    width: 32px;
    height: auto;
    border-radius: 3px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .login-box {
        margin: 24px 12px;
        padding: 32px 20px;
    }

    .login-box h1 {
        font-size: 1.8rem;
    }

    .player-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .match-teams {
        flex-direction: column;
        gap: 16px;
    }

    .score-input-container {
        order: 2;
    }

    .team:first-child {
        order: 1;
    }

    .team:last-child {
        order: 3;
    }

    .cards-row {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1 1 50%;
        font-size: 0.8rem;
        padding: 12px 10px;
    }

    .golden-boot-form {
        max-width: 100%;
    }

    header {
        flex-direction: column;
        gap: 14px;
        text-align: center;
        padding: 14px 18px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    .tab-content {
        padding: 18px;
    }

    .group-tabs {
        justify-content: center;
    }

    .leaderboard-table {
        font-size: 0.8rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 8px;
    }

    /* Standings table mobile */
    .predicted-standings {
        padding: 14px;
        overflow-x: auto;
    }

    .standings-table {
        font-size: 0.75rem;
        min-width: 480px;
    }

    .standings-table th,
    .standings-table td {
        padding: 8px 4px;
    }

    .team-flag-small .flag-img {
        width: 20px;
    }

    /* Home page mobile */
    .home-hero {
        padding: 28px 18px;
    }

    .hero-trophy-img {
        width: 80px;
    }

    .golden-boot-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .golden-boot-img {
        width: 80px;
    }

    .home-hero h2 {
        font-size: 1.5rem;
    }

    .rules-grid {
        grid-template-columns: 1fr;
    }

    .score-row {
        grid-template-columns: 1fr;
        gap: 6px;
        text-align: center;
    }

    .score-points {
        display: inline-block;
    }

    .format-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dates-timeline {
        flex-direction: column;
        gap: 20px;
        padding: 0;
    }

    .dates-timeline::before {
        display: none;
    }

    .date-item {
        flex-direction: row;
        gap: 14px;
    }

    .date-marker {
        margin-bottom: 0;
    }

    .date-content {
        text-align: left;
    }

    .bracket-legend {
        flex-wrap: wrap;
        gap: 12px;
    }

    .bracket-matches {
        grid-template-columns: repeat(2, 1fr);
    }

    .round-of-32 .bracket-matches {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   TABLES TAB - Group Standings Predictions
   ============================================ */

.tables-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tables-header h2 {
    margin-bottom: 0.5rem;
}

.tables-header p {
    color: var(--text-secondary);
}

#tables-group-tabs,
#admin-standings-group-tabs {
    margin-bottom: 1.5rem;
}

.table-prediction-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.table-prediction-card h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.standings-prediction-form,
.admin-standings-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.position-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius);
}

.position-number {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 40px;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
}

.position-number.qualify-direct {
    background: var(--success-bg);
    color: var(--success);
}

.position-number.qualify-possible {
    background: var(--warning-bg);
    color: var(--warning);
}

.position-select {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.position-select:focus {
    outline: none;
    border-color: var(--accent);
}

#save-standings-prediction,
#save-admin-standings {
    margin-top: 1rem;
}

.save-status {
    text-align: center;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border-radius: var(--radius);
}

.save-status.success,
.save-status.saved {
    background: var(--success-bg);
    color: var(--success);
}

.save-status.error {
    background: var(--error-bg);
    color: var(--error);
}

.tables-info {
    max-width: 500px;
    margin: 2rem auto 0;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
}

.tables-info h4 {
    margin-bottom: 0.5rem;
}

.tables-info ul {
    list-style: none;
    padding: 0;
}

.tables-info li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
}

.admin-standings {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.admin-standings h3 {
    margin-bottom: 0.5rem;
}

.admin-standings-form {
    max-width: 500px;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius);
}

.admin-standings-form h4 {
    margin-bottom: 1rem;
    text-align: center;
}

/* ============ Auth form (email / password) ============ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    margin-top: 1.5rem;
}

.auth-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-form label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-form input {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-form .btn-primary {
    margin-top: 0.5rem;
    width: 100%;
}

.auth-error {
    color: #FCA5A5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
}

.auth-toggle {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.35rem;
}

.auth-toggle a:hover {
    text-decoration: underline;
}
