/* ==========================================================================
   WC26 Tracker — Stylesheet
   Premium sports broadcast aesthetic
   TOC: tokens → reset → base → layout → nav → hero → schedule → groups
        → favorites → team → news → footer → components → utilities → responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   TOKENS
   -------------------------------------------------------------------------- */
:root {
    --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
    --content-max:  1320px;
    --gutter:       min(28px, 4vw);
    --radius:       6px;
    --radius-lg:    10px;
    --transition:   180ms ease;
}

/* --------------------------------------------------------------------------
   RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent-1); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }
table { font-variant-numeric: tabular-nums; border-collapse: collapse; }
::selection { background: var(--accent-1); color: var(--bg-base); }

:focus-visible {
    outline: 2px solid var(--accent-1);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

[id] { scroll-margin-top: 72px; }

/* --------------------------------------------------------------------------
   BASE TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
}

.label-caps {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
.page-content {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* --------------------------------------------------------------------------
   NOISE OVERLAY
   -------------------------------------------------------------------------- */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --------------------------------------------------------------------------
   NAVIGATION
   -------------------------------------------------------------------------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--nav-border);
}

.nav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    height: 56px;
    gap: 8px;
}

/* Logo badge */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    text-decoration: none;
    margin-right: 16px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.logo-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-grad);
    color: var(--bg-base);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    border-radius: 4px;
    flex-shrink: 0;
}

.logo-sub {
    display: block;
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-1);
}

/* Nav links */
.nav-links {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.is-active {
    color: var(--accent-1);
    border-color: var(--accent-1);
    background: transparent;
}

/* Theme toggle */
.theme-toggle {
    position: relative;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--text-muted);
    margin-left: 12px;
    transition: color var(--transition), background var(--transition);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.theme-icon {
    position: absolute;
    transition: opacity 320ms ease, transform 320ms ease;
}

[data-theme="dark"] .theme-icon--sun  { opacity: 1; transform: rotate(0); }
[data-theme="dark"] .theme-icon--moon { opacity: 0; transform: rotate(-90deg); }
[data-theme="light"] .theme-icon--sun  { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .theme-icon--moon { opacity: 1; transform: rotate(0); }

/* --------------------------------------------------------------------------
   PAGE HEADER (shared across pages)
   -------------------------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 20px;
    border-left: 3px solid var(--accent-1);
    padding-left: 16px;
    margin-bottom: 28px;
}

.page-header__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    font-style: italic;
}

.page-header__subtitle {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-header__meta {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   HERO — Featured Matches
   -------------------------------------------------------------------------- */
.hero {
    padding: 24px 0 8px;
}

.hero-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.hero-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.hero-counter {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.hero-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.hero-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.hero-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.hero-card__group {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.hero-card__date {
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.hero-card__teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.hero-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.hero-card__flag {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255,255,255,0.08);
}

.hero-card__name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}

.hero-card__vs {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.hero-card__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

.hero-card__countdown {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-1);
}

.hero-card__venue {
    font-size: 11px;
    color: var(--text-muted);
}

.hero-empty {
    color: var(--text-muted);
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

/* --------------------------------------------------------------------------
   FILTER CONTROLS
   -------------------------------------------------------------------------- */
.schedule-controls {
    padding: 16px 0;
    position: sticky;
    top: 58px;
    z-index: 50;
    background: var(--bg-base);
}

.controls-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pill {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.pill:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.pill.is-active {
    background: transparent;
    color: var(--accent-1);
    border-color: var(--accent-1);
}

.search-box { margin-left: auto; }

.search-input {
    width: 220px;
    padding: 7px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-family: var(--font-ui);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: border-color var(--transition), width var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent-1); width: 280px; }

/* --------------------------------------------------------------------------
   DATE SECTIONS — flat, no collapsing
   -------------------------------------------------------------------------- */
.date-section {
    margin-bottom: 24px;
}

.date-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0 10px;
}

.date-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-1) 0%, transparent 100%);
    opacity: 0.3;
}

.date-label {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    font-style: italic;
    color: var(--accent-1);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.date-matches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   MATCH ROW — Compact horizontal: [TIME/GROUP] [TEAMS] [VENUE]
   -------------------------------------------------------------------------- */
.mc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color var(--transition);
}

.mc:hover { border-color: var(--border-hover); }
.mc--tbd { opacity: 0.45; }

/* Left column: time + group */
.mc__left {
    min-width: 56px;
    flex-shrink: 0;
}

.mc__time {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-1);
    font-variant-numeric: tabular-nums;
}

.mc__group {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--accent-1);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 1px;
    opacity: 0.7;
}

.mc__group--ko {
    color: var(--danger);
}

/* Center: teams row */
.mc__teams {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 8px;
}

.mc__team {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.mc__team--home {
    justify-content: flex-end;
}

.mc__team--away {
    justify-content: flex-start;
}

.mc__flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.mc__name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.mc__name:hover { color: var(--accent-1); }

.mc__name--tbd {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
    text-transform: none;
}

.mc__center {
    flex-shrink: 0;
    min-width: 30px;
    text-align: center;
}

.mc__vs {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
}

.mc__score {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.mc__score--live {
    color: var(--live-color);
}

/* Right: venue */
.mc__right {
    flex-shrink: 0;
    text-align: right;
    max-width: 140px;
}

.mc__venue {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.mc__venue::before {
    content: '◉';
    font-size: 5px;
    opacity: 0.4;
    flex-shrink: 0;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: 700;
}

.score-num {
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
}

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

.score-display--final { position: relative; }

.score-display--final::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: 2px;
    background: var(--accent-grad);
    border-radius: 1px;
}

.score-display--live .score-num { color: var(--live-color); }

.match-card__time {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-1);
    font-variant-numeric: tabular-nums;
}

/* Live badge */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--live-color);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live-color);
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.5); opacity: 0.6; }
}

/* Chips */
.chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chip--group {
    background: var(--accent-glow);
    color: var(--accent-1);
}

.chip--stage {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.chip--ft {
    background: var(--border);
    color: var(--text-muted);
}

/* Venue on right end */
.match-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.match-card__venue {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.match-card__venue::before {
    content: '◉';
    font-size: 5px;
    opacity: 0.4;
    flex-shrink: 0;
}

/* Favorite toggle */
.fav-toggle {
    color: var(--text-muted);
    padding: 4px;
    transition: color var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.fav-toggle:hover { color: var(--accent-1); transform: scale(1.15); }
.fav-toggle.is-active { color: var(--accent-1); }
.fav-toggle.is-active svg { fill: var(--accent-1); }

/* --------------------------------------------------------------------------
   GROUPS PAGE
   -------------------------------------------------------------------------- */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-bottom: 32px;
}

.group-card {
    background: #111F36;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
    animation: fadeSlideUp 400ms ease both;
    transition: border-color var(--transition);
}

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

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.skeleton-card { padding: 20px; }

.group-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.group-card__title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-1);
}

.group-card__label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* Standings table */
.st {
    width: 100%;
    table-layout: fixed;
    font-size: 11px;
    border-collapse: collapse;
}

.st th {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.st-th-team { text-align: left; padding-left: 10px; }
.st-th-pts  { color: var(--accent-1); }

.st td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.st tbody tr:last-child td { border-bottom: none; }

/* Flag cell */
.st-td-flag {
    width: 34px;
    padding: 4px 2px 4px 10px;
}

.st-td-flag img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    display: inline-block;
    vertical-align: middle;
}

/* Team cell — code + full name stacked */
.st-td-team {
    text-align: left;
    padding-left: 4px;
}

.st-td-team strong {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--accent-1);
}

.st-td-team small {
    display: block;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    line-height: 1.3;
}

.st-td-team a {
    color: inherit;
    text-decoration: none;
}

.st-td-team a:hover strong {
    color: var(--text-primary);
}

/* PTS cell */
.st-td-pts {
    font-weight: 800;
    color: var(--accent-1);
}

/* Qualification zone */
.row--q { position: relative; }
.row--q::before {
    content: '';
    position: absolute;
    left: 0; top: 3px; bottom: 3px;
    width: 3px;
    background: var(--accent-grad);
    border-radius: 2px;
}

.row--3 { position: relative; }
.row--3::before {
    content: '';
    position: absolute;
    left: 0; top: 3px; bottom: 3px;
    width: 3px;
    background: var(--accent-grad);
    opacity: 0.2;
    border-radius: 2px;
}

.group-card__hint {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    padding: 10px;
    font-style: italic;
}

.groups-error {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--danger);
    padding: 48px 0;
}

/* --------------------------------------------------------------------------
   FAVORITES PAGE
   -------------------------------------------------------------------------- */
.fav-picker { margin-bottom: 40px; }

.fav-picker__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.fav-counter { font-size: 13px; color: var(--text-muted); }
.fav-counter strong { color: var(--accent-1); font-variant-numeric: tabular-nums; }

.btn {
    padding: 7px 16px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: all var(--transition);
}

.btn--ghost {
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn--ghost:hover { color: var(--danger); border-color: var(--danger); }

.team-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.team-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition);
    cursor: pointer;
    text-align: center;
}

.team-toggle:hover { border-color: var(--border-hover); }

.team-toggle.is-active {
    border-color: var(--accent-1);
    box-shadow: var(--shadow-glow);
}

.team-toggle__flag {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.06);
}

.team-toggle__name {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.team-toggle__group {
    font-size: 10px;
    color: var(--text-muted);
}

.team-toggle__check {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--accent-1);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity var(--transition), transform var(--transition);
}

.team-toggle.is-active .team-toggle__check {
    opacity: 1;
    transform: scale(1);
}

/* Personalized feed */
.fav-feed { padding-bottom: 32px; }
.fav-feed__section { margin-bottom: 32px; }

.fav-feed__heading {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 14px;
    padding-left: 14px;
    border-left: 3px solid var(--accent-1);
}

.fav-empty {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 16px 0;
}

.fav-match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 8px;
    transition: border-color var(--transition);
}

.fav-match-card:hover { border-color: var(--border-hover); }

.fav-match-card__teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 8px;
}

.fav-match-card__team { display: flex; align-items: center; gap: 8px; }

.fav-match-card__flag {
    width: 28px; height: 21px;
    object-fit: cover; border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.fav-match-card__name { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.fav-match-card__name.is-fav { color: var(--accent-1); font-weight: 800; }
.fav-match-card__vs { font-size: 11px; color: var(--text-muted); font-weight: 700; }

.fav-match-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   NEWS CARDS
   -------------------------------------------------------------------------- */
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 8px;
    transition: border-color var(--transition);
}

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

.news-card__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.news-card__title:hover { color: var(--accent-1); }

.news-card__desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}

.news-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
}

.news-card__source {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.news-empty {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 16px 0;
}

.news-load-more {
    width: 100%;
    margin-top: 8px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   TEAM DETAIL PAGE
   -------------------------------------------------------------------------- */
.team-404 { text-align: center; padding: 80px 0; }
.team-404 h1 { margin-bottom: 8px; }
.team-404 a { display: inline-block; margin-top: 16px; }

.team-header { padding: 32px 0 24px; }

.team-header__inner {
    display: flex;
    align-items: center;
    gap: 28px;
}

.team-header__flag {
    width: 140px;
    height: 105px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.team-header__name {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-style: italic;
    margin-bottom: 6px;
}

.team-header__hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 10px;
    font-style: italic;
}

.team-stats {
    display: flex;
    gap: 20px;
    margin-top: 14px;
}

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

.team-stat__val {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.team-stat__label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.team-stat--accent .team-stat__val { color: var(--accent-1); }

.team-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding-bottom: 32px;
}

.team-col__heading {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 14px;
    padding-left: 14px;
    border-left: 3px solid var(--accent-1);
}

.team-empty {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.team-match {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 6px;
    transition: border-color var(--transition);
}

.team-match:hover { border-color: var(--border-hover); }

.team-match__main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-match__side { width: 20px; text-align: center; }

.team-match__ha {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

.team-match__opponent {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.team-match__flag {
    width: 24px; height: 18px;
    object-fit: cover; border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.team-match__opp-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

a.team-match__opp-name:hover { color: var(--accent-1); }

.team-match__result {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 60px;
    text-align: right;
}

.team-match__score {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    position: relative;
}

.team-match__score.score-display--final::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0; right: 0;
    height: 2px;
    background: var(--accent-grad);
    border-radius: 1px;
}

.team-match__score.score-display--live { color: var(--live-color); }

.team-match__kickoff {
    font-size: 12px;
    color: var(--accent-1);
    font-weight: 600;
}

.team-match__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

.team-match--finished { opacity: 0.8; }

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: 48px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    text-align: center;
}

.footer-text { font-size: 12px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 18px;
    font-size: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    pointer-events: auto;
    animation: toast-in 240ms ease-out;
}

.toast--error { border-color: var(--danger); color: var(--danger); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   SKELETON LOADERS
   -------------------------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-alt) 37%, var(--bg-card) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.6s ease infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* --------------------------------------------------------------------------
   UTILITIES
   -------------------------------------------------------------------------- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 200;
    padding: 8px 16px;
    background: var(--accent-1);
    color: var(--bg-base);
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius);
    text-decoration: none;
    transition: top 200ms ease;
}

.skip-link:focus { top: 8px; }

/* --------------------------------------------------------------------------
   VIEW TRANSITIONS
   -------------------------------------------------------------------------- */
@supports (view-transition-name: none) {
    .schedule { view-transition-name: schedule-list; }
    ::view-transition-old(schedule-list),
    ::view-transition-new(schedule-list) { animation-duration: 200ms; }
}

@supports not (view-transition-name: none) {
    .schedule { transition: opacity 200ms ease, transform 200ms ease; }
    .schedule.is-transitioning { opacity: 0; transform: translateY(8px); }
}

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

/* --------------------------------------------------------------------------
   RESPONSIVE — MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
    .nav-inner { gap: 6px; }
    .nav-link { padding: 5px 8px; font-size: 10px; }
    .logo-text { font-size: 0.9rem; }

    .hero-cards { grid-template-columns: 1fr; }
    .hero-card__flag { width: 56px; height: 42px; }

    .date-matches { grid-template-columns: 1fr; }
    .mc { padding: 8px 10px; gap: 8px; }
    .mc__left { min-width: 44px; }
    .mc__time { font-size: 11px; }
    .mc__flag { width: 20px; height: 15px; }
    .mc__name { font-size: 11px; }
    .mc__right { display: none; }

    .controls-inner { flex-direction: column; align-items: stretch; }
    .search-box { margin-left: 0; }
    .search-input, .search-input:focus { width: 100%; }

    .groups-grid { grid-template-columns: 1fr; gap: 12px; }
    .team-grid { grid-template-columns: repeat(3, 1fr); }
    .team-content { grid-template-columns: 1fr; }
    .team-header__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
    .team-header__flag { width: 80px; height: 60px; }

    .toast-container { right: 12px; left: 12px; bottom: 12px; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — TABLET
   -------------------------------------------------------------------------- */
@media (min-width: 640px) and (max-width: 959px) {
    .hero-cards { grid-template-columns: repeat(2, 1fr); }
    .groups-grid { grid-template-columns: repeat(2, 1fr); }
    .team-grid { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — SMALL DESKTOP
   -------------------------------------------------------------------------- */
@media (min-width: 960px) and (max-width: 1199px) {
    .groups-grid { grid-template-columns: repeat(2, 1fr); }
    .team-grid { grid-template-columns: repeat(5, 1fr); }
}

/* --------------------------------------------------------------------------
   PRINT
   -------------------------------------------------------------------------- */
@media print {
    .site-nav, .noise-overlay, .theme-toggle, .toast-container,
    .fav-toggle, .search-box, .filter-pills { display: none !important; }
    body { background: white; color: black; }
    .match-card, .group-card { box-shadow: none; border: 1px solid #ccc; }
}
