/* vr.html: stand inside the sky. Same dark tokens as the other Fazari pages; self-contained. */
:root {
  --bg: #05070d; --line: rgba(160, 180, 230, .22); --fg: #eef1f8; --mut: #b3bdd2; --soft: #c9d2e6;
  --acc: #ffc94d; --acc-ink: #1a1300; --blue: #7fd4ff; --good: #5cf0a0; --bad: #ff8a7b;
  --glass: rgba(6, 9, 18, .78);
  --b0: #7fd4ff; --b1: #ffe66d; --b2: #ffad5c; --b3: #ff5c8a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); overflow: hidden; overscroll-behavior: none;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--blue); }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#stage { position: fixed; inset: 0; }
#sky { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
#sky:active { cursor: grabbing; }
#sky:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); }

/* top bar */
#top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: linear-gradient(rgba(5, 7, 13, .88), rgba(5, 7, 13, 0)); pointer-events: none; }
#top > * { pointer-events: auto; }
#top h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: .01em; }
#top .sp { flex: 1; }
#back { color: var(--soft); text-decoration: none; font-size: 14px; padding: 6px 2px; white-space: nowrap; }
#back:hover { color: var(--fg); text-decoration: underline; }
.btn { border: 1px solid var(--line); background: var(--glass); color: var(--fg); border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; min-height: 36px; }
.btn:hover { border-color: rgba(127, 212, 255, .6); }
.btn.acc { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 650; }
.btn[aria-pressed="true"] { background: rgba(127, 212, 255, .2); border-color: var(--blue); }
.btn.round { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-size: 15px; flex: none; }

/* target chips */
#targets { position: fixed; z-index: 4; left: max(16px, env(safe-area-inset-left)); right: 16px; top: 54px; display: flex; gap: 6px;
  flex-wrap: wrap; pointer-events: none; }
#targets button { pointer-events: auto; border: 1px solid var(--line); background: var(--glass); color: var(--soft); border-radius: 999px;
  padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; min-height: 30px; }
#targets button:hover, #targets button[aria-current="true"] { color: var(--fg); border-color: var(--acc); }

/* labels over the sky */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; background: none; padding: 0; color: var(--fg); cursor: pointer;
  font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; text-shadow: 0 0 4px #000, 0 0 2px #000; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; will-change: transform; }
.lbl .ring { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--acc); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
  margin-left: -11px; flex: none; }
.lbl .tx { background: rgba(5, 7, 13, .55); padding: 2px 6px; border-radius: 6px; }
.lbl.slow .ring { border-color: #b9f2c8; }
.lbl:focus-visible { outline: none; }
.lbl:focus-visible .tx { outline: 2px solid var(--blue); }

#tip { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(var(--fh, 150px) + 10px); margin: 0; max-width: min(92vw, 460px);
  background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 13.5px; text-align: center; }
#hint { position: fixed; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, 40px); margin: 0; pointer-events: none;
  background: rgba(5, 7, 13, .6); padding: 6px 12px; border-radius: 10px; font-size: 13.5px; color: var(--soft); text-align: center;
  max-width: calc(100vw - 32px); transition: opacity .6s; }
#hint.gone { opacity: 0; }

#zoom { position: fixed; z-index: 4; right: max(16px, env(safe-area-inset-right)); bottom: calc(var(--fh, 150px) + 10px); display: flex; flex-direction: column; gap: 6px; }
#zoom button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: var(--fg);
  font-size: 20px; line-height: 1; cursor: pointer; }

/* bottom: slider, legend, caption */
#bottom { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; padding: 10px max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(rgba(5, 7, 13, 0), rgba(5, 7, 13, .9) 28%); }
#bottom .row { display: flex; align-items: center; gap: 12px; max-width: 900px; margin: 0 auto; }
#time { flex: 1; min-width: 0; accent-color: var(--acc); height: 32px; }
#year { min-width: 7.5em; text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.2; }
#year b { display: block; font-size: 17px; color: var(--acc); }
#legend { margin: 6px auto 0; max-width: 900px; font-size: 12.5px; color: var(--mut); }
#legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px 0 6px; vertical-align: 0; }
#legend i.b0 { background: var(--b0); } #legend i.b1 { background: var(--b1); } #legend i.b2 { background: var(--b2); } #legend i.b3 { background: var(--b3); }
#about { max-width: 900px; margin: 4px auto 0; font-size: 12.5px; color: var(--mut); }
#about summary { cursor: pointer; }
#about p { margin: 6px 0; max-height: 30vh; overflow: auto; }
#about .credit { font-size: 11.5px; }

/* floating target panel */
#panel { position: fixed; z-index: 7; right: max(16px, env(safe-area-inset-right)); top: calc(var(--th, 96px) + 8px); width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - var(--th, 96px) - var(--fh, 150px) - 16px); overflow: auto; background: rgba(8, 12, 24, .94); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
#panel h2 { margin: 0 0 8px; font-size: 19px; line-height: 1.2; padding-right: 30px; }
#panel .tag { margin: 0 0 2px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: #9fdcff; font-weight: 650; padding-right: 30px; }
#panel .x { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: none; color: var(--fg); font-size: 20px; cursor: pointer; }
#panel p { margin: 6px 0; font-size: 14px; }
#panel .fine { font-size: 12px; color: var(--mut); }
#panel .ok { color: var(--good); } #panel .bad { color: var(--bad); }
#panel .go a { display: inline-block; margin-right: 14px; font-weight: 600; }
.blink { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.blink svg { display: block; width: 100%; height: 100%; }
.blink image { visibility: hidden; } .blink image.on { visibility: visible; }
.blink .rg { fill: none; stroke: var(--acc); stroke-width: 2.4; vector-effect: non-scaling-stroke; visibility: hidden; } .blink .rg.on { visibility: visible; }
.blink .ep { position: absolute; left: 8px; bottom: 6px; font-size: 13px; font-weight: 650; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.bctl { display: flex; gap: 8px; margin-top: 6px; }
.bctl .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }

#flat { position: absolute; inset: 0; overflow: auto; padding: calc(var(--th, 96px) + 12px) 16px calc(var(--fh, 150px) + 16px); }
#flat p { max-width: 640px; margin: 0 auto 12px; color: var(--soft); }
#flat img { display: block; width: 100%; max-width: 1400px; margin: 0 auto; height: auto; }

@media (max-width: 560px) {
  #top h1 { font-size: 15px; }
  #top { gap: 6px 10px; }
  .btn { padding: 6px 11px; font-size: 13px; }
  #targets { flex-wrap: nowrap; overflow-x: auto; right: 0; padding-right: 16px; scrollbar-width: none; }
  #targets::-webkit-scrollbar { display: none; }
  #targets button { font-size: 12px; padding: 3px 8px; min-height: 30px; flex: none; }
  #panel { left: 16px; right: 16px; width: auto; top: auto; bottom: calc(var(--fh, 150px) + 6px); }
  #panel .blink { max-width: 230px; margin: 0 auto; }
  #legend, #about { font-size: 11.5px; }
  #bottom { padding-top: 6px; }
}
@media (max-width: 360px) {
  #panel .blink { max-width: 170px; }
  #panel p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  #hint { transition: none; }
}
