:root {
  --bg: #111928;
  --surface: #1f2a37;
  --text: #fff;
  --secondary: #d2d4d7;
  --muted: #969aa1;
  --accent: #1ecad3;
  --mint: #6fffd2;
  --line: rgba(30, 202, 211, 0.45);
  color-scheme: dark;
  font-family: Inter, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(17, 25, 40, 0.94);
  border-bottom: 2px solid var(--accent);
}
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 0.85rem 0;
}
.logo { justify-self: start; flex: 0 0 auto; }
.logo img { height: 2.4rem; width: 8.58rem; max-width: none; display: block; }
.top nav { display: flex; gap: 1.25rem; align-items: center; justify-content: center; font-family: Montserrat, Inter, sans-serif; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.top nav a[aria-current="page"] { color: var(--accent); }
.lang { justify-self: end; font-family: Roboto Mono, ui-monospace, monospace; text-transform: uppercase; color: var(--muted); }
.games { position: relative; }
.games summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.games summary::-webkit-details-marker { display: none; }
.caret {
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.12rem);
  display: inline-block;
}
.games[open] .caret { transform: rotate(225deg) translateY(-0.05rem); }
.games div { display: none; }
.games[open] div {
  display: grid;
  position: absolute;
  z-index: 3;
  top: 1.6rem;
  left: 0;
  background: var(--surface);
  min-width: 14rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
}
.games a { padding: 0.55rem 0.7rem; letter-spacing: 0; text-transform: none; font-family: Inter, sans-serif; font-size: 0.95rem; }

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 3rem; }
h1, h2, h3 { font-family: Montserrat, Inter, sans-serif; letter-spacing: 0.04em; }
h1 { text-transform: uppercase; font-size: clamp(1.4rem, 2vw, 2rem); }
.label { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }

.ticker { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; }
.chip, .cards a, .cards article, .match {
  background: var(--surface);
  border-radius: 0.6rem;
}
.chip { min-width: 15rem; padding: 0.8rem; display: grid; grid-template-columns: auto 1fr auto; gap: 0.4rem 0.6rem; align-items: center; border: 2px solid var(--accent); }
.chip small { grid-column: 1 / -1; color: var(--muted); }
.mark { position: relative; overflow: hidden; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 0.4rem; color: #111928; font-family: Montserrat, sans-serif; font-size: 0.68rem; font-weight: 700; }
.mark svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.vs { text-align: center; font-family: Roboto Mono, ui-monospace, monospace; }
.vs em { display: block; color: var(--accent); font-style: normal; font-family: Montserrat, sans-serif; font-size: 0.72rem; }

.news-grid { display: grid; gap: 1rem; }
.story, .feature {
  display: block;
  border: 2px solid var(--accent);
  border-radius: 0.7rem;
  background: var(--surface);
  overflow: hidden;
}
.story img, .feature img, .preview { width: 100%; height: 9rem; object-fit: cover; display: block; }
.feature img { height: 16rem; }
.story .copy, .feature .copy { padding: 0.85rem 1rem 1rem; }
.stack { display: grid; gap: 0.75rem; }
.posts-grid { display: grid; gap: 0.75rem; margin-bottom: 1.4rem; }
.cards a, .cards article { display: block; padding: 1rem 1.1rem; }
.hero { width: 100%; height: 18rem; object-fit: cover; border: 2px solid var(--accent); border-radius: 0.7rem; display: block; margin-bottom: 1rem; }
.cards { display: grid; gap: 0.75rem; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.filter summary, .more summary { cursor: pointer; list-style: none; }
.filter summary::-webkit-details-marker, .more summary::-webkit-details-marker { display: none; }
.filter summary { background: var(--accent); color: #111928; font-family: Montserrat, sans-serif; font-weight: 700; border-radius: 0.45rem; padding: 0.45rem 0.8rem; }
.filter.on summary { box-shadow: inset 0 0 0 2px #fff; }
.filter .sheet { display: none; }
.filter[open] .sheet { display: grid; place-items: center; position: fixed; inset: 0; z-index: 30; background: rgba(8, 12, 18, 0.72); padding: 1rem; }
.panel { width: min(42rem, 100%); max-height: min(82vh, 44rem); overflow: auto; background: #1b2430; border-radius: 1rem; padding: 1.1rem 1.2rem 1.3rem; display: grid; gap: 0.7rem; }
.panel h2 { margin: 0.4rem 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chipbox { position: relative; }
.chipbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipbox span { display: inline-flex; border: 1px solid #fff; border-radius: 999px; padding: 0.42rem 0.8rem; color: #fff; }
.chipbox input:checked + span { background: var(--accent); color: #111928; border-color: var(--accent); }
.chipbox input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.filter-actions { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.4rem; }
.filter-actions a { color: var(--secondary); }
.more { margin: 1rem 0 1.6rem; }
.more summary { display: block; width: fit-content; margin: 0 auto; background: var(--accent); color: #111928; font-family: Montserrat, sans-serif; font-weight: 700; border-radius: 999px; padding: 0.7rem 1.2rem; }
.more .posts-grid { margin-top: 1rem; }
.board { display: grid; gap: 1rem; margin-top: 2rem; }
.seg { display: flex; background: #1a2330; border-radius: 0.7rem; overflow: hidden; margin-bottom: 0.8rem; }
.seg a { flex: 1; text-align: center; padding: 0.75rem 0.4rem; font-family: Montserrat, sans-serif; }
.seg a[aria-current="page"] { background: var(--accent); color: #111928; }
.picker a { display: block; margin-bottom: 0.45rem; padding: 0.7rem 0.9rem; border-radius: 0.55rem; background: var(--surface); }
.picker a[aria-current="page"] { background: var(--accent); color: #111928; }
.event { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 1rem; padding: 0.9rem 1rem; border: 2px solid var(--accent); border-radius: 0.7rem; background: var(--surface); }
.event span, .event em { color: var(--secondary); font-style: normal; }
.article-grid { display: grid; gap: 1.2rem; align-items: start; }
.empty { color: var(--secondary); }

.tabs { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.tabs a { padding: 0.35rem 0.7rem; border-radius: 999px; background: var(--surface); }
.tabs a[aria-current="page"] { background: var(--accent); color: #111928; }

.match, a.match {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.8rem 1rem;
}
.match small, a.match small { grid-column: 1 / -1; color: var(--muted); }
.score { font-family: Roboto Mono, ui-monospace, monospace; text-align: center; }
.clock { font-family: Roboto Mono, ui-monospace, monospace; font-size: 1.4rem; color: var(--accent); }
.rosters { display: grid; gap: 1rem; }
.rosters ul { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: 0.6rem; }
.rosters li { display: flex; justify-content: space-between; padding: 0.7rem 1rem; border-top: 1px solid rgba(255,255,255,0.05); }
.rosters li span { color: var(--muted); }
.article .body, .body { max-width: 68ch; color: var(--secondary); font-size: 1.05rem; line-height: 1.6; }
.body h2, .body h3, .body h4 { color: var(--text); margin: 1.1rem 0 0.35rem; }
.body h2 { font-size: 1.7rem; }
.body h3 { font-size: 1.35rem; }
.body h4 { font-size: 1.1rem; }

form { display: grid; gap: 0.8rem; }
label { display: grid; gap: 0.3rem; color: var(--secondary); }
input, textarea, select, button {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.45rem;
  padding: 0.65rem 0.75rem;
}
button { background: var(--accent); color: #111928; border: 0; font-family: Montserrat, sans-serif; font-weight: 700; cursor: pointer; }
button.ghost { background: transparent; color: var(--secondary); border: 1px solid rgba(255,255,255,0.15); }
.search { grid-template-columns: 1fr auto; margin-bottom: 1rem; }
.narrow { max-width: 36rem; }
.check { grid-template-columns: auto 1fr; align-items: center; }
.when { display: flex; gap: 0.5rem; }
.when input[type="date"] { flex: 1; min-width: 0; }
.when input:last-child { width: 6.5rem; flex: none; }

.site-foot { width: min(1120px, calc(100% - 2rem)); margin: 2.5rem auto 2rem; padding-top: 1.6rem; border-top: 2px solid var(--accent); display: grid; gap: 1.6rem; color: var(--secondary); }
.foot-grid { display: grid; gap: 1.2rem; }
.foot-grid a, .legal-links a { display: block; color: var(--secondary); margin: 0.28rem 0; }
.socs { display: grid; grid-template-columns: repeat(4, 2.35rem); gap: 0.55rem; justify-content: start; }
.soc { width: 2.35rem; height: 2.35rem; display: grid; place-items: center; }
.soc img { width: 2.15rem; height: 2.15rem; display: block; }
.channel .soc { width: 2.8rem; height: 2.8rem; }
.channel .soc img { width: 2.6rem; height: 2.6rem; }
.soc.big { width: auto; height: auto; margin-bottom: 0.6rem; }
.soc.big img { width: 4.5rem; height: 4.5rem; }
.crest { width: 1.7rem; height: 1.7rem; object-fit: contain; border-radius: 0.3rem; vertical-align: middle; }
.crest.lg { width: 4.5rem; height: 4.5rem; }
.flag { width: 1.2rem; height: 0.9rem; object-fit: cover; border-radius: 0.12rem; margin-right: 0.35rem; vertical-align: middle; }
.ad { display: block; margin: 0.75rem 0 0; border: 2px solid var(--accent); border-radius: 0.7rem; overflow: hidden; background: var(--surface); }
.ad img, .ad-preview { width: 100%; height: 9rem; object-fit: cover; display: block; }
.rows { display: grid; gap: 0.75rem; }
.t-board { display: grid; gap: 1.2rem; align-items: start; }
.fold { background: #1a2330; border-radius: 0.7rem; margin-bottom: 0.55rem; }
.fold summary { cursor: pointer; list-style: none; padding: 0.85rem 1rem; font-family: Montserrat, sans-serif; display: flex; justify-content: space-between; align-items: center; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.fold[open] summary::after { transform: rotate(225deg) translateY(0.15rem); }
.fold .rows { padding: 0 0.7rem 0.7rem; }
.t-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.squads { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.8rem; }
.squad { background: var(--surface); border-radius: 0.8rem; padding: 0.9rem; }
.squad ul { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.squad li { margin: 0.25rem 0; }
.chipbox .crest { width: 1.1rem; height: 1.1rem; margin-right: 0.3rem; }
.foot-base { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.foot-base .logo img { height: 2rem; width: 7.15rem; }
.legal { color: var(--muted); }
.follow-grid { display: grid; gap: 0.7rem; }
.channel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.7rem; align-items: center; background: var(--surface); border-radius: 0.75rem; padding: 0.75rem 0.85rem; }
.channel-main { display: flex; gap: 0.75rem; align-items: center; min-width: 0; }
.channel-main span:last-child { display: grid; }
.channel-main small { color: var(--muted); }
a.go { display: inline-flex; align-items: center; width: fit-content; background: var(--accent); color: #111928; border-radius: 999px; padding: 0.45rem 0.9rem; font-family: Montserrat, sans-serif; font-weight: 700; }
.section { margin: 2rem 0 0.8rem; }
.project { display: grid; gap: 1rem; border: 1px solid rgba(255,255,255,0.16); border-radius: 0.9rem; padding: 1rem; margin-bottom: 0.9rem; }
.project img { width: 100%; max-height: 9rem; object-fit: contain; }
.badge { display: inline-flex; align-items: center; background: #2a3544; color: var(--text); border-radius: 999px; padding: 0.15rem 0.55rem; font-size: 0.75rem; margin-left: 0.35rem; }
.editor { display: grid; gap: 0.35rem; }
.tools { display: flex; gap: 0.35rem; }
.tools button { background: transparent; color: var(--secondary); border: 1px solid rgba(255,255,255,0.18); padding: 0.3rem 0.55rem; }
.chip-search { margin-top: 0.2rem; }

@media (min-width: 800px) {
  .news-grid { grid-template-columns: 1.5fr 0.9fr; }
  .posts-grid { grid-template-columns: 1fr 1fr 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .board { grid-template-columns: 1.7fr 0.7fr; }
  .t-board { grid-template-columns: 1fr 1fr; }
  .article-grid { grid-template-columns: 1.45fr 0.8fr; }
  .rosters { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1.1fr 1fr auto; align-items: start; }
  .socs { justify-content: end; }
  .legal-links { padding-top: 1.6rem; }
  .follow-grid { grid-template-columns: 1fr 1fr; }
  .project { grid-template-columns: 16rem 1fr; align-items: center; }
}

.admin-nav { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.admin-nav a { color: var(--secondary); }
.admin-nav a[aria-current="page"] { color: var(--accent); }
.split { display: grid; gap: 1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); vertical-align: top; }
.inline { display: flex; gap: 0.5rem; align-items: center; }

@media (min-width: 800px) {
  .split { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .top { display: flex; flex-wrap: wrap; }
  .top nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
    gap: 0.15rem 0.9rem;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
  }
  .top nav > a, .games summary { padding: 0.45rem 0; }
  .games[open] div {
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 0.2rem);
    z-index: 5;
    text-align: center;
  }
  .match, a.match {
    grid-template-columns: auto auto;
    justify-content: center;
    justify-items: center;
    text-align: center;
    grid-template-areas:
      "ma na"
      "score score"
      "mb nb"
      "meta meta";
  }
  a.match .mark:first-child { grid-area: ma; }
  a.match strong:first-of-type { grid-area: na; }
  a.match .score { grid-area: score; text-align: center; }
  a.match .mark:last-of-type { grid-area: mb; }
  a.match strong:nth-of-type(2) { grid-area: nb; justify-self: center; }
  a.match small { grid-area: meta; text-align: center; }
}
