:root {
  color-scheme: dark;
  --panel: rgba(9, 13, 28, 0.72);
  --panel-strong: rgba(9, 13, 28, 0.9);
  --stroke: rgba(255, 255, 255, 0.14);
  --text: #eef4ff;
  --muted: #9da9c1;
  --accent: #67e8f9;
  --accent-2: #f59e0b;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050816;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 24% 20%, rgba(103, 232, 249, 0.2), transparent 26rem),
    radial-gradient(circle at 78% 26%, rgba(245, 158, 11, 0.16), transparent 24rem),
    radial-gradient(circle at 50% 90%, rgba(124, 58, 237, 0.18), transparent 30rem),
    linear-gradient(135deg, #030712 0%, #07111f 48%, #020617 100%);
}

.simulation-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  isolation: isolate;
}

canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  cursor: grab;
}

canvas:active { cursor: grabbing; }

.hero-panel,
.hud,
.bar { z-index: 2; }

.hero-panel {
  position: fixed;
  top: 24px;
  left: 24px;
  width: min(390px, calc(100vw - 48px));
  padding: 22px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.48));
  border: 1px solid var(--stroke);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.back-link:hover { color: #a5f3fc; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.lede {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.instruction-grid span {
  padding: 9px 8px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.hud {
  position: fixed;
  right: 24px;
  top: 24px;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  pointer-events: none;
  backdrop-filter: blur(16px);
}

.hud b { color: var(--text); font-weight: 700; }

.bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: min(740px, calc(100vw - 32px));
  padding: 10px 12px;
  background: var(--panel-strong);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.grp {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.grp b { min-width: 44px; color: var(--text); font-weight: 800; text-align: center; text-transform: none; }

button {
  width: 34px;
  height: 34px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

button:hover { background: rgba(103, 232, 249, 0.16); border-color: rgba(103, 232, 249, 0.45); }
button:active { transform: scale(0.94); }

#dim {
  width: auto;
  padding: 0 16px;
  font-size: 12px;
  text-transform: uppercase;
}

#dim.on { background: rgba(103, 232, 249, 0.22); border-color: rgba(103, 232, 249, 0.6); }

@media (max-width: 760px) {
  .hero-panel { top: 12px; left: 12px; width: calc(100vw - 24px); padding: 18px; }
  .lede,
  .hud,
  .instruction-grid { display: none; }
  .bar { bottom: 12px; }
}
