:root {
  color-scheme: dark;
  --bg: #08110f;
  --panel: rgba(9, 19, 17, 0.78);
  --panel-strong: rgba(13, 27, 24, 0.94);
  --text: #effaf1;
  --muted: #a6bcb3;
  --line: rgba(210, 255, 226, 0.18);
  --mint: #4dffc4;
  --gold: #ffd166;
  --coral: #ff6b6b;
  --blue: #6ea8ff;
  --ink: #050807;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(77, 255, 196, 0.12), transparent 28rem),
    radial-gradient(circle at 84% 16%, rgba(255, 209, 102, 0.12), transparent 24rem),
    linear-gradient(135deg, #07100d 0%, #0f1718 48%, #160d18 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 250, 241, 0.08);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.shell {
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100vw;
  height: 100vh;
}

.hud {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 7, 0.72);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(77, 255, 196, 0.45);
  border-radius: 8px;
  background: rgba(77, 255, 196, 0.12);
  color: var(--mint);
  font-size: 30px;
  line-height: 1;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 8px;
}

.metrics div {
  min-width: 82px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 250, 241, 0.06);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  margin-top: 1px;
  font-size: 17px;
}

#pauseButton {
  min-width: 80px;
  height: 42px;
}

.stage-wrap {
  position: relative;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #07100e;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 7, 0.42);
}

.overlay[hidden] {
  display: none;
}

.panel {
  width: min(560px, 100%);
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(210, 255, 226, 0.26);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.kicker {
  color: var(--mint);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel h2 {
  margin-top: 10px;
  font-size: clamp(31px, 5vw, 54px);
  line-height: 0.96;
  letter-spacing: 0;
}

.panel p:not(.kicker) {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.controls span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 250, 241, 0.06);
  color: #d8e7df;
  font-size: 12px;
}

#startButton {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  border-color: rgba(77, 255, 196, 0.62);
  background: linear-gradient(135deg, rgba(77, 255, 196, 0.88), rgba(255, 209, 102, 0.9));
  color: var(--ink);
  font-weight: 900;
}

.prompt-tray {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  pointer-events: none;
}

.prompt-card {
  min-height: 96px;
  padding: 13px;
  border: 1px solid rgba(210, 255, 226, 0.28);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(15px);
  pointer-events: auto;
}

.prompt-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--mint);
  font-size: 14px;
}

.prompt-card span {
  color: #dceae3;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .hud {
    grid-template-columns: 1fr auto;
  }

  .brand p {
    display: none;
  }

  .metrics {
    grid-column: 1 / -1;
    order: 3;
  }

  .prompt-tray {
    grid-template-columns: 1fr;
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .prompt-card {
    min-height: 76px;
  }
}
