/* ================================================================
   WC 2026 Sweepstake — Football Theme
   ================================================================ */

:root {
    --green-dark:   #1a3a1a;
    --green-mid:    #2d6a2d;
    --green-light:  #3d8b3d;
    --green-pitch:  #4caf50;
    --gold:         #ffd700;
    --gold-dark:    #c9a800;
    --white:        #ffffff;
    --off-white:    #f4f8f4;
    --text:         #1a1a1a;
    --text-light:   #555;
    --border:       #cdd;
    --red:          #c0392b;
    --blue:         #2980b9;
    --shadow:       0 2px 8px rgba(0,0,0,0.12);
    --radius:       6px;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--off-white);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* ----------------------------------------------------------------
   AUTH PAGES
   ---------------------------------------------------------------- */

body.auth-page {
    background: var(--green-dark);
    background-image: radial-gradient(ellipse at center, var(--green-mid) 0%, var(--green-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--green-mid);
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.auth-card h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.auth-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.75rem 0 0.25rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--green-pitch);
}

.auth-links {
    margin-top: 1rem;
    font-size: 0.875rem;
    text-align: center;
    color: var(--text-light);
}

.auth-links a { color: var(--green-mid); text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   HEADER / NAV
   ---------------------------------------------------------------- */

.site-header {
    background: var(--green-dark);
    background-image: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 56px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.main-nav { display: flex; gap: 0.25rem; }

.main-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.main-nav a:hover, .main-nav a.active {
    background: rgba(255,255,255,0.15);
    color: var(--white);
}

.main-nav a.admin-link { color: var(--gold); }
.main-nav a.admin-link:hover, .main-nav a.admin-link.active {
    background: rgba(255,215,0,0.15);
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.username { color: rgba(255,255,255,0.7); }

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.paid    { background: var(--green-pitch); color: var(--white); }
.badge.unpaid  { background: #e67e22; color: var(--white); }

.btn-logout {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: var(--white); }

/* ----------------------------------------------------------------
   LAYOUT
   ---------------------------------------------------------------- */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    color: var(--green-dark);
}

/* ----------------------------------------------------------------
   ALERTS
   ---------------------------------------------------------------- */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success { background: #d4edda; border-left: 4px solid #28a745; color: #155724; }
.alert-error   { background: #f8d7da; border-left: 4px solid var(--red); color: #721c24; }
.alert-info    { background: #d1ecf1; border-left: 4px solid var(--blue); color: #0c5460; }
.alert-warn    { background: #fff3cd; border-left: 4px solid #ffc107; color: #856404; }

/* ----------------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
}

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

.btn-primary   { background: var(--green-mid); color: var(--white); }
.btn-secondary { background: #555; color: var(--white); }
.btn-warn      { background: #e67e22; color: var(--white); }
.btn-xs        { padding: 0.25rem 0.65rem; font-size: 0.78rem; background: #eee; color: var(--text); border: 1px solid var(--border); border-radius: 4px; }

.form-actions { margin-top: 1.25rem; }

/* ----------------------------------------------------------------
   DASHBOARD
   ---------------------------------------------------------------- */

.dashboard-hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.dashboard-hero h1 { font-size: 1.8rem; font-weight: 800; }
.dashboard-hero .tagline { opacity: 0.8; margin-top: 0.25rem; }
.dashboard-hero .alert { margin-top: 1rem; }

.points-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pts-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.pts-card .pts-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.pts-card .pts-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--green-mid);
    margin-top: 0.25rem;
}

.pts-total { border-top: 3px solid var(--gold); }
.pts-total .pts-value { color: var(--gold-dark); }

.prediction-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.pred-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
    border-bottom: 3px solid var(--green-pitch);
}

.pred-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.pred-card .pred-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.pred-card h3 { font-size: 1.1rem; font-weight: 800; color: var(--green-dark); margin-bottom: 0.4rem; }
.pred-card p  { font-size: 0.875rem; color: var(--text-light); }

/* ----------------------------------------------------------------
   SCORES PAGE
   ---------------------------------------------------------------- */

.scores-section { margin-bottom: 2.5rem; }
.scores-section h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--green-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lock-badge {
    font-size: 0.75rem;
    font-weight: 700;
    background: #e74c3c;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.group-block {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.group-block h3 {
    background: var(--green-dark);
    color: var(--white);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.scores-table-wrap { overflow-x: auto; }

.scores-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.scores-table th {
    background: #f0f5f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

.scores-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.scores-table tr:last-child td { border-bottom: none; }
.scores-table tr.confirmed { background: #f0fff0; }

.team-cell   { min-width: 120px; font-weight: 500; }
.score-cell  { width: 60px; text-align: center; }
.actual-cell { width: 60px; text-align: center; font-weight: 700; color: var(--green-mid); }
.pts-cell    { width: 50px; text-align: center; font-weight: 700; color: var(--gold-dark); }

.score-input {
    width: 52px;
    padding: 0.3rem;
    text-align: center;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
}

.score-input:focus { outline: none; border-color: var(--green-pitch); }
.score-static { font-weight: 700; color: var(--text-light); }

.info-text { color: var(--text-light); font-style: italic; margin: 0.75rem 0; }

/* ----------------------------------------------------------------
   TABLES PAGE
   ---------------------------------------------------------------- */

.tables-block {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
}

.tables-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.table-pred h3, .table-actual h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.group-table th {
    background: #f0f5f0;
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

.group-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.group-table tr:last-child td { border-bottom: none; }

.pos-cell { width: 40px; font-weight: 700; color: var(--text-light); text-align: center; }

.team-select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
}

.team-select:focus { outline: none; border-color: var(--green-pitch); }
.group-pts { font-size: 0.875rem; margin-top: 0.5rem; color: var(--text-light); }

/* ----------------------------------------------------------------
   BONUS PAGE
   ---------------------------------------------------------------- */

.bonus-table-wrap { overflow-x: auto; }

.bonus-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 0.875rem;
    overflow: hidden;
}

.bonus-table th {
    background: var(--green-dark);
    color: var(--white);
    padding: 0.6rem 0.85rem;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bonus-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.bonus-table tr:last-child td { border-bottom: none; }
.bonus-table tr.answered { background: #f0fff0; }

.q-num    { width: 40px; font-weight: 700; text-align: center; }
.q-text   { min-width: 260px; }
.q-pts    { width: 140px; font-size: 0.8rem; color: var(--text-light); }
.q-answer { min-width: 160px; }
.q-actual { min-width: 120px; font-weight: 600; color: var(--green-mid); }
.q-awarded{ width: 50px; text-align: center; font-weight: 700; color: var(--gold-dark); }

.answer-input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
}

.answer-input:focus { outline: none; border-color: var(--green-pitch); }

/* ----------------------------------------------------------------
   ADMIN
   ---------------------------------------------------------------- */

.admin-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.15s;
}

.tab-btn:hover { color: var(--text); background: #eee; }
.tab-btn.active {
    color: var(--green-dark);
    background: var(--white);
    border-color: var(--border);
    border-bottom: 2px solid var(--white);
    margin-bottom: -2px;
}

.admin-section {
    margin-bottom: 1.5rem;
}

.admin-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 0.75rem;
}

.admin-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-actions { margin-bottom: 1rem; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 0.875rem;
    overflow: hidden;
}

.admin-table th {
    background: #f0f5f0;
    padding: 0.55rem 0.85rem;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafffe; }

.score-input-sm {
    width: 56px;
    padding: 0.3rem;
    text-align: center;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
}

.answer-input-admin {
    width: 100%;
    min-width: 180px;
    padding: 0.35rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
}

.settings-form .admin-section { max-width: 480px; }
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    font-weight: 500;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--green-pitch);
}

.user-link { color: var(--green-mid); font-weight: 600; text-decoration: none; }
.user-link:hover { text-decoration: underline; }

/* Leaderboard */
.leaderboard-table tr.rank-1 td { background: #fff9e6; }
.leaderboard-table tr.rank-2 td { background: #f5f5f5; }
.leaderboard-table tr.rank-3 td { background: #fff4ec; }

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */

.site-footer {
    background: var(--green-dark);
    color: rgba(255,255,255,0.4);
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */

@media (max-width: 768px) {
    .points-summary    { grid-template-columns: repeat(2, 1fr); }
    .prediction-cards  { grid-template-columns: 1fr; }
    .tables-cols       { grid-template-columns: 1fr; }
    .header-inner      { flex-wrap: wrap; height: auto; padding: 0.5rem 1rem; }
    .main-nav          { order: 3; width: 100%; padding-bottom: 0.5rem; }
    .header-right      { gap: 0.5rem; }
    .username          { display: none; }
    .page-title        { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .points-summary { grid-template-columns: 1fr 1fr; }
    .auth-card      { padding: 1.5rem; }
    .admin-tabs     { gap: 0.15rem; }
    .tab-btn        { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
}
