:root {
  color-scheme: dark;
  --bg: #06090d;
  --panel: #0b1219;
  --panel-2: #111923;
  --line: rgba(222, 233, 246, 0.18);
  --line-strong: rgba(222, 233, 246, 0.28);
  --text: #f0f5fa;
  --muted: #97a5b5;
  --quiet: #687586;
  --team-primary: #75808f;
  --team-secondary: #d6dde6;
  --good: #1f9a63;
  --warn: #d68b31;
  --bad: #b23b3b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: "Bahnschrift", "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(212, 175, 55, 0.055), transparent 24rem),
    radial-gradient(circle at 84% 10%, color-mix(in srgb, var(--team-primary) 30%, transparent), transparent 32rem),
    linear-gradient(135deg, #05080c 0%, #111923 52%, #070b10 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.1), transparent 18rem),
    #05080c;
  z-index: 10;
  text-align: center;
}

.splash-mark {
  font-size: 5.8rem;
  line-height: 0.9;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.splash-line {
  width: 260px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #a93535, #c6b93f, #1f9a63);
  animation: loadPulse 1.05s ease-in-out infinite alternate;
}

.splash p {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
}

@keyframes loadPulse {
  from {
    opacity: 0.45;
    transform: scaleX(0.72);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.main-menu {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 18rem),
    rgba(6, 9, 13, 0.97);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand strong {
  font-size: 1.18rem;
}

.brand span {
  color: var(--muted);
  font-size: 0.78rem;
}

.menu-buttons {
  display: grid;
  gap: 8px;
  padding: 14px 10px;
}

.menu-buttons button,
.action,
.quick-links a,
.copy-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  padding: 11px 12px;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.menu-buttons button:hover,
.menu-buttons button.active,
.action:hover,
.quick-links a:hover,
.copy-button:hover,
.primary-button:hover {
  border-color: color-mix(in srgb, var(--team-secondary) 62%, white);
  color: var(--text);
  background: color-mix(in srgb, var(--team-primary) 22%, rgba(255, 255, 255, 0.06));
}

.primary-button {
  color: var(--text);
  background: linear-gradient(135deg, color-mix(in srgb, var(--team-primary) 62%, #0d141c), #172330);
  border-color: color-mix(in srgb, var(--team-secondary) 50%, var(--line));
  text-align: center;
}

.danger-button {
  border-color: rgba(220, 85, 85, 0.42);
  color: #f0b8b8;
}

.danger-button:hover {
  border-color: rgba(255, 120, 120, 0.78);
  background: rgba(180, 45, 45, 0.18);
  color: #fff3f3;
}

button:disabled {
  cursor: progress;
  opacity: 0.58;
}

.quick-links {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px 10px 18px;
  border-top: 1px solid var(--line);
}

.screen {
  min-width: 0;
  padding: 18px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  min-height: 180px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--team-primary) 28%, transparent), transparent 46%),
    radial-gradient(circle at 92% 20%, rgba(212, 175, 55, 0.16), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    #0b1219;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.eyebrow,
.panel-kicker,
.metric span,
.form-label,
.save-meta,
.event-date {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: 4.4rem;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.subhead {
  margin-top: 12px;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.4;
}

.hero-card {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.hero-card span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 900;
  font-size: 0.72rem;
}

.hero-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.content {
  margin-top: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.045), transparent 36%),
    rgba(9, 15, 22, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  padding: 18px;
}

.panel + .panel,
.grid + .panel {
  margin-top: 14px;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  font-size: 1.08rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-kicker {
  font-size: 0.76rem;
}

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

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

.metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
}

.metric strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.metric small,
.muted,
.command-note {
  color: var(--muted);
}

.start-copy {
  display: grid;
  gap: 8px;
}

.start-copy strong {
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.start-copy p {
  line-height: 1.45;
}

.list-stack {
  display: grid;
  gap: 9px;
}

.event-row,
.save-row,
.team-choice,
.setting-row {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.event-row,
.save-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.save-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.event-row strong,
.save-row strong,
.team-choice strong {
  display: block;
}

.event-date,
.save-meta {
  font-size: 0.76rem;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.flow-step {
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.flow-number {
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--team-secondary) 46%, var(--line));
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 900;
}

.flow-step strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flow-step p {
  margin-top: 7px;
  line-height: 1.35;
}

.flow-step em {
  color: var(--team-secondary);
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.74rem;
}

.mini-button {
  padding: 8px 9px;
  font-size: 0.68rem;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.form-stack {
  display: grid;
  gap: 11px;
}

.form-label {
  display: grid;
  gap: 6px;
  font-size: 0.76rem;
}

.form-label input,
.form-label select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c141d;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

.form-label input:focus,
.form-label select:focus {
  border-color: color-mix(in srgb, var(--team-secondary) 62%, white);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  max-height: 528px;
  overflow: auto;
}

.team-choice {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  cursor: pointer;
}

.team-choice.active {
  border-color: color-mix(in srgb, var(--team-secondary) 70%, white);
  background: color-mix(in srgb, var(--team-primary) 22%, rgba(255, 255, 255, 0.04));
}

.team-choice img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.command-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #080f16;
}

.command-box code {
  display: block;
  overflow-wrap: anywhere;
  color: #d7e7f7;
  line-height: 1.45;
}

.command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.runner-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.runner-output {
  min-height: 170px;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #050a0f;
  color: #d8e6f4;
  white-space: pre-wrap;
  line-height: 1.4;
}

.action-status-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), transparent 64%),
    rgba(255, 255, 255, 0.032);
}

.action-status-card strong {
  display: block;
  color: var(--text);
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.action-status-card p {
  margin-top: 4px;
  white-space: pre-wrap;
  line-height: 1.35;
}

.action-status-card.good {
  border-color: color-mix(in srgb, var(--good) 48%, var(--line));
}

.action-status-card.bad {
  border-color: color-mix(in srgb, var(--bad) 56%, var(--line));
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d4af37;
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.10);
}

.action-status-card.good .status-dot {
  background: var(--good);
  box-shadow: 0 0 0 5px rgba(31, 154, 99, 0.12);
}

.action-status-card.bad .status-dot {
  background: var(--bad);
  box-shadow: 0 0 0 5px rgba(178, 59, 59, 0.13);
}

.spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid rgba(222, 233, 246, 0.18);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.runner-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 12px 14px;
  background: #0c141d;
  color: var(--text);
  box-shadow: var(--shadow);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

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

  .main-menu {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .menu-buttons,
  .quick-links {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .grid,
  .flow-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .screen {
    padding: 10px;
  }

  .hero {
    display: grid;
    padding: 18px;
  }

  h1 {
    font-size: 2.9rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .runner-summary {
    grid-template-columns: 1fr;
  }

  .event-row,
  .save-row {
    grid-template-columns: 1fr;
  }
}
