:root {
  --bg: #00080e;
  --surface: #03121d;
  --surface-2: #071e2d;
  --line: #17394c;
  --text: #f4f9fc;
  --muted: #8ba3b3;
  --blue: #2d9feb;
  --lime: #d5ea45;
  --yellow: #f6c444;
  --radius: 18px;
  --shadow: 0 20px 55px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 80% 0%, rgba(45,159,235,.12), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid rgba(139,163,179,.16);
  background: rgba(0,8,14,.88);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; color: #00101a; background: var(--lime);
  font-weight: 900; letter-spacing: -.08em;
}
.brand strong { display: block; font-size: 20px; letter-spacing: .08em; line-height: 1; }
.brand small { color: var(--blue); font-size: 10px; letter-spacing: .3em; }
nav { display: flex; gap: 30px; color: #bdd0db; font-size: 14px; font-weight: 650; }
nav a:hover, nav a:focus-visible { color: var(--lime); }
.menu-toggle { display: none; }
.connection { justify-self: end; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.connection i, .live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.connection.online i, .live-pill i { background: var(--lime); box-shadow: 0 0 0 5px rgba(213,234,69,.1); }

main { width: min(1440px, calc(100% - 36px)); margin: 0 auto; }
.hero {
  min-height: 390px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(30px, 6vw, 90px);
  align-items: center;
  padding: 72px clamp(0px, 3vw, 36px) 48px;
}
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
h1 { max-width: 850px; margin: 0; font-size: clamp(42px, 7vw, 88px); line-height: .98; letter-spacing: -.055em; }
.hero-meta { margin: 24px 0 0; color: var(--muted); font-size: 17px; }
.score-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(7,30,45,.96), rgba(3,18,29,.8));
  box-shadow: var(--shadow);
}
.score-card::after { content: ""; position: absolute; width: 160px; height: 160px; top: -85px; right: -55px; border: 28px solid rgba(45,159,235,.14); border-radius: 50%; }
.score-card span, .score-card small { display: block; color: var(--muted); }
.score-card strong { display: block; margin: 10px 0 20px; color: var(--lime); font-size: 34px; }

.section { padding: 58px 0; scroll-margin-top: 75px; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 24px; }
h2 { margin: 0; font-size: clamp(27px, 4vw, 42px); letter-spacing: -.035em; }
.section-note { margin: 0; color: var(--muted); font-size: 13px; }
.live-pill { display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid rgba(213,234,69,.25); border-radius: 999px; color: var(--lime); font-size: 12px; font-weight: 800; text-transform: uppercase; }

.groups-grid, .teams-grid, .match-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card, .group-card, .team-card, .match-row {
  border: 1px solid var(--line);
  background: rgba(3,18,29,.88);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0,0,0,.14);
}
.group-card { overflow: hidden; }
.group-title { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.group-title strong { font-size: 18px; }
.group-title span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; text-align: center; border-bottom: 1px solid rgba(23,57,76,.55); font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td { font-size: 13px; }
th:nth-child(2), td:nth-child(2) { width: 100%; text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
.rank { color: var(--lime); font-weight: 800; }
.group-link {
  display: block;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  color: var(--lime);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}
.group-link:hover, .group-link:focus-visible { background: rgba(213,234,69,.07); }

.group-page .hero { min-height: 300px; }
.back-link { display: inline-flex; margin-bottom: 18px; color: var(--blue); font-weight: 700; }
.group-nav { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.group-nav a {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.group-nav a.active { border-color: var(--lime); background: var(--lime); color: #00101a; }
.single-group { max-width: 920px; }
.group-teams { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.encounter-hero { min-height: 330px; }
.encounter-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; margin-top: 25px; }
.encounter-score .side { font-size: clamp(20px, 3vw, 34px); font-weight: 800; }
.encounter-score .side:last-child { text-align: right; }
.encounter-score strong { color: var(--lime); font-size: clamp(32px, 5vw, 58px); white-space: nowrap; }
.games-list { display: grid; gap: 12px; }
.game-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(3,18,29,.88); }
.game-summary { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto minmax(0, 1fr) 90px; align-items: center; gap: 16px; padding: 18px 20px; }
.game-number { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.game-player { font-weight: 700; }
.game-player.home { text-align: right; }
.game-score { min-width: 70px; color: var(--lime); font-size: 25px; font-weight: 900; text-align: center; }
.game-summary .status { justify-self: end; }
.set-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); background: rgba(0,8,14,.3); }
.set-table { min-width: 520px; }
.set-table th, .set-table td { width: 105px; padding: 10px 14px; }
.set-table .set-player-label { width: 100%; min-width: 260px; text-align: left; }
.set-table td { font-size: 14px; font-weight: 700; }
.set-table td.set-winner { color: var(--lime); font-weight: 900; }
.match-context { margin-top: 14px; color: var(--muted); }
.optional-games { margin-top: 7px; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(7,30,45,.32); }
.optional-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; cursor: pointer; color: var(--blue); font-weight: 800; list-style-position: inside; }
.optional-heading span:first-child { display: inline-flex; align-items: baseline; gap: 12px; }
.optional-heading small { color: var(--muted); font-size: 11px; font-weight: 500; }
.optional-count { padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; white-space: nowrap; }
.optional-list { display: grid; gap: 10px; padding: 0 10px 10px; }
.optional-list .game-card { background: rgba(3,18,29,.7); }
.ranking-list { display: grid; gap: 12px; max-width: 1050px; margin: 0 auto; }
.ranking-row { display: grid; grid-template-columns: 70px 70px minmax(0, 1fr) minmax(220px, .8fr); align-items: center; gap: 18px; padding: 16px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(3,18,29,.88); }
.ranking-position { color: var(--lime); font-size: 29px; font-weight: 900; text-align: center; }
.ranking-row:nth-child(1) { border-color: rgba(246,196,68,.7); background: linear-gradient(90deg, rgba(246,196,68,.10), rgba(3,18,29,.88) 38%); }
.ranking-row:nth-child(2), .ranking-row:nth-child(3) { border-color: rgba(45,159,235,.38); }
.ranking-team h3 { margin: 0; font-size: 19px; }
.ranking-team small { color: var(--muted); }
.ranking-players { display: grid; gap: 3px; color: #bdd0db; font-size: 13px; }
.ranking-logo { width: 58px; height: 58px; border-radius: 13px; object-fit: contain; padding: 4px; background: #fff; }

.match-list { display: grid; gap: 11px; }
.match-row { display: grid; grid-template-columns: 100px minmax(0,1fr) auto minmax(0,1fr) 92px; align-items: center; gap: 16px; padding: 17px 20px; }
.match-row[role="link"] { cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.match-row[role="link"]:hover, .match-row[role="link"]:focus-visible { border-color: var(--blue); transform: translateY(-1px); outline: none; }
.match-info { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.team-a { text-align: right; }
.team-name { font-weight: 700; }
.score { min-width: 74px; text-align: center; color: var(--lime); font-size: 24px; font-weight: 900; letter-spacing: .08em; }
.status { justify-self: end; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.status.done { color: var(--lime); }
.status.live { color: var(--yellow); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.filter { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--muted); background: transparent; cursor: pointer; }
.filter.active { color: #00101a; border-color: var(--lime); background: var(--lime); }

.team-card { padding: 20px; }
.team-head { display: flex; gap: 13px; align-items: center; margin-bottom: 16px; }
.team-number { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; color: var(--blue); font-weight: 900; }
.team-logo { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; object-fit: contain; background: #fff; padding: 4px; }
.team-card h3 { margin: 0; font-size: 17px; }
.players { display: grid; gap: 8px; }
.player { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(7,30,45,.72); font-size: 13px; }
.player span:last-child { color: var(--muted); text-align: right; }

.skeleton { min-height: 88px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 45%, var(--surface) 70%); background-size: 250% 100%; animation: shimmer 1.4s infinite; }
.skeleton.tall { min-height: 280px; }
@keyframes shimmer { to { background-position-x: -250%; } }
.empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

footer { display: flex; justify-content: space-between; gap: 20px; width: min(1440px, calc(100% - 36px)); margin: 40px auto 0; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; width: min(520px, calc(100% - 30px)); padding: 13px 18px; border: 1px solid #814e30; border-radius: 12px; background: #2b160c; color: #ffd2b5; text-align: center; box-shadow: var(--shadow); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto auto; gap: 12px; }
  nav { position: absolute; top: 71px; left: 0; right: 0; display: none; flex-direction: column; gap: 0; padding: 8px 14px 15px; border-bottom: 1px solid var(--line); background: rgba(0,8,14,.98); box-shadow: 0 18px 35px rgba(0,0,0,.35); }
  nav.open { display: flex; }
  nav a { padding: 13px 12px; border-bottom: 1px solid rgba(23,57,76,.55); }
  nav a:last-child { border-bottom: 0; }
  .menu-toggle { display: grid; grid-template-columns: 20px auto; grid-template-rows: repeat(3, 4px); align-items: center; column-gap: 8px; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; }
  .menu-toggle span { grid-column: 1; width: 20px; height: 2px; border-radius: 2px; background: var(--lime); }
  .menu-toggle b { grid-column: 2; grid-row: 1 / 4; font-size: 12px; }
  .menu-toggle[aria-expanded="true"] { border-color: var(--lime); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 56px; }
  .score-card { max-width: 460px; }
  .groups-grid, .teams-grid { grid-template-columns: 1fr; }
  .group-teams { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  main { width: min(100% - 24px, 1440px); }
  .site-header { padding-inline: 14px; }
  .menu-toggle b { display: none; }
  .menu-toggle { grid-template-columns: 20px; padding-inline: 10px; }
  .connection span { display: none; }
  .section { padding: 42px 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filters { justify-content: start; }
  .match-grid { grid-template-columns: 1fr; }
  .match-row { grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 15px 12px; }
  .match-info { grid-column: 1 / 3; }
  .status { grid-column: 3; grid-row: 1; }
  .score { min-width: 60px; font-size: 21px; }
  .team-name { font-size: 13px; }
  .encounter-score { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .encounter-score .side { font-size: 16px; }
  .game-summary { grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 15px 12px; }
  .game-number { grid-column: 1 / 3; }
  .game-summary .status { grid-column: 3; grid-row: 1; }
  .game-player { font-size: 13px; }
  .optional-heading { align-items: flex-start; padding: 14px 12px; }
  .optional-heading span:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .ranking-row { grid-template-columns: 46px 52px 1fr; gap: 10px; padding: 13px 12px; }
  .ranking-position { font-size: 23px; }
  .ranking-logo { width: 48px; height: 48px; }
  .ranking-players { grid-column: 3; }
  footer { width: calc(100% - 24px); flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; } }
