:root {
  color-scheme: dark;
  --surface: #152641;
  --line: #344c70;
  --ink: #f2f7ff;
  --muted: #bacce6;
  --accent: #84ddff;
  --lavender: #c8b7ff;
  font: 1rem/1.5 Geist, system-ui, sans-serif;
  background: #091428;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 4.5rem); line-height: 1.05; letter-spacing: -.04em; }
h2 { font-size: 1.5rem; }
h3, h4 { font-size: 1rem; }
p { text-wrap: pretty; }
button, input, select { font: inherit; }
a, button, input, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
.shell { max-width: 72rem; width: calc(100% - 3rem); margin-inline: auto; }
header { border-bottom: 1px solid var(--line); }
.bar, nav, .section-head, .match-meta, .team-line, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.bar { min-height: 4.5rem; flex-wrap: wrap; padding-block: .75rem; }
.brand { display: inline-flex; gap: .75rem; align-items: center; font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2.75rem; height: 2.25rem; border-radius: .5rem; color: #0b1c34; background: var(--accent); letter-spacing: -.05em; }
nav { flex-wrap: wrap; justify-content: start; font-size: .875rem; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover, nav a[aria-current] { color: var(--accent); text-decoration: underline; text-underline-offset: .375rem; }
.skip { position: absolute; transform: translateY(-200%); padding: .5rem; background: var(--surface); }
.skip:focus { transform: none; }
.overview { position: relative; isolation: isolate; overflow: hidden; margin-block: 1.5rem; padding: clamp(1.25rem, 5vw, 3.5rem); background: #122443; border: 1px solid var(--line); border-radius: 1.25rem; }
.overview-content { position: relative; z-index: 1; width: fit-content; }
.overview h1 span { display: block; color: var(--accent); }
.format { display: flex; flex-wrap: wrap; list-style: none; margin: 1.25rem 0; padding: 0; gap: .5rem 1rem; color: var(--muted); font-weight: 650; }
.format li + li { border-left: 1px solid var(--line); padding-left: 1rem; }
.arena-art { --arena-line: #395c8f; position: absolute; z-index: -1; width: clamp(14rem, 33vw, 28rem); aspect-ratio: 1; top: 50%; right: clamp(-5rem, 4vw, 6rem); transform: translateY(-50%) rotate(-18deg); border: 1px solid var(--arena-line); border-radius: 2rem; box-shadow: 0 1.5rem 3rem #06112550; }
.arena-art::before, .arena-art::after { content: ""; position: absolute; border: 1px solid var(--arena-line); border-radius: 1.5rem; }
.arena-art::before { inset: 12%; }
.arena-art::after { inset: 24%; border-color: #5377ab; }
.arena-core { position: absolute; inset: 36%; border: .5rem solid #80d8ff; border-right-color: var(--lavender); border-radius: 1rem; transform: rotate(45deg); box-shadow: 0 .75rem 2rem #0a162b80; }
.panel, .notice { border: 1px solid var(--line); border-radius: .75rem; padding: 1.25rem; background: var(--surface); }
.muted, footer { color: var(--muted); }
button, .button {
  display: inline-block;
  background: var(--accent);
  color: #0b1c34;
  border: 1px solid transparent;
  border-radius: .5rem;
  padding: .625rem 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms cubic-bezier(.16, 1, .3, 1), transform 160ms cubic-bezier(.16, 1, .3, 1);
}
button:hover, .button:hover { background: #b9edff; }
button:active, .button:active { transform: scale(.98); }
.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.secondary:hover { background: #233d60; }
.section-head { flex-wrap: wrap; margin-block: 1.5rem 1rem; }
.cards, .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.bracket-panel {
  --board: #0f1d34;
  --bronze-wire: var(--lavender);
  background: var(--board);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: clamp(1rem, 4vw, 2rem);
}
.bracket-panel .section-head { margin: 0 0 .5rem; }
.status { color: var(--accent); font-size: .875rem; font-weight: 650; }
.champion { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; margin-top: 1rem; padding: .625rem .875rem; background: #14324e; border: 1px solid #416a91; border-radius: .5rem; color: var(--muted); overflow-wrap: anywhere; }
.champion strong { color: var(--accent); }
.bracket-note { font-size: .875rem; }
.bracket-board {
  margin-top: 1.5rem;
}
.bracket-heading { color: var(--muted); font-size: .875rem; font-weight: 700; margin-bottom: .5rem; }
.bracket-entrants, .bracket-pair { display: grid; gap: .5rem; }
.bracket-entrants { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; margin: 0; list-style: none; }
.bracket-entrants li { display: grid; place-items: center; min-height: 2.75rem; padding: .5rem .25rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); text-align: center; font-size: .875rem; line-height: 1.25; overflow-wrap: anywhere; }
.bracket-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: .5rem; gap: 1rem; }
.bracket-wires { display: block; width: 100%; fill: none; }
.entrants-wires { height: 2rem; }
.result-wires { height: 3.5rem; }
.bracket-wires path { stroke-width: 1.75; vector-effect: non-scaling-stroke; }
.bracket-wires .wire-gap { stroke: var(--board); stroke-width: 6; }
.wire-neutral { stroke: #7893be; }
.wire-final { stroke: var(--accent); }
.wire-bronze { stroke: var(--bronze-wire); stroke-dasharray: 4 3; }
.match { display: grid; grid-template-rows: minmax(2.75rem, auto) repeat(2, 1fr); min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; }
.final { border-color: #6094be; }
.bronze { border-color: #756ba3; }
.match-meta { padding: .5rem .75rem; flex-wrap: wrap; gap: .125rem .5rem; }
.match-meta h3 { font-size: .875rem; }
.placeholder { font-size: .875rem; color: var(--muted); }
.team-line { gap: .25rem; padding: .5rem .75rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; line-height: 1.25; }
.team-line strong { flex: 0 0 auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.team-line > span:first-child { flex: 1; min-width: 0; }
.starting-side { flex: 0 0 auto; color: var(--muted); font-size: .75rem; font-weight: 700; }
.starting-side.ct { color: var(--accent); }
.starting-side.t { color: var(--lavender); }
.score-origin { color: var(--accent); font-size: .875rem; }
.winner { color: var(--accent); background: #1b3858; }
.legend { list-style: none; margin: 1rem 0 0; padding: .75rem 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--muted); font-size: .875rem; }
.legend li { display: flex; gap: .5rem; align-items: center; }
.legend li span { width: 1rem; border-top: 2px solid var(--accent); }
.legend li .legend-bronze { border-top: 2px dashed var(--bronze-wire); }
.team-list { margin-top: 1.5rem; }
.team-list ul { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding-left: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.heading { padding-block: 2.5rem 1rem; }
.heading h1 { font-size: clamp(2rem, 6vw, 3.75rem); }
.live-player { border: 1px solid var(--line); border-radius: 1rem; background: #070f1d; overflow: hidden; }
.live-screen { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; aspect-ratio: 16 / 9; max-height: 62vh; }
.live-screen video { display: block; width: 100%; height: 100%; object-fit: contain; }
.live-placeholder { position: absolute; inset: 0; display: grid; place-content: center; gap: .5rem; padding: 1rem; text-align: center; background: #0e1e37; }
.live-placeholder strong { font-size: clamp(1.125rem, 3vw, 2rem); }
.live-placeholder span { color: var(--muted); font-size: .875rem; }
.live-player[data-state="ready"] .live-placeholder, .live-player[data-state="live"] .live-placeholder { display: none; }
.live-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem; border-top: 1px solid var(--line); background: var(--surface); }
.live-status { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 700; color: var(--muted); }
.live-status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); }
.live-player[data-state="live"] .live-status { color: var(--accent); }
.live-player[data-state="live"] .live-status::before { background: var(--accent); }
.live-controls { display: flex; flex-wrap: wrap; gap: .5rem; }
.live-controls .secondary { min-height: 2.75rem; font-size: .875rem; }
.live-controls button:disabled { opacity: .5; cursor: default; }
.live-controls button:disabled:hover { background: transparent; }
.live-controls .live-fullscreen { background: var(--accent); color: #0b1c34; }
.live-controls .live-fullscreen:hover { background: #b9edff; }
.live-player:is(:fullscreen, .live-expanded) {
  display: grid;
  grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.live-player:is(:fullscreen, .live-expanded) .live-screen { aspect-ratio: auto; min-height: 0; max-height: none; }
.live-player:is(:fullscreen, .live-expanded) video { min-width: 0; min-height: 0; }
.live-player.live-expanded { position: fixed; inset: 0; z-index: 20; height: 100dvh; }
.live-expanded-page { overflow: hidden; }
.form { display: grid; gap: 1rem; }
.heading ~ .form { margin-top: 1rem; }
.narrow { max-width: 28rem; }
label { display: grid; gap: .25rem; font-size: .875rem; overflow-wrap: anywhere; }
input, select { width: 100%; min-width: 0; padding: .625rem; color: var(--ink); background: #0c1930; border: 1px solid var(--line); border-radius: .375rem; }
fieldset { margin: 0; padding: .75rem; border: 1px solid var(--line); border-radius: .5rem; min-width: 0; }
legend { padding-inline: .5rem; font-weight: 700; }
.notice { margin-top: 1rem; }
.error { border-color: #ce866e; }
.success { border-color: #6094be; }
.equipment { background: #122b49; border-color: #6094be; }
.equipment strong { display: block; margin-bottom: .25rem; }
.test-cleanup { margin-top: 1rem; }
.test-cleanup summary { cursor: pointer; color: #f0ad9c; font-weight: 650; }
.test-cleanup form { margin-top: 1rem; }
.game-extra summary { cursor: pointer; color: var(--accent); }
.stop-match summary { color: #ffceca; }
.stop-match summary::marker { content: ""; }
.stop-match summary::-webkit-details-marker { display: none; }
.stop-match[open] { border-radius: .75rem; background: #101c30; padding: .75rem; }
.game-extra form { max-width: 32rem; margin-top: 1rem; }
.game-extra input[type="number"] { max-width: 8rem; }
.confirm { display: flex; align-items: center; gap: .5rem; }
.confirm input { width: 1rem; height: 1rem; flex-shrink: 0; accent-color: var(--accent); }
.danger { color: #ffe6df; background: #6a352d; }
.danger:hover { background: #87463b; }
.roster { padding-left: 1.25rem; }
.roster small { display: block; color: var(--muted); }
.roster-edit { margin-block: .75rem; }
.roster-edit summary { color: var(--accent); cursor: pointer; }
.roster-edit form { margin-top: .75rem; }
.application-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .25rem .75rem; }
.application-details dt { color: var(--muted); }
.application-details dd { margin: 0; }
.actions, .draw { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.draw { margin-top: 1rem; justify-content: space-between; }
.panel { overflow-wrap: anywhere; }
footer { flex-wrap: wrap; padding-block: 1.25rem; margin-top: 2rem; border-top: 1px solid var(--line); font-size: .875rem; }
@media (max-width: 45rem) {
  .shell { width: calc(100% - 2rem); }
  .overview { margin-block: 1rem; }
  .arena-art { opacity: .35; right: -7rem; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 28rem) {
  .overview h1 { font-size: clamp(1.5rem, 7.3vw, 2rem); }
  .format { font-size: .875rem; gap: .5rem; }
  .format li + li { padding-left: .5rem; }
  .fields { grid-template-columns: 1fr; }
  .team-line, .match-meta { padding-inline: .5rem; }
  .bracket-panel .section-head { gap: .25rem; }
  .bracket-entrants { gap: .25rem; }
  .bracket-entrants li { font-size: .75rem; }
  .bracket-pair { padding-inline: 0; gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  button, .button { transition: none; }
}
