@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700&family=Unbounded:wght@400;600;700&display=swap");

:root {
  --bg: #0a130f;
  --bg-soft: #14211c;
  --panel: rgba(14, 21, 18, 0.9);
  --panel-border: rgba(244, 226, 178, 0.16);
  --paper: #f7f0df;
  --muted: #c4c2b0;
  --accent: #e3c278;
  --accent-soft: #92c9aa;
  --danger: #df9272;
  --warning: #f4cf74;
  --shadow: 0 24px 84px rgba(0, 0, 0, 0.34);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(102, 152, 112, 0.22), transparent 34%),
    radial-gradient(circle at 84% 0%, rgba(201, 145, 76, 0.2), transparent 30%),
    radial-gradient(circle at 52% 92%, rgba(68, 113, 91, 0.26), transparent 34%),
    linear-gradient(180deg, #162922 0%, var(--bg) 52%, #040906 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
}
body::after {
  content: "";
  position: fixed;
  inset: -15%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.24;
  background:
    radial-gradient(circle at 22% 22%, rgba(186, 130, 62, 0.52), transparent 28%),
    radial-gradient(circle at 74% 30%, rgba(86, 154, 126, 0.42), transparent 34%);
  filter: blur(46px);
  animation: drift 14s ease-in-out infinite alternate;
}
.page-shell {
  position: relative;
  max-width: 1620px;
  margin: 0 auto;
  padding: 28px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}
.hero > * {
  min-width: 0;
}
.hero__copy,
.hero__stats,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(31, 46, 39, 0.86), rgba(9, 14, 13, 0.92)),
    var(--panel);
  box-shadow: var(--shadow);
}
.hero__copy {
  padding: 28px 30px 30px;
}
.hero__copy::after,
.panel::after {
  content: "";
  position: absolute;
  inset: auto -30% -45% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 191, 120, 0.18), transparent 68%);
}
.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}
.hero h1,
.panel h2,
.panel h3 {
  margin: 0;
  font-family: "Unbounded", "Trebuchet MS", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.hero h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.95;
  max-width: 12ch;
}
.hero__lead {
  max-width: 58ch;
  color: var(--paper);
  font-size: 1.02rem;
  line-height: 1.6;
  margin: 20px 0 14px;
}
.hero__disclaimer {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  align-content: center;
}
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 110px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(243, 226, 186, 0.12);
  background: linear-gradient(180deg, rgba(28, 45, 38, 0.86), rgba(7, 12, 10, 0.78));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.stat-card span {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 10px;
}
.stat-card strong {
  font-size: 1.8rem;
  font-family: Georgia, "Times New Roman", serif;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.95fr);
  gap: 22px;
}
.layout > * {
  min-width: 0;
}
.panel {
  padding: 18px;
  animation: panelRise 480ms ease both;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-head.compact {
  margin-bottom: 14px;
}
.panel-head__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}
.viewport-panel {
  padding: 18px;
}
#game-canvas {
  display: block;
  width: 960px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid rgba(243, 226, 186, 0.12);
  background: #0b1110;
}
.hud-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.hud-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(10, 14, 13, 0.7);
  border: 1px solid rgba(243, 226, 186, 0.08);
}
.hud-card span {
  display: block;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.hud-card p {
  margin: 0;
  line-height: 1.45;
  color: var(--paper);
}
.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}
.stage-list {
  display: grid;
  gap: 10px;
}
.stage-card {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(243, 226, 186, 0.12);
  border-radius: 18px;
  background: rgba(9, 14, 13, 0.72);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.stage-card::before {
  content: "";
  width: 42px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(227, 194, 120, 0.9), rgba(146, 201, 170, 0.3));
  margin-bottom: 4px;
}
.stage-card:hover:not(:disabled),
.stage-card.is-selected {
  transform: translateY(-1px);
  border-color: rgba(243, 226, 186, 0.32);
  background: rgba(23, 32, 29, 0.9);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}
.stage-card.is-complete {
  border-color: rgba(137, 199, 157, 0.4);
}
.stage-card:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.stage-card__tag,
.stage-card__state {
  font-size: 0.76rem;
  color: var(--muted);
}
.briefing {
  display: grid;
  gap: 12px;
}
.briefing__meta {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.briefing h3 {
  font-size: 1.5rem;
}
.briefing p,
.briefing li,
.source-item p,
.codex-card p,
.timeline-item p {
  margin: 0;
  line-height: 1.55;
  color: var(--paper);
}
.briefing__context,
.briefing__note,
.source-list__lead {
  color: var(--muted);
}
.briefing__objectives {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}
.tab-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab-button,
.button {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}
.tab-button {
  padding: 10px 14px;
  background: rgba(10, 14, 13, 0.78);
  color: var(--muted);
  border: 1px solid rgba(243, 226, 186, 0.1);
}
.tab-button.is-active {
  color: #11150f;
  background: linear-gradient(180deg, #eed89a, #d6b86d);
}
.button {
  padding: 11px 18px;
  transition: opacity 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.button.primary {
  color: #10140f;
  background: linear-gradient(180deg, #f2db9a, #c9a95c);
}
.button.ghost {
  color: var(--paper);
  background: rgba(9, 14, 13, 0.78);
  border: 1px solid rgba(243, 226, 186, 0.12);
}
.button.tiny {
  padding: 9px 12px;
  font-size: 0.84rem;
}
.tab-content {
  min-height: 320px;
}
.codex-grid,
.timeline-list,
.source-list {
  display: grid;
  gap: 12px;
}
.codex-card,
.timeline-item,
.source-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(9, 14, 13, 0.72);
  border: 1px solid rgba(243, 226, 186, 0.08);
}
.codex-card span,
.timeline-item span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.codex-card strong,
.timeline-item strong,
.source-item a {
  display: block;
  font-family: "Unbounded", "Trebuchet MS", sans-serif;
  font-size: 1.05rem;
  color: var(--paper);
  text-decoration: none;
  margin-bottom: 8px;
}
.codex-card small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.codex-card.is-locked {
  opacity: 0.6;
  filter: saturate(0.7);
}
.source-item a:hover {
  color: var(--accent);
}
.log-feed {
  display: grid;
  gap: 10px;
}
.log-entry {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(9, 14, 13, 0.72);
  border: 1px solid rgba(243, 226, 186, 0.07);
  color: var(--paper);
  line-height: 1.45;
}
.log-entry--success {
  border-color: rgba(137, 199, 157, 0.22);
}
.log-entry--warning {
  border-color: rgba(240, 200, 112, 0.22);
}
.log-entry--danger {
  border-color: rgba(217, 139, 112, 0.22);
}
#overlay-root {
  position: relative;
  z-index: 20;
}
.overlay-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}
.overlay-card {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(243, 226, 186, 0.16);
  background:
    linear-gradient(180deg, rgba(29, 41, 36, 0.95), rgba(11, 16, 15, 0.94));
  box-shadow: var(--shadow);
}
.overlay-card__eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}
.overlay-card h3 {
  margin: 0 0 12px;
  font-family: "Unbounded", "Trebuchet MS", sans-serif;
  font-size: 2rem;
}
.overlay-card p {
  margin: 0 0 20px;
  color: var(--paper);
  line-height: 1.6;
}
@keyframes drift {
  0% {
    transform: translate3d(-2%, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(2%, -1%, 0) scale(1.06);
  }
}
@keyframes panelRise {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 1180px) {
  .hero,
  .layout,
  .hud-strip {
    grid-template-columns: 1fr;
  }
  .hero__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .page-shell {
    padding: 16px;
  }
  .hero__stats {
    grid-template-columns: 1fr;
  }
  .panel-head,
  .panel-head.compact,
  .panel-head__actions,
  .tab-strip {
    flex-direction: column;
    align-items: stretch;
  }
  .panel-head__actions {
    width: 100%;
  }
  .button,
  .tab-button {
    width: 100%;
    justify-content: center;
  }
}
