:root {
  --bg: #050706;
  --panel: #0a0f0c;
  --panel-2: #111813;
  --line: #263128;
  --text: #d7ded6;
  --muted: #859086;
  --accent: #b8d9b5;
  --accent-2: #748d72;
  --hot: #d9c9a8;
  --shadow: rgba(0,0,0,.45);
  font-family: "Lucida Console", "Courier New", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 10%, #101812 0, #070a08 42%, #030403 100%);
  color: var(--text);
}

body {
  min-height: 100dvh;
  padding: 18px;
}

button { font: inherit; }

.shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.hud {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .16em;
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 5vw, 42px);
  letter-spacing: -.04em;
}

.resource {
  min-width: 130px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 9, .8);
  box-shadow: 0 10px 30px var(--shadow);
  text-align: right;
}

.resource span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.resource strong {
  font-size: 24px;
}

.game-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #050706;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), 0 24px 60px var(--shadow);
}

canvas {
  display: block;
  width: 100%;
  height: min(64vh, 620px);
  min-height: 380px;
  image-rendering: pixelated;
  touch-action: manipulation;
}

.action {
  position: absolute;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  padding: 14px 28px;
  min-width: 150px;
  border: 1px solid #6f846f;
  background: rgba(17, 25, 18, .92);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .15em;
  box-shadow: 0 0 0 2px rgba(0,0,0,.4), inset 0 0 18px rgba(184,217,181,.06);
  cursor: pointer;
}

.action:active,
.action.pulse {
  transform: scale(.97);
  background: #18251a;
}

.upgrades {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.upgrade {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.upgrade:hover { background: var(--panel-2); }

.upgrade:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.upgrade strong {
  display: block;
  margin-bottom: 2px;
}

.upgrade small {
  color: var(--muted);
}

.upgrade b {
  min-width: 42px;
  padding: 6px 8px;
  border: 1px solid #3a493c;
  color: var(--hot);
  text-align: center;
}

.note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 650px) {
  body { padding: 10px; }
  .hud { align-items: center; }
  .resource { min-width: 100px; }
  .upgrades { grid-template-columns: 1fr; }
  canvas { min-height: 56vh; }
}
