:root {
  color-scheme: dark;
  --bg: #050503;
  --panel: #0c0a06;
  --panel-2: #151006;
  --panel-3: #201708;
  --gold: #ffd66b;
  --gold-2: #d59d27;
  --amber: #ffe8a8;
  --cyan: #55dcff;
  --green: #7df2bd;
  --red: #ff6b6b;
  --paper: #fff7dc;
  --muted: #bda96f;
  --line: rgba(255, 214, 107, 0.28);
  --line-strong: rgba(255, 214, 107, 0.48);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 214, 107, 0.15), transparent 27rem),
    radial-gradient(circle at 88% 8%, rgba(85, 220, 255, 0.1), transparent 28rem),
    linear-gradient(180deg, #090704 0%, #050503 46%, #080604 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100% - 32px, 1360px);
  margin: 0 auto;
  padding: 18px 0 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold);
  background: #090805;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 900;
  box-shadow: 0 0 26px rgba(255, 214, 107, 0.2);
}

.brand strong {
  display: block;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1;
}

.brand em,
.eyebrow,
.nav a,
.hero-stats span {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.nav a {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 7, 5, 0.74);
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 18px;
  align-items: end;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(19, 14, 7, 0.97), rgba(6, 5, 4, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 214, 107, 0.07) 0 1px, transparent 1px 30px);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  gap: 13px;
  max-width: 840px;
}

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

h1 {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.95;
}

.hero-copy p {
  color: #f0dc9d;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

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

.hero-stats div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(255, 214, 107, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.hero-stats strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 10px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}

.mission-panel,
.terminal-wrap,
.map-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(14, 11, 6, 0.96), rgba(6, 5, 4, 0.98));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.mission-panel {
  display: grid;
  align-content: start;
  gap: 1px;
  overflow: hidden;
}

.panel-block {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 214, 107, 0.14);
}

.panel-block h2,
.section-head h2 {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.panel-block h3 {
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-block p,
.section-head p {
  color: #dfcf98;
  font-size: 14px;
  line-height: 1.5;
}

.command-card {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.command-card code {
  padding: 6px 8px;
  border: 1px solid rgba(85, 220, 255, 0.24);
  border-radius: 5px;
  color: var(--cyan);
  background: rgba(85, 220, 255, 0.08);
  font-family: var(--mono);
  font-size: 12px;
}

.panel-actions {
  grid-template-columns: 1fr;
}

.panel-actions button,
.terminal-form button {
  min-height: 40px;
  border: 1px solid var(--gold-2);
  border-radius: 6px;
  color: #080704;
  background: linear-gradient(#ffe8a8, #c99418);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-actions button:nth-child(2),
.panel-actions button:nth-child(3) {
  color: var(--gold);
  background: rgba(0, 0, 0, 0.26);
}

.terminal-wrap {
  display: grid;
  grid-template-rows: auto minmax(420px, 58vh) auto;
  min-width: 0;
  overflow: hidden;
}

.terminal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 214, 107, 0.18);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.terminal-output {
  overflow: auto;
  padding: 16px;
  color: #dfffe9;
  background:
    linear-gradient(rgba(255, 214, 107, 0.03) 50%, rgba(0, 0, 0, 0) 50%) 0 0 / 100% 8px,
    #030403;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.line {
  margin: 0 0 8px;
}

.line.command {
  color: var(--gold);
}

.line.system {
  color: var(--cyan);
}

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

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

.terminal-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 86px;
  gap: 10px;
  align-items: center;
  min-height: 60px;
  padding: 10px;
  border-top: 1px solid rgba(255, 214, 107, 0.18);
  background: rgba(6, 5, 4, 0.95);
}

.terminal-form label {
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}

.terminal-form input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(125, 242, 189, 0.26);
  border-radius: 6px;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.48);
  font-family: var(--mono);
  padding: 0 11px;
}

.terminal-form input:focus {
  outline: 2px solid rgba(85, 220, 255, 0.55);
  outline-offset: 2px;
}

.map-section {
  margin-top: 16px;
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

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

.map-card {
  min-height: 96px;
  padding: 12px;
  border: 1px solid rgba(255, 214, 107, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.map-card.current {
  border-color: rgba(85, 220, 255, 0.65);
  box-shadow: inset 0 0 0 1px rgba(85, 220, 255, 0.25);
}

.map-card.done {
  border-color: rgba(125, 242, 189, 0.55);
}

.map-card strong {
  display: block;
  color: var(--gold);
  font-size: 13px;
}

.map-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

  .terminal-wrap {
    grid-template-rows: auto minmax(390px, 60vh) auto;
  }

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

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding-top: 12px;
  }

  .topbar,
  .section-head {
    display: grid;
    justify-content: stretch;
  }

  .nav {
    justify-content: stretch;
  }

  .nav a {
    flex: 1 1 130px;
  }

  .hero {
    padding: 18px;
  }

  h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

  .hero-stats,
  .mission-map {
    grid-template-columns: 1fr;
  }

  .terminal-wrap {
    grid-template-rows: auto minmax(380px, 56vh) auto;
  }

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

  .terminal-form label {
    white-space: normal;
  }

  .terminal-form button {
    width: 100%;
  }
}
