:root {
  --bg: #0b1114;
  --surface: #121a1f;
  --surface-2: #18232a;
  --surface-3: #203039;
  --text: #ffffff;
  --muted: #9baab2;
  --soft: #cfdae0;
  --green: #20e37a;
  --green-2: #00b86b;
  --gold: #ffd166;
  --red: #ff5f6d;
  --blue: #72b7ff;
  --border: rgba(255,255,255,.1);
  --shadow: rgba(0,0,0,.45) 0 20px 60px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(32,227,122,.22), transparent 32rem),
    radial-gradient(circle at 78% 14%, rgba(255,209,102,.12), transparent 30rem),
    linear-gradient(180deg, #071013 0%, var(--bg) 40%, #080c0f 100%);
}
button, input, select { font: inherit; }
.app-shell { max-width: 1440px; margin: 0 auto; padding: 24px; }
.hero {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(32,227,122,.18), transparent 38%),
    linear-gradient(220deg, rgba(255,209,102,.13), transparent 45%),
    rgba(18,26,31,.78);
  box-shadow: var(--shadow);
}
.hero:after {
  content: "";
  position: absolute; inset: auto -10% -45% 42%; height: 420px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 22px);
  transform: rotate(-11deg);
  pointer-events: none;
}
.topbar, .hero-grid, main { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .02em; }
.pulse { width: 13px; height: 13px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 8px rgba(32,227,122,.14), 0 0 28px rgba(32,227,122,.8); }
.meta { color: var(--muted); font-size: 13px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 28px; align-items: end; margin-top: 78px; }
.eyebrow { margin: 0 0 14px; color: var(--green); text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 900; }
h1 { max-width: 860px; margin: 0; font-size: clamp(42px, 6vw, 92px); line-height: .9; letter-spacing: -.07em; }
.lead { max-width: 650px; color: var(--soft); font-size: 19px; line-height: 1.55; margin: 22px 0 0; }
.quick-actions, .tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pill, .tab, .export-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.06);
  padding: 11px 17px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.pill:hover, .tab:hover, .export-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.11); }
.pill.active, .tab.active { color: #00130a; background: var(--green); border-color: transparent; }
.now-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  background: rgba(10,15,18,.72);
  box-shadow: rgba(0,0,0,.34) 0 18px 50px;
  backdrop-filter: blur(14px);
}
.tag { display: inline-flex; width: fit-content; border-radius: 999px; padding: 7px 11px; background: rgba(32,227,122,.13); color: var(--green); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.now-title { margin: 18px 0 10px; font-size: 27px; line-height: 1.04; font-weight: 900; letter-spacing: -.04em; }
.now-time { display: flex; justify-content: space-between; gap: 10px; color: var(--soft); }
.countdown { margin-top: 18px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); font-weight: 900; color: var(--gold); }
main { padding: 24px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { padding: 18px; border-radius: 22px; background: rgba(18,26,31,.86); border: 1px solid var(--border); }
.stat b { display: block; font-size: 30px; letter-spacing: -.05em; }
.stat span { color: var(--muted); font-size: 13px; }
.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(150px, .6fr)) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(18,26,31,.78);
  position: sticky;
  top: 8px;
  z-index: 5;
  backdrop-filter: blur(14px);
}
.search-wrap { display: flex; align-items: center; gap: 10px; padding: 0 15px; border-radius: 999px; background: #0f171b; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); padding: 13px 0; }
select { border: 0; outline: 0; border-radius: 999px; background: #0f171b; color: var(--text); padding: 0 13px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.export-btn { margin: 0; background: var(--surface-3); }
.view { display: none; }
.view.active { display: block; }
.match-list { display: grid; gap: 12px; }
.day-header { position: sticky; top: 86px; z-index: 3; margin: 22px 0 10px; padding: 10px 14px; border-radius: 999px; background: rgba(8,12,15,.86); border: 1px solid var(--border); color: var(--soft); font-weight: 900; backdrop-filter: blur(14px); }
.match-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto minmax(0, 1fr) minmax(220px, .8fr) 44px;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)), var(--surface);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.match-card:hover { transform: translateY(-2px); border-color: rgba(32,227,122,.35); background: var(--surface-2); }
.match-card.live { border-color: rgba(32,227,122,.7); box-shadow: rgba(32,227,122,.16) 0 0 0 1px, rgba(0,0,0,.38) 0 16px 34px; }
.match-card.germany { border-color: rgba(255,209,102,.45); }
.time-block .time { font-size: 21px; font-weight: 900; letter-spacing: -.03em; }
.time-block .stage { color: var(--muted); font-size: 12px; margin-top: 3px; }
.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team.away { justify-content: flex-end; text-align: right; }
.flag { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-3); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.team-name { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-code { color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.score { min-width: 78px; text-align: center; font-size: 26px; font-weight: 1000; letter-spacing: -.06em; }
.score small { color: var(--muted); font-size: 12px; display: block; letter-spacing: 0; margin-top: 3px; }
.venue { color: var(--soft); font-size: 14px; }
.venue b { display: block; color: var(--text); margin-bottom: 3px; }
.fav { border: 0; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.08); color: var(--muted); font-size: 20px; }
.fav.active { color: #10130b; background: var(--gold); }
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.group-table { border: 1px solid var(--border); border-radius: 24px; overflow: hidden; background: var(--surface); }
.group-table h3 { margin: 0; padding: 16px 18px; background: rgba(255,255,255,.05); }
.table-row { display: grid; grid-template-columns: 1fr repeat(5, 34px); gap: 6px; align-items: center; padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.06); color: var(--soft); font-size: 13px; }
.table-row.header { color: var(--muted); text-transform: uppercase; font-size: 11px; font-weight: 900; }
.table-row .club { color: var(--text); font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knockout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; margin-top: 18px; }
.ko-card { padding: 18px; border-radius: 24px; border: 1px solid var(--border); background: var(--surface); }
.ko-card h3 { margin: 0 0 10px; }
.empty, .loader { color: var(--muted); padding: 22px; }
@media (max-width: 980px) {
  .hero-grid, .controls { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .match-card { grid-template-columns: 70px 1fr 62px 1fr 38px; }
  .venue { grid-column: 2 / span 3; }
}
@media (max-width: 650px) {
  .app-shell { padding: 10px; }
  .hero { padding: 18px; border-radius: 24px; }
  .hero-grid { margin-top: 42px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .match-card { grid-template-columns: 1fr; gap: 9px; }
  .team.away { justify-content: flex-start; text-align: left; flex-direction: row-reverse; }
  .score { text-align: left; }
  .venue { grid-column: auto; }
  .day-header { top: 0; }
}
