/* ============================================================
   2026 FIFA World Cup Survivor — Styles
   Palette: Deep Navy + Teal + Sunrise Orange (FIFA 2026 inspired)
   ============================================================ */

:root {
    --primary: #1F2A5C;            /* deep navy — header, table heads, primary buttons */
    --primary-mid: #2E3D7C;
    --primary-light: #4458A4;
    --accent-teal: #00C9A7;        /* vivid teal — highlights, "alive" status */
    --accent-orange: #F26C4F;      /* sunrise orange — warnings, eliminated badges */
    --gold-accent: #F4B400;        /* winner shimmer */
    --cream: #FFF7E6;              /* light text on dark; subtle backdrops */
    --bg: #F5F5F0;
    --bg-alt: #EBEEF5;             /* subtle blue tint instead of green tint */
    --text: #212529;
    --text-light: #6C757D;
    --white: #FFFFFF;
    --border: #D4D4D4;
    --shadow: rgba(0, 0, 0, 0.1);
    --row-hover: #DEE5F2;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent-teal); }

/* ---- Site Header ---- */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    background: var(--primary);
    color: var(--cream);
}

.site-title {
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* ---- Hamburger ---- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--cream);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---- Navigation ---- */
.nav {
    background: var(--white);
    border-bottom: 3px solid var(--primary);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-menu > li { position: relative; }

.nav-link {
    display: block;
    padding: 0.65rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary);
    color: var(--cream);
}

/* Dropdown indicator arrow */
.nav-dropdown > .nav-link::after {
    content: ' \25BE';
    font-size: 0.7em;
    opacity: 0.6;
}

/* ---- Dropdown Menus ---- */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--white);
    box-shadow: 0 4px 16px var(--shadow);
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    list-style: none;
    padding: 0.3rem 0;
    z-index: 200;
    max-height: 70vh;
    overflow-y: auto;
}

.nav-dropdown:hover > .dropdown-menu { display: block; }

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    transition: background 0.15s;
}

.dropdown-menu a:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.dropdown-divider {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
    padding: 0.5rem 1rem 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* ---- Banner ---- */
.banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 55%, var(--primary-light) 100%);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle pitch-grid pattern */
.banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 V60 M0 30 H60' stroke='rgba(255,255,255,0.05)' stroke-width='1'/%3E%3Ccircle cx='30' cy='30' r='12' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1'/%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.banner-text {
    display: block;
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    font-weight: 800;
    color: var(--cream);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    position: relative;
}

.banner-subtext {
    display: block;
    font-size: clamp(0.7rem, 1.6vw, 0.9rem);
    font-weight: 500;
    color: var(--accent-teal);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    position: relative;
}

.banner-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.social-label {
    font-size: clamp(0.6rem, 1.5vw, 0.75rem);
    font-weight: 600;
    color: rgba(255, 247, 230, 0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--white);
    border-radius: 50%;
    color: var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-icons a:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.social-icons a svg { width: 15px; height: 15px; }

.social-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 247, 230, 0.4);
}

/* ---- Main Content ---- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ---- Countdown banner ---- */
.countdown {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 1rem;
    margin: 1rem auto 1.5rem;
    padding: 0.7rem 1rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 6px var(--shadow);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.countdown-label {
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
}

.countdown-value {
    font-weight: 800;
    color: var(--accent-orange);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

/* ---- Survivors badge ---- */
.survivors-badge {
    display: inline-block;
    margin: 0 auto 1rem;
    padding: 0.5rem 1.2rem;
    background: var(--accent-teal);
    color: var(--primary);
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

.survivors-wrap {
    text-align: center;
}

/* ---- Pool/Standings Table ---- */
.pool-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px var(--shadow);
    background: var(--white);
}

.pool-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 780px;
    font-size: 0.82rem;
}

.pool-table thead th {
    background: var(--primary);
    color: var(--cream);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.4rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.pool-table thead th:first-child {
    text-align: left;
    padding-left: 0.8rem;
    min-width: 130px;
}

.pool-table tbody tr { transition: background 0.15s; }

.pool-table tbody tr:nth-child(even) { background: var(--bg-alt); }
.pool-table tbody tr:nth-child(odd) { background: var(--white); }
.pool-table tbody tr:hover { background: var(--row-hover); }

.pool-table td {
    padding: 0.5rem 0.35rem;
    text-align: center;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
}

.col-entry {
    text-align: left !important;
    padding-left: 0.8rem !important;
    font-weight: 700;
    white-space: nowrap;
}

.col-rebuy {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    background: var(--accent-orange);
    color: var(--white);
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.col-picks {
    text-align: left !important;
    font-size: 0.78rem;
    color: var(--text);
    line-height: 1.3;
}

.team-pill {
    display: inline-block;
    padding: 1px 6px;
    margin: 1px 2px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
}

.team-pill.win {
    background: #d4edda;
    border-color: #b6e0c5;
    color: #155724;
}

.team-pill.loss {
    background: #f8d7da;
    border-color: #f1c1c4;
    color: #721c24;
    text-decoration: line-through;
}

.team-pill.pending {
    background: #FFF3CD;
    border-color: #FFE89A;
    color: #856404;
}

/* Hidden picks placeholder (before deadline) */
.team-pill.hidden {
    background: #eee;
    color: #aaa;
    font-style: italic;
}

.status-alive {
    color: var(--accent-teal);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.78rem;
}

.status-eliminated {
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.78rem;
}

/* Winner rows — place-specific colors */
.pool-table tbody tr.place-1 {
    background: linear-gradient(90deg, #FFD700 0%, #FFF8DC 30%, #FFFBE6 100%) !important;
}
.pool-table tbody tr.place-2 {
    background: linear-gradient(90deg, #C0C0C0 0%, #E8E8E8 30%, #F5F5F5 100%) !important;
}
.pool-table tbody tr.place-3 {
    background: linear-gradient(90deg, #CD7F32 0%, #E8C49A 30%, #FDF0E0 100%) !important;
}
.pool-table tbody tr.place-4,
.pool-table tbody tr.place-5 {
    background: linear-gradient(90deg, #B6CFE8 0%, #DCE7F4 30%, #F2F6FB 100%) !important;
}

.pool-table tbody tr[class^="place-"] td:first-child::before {
    content: attr(data-place);
    display: inline-block;
    color: var(--text);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    text-transform: uppercase;
}

/* ---- Footer ---- */
.site-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.site-footer .last-updated {
    font-weight: 600;
    color: var(--text);
}

/* ---- Rules / Generic content sections ---- */
.rules-container {
    max-width: 800px;
    margin: 0 auto;
}

.rules-section {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 6px var(--shadow);
    margin-bottom: 1.2rem;
    overflow: hidden;
}

.rules-section h2 {
    background: var(--primary);
    color: var(--cream);
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rules-section .rules-body {
    padding: 1rem 1.2rem;
    font-size: 0.88rem;
    line-height: 1.7;
}

.rules-section .rules-body p { margin-bottom: 0.8rem; }
.rules-section .rules-body p:last-child { margin-bottom: 0; }

.rules-section .rules-body ul { margin: 0.3rem 0 0.8rem 1.5rem; }
.rules-section .rules-body li { margin-bottom: 0.4rem; }

.payout-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8rem 0;
    font-size: 0.85rem;
}

.payout-table th {
    background: var(--bg-alt);
    padding: 0.5rem 0.8rem;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
}

.payout-table td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

/* ---- Pool Status Banner ---- */
.status-banner {
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-banner.pending {
    background: #FFF3CD;
    color: #856404;
}

.status-banner.active {
    background: #d4edda;
    color: #155724;
}

.status-banner.complete {
    background: #D1ECF1;
    color: #0C5460;
}

/* ---- Forms (signup, picks) ---- */
.form-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 6px var(--shadow);
    padding: 1.5rem;
    max-width: 540px;
    margin: 1rem auto;
}

.form-card h2 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-row {
    margin-bottom: 0.9rem;
}

.form-row label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(31,42,92,0.12);
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    color: var(--cream);
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn:hover { background: var(--primary-mid); }
.btn:disabled { background: var(--text-light); cursor: not-allowed; }

.btn-accent { background: var(--accent-orange); }
.btn-accent:hover { background: #d8593e; }

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-secondary:hover { background: var(--bg-alt); }

.note {
    font-size: 0.78rem;
    color: var(--text-light);
    font-style: italic;
}

.flash {
    padding: 0.7rem 1rem;
    border-radius: 4px;
    margin: 0 auto 1rem;
    max-width: 540px;
    font-size: 0.85rem;
    font-weight: 600;
}

.flash.success { background: #d4edda; color: #155724; border: 1px solid #b6e0c5; }
.flash.error   { background: #f8d7da; color: #721c24; border: 1px solid #f1c1c4; }
.flash.info    { background: #D1ECF1; color: #0C5460; border: 1px solid #bee5eb; }

/* ---- Picks UI: team grid ---- */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}

.group-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.group-card h3 {
    background: var(--primary);
    color: var(--cream);
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.group-card .team-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.1s;
}

.group-card .team-row:first-of-type { border-top: none; }
.group-card .team-row:hover:not(.disabled) { background: var(--bg-alt); }

.group-card .team-row input[type="checkbox"],
.group-card .team-row input[type="radio"] {
    accent-color: var(--primary);
}

.group-card .team-row.selected {
    background: rgba(0,201,167,0.18);
    font-weight: 700;
}

.group-card .team-row.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.used-tag {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pick-counter {
    text-align: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--primary);
    margin: 0.5rem 0 1rem;
}

/* ---- Knockout matchup picks ---- */
.matchup-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.7rem;
    margin: 1rem 0;
}

.matchup {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
}

.matchup-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.matchup-teams {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.matchup-team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}

.matchup-team:hover:not(.disabled) { background: var(--bg-alt); }
.matchup-team.selected {
    background: rgba(0,201,167,0.18);
    border-color: var(--accent-teal);
}

.matchup-team.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.matchup-vs {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
}

/* ---- Responsive: Tablet (iPad) ---- */
@media (max-width: 1024px) {
    .main-content { padding: 1rem 0.75rem; }
    .pool-table { min-width: 700px; }
    .pool-table thead th:first-child { min-width: 110px; }
}

/* ---- Responsive: Mobile ---- */
@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        border-bottom: none;
    }

    .nav.open {
        max-height: 100vh;
        border-bottom: 3px solid var(--primary);
        overflow-y: auto;
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-link {
        padding: 0.8rem 1.5rem;
        border-bottom: 1px solid #eee;
        font-size: 0.9rem;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--bg);
        display: none;
        padding-left: 1rem;
    }

    .nav-dropdown.open > .dropdown-menu { display: block; }

    .dropdown-menu a {
        padding: 0.6rem 1.5rem;
        font-size: 0.82rem;
    }

    /* Sticky first column on mobile */
    .pool-table .col-entry {
        position: sticky;
        left: 0;
        z-index: 5;
        background: inherit;
        box-shadow: 2px 0 4px rgba(0,0,0,0.08);
    }

    .pool-table thead th:first-child {
        position: sticky;
        left: 0;
        z-index: 15;
    }

    .pool-table { min-width: 650px; }

    .banner { padding: 1.5rem 1rem 1rem; }
    .banner-text { letter-spacing: 2px; }
    .main-content { padding: 1rem 0.5rem; }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.05rem; }
    .pool-table { font-size: 0.75rem; }
}
