:root {
  color-scheme: dark;
  --bg: #0b1718;
  --bg-deep: #061011;
  --panel: rgba(15, 34, 34, 0.88);
  --panel-strong: rgba(22, 45, 44, 0.96);
  --line: #3d6663;
  --line-soft: rgba(103, 151, 141, 0.22);
  --ink: #eef8df;
  --muted: #a6c0b9;
  --accent: #9fe39b;
  --gold: #f2ca71;
  --danger: #f28573;
  --mid: #d9b86b;
  --good: #95de9b;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: "Azeret Mono", "IBM Plex Mono", "Iosevka Fixed", ui-monospace, monospace;
  background:
    radial-gradient(circle at top, rgba(36, 81, 74, 0.35), transparent 45%),
    linear-gradient(180deg, #102120, var(--bg-deep) 58%, #071112);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 2px solid #648881;
  border-radius: 9px;
  background: linear-gradient(180deg, #214240, #173130);
  color: var(--ink);
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.24);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

button:hover {
  border-color: #8cc7b6;
  background: linear-gradient(180deg, #27514d, #1a3937);
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  width: min(1180px, 100%);
  max-width: 100vw;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 28px);
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.92fr);
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}

.tank-zone,
.controls-zone {
  min-width: 0;
}

.tank-frame {
  position: relative;
  border: 3px solid #61817a;
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0)),
    #0b181a;
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#tank {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #102e42;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.status-strip span,
.panel {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.status-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  color: #dbead8;
  text-align: center;
}

.controls-zone {
  display: grid;
  gap: 14px;
}

.topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.topline-actions {
  display: flex;
  gap: 10px;
  align-items: start;
}

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

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.45rem);
  line-height: 1.02;
}

h2 {
  font-size: 1rem;
  color: #def5cc;
}

.lede,
.panel p {
  margin: 10px 0 0;
  color: #d1e4dd;
  line-height: 1.5;
}

.reset-button {
  min-width: 110px;
  background: linear-gradient(180deg, #35554d, #233933);
}

.latest-button {
  min-width: 92px;
  background: linear-gradient(180deg, #24423f, #18302e);
}

.panel {
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.action-panel {
  background:
    linear-gradient(180deg, rgba(242, 202, 113, 0.08), transparent 50%),
    var(--panel-strong);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.meter-stack {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.meter-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
}

.meter-row span,
.meter-row strong {
  font-size: 0.92rem;
}

.meter-row span {
  color: var(--muted);
}

.meter {
  height: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(6, 16, 17, 0.85);
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
}

.meter-fill.good {
  background: linear-gradient(90deg, #70c17a, var(--good));
}

.meter-fill.mid {
  background: linear-gradient(90deg, #b89343, var(--mid));
}

.meter-fill.bad {
  background: linear-gradient(90deg, #d16c5f, var(--danger));
}

.fact-list,
.journal-list {
  margin: 14px 0 0;
  padding-left: 20px;
}

.fact-list {
  display: grid;
  gap: 8px;
  color: #d5e7dd;
}

.journal-list {
  display: grid;
  gap: 10px;
  color: #dce9d5;
}

.journal-list li:first-child {
  color: #f5f2d8;
}

li::marker {
  color: var(--gold);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px;
  }

  .topline {
    flex-direction: column;
  }

  .topline-actions {
    width: 100%;
  }

  .reset-button {
    width: 100%;
  }

  .latest-button {
    width: 100%;
  }

  .action-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .meter-row {
    grid-template-columns: 64px minmax(0, 1fr) 30px;
    gap: 8px;
  }
}
