:root {
  --steel: #12161a;
  --steel-2: #1a2228;
  --brass: #c4a574;
  --brass-d: #8a6a3e;
  --teal: #3ad7c4;
  --ink: #e8e0d4;
  --dim: #9a9184;
  --fail: #e07050;
  --void: #05070a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 500px at 50% -10%, #1a2428 0%, transparent 55%),
    var(--steel);
  color: var(--ink);
  overflow: hidden;
}
.shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: 10px;
  gap: 8px;
}
.hud, .dock {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: linear-gradient(#243038, #14181c);
  border: 1px solid #3a3428;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 #4a4030, 0 8px 24px #0008;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Cinzel, Palatino, serif;
  letter-spacing: 0.12em;
  color: var(--brass);
  text-decoration: none;
}
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.title {
  font-family: Cinzel, Palatino, serif;
  letter-spacing: 0.08em;
}
.title small {
  display: block;
  color: var(--dim);
  font-family: "Source Sans 3", sans-serif;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
}
.grow { flex: 1; }
.fuel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}
.fuel span {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.fuel-track {
  flex: 1;
  height: 10px;
  background: #0c1014;
  border: 1px solid var(--brass-d);
  border-radius: 99px;
  overflow: hidden;
}
#fuel-bar {
  display: block;
  height: 100%;
  width: 70%;
  background: linear-gradient(90deg, #8a5a20, var(--brass));
  box-shadow: 0 0 8px #c4a57488;
}
#fuel-bar.low { background: linear-gradient(90deg, #6a2018, var(--fail)); }
#fuel-n { color: var(--brass); min-width: 2ch; font-variant-numeric: tabular-nums; }
#view-wrap {
  position: relative;
  border: 2px solid var(--brass-d);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 4px #0c0c0e, inset 0 0 40px #0006;
  background: var(--void);
}
#view { width: 100%; height: 100%; display: block; touch-action: none; }
.status {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  pointer-events: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--teal);
  text-shadow: 0 1px 8px #000;
}
button, select {
  font: inherit;
  color: var(--ink);
  background: #2a241c;
  border: 1px solid var(--brass-d);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
button:hover { border-color: var(--brass); color: var(--brass); }
#btn-lamp.on,
.kit button.on {
  background: #3a3220;
  color: var(--brass);
  box-shadow: 0 0 12px #c4a57455;
}
.pad {
  display: grid;
  grid-template-columns: 44px 44px 44px;
  gap: 4px;
}
.pad button { width: 44px; height: 36px; touch-action: none; }
.pad .n { grid-column: 2; grid-row: 1; }
.pad .w { grid-column: 1; grid-row: 2; }
.pad .s { grid-column: 2; grid-row: 2; }
.pad .e { grid-column: 3; grid-row: 2; }
.hint { font-size: 0.78rem; opacity: 0.75; }
.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #05070acc;
  padding: 16px;
}
.modal[hidden] { display: none !important; }
.panel {
  background: #1c1814;
  border: 1px solid var(--brass);
  border-radius: 12px;
  padding: 22px 24px;
  max-width: 440px;
  width: min(440px, 92vw);
  box-shadow: 0 16px 40px #000a, inset 0 1px 0 #c4a57433;
}
.panel h2 {
  font-family: Cinzel, Palatino, serif;
  margin: 0 0 8px;
  color: var(--brass);
  font-weight: 600;
}
.panel p { color: var(--dim); line-height: 1.45; }
.panel.paper {
  background: #e8d8b8;
  color: #2a2018;
  border-color: #8a6a3e;
}
.panel.paper h2, .panel.paper p { color: #2a2018; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.scrap { color: var(--teal); font-variant-numeric: tabular-nums; }
.kit {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kit button b,
.kit button {
  font-variant-numeric: tabular-nums;
}
.kit button b { color: var(--teal); margin-left: 4px; }
.kit button:disabled { opacity: 0.45; cursor: default; }
a { color: var(--brass); text-decoration: none; }
