:root {
  --bg: #0b0b0d;
  --fg: #f5f5f7;
  --muted: #8a8a90;
  --team1: #d12d2d;
  --team2: #2d6cd1;
  --ok: #2dd17a;
  --warn: #d1a72d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, system-ui, sans-serif;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

body { display: flex; flex-direction: column; }

#hdr {
  display: flex; align-items: center; gap: 8px;
  padding: env(safe-area-inset-top, 8px) 12px 8px;
  font-size: 13px; color: var(--muted);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #555; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: var(--warn); }
#mode { margin-left: auto; font-weight: 600; color: var(--warn); }

main {
  flex: 1;
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px;
}

.slot {
  flex: 1;
  display: flex; flex-direction: column;
  border-radius: 18px;
  background: #15151a;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.slot[data-side="team_1"] { border: 2px solid var(--team1); }
.slot[data-side="team_2"] { border: 2px solid var(--team2); }

.label {
  font-size: 38px; font-weight: 800; letter-spacing: 0.5px;
  text-align: center;
  margin-top: 8px;
}

.slider {
  margin-top: auto;
  position: relative;
  height: 78px;
  border-radius: 999px;
  background: #1f1f25;
  overflow: hidden;
  touch-action: none;
}

.track {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.12));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 60ms linear;
}

.slot[data-side="team_1"] .track { background: var(--team1); }
.slot[data-side="team_2"] .track { background: var(--team2); }

.knob {
  position: absolute;
  top: 6px; left: 6px;
  height: calc(100% - 12px);
  padding: 0 22px;
  border-radius: 999px;
  background: #fff; color: #111;
  display: flex; align-items: center;
  font-weight: 800; font-size: 18px;
  transition: left 140ms cubic-bezier(.2,.8,.2,1);
  will-change: left;
}

.slot.firing .knob { background: var(--ok); color: #fff; }
.slot.armed .knob { background: var(--warn); }

#log {
  padding: 10px 14px env(safe-area-inset-bottom, 10px);
  font-size: 13px; color: var(--muted);
  border-top: 1px solid #222;
  min-height: 44px;
}
#last { font-variant-numeric: tabular-nums; }
#last.ok { color: var(--ok); }
#last.err { color: #e25c5c; }
