:root {
  color-scheme: dark;
  --bg: #090407;
  --panel: #180911;
  --panel-2: #220d18;
  --ink: #f7f2ee;
  --muted: #b7a9ae;
  --line: #4a2633;
  --red: #e3425f;
  --pink: #f02b8f;
  --green: #2fdd8f;
  --lime: #c9f400;
  --amber: #ffbc42;
  --blue: #4a8dff;
  --danger: #ff284f;
  --ok: #29cf82;
  --shadow: rgba(0, 0, 0, 0.32);
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 8% 0%, rgba(240, 43, 143, 0.2) 0, transparent 34%),
    radial-gradient(circle at 92% 10%, rgba(227, 66, 95, 0.18) 0, transparent 30%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.025), transparent 36%),
    var(--bg);
  color: var(--ink);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 11px 15px;
  background: linear-gradient(135deg, var(--pink), var(--red));
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(240, 43, 143, 0.22);
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.secondary {
  background: rgba(59, 34, 48, 0.86);
  color: var(--ink);
  border: 1px solid var(--line);
}

button.green {
  background: linear-gradient(135deg, #2fdd8f, #94f7c3);
  color: #062014;
}

button.amber {
  background: var(--amber);
  color: #261506;
}

button.danger {
  background: var(--danger);
}

button.bridge-choice {
  background: #7657ff;
  color: white;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

button.mini {
  padding: 6px 9px;
  font-size: 12px;
  box-shadow: none;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #140b10;
  color: var(--ink);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 245px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, rgba(18, 8, 13, 0.96), rgba(9, 4, 7, 0.98));
  border-right: 1px solid var(--line);
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.26);
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: 28px;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0.08em;
  color: white;
  text-shadow: 0 0 18px rgba(240, 43, 143, 0.44);
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  text-align: left;
  background: transparent;
  box-shadow: none;
  border: 1px solid transparent;
  color: var(--muted);
}

.nav button.active,
.nav button:hover {
  border-color: rgba(240, 43, 143, 0.42);
  color: var(--ink);
  background: rgba(240, 43, 143, 0.12);
}

.main {
  padding: 26px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1;
  text-shadow: 0 0 26px rgba(240, 43, 143, 0.28);
}

.eyebrow,
.section-kicker {
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-kicker {
  margin-bottom: 8px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pill strong {
  color: var(--ink);
}

.pill.player {
  border-color: rgba(47, 221, 143, 0.5);
  background: rgba(47, 221, 143, 0.14);
  color: var(--green);
}

.pill.player strong {
  color: var(--green);
}

.pill.soldier {
  border-color: rgba(240, 43, 143, 0.58);
  background: rgba(240, 43, 143, 0.2);
  color: #ff74bb;
}

.pill.soldier strong {
  color: #ff9bcc;
}

.grid {
  display: grid;
  gap: 16px;
}

.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: linear-gradient(180deg, rgba(32, 16, 24, 0.94), rgba(15, 6, 10, 0.94));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 22px 60px var(--shadow);
}

.card h2,
.card h3 {
  margin: 0 0 12px;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.timer {
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(42px, 6vw, 86px);
  font-weight: 900;
  letter-spacing: 0;
}

.dashboard-command {
  --dashboard-glow: rgba(240, 43, 143, 0.26);
}

.dashboard-command[data-status="running"] {
  --dashboard-glow: rgba(47, 221, 143, 0.28);
}

.dashboard-command[data-status="countdown"],
.dashboard-command[data-status="paused"] {
  --dashboard-glow: rgba(255, 188, 66, 0.28);
}

.dashboard-command[data-status="finished"] {
  --dashboard-glow: rgba(255, 40, 79, 0.28);
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.dashboard-stack {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

.command-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  align-content: start;
  border-color: rgba(240, 43, 143, 0.38);
}

.command-hero::before,
.command-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: radial-gradient(circle at 14% 0%, var(--dashboard-glow), transparent 34%),
    linear-gradient(90deg, rgba(240, 43, 143, 0.18), transparent 22%, transparent 78%, rgba(240, 43, 143, 0.12));
  opacity: 0.9;
}

.command-hero > *,
.command-panel > * {
  position: relative;
}

.command-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 188, 66, 0.32);
  min-width: 0;
}

.command-panel .status-strip,
.command-panel .controls,
.command-panel .field-row,
.command-panel .compact-field {
  min-width: 0;
}

.command-panel button,
.command-panel input,
.command-panel select,
.command-panel .pill {
  max-width: 100%;
}

.command-panel .controls > button {
  min-width: 0;
}

.command-panel .pentathlon-next-action {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.command-primary-actions {
  align-items: stretch;
}

.command-primary-actions > button,
.command-panel .pentathlon-next-action button,
.stage-mode-grid button[data-stage-display="WELCOME"],
.stage-mode-grid button[data-stage-display="GAME"],
.stage-mode-grid button[data-stage-display="PLAYERS"] {
  min-height: 50px;
}

.quiet-control {
  background: rgba(255, 255, 255, 0.025);
}

.priority-control {
  border-color: rgba(255, 188, 66, 0.44);
  background: rgba(255, 188, 66, 0.08);
}

#timerResetActiveDashboard,
#timerFinish,
#resetActive,
#resetAll,
[data-team-action="regenerate-current"],
[data-team-action="lock"] {
  box-shadow: none;
}

#timerResetActiveDashboard,
#resetActive {
  border-color: rgba(255, 188, 66, 0.56);
}

#resetAll {
  border: 1px solid rgba(255, 40, 79, 0.62);
}

.command-headline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.command-headline h2,
.command-panel h2,
.live-panel h2,
.ops-panel h2 {
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.05;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(240, 43, 143, 0.48);
  border-radius: 999px;
  padding: 7px 12px;
  color: white;
  font-size: 12px;
  font-weight: 900;
  background: rgba(240, 43, 143, 0.16);
  box-shadow: 0 0 24px rgba(240, 43, 143, 0.2);
}

.state-chip.running {
  border-color: rgba(47, 221, 143, 0.54);
  background: rgba(47, 221, 143, 0.16);
  color: #c9ffe4;
}

.state-chip.countdown,
.state-chip.paused {
  border-color: rgba(255, 188, 66, 0.58);
  background: rgba(255, 188, 66, 0.16);
  color: #ffe0a1;
}

.state-chip.finished {
  border-color: rgba(255, 40, 79, 0.58);
  background: rgba(255, 40, 79, 0.16);
  color: #ffd7df;
}

.timer-wrap {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.2);
}

.command-hero .timer {
  color: white;
  font-size: clamp(64px, 9vw, 132px);
  line-height: 0.92;
  text-shadow: 0 0 40px var(--dashboard-glow);
}

.timer-controls {
  padding-top: 2px;
}

.timer-controls #timerStart,
.timer-controls #timerResume {
  min-height: 54px;
  padding-inline: 22px;
  font-size: 16px;
}

.timer-controls #timerFinish,
.timer-controls #timerResetActiveDashboard {
  box-shadow: none;
}

.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.live-panel,
.ops-panel {
  min-height: 280px;
}

.small {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #27121c;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  background: #3a2230;
  color: var(--ink);
}

.badge.player {
  background: rgba(47, 221, 143, 0.14);
  color: var(--green);
}

.badge.soldier {
  background: rgba(240, 43, 143, 0.18);
  color: #ff74bb;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: min(980px, 100%);
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stage-body {
  overflow: hidden;
  background: radial-gradient(circle at 18% 18%, rgba(240, 43, 143, 0.22) 0, transparent 34%),
    radial-gradient(circle at 82% 28%, rgba(47, 221, 143, 0.16) 0, transparent 38%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.03), transparent 34%),
    #070306;
}

.stage-body.rlg-green {
  background: #00b765;
}

.stage-body.rlg-red {
  background: #e0002a;
}

.stage-body.rlg-green .stage-title,
.stage-body.rlg-red .stage-title {
  display: none;
}

.stage-body.rlg-green .stage-message,
.stage-body.rlg-red .stage-message,
.stage-body.rlg-green .stage-title .status,
.stage-body.rlg-red .stage-title .status {
  color: white;
}

.stage {
  min-height: 100vh;
  height: 100vh;
  padding: 54px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  position: relative;
  isolation: isolate;
}

#stageMain {
  display: grid;
  align-items: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.stage::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 7px;
  opacity: 0.12;
  z-index: -1;
}

.stage-body[data-stage-view="welcome"] .stage-title,
.stage-body[data-stage-view="welcome"] footer {
  display: none;
}

.stage-body[data-stage-view="welcome"] .stage {
  grid-template-rows: 1fr;
}

.stage-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.stage-title h1 {
  margin: 0;
  font-size: clamp(54px, 7vw, 120px);
  line-height: 0.9;
  text-shadow: 0 0 36px rgba(240, 43, 143, 0.32);
}

.stage-title .status {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  min-width: 190px;
  padding: 10px 18px;
  border: 1px solid rgba(240, 43, 143, 0.58);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 43, 143, 0.2), rgba(47, 221, 143, 0.12)), rgba(8, 3, 7, 0.72);
  box-shadow: 0 0 0 2px rgba(240, 43, 143, 0.08), 0 18px 44px rgba(0, 0, 0, 0.36);
  color: white;
  font-size: clamp(16px, 1.35vw, 28px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.stage-title .status::before {
  content: "";
  width: 12px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(47, 221, 143, 0.82);
}

.stage-title .status::after {
  content: "";
  position: absolute;
  inset: auto 10px 7px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 221, 143, 0.7), transparent);
}

.stage-body.glass-stage .stage {
  padding: 34px 44px;
  gap: 12px;
}

.stage-body.glass-stage .stage-title {
  align-items: end;
}

.stage-body.glass-stage .stage-title h1 {
  font-size: clamp(30px, 3.2vw, 58px);
  line-height: 1;
}

.stage-body.glass-stage .stage-title .stage-message {
  font-size: clamp(16px, 1.5vw, 28px);
}

.stage-body.glass-stage .stage-title .status {
  min-height: 44px;
  min-width: 150px;
  padding: 8px 14px;
  font-size: clamp(14px, 1.15vw, 22px);
}

.stage-body.glass-stage .stage-bridge {
  width: 100%;
}

.stage-timer {
  align-self: center;
  justify-self: center;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(82px, 14vw, 220px);
  font-weight: 900;
  color: white;
  text-shadow: 0 0 40px rgba(240, 43, 143, 0.38);
}

.stage-kicker {
  margin: 0;
  color: var(--pink);
  font-size: clamp(16px, 1.8vw, 30px);
  font-weight: 900;
  text-transform: uppercase;
}

.stage-center {
  text-align: center;
}

.stage-welcome,
.stage-waiting,
.stage-live,
.stage-briefing,
.stage-summary,
.stage-player-board,
.stage-bridge {
  align-self: center;
  justify-self: center;
  width: min(1280px, 100%);
  max-width: 100%;
  min-width: 0;
}

.stage-welcome {
  display: grid;
  justify-items: center;
  gap: 26px;
  text-align: center;
}

.stage-welcome h2 {
  margin: 0;
  font-size: clamp(62px, 10vw, 178px);
  line-height: 0.82;
  color: white;
  text-shadow: 0 0 58px rgba(240, 43, 143, 0.42);
}

.stage-welcome p:not(.stage-kicker) {
  margin: 0;
  color: #ffe6f3;
  font-size: clamp(24px, 3vw, 54px);
  font-weight: 900;
}

.symbol-row {
  display: flex;
  gap: clamp(18px, 3vw, 42px);
  align-items: center;
}

.symbol-row span {
  width: clamp(58px, 7vw, 124px);
  aspect-ratio: 1;
  border: 7px solid rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 0 22px rgba(240, 43, 143, 0.44));
}

.symbol-row span:nth-child(1) {
  border-radius: 50%;
}

.symbol-row span:nth-child(2) {
  border-radius: 4px;
}

.symbol-row span:nth-child(3) {
  width: 0;
  height: 0;
  border-left: clamp(34px, 4vw, 68px) solid transparent;
  border-right: clamp(34px, 4vw, 68px) solid transparent;
  border-bottom: clamp(64px, 7vw, 124px) solid rgba(255, 255, 255, 0.92);
  border-top: 0;
  aspect-ratio: auto;
  filter: drop-shadow(0 0 22px rgba(47, 221, 143, 0.34));
}

.welcome-scanline {
  width: min(680px, 72vw);
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--green), var(--pink), transparent);
  box-shadow: 0 0 28px rgba(47, 221, 143, 0.42);
}

.stage-waiting {
  display: grid;
  gap: 24px;
  text-align: center;
}

.stage-waiting h2,
.stage-briefing h2,
.stage-summary h2 {
  margin: 0;
  color: white;
  font-size: clamp(62px, 8vw, 150px);
  line-height: 0.9;
}

.stage-waiting p:not(.stage-kicker),
.stage-briefing p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(22px, 2.5vw, 46px);
  font-weight: 900;
}

.waiting-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  gap: 12px;
  opacity: 0.72;
}

.waiting-grid span {
  min-height: clamp(54px, 7vw, 120px);
  border: 1px solid rgba(240, 43, 143, 0.35);
  background: linear-gradient(180deg, rgba(240, 43, 143, 0.18), rgba(47, 221, 143, 0.06));
}

.stage-live {
  display: grid;
  gap: 22px;
  justify-items: center;
  text-align: center;
}

.stage-live .stage-timer {
  font-size: clamp(104px, 18vw, 280px);
}

.stage-board-live {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  justify-items: stretch;
  text-align: left;
  width: 100%;
}

.stage-board-live .stage-timer {
  justify-self: end;
  font-size: clamp(34px, 4.6vw, 76px);
  line-height: 0.92;
}

.stage-live-message {
  color: #ffe6f3;
  font-size: clamp(24px, 3vw, 58px);
  font-weight: 900;
  max-width: 1100px;
}

.stage-mega {
  color: white;
  font-size: clamp(112px, 22vw, 340px);
  font-weight: 1000;
  line-height: 0.8;
  text-shadow: 0 0 48px rgba(240, 43, 143, 0.42);
}

.stage-briefing {
  display: grid;
  gap: 28px;
}

.briefing-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.briefing-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.28);
}

.briefing-panel strong {
  color: var(--amber);
  font-size: clamp(24px, 2.4vw, 44px);
}

.briefing-panel ol {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
  padding-left: 1.4em;
  color: white;
  font-size: clamp(22px, 2.2vw, 38px);
  font-weight: 900;
}

.stage-timer-fixed {
  min-height: 1.1em;
  line-height: 1;
  white-space: nowrap;
}

.stage-summary.compact {
  padding: 0 0 14px;
  gap: 10px;
}

.stage-summary {
  display: grid;
  gap: 18px;
  justify-items: stretch;
}

.stage-summary > h2,
.stage-summary > .stage-kicker {
  text-align: center;
}

.stage-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stage-summary-section {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.24);
}

.stage-summary-section > strong {
  color: var(--amber);
  font-size: clamp(22px, 2.2vw, 38px);
}

.summary-list {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
}

.summary-list > strong {
  color: var(--amber);
  font-size: clamp(18px, 2vw, 32px);
}

.summary-list .status-strip {
  justify-content: center;
}

.stage-player-board {
  display: grid;
  gap: 18px;
}

.stage-roster-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.stage-roster-head h2 {
  margin: 0;
  color: white;
  font-size: clamp(48px, 6vw, 110px);
  line-height: 0.9;
}

.roster-counts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.roster-counts span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 900;
}

.roster-counts strong {
  color: white;
}

.stage-player-table {
  display: grid;
  gap: 18px;
  max-height: none;
  overflow: visible;
  padding: 4px;
}

.stage-player-section {
  display: grid;
  gap: 10px;
}

.stage-player-section > strong {
  color: var(--amber);
  font-size: clamp(18px, 1.8vw, 30px);
  letter-spacing: 0;
}

.stage-number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 8px;
}

.stage-number-grid span {
  display: grid;
  place-items: center;
  min-height: clamp(38px, 5vh, 58px);
  border: 1px solid rgba(47, 221, 143, 0.42);
  border-radius: 8px;
  background: rgba(47, 221, 143, 0.13);
  color: white;
  font-size: clamp(18px, 2.1vw, 36px);
  font-weight: 900;
  letter-spacing: 0;
}

.stage-number-grid.soldier span {
  border-color: rgba(240, 43, 143, 0.54);
  background: rgba(240, 43, 143, 0.18);
  color: #ffd7e9;
}

.stage-player-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  font-size: clamp(18px, 1.8vw, 28px);
  font-weight: 900;
  text-align: center;
}

.stage-summary-admin {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
}

.team-outcome-list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.team-outcome-list.admin {
  margin-top: 10px;
}

.team-outcome-row {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid rgba(47, 221, 143, 0.42);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(47, 221, 143, 0.12);
}

.team-outcome-row.dnf {
  border: 1px solid rgba(240, 43, 143, 0.44);
  background: rgba(240, 43, 143, 0.12);
}

.team-outcome-row strong {
  color: #d6ffe9;
}

.team-outcome-row.dnf strong {
  color: #ffd7e9;
}

.team-outcome-row span {
  color: var(--ink);
  font-weight: 800;
}

.stage-summary .team-outcome-row {
  text-align: center;
  font-size: clamp(18px, 2vw, 30px);
}

.pentathlon-phone-warning {
  margin-top: 10px;
  border-color: var(--amber);
}

.countdown-panel {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.countdown-panel span,
.countdown-panel em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.countdown-panel strong {
  color: white;
  font-size: clamp(88px, 16vw, 220px);
  line-height: 0.9;
}

.stage-countdown {
  align-self: center;
  justify-self: center;
  width: min(720px, 100%);
  background: rgba(0, 0, 0, 0.22);
}

.stage-message {
  font-size: clamp(26px, 3vw, 54px);
  color: var(--muted);
  font-weight: 800;
}

.bridge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: clamp(5px, 0.7vw, 12px);
  width: 100%;
  max-width: 1720px;
  overflow: visible;
}

.bridge-step {
  display: grid;
  grid-template-rows: auto 1fr 1fr;
  gap: 5px;
  min-width: 0;
}

.bridge-step.active {
  filter: drop-shadow(0 0 22px rgba(240, 43, 143, 0.42));
}

.bridge-step.active .bridge-step-label {
  color: white;
  background: rgba(240, 43, 143, 0.28);
  border-color: var(--pink);
}

.bridge-step-label {
  border: 1px solid rgba(240, 43, 143, 0.36);
  border-radius: 8px;
  padding: 6px 3px;
  color: var(--pink);
  background: rgba(0, 0, 0, 0.2);
  font-size: clamp(11px, 1vw, 18px);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.bridge-cell {
  border: 2px solid #764157;
  border-radius: 8px;
  background: linear-gradient(135deg, #28131d, #13070d);
  min-height: clamp(42px, 7vh, 86px);
  display: grid;
  place-items: center;
  color: white;
  font-size: clamp(14px, 1.35vw, 28px);
  font-weight: 900;
  min-width: 0;
}

.bridge-cell.correct {
  background: rgba(47, 221, 143, 0.24);
  border-color: var(--green);
}

.bridge-cell.wrong {
  background: rgba(255, 40, 79, 0.28);
  border-color: var(--danger);
}

.teams-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 6px;
  align-content: start;
  overflow: visible;
  max-height: none;
  min-height: 0;
}

.team-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
}

.team-card strong {
  color: var(--amber);
  font-size: clamp(10px, 0.8vw, 14px);
}

.team-card div {
  color: white;
  font-size: clamp(12px, 1vw, 22px);
  font-weight: 900;
  line-height: 1.05;
  margin-top: 4px;
  white-space: nowrap;
}

.ddakji-pair-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 320px;
  overflow: auto;
}

.ddakji-pair-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.ddakji-pair-row strong {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 8px;
  background: rgba(240, 43, 143, 0.18);
  color: #ff74bb;
}

.ddakji-pair-row span {
  color: white;
  font-size: 18px;
  font-weight: 900;
}

.ddakji-stage {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 0;
}

.ddakji-stage-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.ddakji-stage-head strong {
  color: white;
  font-size: clamp(34px, 4vw, 68px);
  line-height: 0.9;
  text-shadow: 0 0 28px rgba(240, 43, 143, 0.38);
}

.ddakji-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 4px;
  align-content: start;
  align-items: stretch;
}

.ddakji-stage-pair {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(240, 43, 143, 0.36);
  border-radius: 8px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: 0 0 24px rgba(240, 43, 143, 0.08);
}

.ddakji-stage-pair span {
  color: var(--muted);
  font-size: clamp(8px, 0.68vw, 12px);
  font-weight: 900;
  text-transform: uppercase;
}

.ddakji-stage-pair strong {
  color: white;
  font-size: clamp(12px, 1.05vw, 24px);
  line-height: 1;
  white-space: nowrap;
}

.ddakji-stage-pair.waiting {
  border-color: rgba(255, 188, 66, 0.58);
}

.dashboard-team-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.dashboard-team-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 6px;
}

.dashboard-team-card strong {
  color: var(--amber);
}

.dashboard-team-card span {
  color: white;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.stage-current-player {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
  margin-bottom: 10px;
}

.stage-current-player span {
  color: var(--pink);
  font-size: clamp(14px, 1.5vw, 26px);
  font-weight: 900;
  text-transform: uppercase;
}

.stage-current-player strong {
  color: white;
  font-size: clamp(34px, 4.5vw, 86px);
  line-height: 0.9;
}

.lane-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  gap: 10px;
}

.lane-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.lane-title span {
  color: var(--muted);
  font-weight: 800;
}

.lane-time {
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(30px, 4vw, 58px);
  font-weight: 900;
  color: var(--green);
  line-height: 1;
}

.pentathlon-ops-panel {
  border-color: rgba(255, 188, 66, 0.55);
}

.pentathlon-next-action {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.pentathlon-next-action p {
  margin: 6px 0 0;
}

.dashboard-detail-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.dashboard-detail-link span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.lane-match-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.lane-match-row {
  display: grid;
  grid-template-columns: 86px minmax(86px, 1fr) minmax(120px, 1fr) 82px minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.lane-match-row.warn {
  border-color: var(--amber);
}

.lane-match-row strong,
.lane-match-row em {
  color: var(--amber);
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 760px) {
  .pentathlon-next-action,
  .dashboard-detail-link,
  .lane-match-row {
    grid-template-columns: 1fr;
  }
}

.compact-field {
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.remainder-quick-list,
.remainder-row {
  display: grid;
  gap: 8px;
}

.remainder-row {
  grid-template-columns: minmax(44px, auto) minmax(128px, 1fr) auto auto;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.remainder-row strong {
  color: var(--amber);
}

@media (max-width: 720px) {
  .remainder-row {
    grid-template-columns: 1fr;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 100;
  padding: 18px;
}

.modal-backdrop.show {
  display: grid;
}

.modal {
  width: min(560px, 100%);
  background: #1d0e15;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.modal.danger {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 40, 79, 0.18), 0 28px 80px rgba(0, 0, 0, 0.58);
}

.notice {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
}

.mingle-callout {
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 2px solid rgba(47, 221, 143, 0.78);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(47, 221, 143, 0.24), rgba(240, 43, 143, 0.16)), rgba(7, 3, 6, 0.92);
  box-shadow: 0 0 0 3px rgba(47, 221, 143, 0.1), 0 18px 54px rgba(0, 0, 0, 0.32);
  text-align: center;
}

.mingle-callout span,
.mingle-callout em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.mingle-callout strong {
  color: white;
  font-size: clamp(72px, 11vw, 132px);
  line-height: 0.82;
  text-shadow: 0 0 34px rgba(47, 221, 143, 0.42);
}

.mingle-callout.moderator {
  margin-bottom: 14px;
  padding: 18px;
}

.mingle-callout.moderator strong {
  font-size: clamp(92px, 30vw, 150px);
}

#notice {
  position: sticky;
  top: 12px;
  z-index: 40;
  border-color: rgba(47, 221, 143, 0.72);
  background: linear-gradient(135deg, rgba(47, 221, 143, 0.2), rgba(240, 43, 143, 0.14)), rgba(9, 5, 8, 0.94);
  color: white;
  box-shadow: 0 0 0 2px rgba(47, 221, 143, 0.14), 0 18px 50px rgba(0, 0, 0, 0.35);
  font-weight: 900;
  animation: noticePulse 0.36s ease-out;
}

#notice.is-error {
  border-color: rgba(255, 40, 79, 0.82);
  background: linear-gradient(135deg, rgba(255, 40, 79, 0.24), rgba(240, 43, 143, 0.16)), rgba(9, 5, 8, 0.94);
}

@keyframes noticePulse {
  from {
    transform: translateY(-6px) scale(0.98);
    opacity: 0.3;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.op-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 86px;
  align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.metric-card span,
.latest-op-card span,
.compact-op-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  color: white;
  font-size: 20px;
  line-height: 1.05;
}

.stage-actions {
  margin: 14px 0;
}

.stage-mode-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.stage-mode-panel > strong {
  color: var(--amber);
}

.stage-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.stage-mode-grid button {
  min-width: 0;
  box-shadow: none;
}

.detail-drawer {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
}

.detail-drawer summary {
  cursor: pointer;
  color: var(--amber);
  font-weight: 900;
}

.latest-op-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(240, 43, 143, 0.34);
  border-radius: 8px;
  padding: 14px;
  background: rgba(240, 43, 143, 0.1);
}

.latest-op-card strong {
  color: white;
  font-size: 20px;
  line-height: 1.2;
}

.latest-op-card em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.compact-op-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.compact-op-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 8px;
}

.compact-op-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.compact-op-row strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.guide-card {
  max-width: 1180px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guide-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.guide-grid strong {
  display: block;
  color: var(--amber);
  font-size: 18px;
  margin-bottom: 10px;
}

.guide-grid ol,
.guide-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.3em;
  color: var(--ink);
}

.guide-checklist label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
}

.guide-checklist input {
  width: auto;
}

.number-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--amber);
  font-weight: 900;
  background: rgba(255, 188, 66, 0.08);
}

.mobile-player-input {
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0;
}

.badge-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.moderator-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.moderator-page {
  background: radial-gradient(circle at 20% 0%, rgba(47, 221, 143, 0.16), transparent 32%),
    radial-gradient(circle at 85% 14%, rgba(240, 43, 143, 0.2), transparent 30%),
    var(--bg);
}

.moderator-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.moderator-topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

.moderator-command {
  border-color: rgba(47, 221, 143, 0.32);
}

.moderator-timer {
  font-size: clamp(44px, 10vw, 84px);
  line-height: 1;
}

.moderator-ready-badge {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 1000;
  letter-spacing: 0;
}

.moderator-ready-badge.ready {
  border: 1px solid rgba(47, 221, 143, 0.58);
  background: rgba(47, 221, 143, 0.16);
  color: #bffff0;
}

.moderator-ready-badge.not-ready {
  border: 1px solid rgba(255, 188, 66, 0.58);
  background: rgba(255, 188, 66, 0.15);
  color: #ffe0a1;
}

#readyButton {
  min-height: 56px;
  font-size: 16px;
}

.ready-box {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 14px;
  margin-top: 14px;
}

.task-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row.primary strong {
  font-size: 26px;
  color: white;
}

.task-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-row strong {
  font-size: 18px;
}

.moderator-warning {
  border-color: rgba(255, 188, 66, 0.54);
  background: rgba(255, 188, 66, 0.09);
  color: #ffe0a1;
}

.moderator-lane-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(47, 221, 143, 0.38);
  border-radius: 8px;
  padding: 14px;
  background: rgba(47, 221, 143, 0.08);
}

.lane-focus {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.lane-focus span {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.lane-focus strong {
  color: var(--green);
  font-size: clamp(62px, 18vw, 112px);
  line-height: 0.82;
}

.moderator-team-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.moderator-team-numbers span {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px solid rgba(47, 221, 143, 0.46);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: white;
  font-size: 28px;
  font-weight: 1000;
}

.moderator-action-row {
  align-items: stretch;
}

.moderator-finish-button,
.moderator-advantage-button,
.moderator-soldier-button {
  width: 100%;
  min-height: 68px;
  font-size: 20px;
}

.moderator-soldier-button {
  background: linear-gradient(135deg, #ff2f75, #ff284f);
}

.moderator-advantage-button {
  background: linear-gradient(135deg, var(--amber), #ffe08a);
  color: #261506;
}

.moderator-lane-empty {
  border-color: rgba(255, 188, 66, 0.48);
}

.danger-zone {
  border-color: var(--danger);
}

.danger-zone h3 {
  color: #ff8aa0;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: static;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .command-grid,
  .dashboard-layout,
  .dashboard-lower,
  .briefing-columns,
  .stage-summary-grid,
  .guide-grid,
  .cols-2,
  .cols-3,
  .login-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 14px;
  }

  .command-hero {
    min-height: auto;
  }

  .command-hero .timer {
    font-size: clamp(56px, 18vw, 92px);
  }

  .stage {
    padding: 24px;
  }

  .stage-roster-head {
    display: grid;
  }

  .roster-counts {
    justify-content: flex-start;
  }

  button {
    min-height: 44px;
  }

  .op-row {
    align-items: stretch;
    flex-direction: column;
  }

  .moderator-hero {
    grid-template-columns: 1fr;
  }

  .ready-box {
    justify-items: stretch;
  }

  .moderator-shell {
    padding: 12px;
  }

  .moderator-topbar {
    grid-template-columns: 1fr;
  }

  .moderator-topbar .ghost {
    width: 100%;
  }

  .moderator-command {
    padding: 14px;
  }

  .moderator-timer {
    font-size: clamp(58px, 18vw, 84px);
  }

  .moderator-finish-button,
  .moderator-advantage-button,
  .moderator-soldier-button {
    min-height: 72px;
  }
}
