:root { color-scheme: dark; font: 16px system-ui, sans-serif; background: #0b0d0c; color: #f2f3f0; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  touch-action: pan-y pinch-zoom;
}
header, nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(12px, 4vw, 24px);
}
header { min-height: 44px; letter-spacing: .12em; font-size: .8rem; }
output { letter-spacing: normal; font-variant-numeric: tabular-nums; }
#stage { display: grid; place-items: center; position: relative; container-type: size; overflow: hidden; }
#stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; user-select: none; }
#stage iframe {
  width: min(100cqw, calc(100cqh * 16 / 9));
  height: min(100cqh, calc(100cqw * 9 / 16));
  border: 0;
  background: #000;
}
nav { min-height: 64px; }
button, a { color: inherit; }
button {
  font: inherit;
  font-size: 1.3rem;
  width: 56px;
  min-height: 44px;
  border: 1px solid #51564f;
  border-radius: 8px;
  background: #20241f;
  cursor: pointer;
}
button:disabled { opacity: .4; cursor: default; }
