:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #181b20;
  --panel-strong: #20252c;
  --text: #f5f1e8;
  --muted: #a6adb7;
  --line: #343b45;
  --accent: #74d3ae;
  --accent-strong: #48b98d;
  --warn: #f2b15d;
  --danger: #ee6f72;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 32px 18px;
  background: linear-gradient(145deg, rgba(116, 211, 174, 0.12), rgba(242, 177, 93, 0.08) 48%, transparent 72%), var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.game-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.hero {
  padding: 18px 0 4px;
}

.eyebrow,
.section-label,
.stat-label,
.recovery-plan span {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: 5.8rem;
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.6;
}

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

.scoreboard div,
.challenge-card,
.action-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.88);
  box-shadow: var(--shadow);
}

.scoreboard div {
  min-height: 104px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.scoreboard strong {
  font-size: 2.4rem;
  line-height: 1;
}

.challenge-card {
  overflow: hidden;
}

.terminal-bar {
  height: 42px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #121419;
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
}

.terminal-bar span:nth-child(2) {
  background: var(--warn);
}

.terminal-bar span:nth-child(3) {
  background: var(--accent);
}

.challenge-card > :not(.terminal-bar) {
  margin-left: 24px;
  margin-right: 24px;
}

.challenge-card .section-label {
  margin-top: 24px;
  margin-bottom: 10px;
}

h2 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: 2.8rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

#challengeBrief {
  max-width: 760px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.result {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(116, 211, 174, 0.32);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(116, 211, 174, 0.11), rgba(116, 211, 174, 0.04));
}

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

.choice-button {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #20252c;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}

.choice-button:hover {
  background: #28303a;
  border-color: rgba(116, 211, 174, 0.54);
}

.result p {
  margin-bottom: 10px;
  font-size: 1.08rem;
  line-height: 1.55;
}

.result span {
  color: var(--warn);
  font-size: 0.92rem;
  font-weight: 800;
}

.recovery-plan {
  margin-bottom: 24px;
  padding: 16px 0 2px;
  border-top: 1px solid var(--line);
}

.recovery-plan p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.action-row {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel-strong);
}

button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #101114;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

button:focus-visible {
  outline: 3px solid rgba(116, 211, 174, 0.38);
  outline-offset: 3px;
}

.choice-button:disabled {
  cursor: default;
  opacity: 0.78;
}

.choice-button:disabled:hover {
  background: #20252c;
  border-color: var(--line);
}

.action-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.action-row strong {
  color: var(--text);
}

@media (max-width: 680px) {
  body {
    padding: 20px 12px;
  }

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

  h1 {
    font-size: 2.75rem;
    line-height: 1;
  }

  h2 {
    font-size: 1.72rem;
    line-height: 1.12;
  }

  .lede {
    font-size: 1rem;
  }

  .scoreboard div {
    min-height: 86px;
  }

  .challenge-card > :not(.terminal-bar) {
    margin-left: 18px;
    margin-right: 18px;
  }

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

  .choice-button {
    min-height: 92px;
  }

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