/* Look: built around the Sniping Skirmish logo. Black scanlined ground, teal, magenta and purple from the logo. */
:root {
  color-scheme: dark;
  --bg: #06070b; --surface: #0d0f17; --raised: #141724; --ink: #eef1ff; --muted: #8e94b3;
  --line: #232842; --teal: #19e3c4; --magenta: #ff2bd6; --purple: #7a3cff;
  --font-display: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --font-script: "Mr Dafoe", "Brush Script MT", cursive;
  --font-body: "Exo 2", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  background:
    radial-gradient(60% 320px at 50% 0, rgba(122, 60, 255, .22), transparent 70%),
    radial-gradient(40% 220px at 50% 40px, rgba(25, 227, 196, .10), transparent 70%),
    var(--bg);
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 3px);
}
.wrap { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; padding: 24px 16px 64px; display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.tight { gap: 10px; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }

/* logo header: the real Sniping Skirmish logo */
.brand { display: flex; justify-content: center; padding: 6px 0 2px; }
.logo { margin: 0; line-height: 0; }
.logo img { display: block; width: min(340px, 78vw); height: auto; filter: drop-shadow(0 0 22px rgba(122, 60, 255, .35)); }
.brand.small .logo img { width: min(230px, 60vw); }
.sub { text-align: center; font: 600 13px var(--font-body); letter-spacing: 0.28em; text-transform: uppercase; color: var(--teal); overflow-wrap: anywhere; }
.tabs { display: flex; justify-content: center; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a, .tabs button { background: none; border: 0; cursor: pointer; padding: 9px 20px; font: 600 13px var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on, .tabs button.on { color: var(--ink); border-bottom-color: var(--teal); }
.tabs a:hover, .tabs button:hover { color: var(--teal); }
body.org #switch, body.org #back { display: none; }
.bar { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; }

/* panels: HUD plates with one cut corner */
.panel, .video {
  background: linear-gradient(180deg, var(--raised), var(--surface)); border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.video { border-top-color: rgba(25, 227, 196, .55); }
.panel h2 { margin: 0; font: italic 800 19px/1.2 var(--font-display); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
label.muted { letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; }
input[type="text"], input[type="url"], input[type="password"], select {
  flex: 1 1 180px; min-width: 0; font: 500 15px var(--font-body);
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 2px; padding: 9px 12px;
}
select { flex: 0 0 auto; }
input.narrow { flex: 0 0 90px; }
.row.grow { flex: 1 1 100%; }
input.narrow2 { flex: 0 1 190px; }
h3.group { margin: 16px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); font: 600 12px var(--font-body); letter-spacing: 0.28em; text-transform: uppercase; color: var(--teal); }
input[type="checkbox"] { accent-color: var(--teal); width: 16px; height: 16px; vertical-align: -3px; }
label.check { font-size: 13px; color: var(--muted); white-space: nowrap; }
input.code { font-weight: 600; font-size: 17px; letter-spacing: 0.14em; text-transform: uppercase; }
input:focus, select:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(25, 227, 196, .2); }
.btn {
  font: 600 13px var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; padding: 10px 16px; border-radius: 2px;
  cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--ink);
}
.btn:hover { border-color: var(--teal); color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #03110f; }
.btn.primary:hover { color: #03110f; box-shadow: 0 0 16px rgba(25, 227, 196, .55); }
a.btn { text-decoration: none; display: inline-block; }
.btn.small { padding: 5px 10px; font-size: 11px; }
.btn.armed { background: var(--magenta); border-color: var(--magenta); color: #ffffff; }
.btn:disabled { opacity: .6; cursor: default; }
.error { color: var(--magenta); font-size: 14px; font-weight: 500; }

/* judge sheet */
.video-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.video-head h2 { margin: 0; font: italic 800 19px/1.2 var(--font-display); min-width: 0; overflow-wrap: anywhere; }
.video-head a { color: var(--teal); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; text-decoration: none; border-bottom: 1px solid currentColor; }
.video-head a:hover { color: var(--ink); }
.crit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 6px 14px; align-items: center; }
.crit-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.crit-name small { color: var(--muted); font-weight: 400; }
.scores { display: grid; gap: 4px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scores.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scores.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scores.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.scores.n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.scores.n7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.scores.n8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.scores.n9 { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.scores.n10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.scores button {
  font: 600 14px var(--font-body); font-variant-numeric: tabular-nums; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 2px; background: var(--bg); color: var(--muted); cursor: pointer;
}
.scores button:hover { border-color: var(--teal); color: var(--teal); }
.scores button[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--magenta), var(--purple)); border-color: transparent; color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 43, 214, .55);
}
.versus { margin: 14px 0 -6px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: center; text-align: center; font: italic 900 22px/1.2 var(--font-display); }
.versus small { flex: 1 0 100%; font: 600 12px var(--font-body); letter-spacing: 0.28em; text-transform: uppercase; color: var(--teal); }
.versus em { font: 400 24px/1 var(--font-script); color: var(--magenta); text-shadow: 0 0 12px rgba(255, 43, 214, .7); }
.versus span { overflow-wrap: anywhere; min-width: 0; }
.items .name small.good { color: var(--teal); }
.empty { border: 1px dashed var(--line); padding: 28px 20px; text-align: center; color: var(--muted); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.good { color: var(--teal); }

/* organiser page */
.rank { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.rank:first-child { border-top: 0; }
.rank-n { font: italic 900 26px/1.1 var(--font-display); color: var(--muted); font-variant-numeric: tabular-nums; }
.rank.first .rank-n { color: var(--teal); text-shadow: 0 0 12px rgba(25, 227, 196, .6); }
.rank-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rank-body strong { font-weight: 600; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips b { color: var(--ink); font-weight: 600; }
.rank-score { text-align: right; font-variant-numeric: tabular-nums; }
.rank-score strong { font: italic 900 24px/1.1 var(--font-display); display: block; }
.rank-score span { font-size: 12px; color: var(--muted); }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.items li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.items li:first-child { border-top: 0; }
.items .name { min-width: 0; flex: 1 1 160px; overflow-wrap: anywhere; }
.items .name small { color: var(--muted); display: block; }
.items code { font: 600 14px ui-monospace, Consolas, monospace; letter-spacing: 0.1em; color: var(--teal); }
textarea { width: 100%; min-height: 110px; font: 13px ui-monospace, Consolas, monospace; color: var(--ink); background: var(--bg); border: 1px solid var(--line); padding: 8px; }

@media (max-width: 520px) { .crit { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .scores.n6, .scores.n8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .scores.n7, .scores.n9, .scores.n10 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* video player inside a judge card */
.player { aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); }
.player iframe, .player video { display: block; width: 100%; height: 100%; border: 0; }
.video-head .row { gap: 10px; }

/* organiser: rounds, progress grid, brackets, finished rounds */
.wrap.wide { max-width: 1100px; }
.round { display: flex; flex-direction: column; gap: 6px; }
.round h3.group { margin: 0; border: 0; padding: 0; }
.round .bar { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.scroll { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
table.grid caption { text-align: left; padding: 4px 0; }
table.grid th, table.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
table.grid th:first-child { text-align: left; }
table.grid thead th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
table.grid tbody th { font-weight: 600; }
table.grid td.done { color: var(--teal); font-weight: 600; }
table.grid td.part { color: var(--magenta); font-weight: 600; }
table.grid td.none { color: var(--muted); }
.bracket-frame { border: 1px solid var(--line); line-height: 0; background: var(--bg); }
.bracket-frame svg { display: block; width: 100%; height: auto; }
.bracket-frame .slot, .bracket-frame #logo { transform-box: fill-box; transform-origin: center; }
.items .name .won { color: var(--ink); font-weight: 600; }
.items .name .lost { color: var(--muted); }
.items .name .vs { font: 400 18px/1 var(--font-script); color: var(--magenta); padding: 0 4px; }
