:root {
  --bg: #05060c;
  --fg: #e6e9f5;
  --muted: #8d92a6;
  --accent: #00f0ff;
  --magenta: #ff3df0;
  --frame-top: #0a0e18;
  --frame-bot: #03050a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100dvh;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

.back {
  position: fixed;
  top: 1rem;
  left: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.back:hover { color: var(--fg); background: rgba(255,255,255,0.05); }

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.frame {
  position: relative;
  line-height: 0;
  width: min(96vw, 960px);
  aspect-ratio: 480 / 270;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--frame-top) 0%, var(--frame-bot) 100%);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 240, 255, 0.10),
    0 0 32px rgba(0, 240, 255, 0.04);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: transparent;
}

.hud-top {
  position: absolute;
  top: 0.4rem;
  right: 0.8rem;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.sound-toggle {
  pointer-events: auto;
  background: rgba(5, 6, 12, 0.55);
  color: var(--fg);
  border: 1px solid rgba(0, 240, 255, 0.20);
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  padding: 0;
}
.sound-toggle:hover {
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.55);
}
.sound-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.meta {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.7;
  max-width: min(96vw, 960px);
}
.meta strong { color: var(--fg); }
.meta kbd {
  display: inline-block;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 3px;
  padding: 0 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--accent);
}

.legal-strip {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  max-width: min(96vw, 960px);
  line-height: 1.6;
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
}
.legal-strip a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(141, 146, 166, 0.3);
}
.legal-strip a:hover {
  color: var(--fg);
  text-decoration-color: currentColor;
}
