:root {
  --bg: #120d0b;
  --panel: rgba(30, 20, 15, 0.87);
  --panel-border: rgba(255, 198, 117, 0.18);
  --text: #f4e7d4;
  --muted: #ccb89a;
  --accent: #d6942d;
  --accent-bright: #f6cb83;
  --accent-cold: #8ac5a6;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(214, 148, 45, 0.12), transparent 30%),
    radial-gradient(circle at bottom left, rgba(111, 155, 122, 0.16), transparent 24%),
    linear-gradient(160deg, #0d0908 0%, #17100d 42%, #0d0907 100%);
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
}

body::after {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 208, 142, 0.05), transparent 16%),
    radial-gradient(circle at 78% 74%, rgba(113, 170, 138, 0.06), transparent 20%);
  filter: blur(20px);
}

.page-shell {
  width: min(1450px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 38px;
}

.hero,
.layout {
  display: grid;
  gap: 20px;
}

.hero {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  margin-bottom: 20px;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: "Impact", "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.04em;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 5.2rem);
  line-height: 0.92;
  text-transform: uppercase;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.subtitle {
  max-width: 820px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.layout {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 18px 60px var(--shadow);
  backdrop-filter: blur(12px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 38%);
}

.controls-card,
.info-panel {
  padding: 22px;
}

.controls-card p,
.info-panel p,
.info-panel li {
  color: var(--muted);
  line-height: 1.55;
}

.controls-card span {
  display: inline-block;
  min-width: 130px;
  color: var(--text);
  font-weight: 700;
}

.stage-panel {
  padding: 18px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.hud > div,
.meter-card,
.info-block {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hud-label,
.meter-head span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.hud strong,
.meter-head strong {
  font-size: 1.05rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.meter-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 180ms ease;
}

.meter-fill.sludge {
  background: linear-gradient(90deg, #759858, #d8cf7d);
}

.meter-fill.signal {
  background: linear-gradient(90deg, #5d8d86, #f1ba6f);
}

.stage-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
}

canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 22px;
  background: linear-gradient(180deg, #2a241f 0%, #171310 100%);
}

.screen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 42px;
  background: linear-gradient(180deg, rgba(10, 8, 7, 0.3), rgba(10, 8, 7, 0.74));
  pointer-events: none;
  transition: opacity 180ms ease;
}

.screen-overlay.hidden {
  opacity: 0;
}

.screen-overlay h3 {
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  color: var(--accent-bright);
}

.screen-overlay p {
  margin: 0;
  max-width: 760px;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
}

.status-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 14px;
}

.message-box {
  flex: 1;
  min-height: 70px;
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1.45;
}

.button-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.restart-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.restart-button {
  color: #20150d;
  background: linear-gradient(135deg, #f2c57b, #ca7921);
  box-shadow: 0 10px 24px rgba(208, 138, 39, 0.26);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ghost-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.restart-button:hover,
.ghost-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.breed-list {
  margin: 0;
  padding-left: 20px;
}

.breed-list strong {
  color: var(--text);
}

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

@media (max-width: 980px) {
  .hud {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1450px);
    padding-top: 18px;
  }

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

  .status-row {
    flex-direction: column;
  }

  .screen-overlay {
    padding: 24px;
  }
}
