:root {
  color-scheme: dark;
  --bg: #0c0e0e;
  --surface: #141817;
  --surface-2: #1b201e;
  --border: #2b3430;
  --text: #f0f3f0;
  --muted: #a0ada7;
  --quiet: #77877e;
  --mint: #bef7b8;
  --mint-ink: #122014;
  --danger: #ff9a97;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --width: 1312px;
  font-family: "Golos Text", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
code, pre { font-family: var(--mono); }
.topbar { background: #101311; border-bottom: 1px solid var(--border); }
.top-width {
  max-width: var(--width); padding: 0 32px; min-height: 76px; margin: auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 850; width: fit-content; }
.brand-game { font: 600 12px var(--mono); color: var(--mint); border-left: 1px solid #49534d; padding-left: 9px; }
.brand-mark {
  width: 25px; aspect-ratio: 1; border: 1px solid #80a480; display: inline-block; flex: none;
  background: linear-gradient(var(--mint), var(--mint)) center / 12px 1px no-repeat,
              linear-gradient(var(--mint), var(--mint)) center / 1px 12px no-repeat;
  transform: rotate(45deg); margin-right: 5px;
}
nav { display: flex; gap: 25px; align-self: stretch; }
nav a {
  display: flex; align-items: center; border-bottom: 2px solid transparent;
  padding: 0 3px; font-size: 14px; color: var(--muted); white-space: nowrap;
}
nav a:hover, nav a[aria-current] { color: var(--text); }
nav a[aria-current] { border-color: var(--mint); }
.status { justify-self: end; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.status i, .signal { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #e6b16a; flex: none; }
.status[data-state="ready"] i { background: var(--mint); box-shadow: 0 0 14px #bef7b87a; }
.status[data-state="offline"] i, .status[data-state="error"] i { background: var(--danger); }
main { max-width: var(--width); padding: 32px 32px 72px; margin: auto; }
.feedback { border: 1px solid #49634a; background: #19241b; color: var(--mint); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.feedback[data-error] { border-color: #764946; background: #281918; color: var(--danger); }
.hero {
  min-height: 389px; position: relative; overflow: hidden; display: flex; justify-content: space-between;
  flex-direction: column; isolation: isolate; border: 1px solid #3a4540; border-radius: 12px;
  background: #1b261e; --art: url('/images/maps/de_mirage.webp');
}
.hero::before, .hero::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.hero::before { background: var(--art) center 48% / cover no-repeat; filter: saturate(.72); }
.hero::after { background: linear-gradient(90deg, #0d1410 0%, #0d1410eb 24%, #0d141070 58%, #131b1640 100%), linear-gradient(0deg,#0d1210db, transparent 40%); }
.hero-content { padding: 36px 39px 24px; }
.hero-tag { display: flex; align-items: center; gap: 9px; color: var(--mint); font-weight: 600; font-size: 13px; }
.signal { background: var(--mint); width: 6px; height: 6px; }
.hero h1 { font-size: clamp(45px, 7.3vw, 96px); font-weight: 800; line-height: .99; letter-spacing: -.049em; margin: 16px 0 11px; }
.hero p { font-size: 14px; color: #d3ded5; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 24px; }
.button {
  display: inline-flex; gap: 10px; align-items: center; justify-content: center;
  min-height: 43px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px;
  font-size: 13px; font-weight: 700; line-height: 1.2; text-align: center;
  transition: background .16s, color .16s, border-color .16s;
}
.button:disabled, .button[aria-disabled="true"] { opacity: .43; cursor: default; }
.primary { background: var(--mint); color: var(--mint-ink); }
.primary:not(:disabled):hover { background: #dcffd9; }
.secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.secondary:not(:disabled):hover { border-color: #6b8374; }
.hero-secondary { background: #121b17ba; border-color: #728073; color: var(--text); }
.hero-secondary:hover { background: #26332c; }
.danger { color: var(--danger); }
.full { width: 100%; }
.compact { min-height: 34px; padding-inline: 12px; font-size: 20px; }
.hero code { display: inline-block; color: #c1d3c4; font-size: 12px; margin-top: 14px; overflow-wrap: anywhere; }
.hero-data { display: flex; gap: 49px; padding: 16px 39px; border-top: 1px solid #aeb8ac2b; background: #0b130fb0; }
.hero-data div, .selection { display: flex; flex-direction: column; gap: 6px; }
.hero-data span, .selection span { color: #b6c4bb; font-size: 12px; }
.hero-data strong { font: 600 17px var(--mono); }
.server-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 25px; margin-top: 31px; align-items: start; }
.heading-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.heading-row h2, .control h2, dialog h2 { font-size: 22px; letter-spacing: -.035em; }
.heading-row p, .page-title p, .form-note { color: var(--muted); font-size: 14px; margin-top: 7px; line-height: 1.5; }
.map-grid { margin-top: 17px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.map-card {
  position: relative; display: flex; flex-direction: column; align-items: start; justify-content: end;
  min-height: 122px; width: 100%; padding: 12px; overflow: hidden; isolation: isolate;
  text-align: left; color: var(--text); border: 1px solid #46524a; border-radius: 8px; background: #23322a;
}
.map-card::before, .map-card::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.map-card::before {
  background: var(--art, repeating-linear-gradient(123deg, #21382b, #21382b 7px, #294334 7px, #294334 9px)) center / cover;
  filter: saturate(.63); transition: transform .18s;
}
.map-card::after { background: linear-gradient(0deg, #0a110e 1%, #101a14a0 39%, #151d162b 85%); }
.map-card:hover::before { transform: scale(1.05); }
.map-card[aria-pressed="true"] { border-color: var(--mint); box-shadow: inset 0 0 0 1px var(--mint); }
.map-card strong { font-size: 16px; }
.map-card small { margin-top: 3px; color: #c5d4cb; font-size: 11px; }
.map-indicator {
  display: none; position: absolute; right: 9px; top: 9px;
  background: var(--mint); color: var(--mint-ink); border-radius: 3px; padding: 4px 6px; font-size: 10px; font-weight: 800;
}
.map-card[data-active] .map-indicator, .map-card[aria-pressed="true"] .map-indicator { display: block; }
.map-card[data-active][aria-pressed="false"] .map-indicator { background: #141f19; color: var(--mint); }
.control { border: 1px solid var(--border); background: var(--surface); padding: 21px; border-radius: 9px; }
.selection { margin: 18px 0 15px; border-top: 1px solid var(--border); padding-top: 15px; }
.selection strong { font-size: 18px; }
.control-note { min-height: 37px; color: var(--muted); font-size: 12px; margin: 10px 0 12px; line-height: 1.55; }
.control-secondary { display: flex; gap: 7px; flex-wrap: wrap; }
.control-secondary button { flex: 1; padding-inline: 10px; }
.page-title { margin: 6px 0 25px; }
.page-title h1 { font-size: clamp(36px, 6vw, 66px); font-weight: 850; letter-spacing: -.065em; }
.filter-row, .form-fields { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.filter-row { grid-template-columns: 1fr 1fr 2fr; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
input, select {
  min-width: 0; width: 100%; min-height: 43px; padding: 8px 11px; background: #111513;
  color: var(--text); border: 1px solid var(--border); border-radius: 6px;
}
.results { color: var(--muted); font-size: 14px; margin: 18px 0 12px; }
.lineups, .command-groups { display: grid; gap: 13px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lineup, .command-group {
  display: flex; flex-direction: column; gap: 9px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 8px; padding: 16px;
}
.lineup h2, .command-group h2 { font-size: 17px; overflow-wrap: anywhere; }
.lineup p, .command-group p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.lineup-kicker { color: var(--mint); font: 500 11px var(--mono); }
.lineup-actions { margin-top: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.source-link { color: var(--mint); font-size: 12px; }
.source-link:hover { text-decoration: underline; }
.command { padding-top: 10px; border-top: 1px solid var(--border); }
.command code { font-size: 12px; color: var(--mint); overflow-wrap: anywhere; }
.log {
  background: #080b09; border: 1px solid var(--border); border-radius: 8px; min-height: 300px; max-height: 67vh;
  overflow: auto; padding: 17px; color: #b5c5b9; font-size: 12px; line-height: 1.6; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
}
dialog { width: min(94vw, 580px); padding: 25px; border: 1px solid #53675a; border-radius: 10px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: #050806bc; }
.form-fields { margin: 18px 0 20px; }
.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 7px; }
.check input { width: 16px; min-height: auto; height: 16px; accent-color: var(--mint); }
.error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }
@media (max-width: 1050px) {
  .map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .top-width, main { padding-inline: 18px; }
  .top-width { grid-template-columns: 1fr 1fr; padding-top: 17px; gap: 11px; }
  nav { grid-row: 2; grid-column: 1 / -1; gap: 19px; min-height: 37px; overflow-x: auto; }
  .server-grid { grid-template-columns: 1fr; }
  .control { grid-row: 1; }
  .lineups, .command-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  main { padding-top: 18px; }
  .hero { min-height: 0; }
  .hero-content { padding: 25px 19px 21px; }
  .hero::after { background: linear-gradient(90deg, #0d1410ed, #0d141066), linear-gradient(0deg, #0d1410dd, transparent); }
  .hero-data { gap: 24px; padding: 13px 19px; }
  .hero-data strong { font-size: 14px; }
  .map-grid, .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { grid-column: 1 / -1; }
  .lineups, .command-groups { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.lineup-dialog { width: min(94vw, 880px); max-height: 92dvh; padding: 22px; overflow-y: auto; }
.lineup-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 14px; }
.lineup-dialog h2 { font-size: clamp(20px, 3.4vw, 34px); line-height: 1.18; margin-top: 6px; }
.media-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.media-switch:empty { display: none; }
.media-switch .button[aria-pressed="true"] { border-color: var(--mint); color: var(--mint); }
.lineup-player { overflow: hidden; border-radius: 8px; background: #080b0c; }
.lineup-player video, .lineup-player img { width: 100%; max-height: 58dvh; object-fit: contain; display: block; }
.lineup-player p { padding: 16px; color: var(--muted); line-height: 1.5; }
.lineup-method { margin: 14px 0; color: var(--text); line-height: 1.5; }
.lineup-dialog-footer { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .lineup-dialog { padding: 15px; }
}
