:root {
  color-scheme: dark;
  --bg: #070b15;
  --panel: rgba(12, 17, 30, 0.9);
  --panel-strong: rgba(15, 23, 39, 0.96);
  --text: #eef3ff;
  --muted: #9da8c7;
  --accent: #79e3c2;
  --accent-2: #81a8ff;
  --danger: #ff7f92;
  --warning: #f4d06f;
  --border: rgba(140, 160, 255, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 12%, rgba(129, 168, 255, 0.18), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(121, 227, 194, 0.14), transparent 24%),
    linear-gradient(180deg, #050812 0%, #090e18 45%, #05070d 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
  padding: 20px;
}

.page,
.scenario-shell {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, var(--panel), rgba(8, 11, 20, 0.94));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

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

h1 {
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.96;
  margin-bottom: 16px;
  max-width: 12ch;
}

.lede {
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}

.primary {
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101d;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(121, 227, 194, 0.25);
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stats {
  display: flex;
  gap: 14px;
  color: var(--muted);
  flex-wrap: wrap;
}

.terminal-frame {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(4, 8, 18, 0.98), rgba(12, 16, 28, 0.98));
}

.terminal-top {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.dot.red {
  background: #ff6d83;
}

.dot.yellow {
  background: #ffcd6a;
}

.dot.green {
  background: #57dca0;
}

.terminal-preview {
  margin: 0;
  padding: 18px;
  min-height: 190px;
  color: #d9e4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  line-height: 1.6;
}

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

.level-head {
  padding: 22px 22px 10px;
}

.level-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

.scenario-list {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.scenario-card {
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  color: var(--text);
  display: grid;
  gap: 8px;
}

.scenario-card.done {
  border-color: rgba(121, 227, 194, 0.5);
}

.scenario-title {
  font-weight: 800;
  font-size: 1.02rem;
}

.scenario-objective {
  color: var(--muted);
  line-height: 1.5;
}

.scenario-badge {
  justify-self: start;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  align-items: end;
  flex-wrap: wrap;
}

.status-box {
  min-width: 260px;
  color: var(--muted);
}

.progress-track,
.mini-bar .track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.progress-track span,
.mini-bar .track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
}

.story-card,
.terminal-card,
.quiz-card {
  padding: 22px;
}

.story-list {
  color: var(--muted);
  padding-left: 18px;
  line-height: 1.8;
}

.terminal-card {
  background: linear-gradient(180deg, rgba(5, 9, 19, 0.98), rgba(12, 17, 30, 0.96));
}

.terminal-topline {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 12px;
}

.terminal-state {
  color: var(--accent);
}

.screen {
  min-height: 290px;
  border-radius: 18px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.line {
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.line.info {
  color: #d8e4ff;
}

.line.success {
  color: var(--accent);
}

.line.error {
  color: var(--danger);
}

.line.hint {
  color: var(--warning);
}

.command-form {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.prompt {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.command-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.hint {
  margin-top: 12px;
  color: var(--muted);
}

.completion,
.quiz-result {
  margin-top: 12px;
  color: var(--muted);
  display: none;
}

.completion.visible,
.quiz-result.visible {
  display: block;
}

.quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  flex-wrap: wrap;
}

.quiz-question {
  font-size: 1.02rem;
  margin-bottom: 12px;
}

.quiz-answers {
  display: grid;
  gap: 10px;
}

.quiz-answer {
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
}

.quiz-answer:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .hero,
  .two-col {
    grid-template-columns: 1fr;
  }

  .scenario-header {
    align-items: start;
  }
}
