:root {
  color-scheme: dark;
  --cream: #fff4dc;
  --gold: #e4bd70;
  --wine: #5b1719;
  font-family: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; background: #10180e; color: var(--cream); }
body { min-height: 100svh; overflow: hidden; }
button { font: inherit; cursor: pointer; }
main { min-height: 100svh; }
.screen { display: none; }
.screen.active { display: flex; }
.screen.artScreen { position: fixed; inset: 0; align-items: center; justify-content: center; background: #10180e; overflow: hidden; }
.artFrame { position: relative; width: min(100vw, calc(100svh * 941 / 1670)); max-height: 100svh; aspect-ratio: 941 / 1670; overflow: hidden; }
.screenArtwork { display: block; width: 100%; height: 100%; object-fit: contain; }
.hotspot { position: absolute; border: 0; background: transparent; color: transparent; }
.hotspot:focus-visible { outline: 3px solid #fff4dc; outline-offset: -9px; border-radius: 18px; }
.splashHotspot { left: 21%; top: 75%; width: 58%; height: 11%; }
.goHotspot { left: 18%; top: 82%; width: 64%; height: 9%; }
.twinkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.twinkles i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff4b4; opacity: .25; box-shadow: 0 0 4px 2px rgba(255, 210, 91, .28); animation: twinkle var(--duration) ease-in-out var(--delay) infinite; }
@keyframes twinkle { 0%,100% { opacity: .16; transform: scale(.65); filter: brightness(.8); } 48% { opacity: .98; transform: scale(1.65); filter: brightness(1.5); box-shadow: 0 0 13px 5px rgba(255, 218, 117, .8); } }

.scanner { position: fixed; inset: 0; z-index: 2; background: #080a06; }
.scanner.active { display: block; }
#cameraStage { position: absolute; inset: 0; overflow: hidden; background: #050605; }
#xrCameraCanvas { position: absolute; }
.cameraTop { position: absolute; z-index: 2; top: calc(14px + env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 10px/1.25 Arial, sans-serif; letter-spacing: .12em; text-shadow: 0 1px 4px #000; }
.iconButton, .revealClose { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid rgba(255,244,220,.7); background: rgba(24,13,8,.72); color: #fff4dc; font: 28px/1 Arial, sans-serif; }
.musicToggle { position: absolute; z-index: 2; right: 16px; bottom: calc(87px + env(safe-area-inset-bottom)); min-height: 42px; padding: 0 16px; border: 1px solid var(--gold); background: rgba(31,24,13,.88); color: var(--cream); font: 700 13px Arial, sans-serif; box-shadow: 0 3px 12px #0008; }
.cameraStatus { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: calc(25px + env(safe-area-inset-bottom)); min-height: 50px; display: grid; place-items: center; text-align: center; padding: 12px; background: rgba(20,14,8,.84); border: 1px solid rgba(228,189,112,.72); font: 14px/1.4 Arial, sans-serif; color: #fff; }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .twinkles i { animation-duration: 4s !important; }
}

/* v17: Camera viewport aligned to XR8 output; no fixed 4:3 constraint. */
html, body, main, #scanner, #cameraStage { width: 100%; height: 100%; }
#scanner, #cameraStage { width: 100vw; height: 100dvh; }
#xrCameraCanvas {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  image-rendering: auto !important;
}
.cameraTop { justify-content: flex-end; }

/* Match the known-good Hankerson camera presentation: full-screen canvas,
   native XR8 camera startup, and no additional digital zoom factor. */
#scanner { position: fixed; inset: 0; z-index: 2; width: auto; height: auto; background: #080707; }
#scanner.active { display: block; }
#cameraStage { position: absolute; inset: 0; width: auto; height: auto; aspect-ratio: auto; overflow: hidden; background: #050505; }
#xrCameraCanvas {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  object-fit: cover !important;
  image-rendering: auto !important;
}
