:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #617080;
  --line: #d8e0e8;
  --paper: #f7f9fb;
  --white: #ffffff;
  --blue: #1d5d9b;
  --green: #1f7a5b;
  --amber: #b86b00;
  --shadow: 0 14px 40px rgba(23, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  border-color: var(--blue);
}

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

button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 4vw, 48px);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar h1,
h2,
h3,
p {
  margin-top: 0;
}

.topbar h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
}

nav {
  display: flex;
  gap: 8px;
}

nav button.active {
  background: #e9f2fb;
  border-color: #9dc1e4;
}

main {
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 32px;
  align-items: start;
}

.hero.compact {
  grid-template-columns: 1fr minmax(300px, 440px);
}

.hero h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
  margin-bottom: 14px;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
  max-width: 640px;
}

.panel,
section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

section {
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 18px;
}

.panel {
  padding: 22px;
}

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

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.scenario-fields {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.band {
  box-shadow: none;
}

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

.code,
.timer,
.status {
  min-height: 42px;
  display: flex;
  align-items: center;
  font-size: 24px;
  font-weight: 800;
}

.timer {
  color: var(--amber);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.round-start {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px);
  gap: 18px;
  align-items: end;
  border-color: #9dc1e4;
  background: #f4f9fe;
}

.layout.two {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
}

.team-list,
.scenario-list,
.action-list {
  display: grid;
  gap: 10px;
}

.team-row,
.scenario-row,
.scenario-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.team-row span {
  display: grid;
  gap: 3px;
}

.team-row small {
  color: var(--muted);
  font-weight: 700;
}

.team-row a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.scenario-row p,
.scenario-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.setup-row {
  border-color: #98ccb9;
  background: #f1faf6;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.choice-card,
.action-choice {
  grid-template-columns: auto 1fr;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  color: var(--ink);
  font-weight: 400;
}

.choice-card input,
.action-choice input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.choice-card span,
.action-choice span {
  display: grid;
  gap: 5px;
}

.choice-card em {
  color: var(--green);
  font-style: normal;
  font-weight: 700;
}

.choice-card small,
.action-choice span {
  color: var(--muted);
  line-height: 1.42;
}

.action-choice strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.note {
  color: var(--muted);
}

.error {
  border: 1px solid #e0a4a4;
  border-radius: 6px;
  background: #fff4f4;
  color: #8a2626;
  padding: 10px 12px;
  line-height: 1.4;
}

.success {
  border: 1px solid #98ccb9;
  border-radius: 6px;
  background: #f1faf6;
  color: #23664c;
  padding: 10px 12px;
  line-height: 1.4;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .hero.compact,
  .layout.two,
  .round-start {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  nav {
    width: 100%;
  }

  nav button {
    flex: 1;
  }
}
