/* Shared typography, background and navigation come from ../portal.css. */
:root { color-scheme: dark; }
.viewer-stage { gap: clamp(28px, 5vw, 72px); }
.stage, .viewer-copy { min-width: 0; }
.viewer-copy header > p:not(.eyebrow) { color: #b9c7c3; line-height: 1.8; }
.viewer-copy h1 { margin-bottom: 20px; }
.viewer-status { margin: 24px 0; }
.viewer-status div { gap: 18px; }
.viewer-status dt { flex-shrink: 0; }
.viewer-status dd { text-align: right; overflow-wrap: anywhere; }
.canvas-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(217, 185, 110, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  transition: border-radius 180ms ease;
}
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.empty-art { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.stage:has(#play:enabled) .empty-art { display: none; }
.stage:has(#play:enabled) .canvas-wrap { border-radius: 28px; }
.playback {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(217, 185, 110, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.025);
}
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
button, select, input::file-selector-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(217, 185, 110, 0.35);
  border-radius: 999px;
  color: #e5e9df;
  background: #18312c;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}
button, input::file-selector-button { cursor: pointer; }
button:hover:enabled { background: #23463e; }
button:disabled, select:disabled { opacity: 0.42; cursor: default; }
#play, #demo { color: #18312c; background: #d9b96e; border-color: #d9b96e; }
#play:hover:enabled, #demo:hover:enabled { background: #e9ce8f; }
#play { min-width: 90px; }
#demo { margin-top: 12px; }
select { max-width: 100%; }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible, canvas:focus-visible, summary:focus-visible {
  outline: 3px solid #d9b96e;
  outline-offset: 3px;
}
.timeline { display: block; margin: 16px 0; }
input[type=range] { display: block; width: 100%; min-height: 32px; accent-color: #d9b96e; }
input[type=checkbox] { accent-color: #d9b96e; }
input[type=file] { display: block; width: 100%; min-width: 0; margin-top: 10px; font: inherit; font-size: 0.85rem; }
input::file-selector-button { margin-right: 8px; }
.file-label { display: block; }
label { font-size: 0.9rem; }
output { color: #b9c7c3; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
h2 { font-size: 1.15rem; }
.open-panel h2 { margin-bottom: 14px; }
.open-panel p, .help p, .info, footer { color: #b9c7c3; font-size: 0.9rem; line-height: 1.8; }
.open-panel > p { margin: 14px 0; }
details { margin-top: 14px; }
summary { color: #d9b96e; cursor: pointer; font-size: 0.9rem; }
.status { margin: 20px 0 10px; color: #e4d5b0; line-height: 1.75; font-size: 0.9rem; }
.info { overflow-wrap: anywhere; margin-bottom: 0; }
#reportJSON { max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .75rem; }
.help { margin-top: 32px; padding: 26px; border: 1px solid rgba(217, 185, 110, 0.18); border-radius: 28px; }
footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.stage:fullscreen { display: flex; flex-direction: column; background: #0d1e1b; padding: 12px; overflow-y: auto; }
.stage:fullscreen .canvas-wrap { flex: 1; min-height: 120px; aspect-ratio: auto; border-radius: 16px; }
.stage:fullscreen .playback { flex-shrink: 0; margin-top: 10px; }
@media (max-width: 760px) {
  .viewer-stage { display: flex; flex-direction: column; gap: 28px; min-height: 0; }
  .viewer-copy { order: -1; width: 100%; }
  .viewer-copy h1 { font-size: clamp(2.4rem, 10vw, 4rem); }
  .viewer-navigation { flex-wrap: wrap; gap: 16px; }
  .stage { width: 100%; }
  .canvas-wrap { max-height: 65vh; aspect-ratio: 1; }
  .playback { padding: 16px; }
  .help { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .canvas-wrap { transition: none; } }
.viewer-body:has(.stage.is-stereo) { overflow: hidden; }
.viewer-body:has(.stage.is-stereo) :is(.viewer-navigation, .viewer-copy, .help, footer) { visibility: hidden; }
.stage.is-stereo {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #0d1e1b;
  overflow: auto;
}
.stage.is-stereo .canvas-wrap {
  flex: 1 0 120px;
  min-height: 120px;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}
.stage.is-stereo .canvas-wrap::after {
  position: absolute;
  inset: 0 auto 0 50%;
  border-left: 1px solid #b9c7c3;
  pointer-events: none;
  content: "";
}
.stage.is-stereo .playback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  padding: 4px 12px;
  border-radius: 0;
}
.stage.is-stereo .playback .row { display: contents; }
.stage.is-stereo .playback > :is(.timeline, .info, .appearance),
.stage.is-stereo .row > :not(:is(#play, #timeLabel, #stereo, #fullscreen, #stereoOptions, #stereoLook, #phoneMotion, #phoneRecenter)) { display: none; }
#phoneMotionStatus { flex-basis: 100%; margin: 0; font-size: .85rem; }
#stereoLook[aria-pressed="true"] { background: #30535b; }
.stereo-orientation { display: none; margin: 0; font-size: .85rem; flex-basis: 100%; }
@media (orientation: portrait) {
  .stage.is-stereo .canvas-wrap { flex: 0 0 auto; aspect-ratio: 2; }
  .stage.is-stereo .stereo-orientation { display: block; }
}
