:root {
  color-scheme: light;
  --bg: #fff;
  --ink: #111;
  --mute: #888;
  --focus: #111;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 12px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  gap: 0.75rem;
}

.stage {
  position: relative;
  width: min(100%, 96vw, 96dvh * 16 / 9);
  aspect-ratio: 16 / 9;
  max-height: min(82dvh, 720px);
  background: #fff;
  border: 1px solid #e6e6e6;
}

#c {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #fff;
  cursor: default;
  outline: none;
}

.hud {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 2px;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.stage:hover .hud,
.stage:focus-within .hud {
  opacity: 0.95;
}

.icon-btn {
  appearance: none;
  margin: 0;
  padding: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 0;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: rgba(0, 0, 0, 0.06);
}

.icon-btn:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 1px;
}

.icon-btn svg {
  display: block;
  stroke: currentColor;
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn #icon-pause,
.icon-btn #icon-play {
  fill: currentColor;
  stroke: none;
}

.icon-btn #icon-sound-on,
.icon-btn #icon-sound-off path:first-child {
  fill: currentColor;
  stroke: none;
}

.hidden { display: none !important; }

.credit {
  max-width: 42rem;
  text-align: center;
  color: var(--mute);
  padding: 0 0.5rem;
}

.credit p { margin: 0; font-size: 11px; }

.noscript {
  color: #b00;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .hud { opacity: 0.85; }
}
