/* World Cup 2026 page — standings + bracket */

/* Brand: show full domain on this page only */
.nav-brand .logo-tld {
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 1px;
}

.wc-hero {
    padding: 120px 0 60px;
    background: var(--gradient-secondary);
    text-align: center;
    border-bottom: 1px solid var(--border);
}
body.dark-mode .wc-hero {
    background: linear-gradient(135deg, #18181b 0%, #0a0a0a 100%);
}
.wc-hero-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--background-card);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.wc-hero-title {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    margin: 0 0 14px;
}
.wc-hero-title .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.wc-hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 640px;
    margin: 0 auto 24px;
}

.wc-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--background-card);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.wc-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-muted);
}
.wc-status-loading { background: #fbbf24; animation: wc-pulse 1.4s infinite; }
.wc-status-ok      { background: #10b981; }
.wc-status-error   { background: #ef4444; }
@keyframes wc-pulse {
    0%, 100% { opacity: 1; } 50% { opacity: 0.35; }
}
.wc-refresh {
    display: inline-flex; align-items: center; gap: 6px;
    border: none; background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 2px 6px;
}
.wc-refresh:hover { color: var(--primary-dark); }

/* Sections */
.wc-section { padding: 60px 0; }
.wc-section-alt { background: var(--background-secondary); }
body.dark-mode .wc-section-alt { background: var(--background-card); }

.wc-section-header { text-align: center; margin-bottom: 36px; }
.wc-section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
}
.wc-section-subtitle {
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    font-size: 0.98rem;
}

/* Groups grid */
.wc-groups-grid {
    display: grid;
    /* Min width chosen so "Korea Republic" fits the team column without ellipsis;
       longer names (e.g. "Bosnia and Herzegovina") still ellipsize gracefully. */
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    gap: 20px;
}
.wc-group-card {
    background: var(--background-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.wc-group-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.wc-group-header {
    padding: 16px 20px;
    background: #18181b;
    color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary);
}
body.dark-mode .wc-group-header { background: #000; }
.wc-group-header h3 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #fafafa;
}
.wc-group-header h3::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.wc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}
.wc-table th, .wc-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
}
.wc-table thead th {
    background: var(--background);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}
.wc-table tbody tr {
    transition: background 0.15s ease;
    position: relative;
}
.wc-table tbody tr:hover { background: var(--background); }
.wc-table tbody tr:last-child td { border-bottom: none; }

.wc-th-rank { width: 36px; padding-left: 16px !important; }
.wc-th-team { text-align: left !important; }

.wc-rank {
    font-weight: 700;
    color: var(--text-secondary);
    padding-left: 16px !important;
    position: relative;
    width: 36px;
    text-align: center;
}
/* Left stripe indicator on rank cell */
.wc-rank::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: transparent;
}
.wc-row-advance .wc-rank::before { background: #10b981; }
.wc-row-third   .wc-rank::before { background: #f59e0b; }
.wc-row-out     .wc-rank::before { background: var(--border); }

.wc-team {
    text-align: left !important;
}
/* Inner span keeps flex alignment without breaking the <td> as a table cell */
.wc-team-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 600;
    min-width: 0;
    max-width: 100%;
}
.wc-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.wc-num {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.wc-pts {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 0.98rem;
}

.wc-row-out { opacity: 0.62; }

/* Group standings: fixed layout so a long team name can't push columns
   off the card. The team column flexes; everything else is fixed-width. */
.wc-group-card .wc-table {
    table-layout: fixed;
    width: 100%;
}
.wc-group-card .wc-th-rank,
.wc-group-card .wc-rank { width: 38px; }
.wc-group-card .wc-th-team,
.wc-group-card .wc-team { width: auto; }
.wc-group-card .wc-table .wc-num { width: 32px; }
.wc-group-card .wc-table th:last-child,
.wc-group-card .wc-table td:last-child { width: 36px; padding-right: 12px; }
/* Team cell becomes a block so its inner flex can shrink and ellipsize */
.wc-group-card .wc-team-cell { display: flex; }

.wc-flag-img {
    display: inline-block;
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid var(--border);
    vertical-align: middle;
    flex-shrink: 0;
}
.wc-flag-text {
    display: inline-block;
    padding: 2px 6px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
body.dark-mode .wc-flag-text { background: var(--background); }

/* Next stage panel (under each group card) */
.wc-next-stage {
    padding: 14px 10px 14px;
    border-top: 1px dashed var(--border);
    background: var(--background);
}
body.dark-mode .wc-next-stage { background: rgba(255,255,255,0.02); }

.wc-next-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 0 0 10px;
    font-weight: 700;
    padding: 0 6px;
}
.wc-next-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wc-next-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 56px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 6px 6px;
    border-radius: 6px;
    background: var(--background-card);
    border: 1px solid var(--border);
    font-size: 0.88rem;
}
.wc-next-rank {
    font-weight: 700;
    font-size: 0.68rem;
    text-align: center;
    padding: 2px 4px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 4px;
    letter-spacing: 0.2px;
}
body.dark-mode .wc-next-rank {
    background: rgba(249, 115, 22, 0.15);
    color: var(--secondary);
}
.wc-next-row .wc-flag { margin-right: 6px; }
.wc-next-team {
    color: var(--text-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wc-next-arrow {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}
.wc-next-opp {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
}
.wc-next-opp .wc-flag-img,
.wc-next-opp .wc-flag-text {
    flex-shrink: 0;
}
.wc-next-opp-name {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.wc-next-opp-tag {
    margin-left: auto;
}
.wc-next-opp-name {
    color: var(--text-primary);
    font-weight: 600;
}
.wc-next-opp-tag {
    font-size: 0.65rem;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.wc-next-opp-text {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.wc-next-pending .wc-next-rank,
.wc-next-out .wc-next-rank {
    background: var(--background);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.wc-next-out { opacity: 0.7; }

/* Where to watch footer */
.wc-watch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--background-card);
    font-size: 0.85rem;
}
.wc-watch-icon { color: var(--text-muted); flex-shrink: 0; }
.wc-watch-label { color: var(--text-muted); font-weight: 500; }
.wc-watch-label::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 12px;
    background: var(--border);
    margin-left: 8px;
    vertical-align: middle;
}
.wc-watch-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s ease;
}
.wc-watch-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 3rd Place Ranking */
.wc-thirds-wrapper { max-width: 900px; margin: 0 auto; }
.wc-thirds-card {
    background: var(--background-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.wc-thirds-table thead th { padding: 14px 8px; }
.wc-thirds-table tbody td { padding: 14px 8px; }
.wc-thirds-group {
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}
/* Thick divider between qualifying 8th and non-qualifying 9th */
.wc-thirds-cutoff td {
    border-top: 2px solid var(--text-primary);
}
@media (max-width: 640px) {
    .wc-thirds-table { font-size: 0.85rem; }
    .wc-thirds-table thead th,
    .wc-thirds-table tbody td { padding: 10px 4px; }
    /* Hide W, D, L, GF, GA on mobile — leave just P, GD, Pts (BBC-style) */
    .wc-thirds-table th:nth-child(5),
    .wc-thirds-table th:nth-child(6),
    .wc-thirds-table th:nth-child(7),
    .wc-thirds-table th:nth-child(8),
    .wc-thirds-table th:nth-child(9),
    .wc-thirds-table td:nth-child(5),
    .wc-thirds-table td:nth-child(6),
    .wc-thirds-table td:nth-child(7),
    .wc-thirds-table td:nth-child(8),
    .wc-thirds-table td:nth-child(9) { display: none; }
    /* Team column allowed to take available space and ellipsize only when needed */
    .wc-thirds-table .wc-team-name {
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

/* Bracket */
.wc-bracket-wrapper {
    overflow-x: auto;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
.wc-bracket-note {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    text-align: center;
    font-size: 0.92rem;
}
body.dark-mode .wc-bracket-note {
    background: rgba(249, 115, 22, 0.12);
    color: var(--secondary);
}

.wc-rounds {
    display: flex;
    gap: 24px;
    min-width: max-content;
    align-items: stretch;
}
.wc-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 12px;
    min-width: 240px;
}
.wc-round-title {
    text-align: center;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 700;
    margin: 0 0 8px;
}

.wc-match {
    background: var(--background-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition);
}
.wc-match:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.wc-match-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.wc-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 4px;
}
.wc-slot:first-of-type { margin-top: 0; }
.wc-slot-filled {
    background: var(--background);
    color: var(--text-primary);
    font-weight: 500;
}
.wc-slot-placeholder {
    background: transparent;
    color: var(--text-muted);
    font-style: italic;
    border: 1px dashed var(--border);
}
.wc-slot-name { flex: 1; }
.wc-slot-tag {
    font-size: 0.7rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}
body.dark-mode .wc-slot-tag {
    background: rgba(249, 115, 22, 0.15);
    color: var(--secondary);
}
.wc-slot-placeholder-text { font-size: 0.85rem; }

.wc-r32  { border-left: 3px solid var(--primary); }
.wc-r16  { border-left: 3px solid #fb923c; }
.wc-qf   { border-left: 3px solid #f59e0b; }
.wc-sf   { border-left: 3px solid #d97706; }
.wc-final {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--background-card) 100%);
}
body.dark-mode .wc-final {
    background: linear-gradient(135deg, rgba(249,115,22,0.15) 0%, var(--background-card) 100%);
}

/* Loading / empty states */
.wc-loading, .wc-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 640px) {
    .wc-hero { padding: 100px 0 40px; }
    .wc-section { padding: 40px 0; }
    .wc-groups-grid { grid-template-columns: 1fr; }
    .wc-round { min-width: 220px; }

    .wc-table { font-size: 0.85rem; }
    .wc-table th, .wc-table td { padding: 10px 4px; }
    .wc-th-rank, .wc-rank { padding-left: 12px !important; width: 28px; }
    .wc-team-cell { gap: 8px; }
    .wc-flag-img { width: 20px; height: 14px; }
}
