/* ARKPlayer — styles · sci-fi HUD on a strict mono grid */

@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/jetbrains-mono-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0400-045F; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/jetbrains-mono-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0400-045F; }

:root {
  --bg: #0b0b0b;
  --bg2: #111;
  --dot: #1f1f1f;
  --line: #242424;
  --line2: #363636;
  --txt: #c8c8c8;
  --dim: #6a6a6a;
  --dim2: #444;
  --acc: #d8ff00;
  --acc-dim: rgba(216,255,0,0.10);
  --acc-glow: rgba(216,255,0,0.25);
  --font: 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }
html, body {
  background: var(--bg); margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font); color: var(--txt); font-size: 12px; letter-spacing: 0.08em;
  -webkit-font-smoothing: antialiased; touch-action: none;
}
button { font-family: inherit; letter-spacing: inherit; }

/* screens */
body.home #playerTop, body.home #menu, body.home #reticle { display: none !important; }
body.fs #reticle { display: none !important; }
body.scale #reticle { display: none !important; }   /* looking at the dome, not through it */
.a-enter-vr, .a-enter-ar { display: none !important; }
/* A-Frame lifts its canvas above everything in fullscreen — keep it under our UI */
html.a-fullscreen .a-canvas { z-index: 0 !important; }
body:not(.home) #home { display: none; }
body.home #scene { visibility: hidden; }

/* phone-only bits of text */
.mobile-only { display: none; }
body.has-gyro .mobile-only { display: inline; }
body.has-gyro p.mobile-only { display: block; }

/* gyro lock: only on devices that have one */
.gyro-only { display: none !important; }
body.has-gyro .gyro-only { display: flex !important; }

/* AR */
body.ar { background: transparent !important; }
#webcam { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -10; background: #000; display: none; }
body.ar #webcam { display: block; }
body.ar .a-canvas { background: transparent !important; }

/* icons */
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- HUD primitives ---------- */
/* dot-matrix background (fine 6px dots + faint 60px grid) */
.dotgrid {
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--dot) 0.8px, transparent 0.9px),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 6px 6px, 60px 60px, 60px 60px;
  background-position: 0 0, 0 0, 0 0;
}

/* corner brackets instead of a full frame */
.corners { position: relative; }
.corners::before, .corners::after {
  content: ''; position: absolute; width: 8px; height: 8px; pointer-events: none;
  border-color: currentColor; border-style: solid; opacity: 0.9;
}
.corners::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.corners::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* chamfered frame: cut top-right + bottom-left, 1px line via padding */
.frame {
  --cut: 12px;
  background: var(--line2); padding: 1px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.frame > * {
  clip-path: polygon(0 0, calc(100% - var(--cut) + 0.5px) 0, 100% calc(var(--cut) - 0.5px), 100% 100%, calc(var(--cut) - 0.5px) 100%, 0 calc(100% - var(--cut) + 0.5px));
}
.frame.acc { background: var(--acc); }
.frame .corners::before { top: 0; left: 0; }
.frame .corners::after { bottom: 0; right: 0; }

/* blinking status dot */
.dot { display: inline-block; width: 5px; height: 5px; background: var(--acc); margin-right: 6px; vertical-align: 1px; animation: blink 2s steps(1) infinite; }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }

/* ================= HOME ================= */
#home {
  position: fixed; inset: 0; z-index: 5000; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--dot) 0.8px, transparent 0.9px),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 6px 6px, 60px 60px, 60px 60px;
}
/* vignette so the centre reads */
#home::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%); }

.scanline {
  position: absolute; left: 0; right: 0; height: 1px; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--acc-glow), transparent);
  animation: scan 9s linear infinite;
}
@keyframes scan { 0% { top: -2px; } 100% { top: 100%; } }

.hud-corner { position: absolute; width: 22px; height: 22px; border: 0 solid var(--line2); pointer-events: none; z-index: 1; }
.hud-corner.tl { top: 14px; left: 14px; border-width: 1px 0 0 1px; }
.hud-corner.tr { top: 14px; right: 14px; border-width: 1px 1px 0 0; }
.hud-corner.bl { bottom: 14px; left: 14px; border-width: 0 0 1px 1px; }
.hud-corner.br { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }
.hud-edge { position: absolute; left: 48px; font-size: 9px; letter-spacing: 0.22em; color: var(--dim2); z-index: 1; pointer-events: none; }
.hud-edge.top { top: 20px; }
.hud-edge.bottom { bottom: 20px; }
.hud-edge .sep { margin: 0 4px; }

.home-wrap { position: relative; z-index: 2; width: 680px; max-width: calc(100vw - 32px); padding: 40px 0; }

.home-top { display: flex; align-items: center; gap: 10px; font-size: 10px; color: var(--dim); letter-spacing: 0.2em; margin-bottom: 24px;
  border-bottom: 1px dotted var(--line2); padding-bottom: 12px; }
.home-top .sep { color: var(--dim2); }
.home-top .right { margin-left: auto; color: var(--acc); }

.home-head { display: flex; align-items: center; gap: 26px; margin-bottom: 36px; position: relative; }
.home-logo { position: relative; flex-shrink: 0; height: 96px; width: 96px; opacity: 0.55; pointer-events: none; }
.home-titles { flex-grow: 1; }
.dial { margin-left: auto; }
.home-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* glitch: two colour-shifted copies flicker in for a moment every few seconds */
.home-logo .g1, .home-logo .g2 { opacity: 0; mix-blend-mode: screen; }
.home-logo .g1 { filter: sepia(1) saturate(6) hue-rotate(35deg); animation: g1 7s steps(1) infinite; } /* lime */
.home-logo .g2 { filter: sepia(1) saturate(8) hue-rotate(160deg); animation: g2 7s steps(1) infinite; } /* cyan */
.home-logo > img:first-child { animation: gbase 7s steps(1) infinite; }
@keyframes gbase {
  0%, 84.9% { opacity: 1; clip-path: none; }
  85% { opacity: 0.6; clip-path: inset(10% 0 60% 0); }
  86% { opacity: 1; clip-path: inset(40% 0 20% 0); }
  87% { opacity: 0.4; clip-path: none; }
  88%, 100% { opacity: 1; clip-path: none; }
}
@keyframes g1 {
  0%, 84.9% { opacity: 0; }
  85% { opacity: 0.9; transform: translate(-6px, 2px); clip-path: inset(0 0 55% 0); }
  86% { opacity: 0.9; transform: translate(5px, -1px); clip-path: inset(30% 0 30% 0); }
  87% { opacity: 0.7; transform: translate(-3px, 0); clip-path: inset(60% 0 0 0); }
  88%, 100% { opacity: 0; }
}
@keyframes g2 {
  0%, 84.9% { opacity: 0; }
  85% { opacity: 0.8; transform: translate(5px, -2px); clip-path: inset(50% 0 0 0); }
  86% { opacity: 0.8; transform: translate(-4px, 1px); clip-path: inset(0 0 65% 0); }
  87% { opacity: 0.6; transform: translate(3px, 0); clip-path: inset(20% 0 45% 0); }
  88%, 100% { opacity: 0; }
}
@media (max-width: 720px) { .home-logo { height: 90px; width: 90px; opacity: 0.35; } }
.dial { width: 96px; height: 96px; flex-shrink: 0; }
.dial .d-ring { fill: none; stroke: var(--line2); stroke-width: 1; }
.dial .d-ring.thin { stroke: var(--line); stroke-dasharray: 2 3; }
.dial .d-ticks { fill: none; stroke: var(--dim); stroke-width: 4; stroke-dasharray: 1 7.03; } /* 36 ticks */
.dial .d-sweep { stroke: var(--acc); stroke-width: 1; transform-origin: 50px 50px; animation: sweep 12s linear infinite; opacity: 0.9; }
.dial .d-core { fill: var(--acc); }
.dial .d-cross { stroke: var(--dim2); stroke-width: 1; }
@keyframes sweep { to { transform: rotate(360deg); } }

.home-title { margin: 0; font-size: 52px; font-weight: 700; letter-spacing: 0.18em; line-height: 1; color: #fff; }
.home-title .accent { color: var(--acc); text-shadow: 0 0 18px var(--acc-glow); }
.home-sub { font-size: 10px; color: var(--dim); letter-spacing: 0.24em; margin-top: 12px; }

.home-open {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 18px 20px;
  background: #121400; border: 0; color: var(--acc); font-size: 13px; font-weight: 700;
  letter-spacing: 0.18em; cursor: pointer; text-transform: uppercase; transition: background 0.15s, border-color 0.15s;
}
.home-open:hover { background: #1b1f00; }
.home-open .hint { margin-left: auto; font-weight: 400; color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: none; }

.home-label { margin: 36px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--txt); display: flex; gap: 10px; align-items: center; }
.home-label .tick { width: 10px; height: 1px; background: var(--acc); }
.home-label .dim { font-weight: 400; color: var(--dim); letter-spacing: 0.1em; text-transform: none; }

.mode-list { border-top: 1px dotted var(--line2); }
.mode-row {
  display: flex; align-items: center; gap: 20px; width: 100%; padding: 20px 14px;
  background: transparent; border: 0; border-bottom: 1px dotted var(--line2); border-left: 2px solid transparent;
  color: var(--txt); font-size: 14px; text-align: left; cursor: pointer; transition: background 0.12s, border-color 0.12s;
  position: relative;
}
.mode-row:hover, .mode-row:focus-visible { background: rgba(255,255,255,0.03); border-left-color: var(--acc); outline: none; }
.mode-row:hover .num { color: var(--acc); }
.mode-row .num { color: var(--dim); font-size: 12px; width: 26px; }
.mode-row .lbl { font-weight: 700; letter-spacing: 0.16em; min-width: 180px; }
.mode-row .desc { color: var(--dim); font-size: 11px; letter-spacing: 0.08em; flex-grow: 1; }
.mode-row .go { color: var(--dim2); font-size: 12px; letter-spacing: 0.1em; }
.mode-row:hover .go { color: var(--acc); }
.mode-row.last { border-left-color: var(--line2); }
.mode-row.last .num { color: var(--txt); }

.home-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; padding-top: 14px; border-top: 1px dotted var(--line2);
  font-size: 11px; color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; }
.home-foot b { color: var(--acc); font-weight: 700; margin-right: 6px; letter-spacing: 0.16em; }

/* ================= PLAYER ================= */
/* the clip: slots stacked bottom-up on the left */
#clip {
  position: fixed; left: 14px; bottom: 28px; z-index: 9998;
  display: flex; flex-direction: column-reverse; gap: 6px; max-height: calc(100vh - 90px); overflow-y: auto; padding: 2px; scrollbar-width: none;
}
#clip::-webkit-scrollbar { display: none; }
#clip.empty { display: none; }
.slot {
  --cut: 8px; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 128px; padding: 7px 22px 7px 10px;
  background: rgba(11,11,11,0.82); color: var(--dim); cursor: pointer; font-size: 9px; letter-spacing: 0.1em; border: 0;
  backdrop-filter: blur(6px); white-space: nowrap; transition: color 0.12s, background 0.12s; text-align: left;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
/* 1px chamfered frame drawn behind the slot */
.slot-frame { --cut: 8px; padding: 1px; background: var(--line2); clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); transition: background 0.12s; }
.slot-frame:hover { background: var(--txt); }
.slot-frame:hover .slot { color: var(--txt); }
.slot .n { font-size: 8px; color: var(--dim2); letter-spacing: 0.2em; }
.slot .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.slot-frame.active { background: var(--acc); }
.slot-frame.active .slot { color: var(--acc); background: #121400; }
.slot-frame.active .slot .n { color: var(--acc); }
.slot .x { position: absolute; top: 5px; right: 7px; font-size: 11px; color: var(--dim2); line-height: 1; }
.slot .x:hover { color: #fff; }
body.home #clip { display: none !important; }
@media (max-width: 720px) { #clip { left: 8px; bottom: auto; top: 52px; flex-direction: row; max-width: calc(100vw - 16px); overflow-x: auto; max-height: none; } .slot { width: 100px; } }

.ui { transition: opacity 0.35s; user-select: none; -webkit-user-select: none; }
#home, #help { user-select: none; -webkit-user-select: none; }
.ui.hidden { opacity: 0; pointer-events: none !important; }

/* reticle in the centre of the view */
#reticle { position: fixed; top: 50%; left: 50%; width: 200px; height: 200px; margin: -100px 0 0 -100px; z-index: 9990; pointer-events: none; opacity: 0.45; }
#reticle.hidden { opacity: 0; }
#reticle svg { width: 100%; height: 100%; }
#reticle .r-ring { fill: none; stroke: var(--txt); stroke-width: 0.6; opacity: 0.5; }
#reticle .r-ticks { fill: none; stroke: var(--acc); stroke-width: 4; stroke-dasharray: 0.8 30.6; opacity: 0.9; } /* 12 ticks */
#reticle .r-cross { stroke: var(--txt); stroke-width: 0.8; opacity: 0.6; }
#reticle .r-center { stroke: var(--acc); stroke-width: 1; }

#playerTop {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999; height: 46px;
  display: flex; align-items: center; gap: 18px; padding: 0 14px;
  background: linear-gradient(rgba(11,11,11,0.92), rgba(11,11,11,0)); font-size: 10px; letter-spacing: 0.18em;
}
.top-btn {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 6px;
  background: rgba(11,11,11,0.7); border: 1px solid var(--line2); color: var(--txt); font-size: 10px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.18em;
}
.top-btn:hover { border-color: var(--acc); color: var(--acc); }
.top-mode { font-weight: 700; color: #fff; white-space: nowrap; }
.top-mode .num { color: var(--acc); margin-right: 4px; }
.top-file { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.06em; flex-grow: 1; }
.top-tech { display: flex; gap: 16px; font-size: 9px; color: var(--dim); letter-spacing: 0.16em; white-space: nowrap; }
.top-tech span.on { color: var(--acc); }
@media (max-width: 720px) { .top-tech { display: none; } }

.controls {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 9999; width: 372px; max-width: calc(100vw - 24px); pointer-events: none;
}
.controls .frame { pointer-events: auto; }
.panel {
  pointer-events: auto; border: 0; color: var(--line2);
  padding: 12px; display: flex; flex-direction: column; gap: 8px; backdrop-filter: blur(10px);
  background-color: rgba(11,11,11,0.86);
  background-image: radial-gradient(rgba(255,255,255,0.05) 0.8px, transparent 0.9px);
  background-size: 6px 6px;
}
.panel.corners::before, .panel.corners::after { width: 12px; height: 12px; border-color: var(--acc); }
.panel > * { color: var(--txt); }
.row { display: flex; align-items: center; gap: 6px; width: 100%; }
.row.space { justify-content: space-between; }
.group { border-top: 1px dotted var(--line2); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.group[hidden] { display: none; }
#progressRow[hidden] { display: none; }

/* OFFSET: two axes, full width, same tick scale so the pair reads as one control */
.off-row { gap: 8px; }
.off-row .ax { font-size: 9px; font-weight: 700; color: var(--dim); letter-spacing: 0.2em; width: 10px; flex-shrink: 0; }
.off-row .lbl.val { min-width: 34px; cursor: pointer; }
.off-row .lbl.val:hover { color: #fff; }
.off-row[hidden] { display: none; }
.off-hint { margin-left: auto; font-size: 8px; color: var(--dim2); letter-spacing: 0.1em; }

/* the rig: its own slot, mirrored from the clip on the right */
#rightRail { position: fixed; right: 14px; bottom: 28px; z-index: 9998; padding: 2px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
body.home #rightRail { display: none !important; }
#rigSlot.empty { display: none; }
.slot.rig-one { width: 118px; }
#rigSlot .slot-frame:not(.active) .slot { opacity: 0.5; }

/* figure lift: the same slider, stood on end — rotating keeps the ticks and
   the thumb identical to every other control */
.lift-box { width: 44px; height: 136px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; }
.lift-box[hidden] { display: none; }
.lift-rot { width: 112px; height: 22px; transform: rotate(-90deg); flex-shrink: 0; margin: 45px 0; }
.lift-rot .slider-wrap { width: 112px; }
.lift-val { font-size: 8px; color: var(--acc); letter-spacing: 0.1em; white-space: nowrap; }

/* scale view: a square button, grey silhouette, lime once you are outside */
.slot-frame.sq { width: 44px; height: 44px; }
.slot.sq { width: 100%; height: 100%; padding: 0; align-items: center; justify-content: center; color: #9a9a9a; }
.slot-frame.sq:hover .slot { color: var(--txt); }
.slot-frame.sq.active { background: var(--acc); }
.slot-frame.sq.active .slot { color: var(--acc); background: #121400; }
.ic.big { width: 22px; height: 22px; }
#scaleFrame.gone { display: none; }
/* the rig is desktop-only; the scale button works anywhere the dome is real */
body.has-gyro #rigSlot { display: none !important; }
@media (max-width: 720px) { #rigSlot { display: none !important; } }

.b {
  height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1px solid var(--line2); color: var(--txt); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: border-color 0.12s, color 0.12s, background 0.12s; padding: 0 10px;
}
.b:hover { border-color: var(--txt); color: #fff; }
.b:active { background: var(--bg2); }
.b-menu { flex-grow: 1; letter-spacing: 0.16em; font-weight: 700; }
.vr-only { display: none !important; }
body.has-vr .vr-only { display: flex !important; }
.b-open { flex-grow: 1; border-color: rgba(216,255,0,0.4); background: var(--acc-dim); color: var(--acc); font-weight: 700; letter-spacing: 0.16em; }
.b-open:hover { background: rgba(216,255,0,0.18); color: var(--acc); border-color: var(--acc); }
.b-ic { width: 34px; padding: 0; flex-shrink: 0; }
.b-ic.sm { width: 30px; height: 28px; }
.b-ic.on { border-color: var(--acc); color: var(--acc); background: var(--acc-dim); }
.b-opt { flex-grow: 1; height: 28px; padding: 0 4px; font-size: 10px; color: var(--dim); letter-spacing: 0.06em; }
.b-opt.active { border-color: var(--acc); color: var(--acc); background: var(--acc-dim); box-shadow: inset 0 0 0 1px rgba(216,255,0,0.15); }

.status {
  flex-grow: 1; min-width: 0; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px dotted var(--line2); color: #fff; font-size: 10px; letter-spacing: 0.1em; padding: 0 8px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.lbl { font-size: 9px; color: var(--dim); letter-spacing: 0.2em; font-weight: 700; width: 38px; flex-shrink: 0; }
.lbl.val { color: var(--acc); width: auto; text-align: right; }
.tilt-name { font-size: 9px; font-weight: 700; letter-spacing: 0.18em; color: var(--acc); white-space: nowrap; padding-left: 6px; text-shadow: 0 0 8px var(--acc-glow); }
.tilt-name[hidden] { display: none; }

/* sliders with tick scales */
.slider-wrap { position: relative; flex-grow: 1; min-width: 0; }
.slider-wrap.scale { padding-bottom: 10px; }
.ticks {
  position: absolute; left: 6px; right: 6px; top: 50%; height: 6px; margin-top: -3px; pointer-events: none;
  background-image: linear-gradient(90deg, var(--line2) 1px, transparent 1px);
  background-size: var(--tick, 10%) 100%; background-position: 0 0; opacity: 0.9;
}
.ticks.fixed { --tick: 16.6667%; }   /* tilt: every 15° */
.ticks.fixed.ten { --tick: 11.1111%; } /* opacity: 10..100 */
.ticks.fixed.h { --tick: 8.3333%; }    /* offset H: -180..180, every 30° */
.ticks.fixed.v { --tick: 8.3333%; }    /* offset V: range varies, 12 steps across */
.ticks.fixed.lift { --tick: 10%; }     /* figure lift: one notch per metre-ish */
.ticks.fixed.rim { --tick: 20%; }      /* dome rim: 0..5 m, one notch per metre */
.slider-wrap.scale .ticks { top: 8px; margin-top: 0; }
.scale-labels { display: flex; justify-content: space-between; font-size: 8px; color: var(--dim2); letter-spacing: 0.05em; padding: 0 3px; margin-top: -4px; }

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 1px; background: var(--line2);
  outline: none; margin: 8px 0; cursor: pointer; position: relative; z-index: 1;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 10px; height: 14px; border-radius: 0;
  background: var(--bg); border: 1px solid var(--acc); cursor: pointer; box-shadow: 0 0 8px var(--acc-glow);
}
input[type=range]::-moz-range-thumb { width: 10px; height: 14px; border-radius: 0; background: var(--bg); border: 1px solid var(--acc); }
.progress-row { gap: 8px; }
.time { font-size: 9px; color: var(--dim); min-width: 34px; text-align: center; letter-spacing: 0.06em; }

/* ================= HELP ================= */
#help { position: fixed; inset: 0; z-index: 6000; display: none; align-items: center; justify-content: center;
  background: rgba(11,11,11,0.85); backdrop-filter: blur(6px); overflow: auto; }
body.help #help { display: flex; }
.help-wrap { width: 760px; max-width: calc(100vw - 32px); --cut: 16px; }
.help-in { background: var(--bg); padding: 26px 30px; background-image: radial-gradient(var(--dot) 0.8px, transparent 0.9px); background-size: 6px 6px; }
.help-top { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.2em; padding-bottom: 14px; border-bottom: 1px dotted var(--line2); }
.help-top .tick { width: 10px; height: 1px; background: var(--acc); }
.help-top .dim { font-weight: 400; color: var(--dim); letter-spacing: 0.1em; text-transform: none; }
.help-top .top-btn { margin-left: auto; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 36px; padding: 22px 0 6px; }
@media (max-width: 640px) { .help-grid { grid-template-columns: 1fr; } }
.help-grid h3 { margin: 0 0 8px; font-size: 10px; letter-spacing: 0.22em; color: var(--acc); font-weight: 700; }
.help-grid p { margin: 0 0 8px; font-size: 11px; line-height: 1.6; color: var(--txt); letter-spacing: 0.04em; }
.help-grid b { color: #fff; font-weight: 700; }
.keys { border-collapse: collapse; font-size: 11px; }
.keys td { padding: 3px 14px 3px 0; letter-spacing: 0.06em; color: var(--txt); }
.keys td:first-child { color: var(--acc); font-weight: 700; white-space: nowrap; }
.help-foot { margin-top: 12px; padding-top: 12px; border-top: 1px dotted var(--line2); font-size: 9px; color: var(--dim2); letter-spacing: 0.2em; }

/* drop hint */
#dropHint {
  position: fixed; inset: 16px; border: 1px dashed var(--acc); z-index: 9998; display: none;
  align-items: center; justify-content: center; font-size: 14px; letter-spacing: 0.3em; color: var(--acc);
  background: rgba(11,11,11,0.6); pointer-events: none;
}
#dropHint span { padding: 12px 24px; border: 1px solid var(--acc); background: var(--acc-dim); }
body.dragging #dropHint { display: flex; }

/* ================= RIG ================= */
#rig { position: fixed; inset: 0; z-index: 6000; display: none; align-items: center; justify-content: center;
  background: rgba(11,11,11,0.85); backdrop-filter: blur(6px); overflow: auto; }
body.rig #rig { display: flex; }
body.rig #dropHint { display: none !important; }
.rig-wrap { width: 820px; max-width: calc(100vw - 32px); --cut: 16px; margin: 24px 0; }
.rig-in { background: var(--bg); padding: 26px 30px; background-image: radial-gradient(var(--dot) 0.8px, transparent 0.9px); background-size: 6px 6px; }

/* the cross: 4 x 3 grid, faces placed by rig.js */
.rig-cross { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 520px; max-width: 100%; margin: 0 auto; padding: 22px 0 10px; }
.rig-cell { --cut: 10px; aspect-ratio: 1; padding: 1px; background: var(--line2); transition: background 0.12s;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }
.rig-cell:hover, .rig-cell.over { background: var(--txt); }
.rig-cell.filled { background: var(--acc); }
.rig-slot {
  position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  gap: 3px; padding: 10px; border: 0; cursor: pointer; text-align: left; overflow: hidden;
  background-color: rgba(11,11,11,0.9); background-size: cover; background-position: center;
  color: var(--dim); font-size: 9px; letter-spacing: 0.1em;
  clip-path: polygon(0 0, calc(100% - var(--cut) + 0.5px) 0, 100% calc(var(--cut) - 0.5px), 100% 100%, calc(var(--cut) - 0.5px) 100%, 0 calc(100% - var(--cut) + 0.5px));
}
/* keeps the labels readable over a loaded face */
.rig-slot::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(11,11,11,0.25), rgba(11,11,11,0.88)); pointer-events: none; }
.rig-slot > * { position: relative; z-index: 1; }
.rig-cell:hover .rig-slot { color: var(--txt); }
.rig-n { position: absolute; top: 10px; left: 10px; font-size: 8px; color: var(--dim2); letter-spacing: 0.2em; }
.rig-cell.filled .rig-n { color: var(--acc); }
.rig-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; color: var(--txt); }
.rig-cell.filled .rig-lbl { color: var(--acc); text-shadow: 0 0 10px var(--acc-glow); }
.rig-file { font-size: 8px; color: var(--dim2); letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rig-cell.filled .rig-file { color: var(--dim); }
.rig-x { position: absolute; top: 6px; right: 8px; font-size: 12px; color: var(--dim2); line-height: 1; z-index: 2; }
.rig-x:hover { color: #fff; }
.rig-hint { font-size: 9px; color: var(--dim2); letter-spacing: 0.12em; padding-bottom: 16px; border-bottom: 1px dotted var(--line2); }

.rig-bar { display: flex; align-items: center; gap: 8px; padding: 16px 0 10px; }
.rig-bar #rigSize { width: auto; flex-grow: 0; gap: 4px; }
.rig-bar #rigSize .b-opt { width: 46px; flex-grow: 0; }
.rig-bar #rigStitch { margin-left: auto; flex-grow: 0; width: 190px; }
.b:disabled { opacity: 0.35; cursor: default; }
.b:disabled:hover { border-color: rgba(216,255,0,0.4); color: var(--acc); }

.rig-calc { display: flex; align-items: center; gap: 14px; font-size: 9px; color: var(--dim); letter-spacing: 0.16em; }
.rig-calc .sep { color: var(--dim2); }
.rig-calc #rigCalc.warn { color: var(--acc); }
.rig-missing { margin-left: auto; color: var(--dim2); }
.rig-status { font-size: 10px; color: var(--acc); letter-spacing: 0.2em; min-height: 16px; padding-top: 8px; }

.rig-result { margin-top: 10px; padding-top: 18px; border-top: 1px dotted var(--line2); }
.rig-result[hidden] { display: none; }
.rig-ok { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--acc); }
.rig-ok .tick { width: 10px; height: 1px; background: var(--acc); }
.rig-thumbs { display: flex; gap: 12px; padding: 16px 0; align-items: flex-start; }
.rig-thumb { display: flex; flex-direction: column; gap: 6px; }
.rig-thumb img { display: block; height: 132px; border: 1px solid var(--line2); background: #000; }
.rig-thumb span { font-size: 9px; color: var(--dim); letter-spacing: 0.18em; font-weight: 700; }
.rig-go { width: 100%; height: 44px; letter-spacing: 0.2em; }
.rig-note { font-size: 9px; color: var(--dim2); letter-spacing: 0.12em; padding-top: 10px; text-align: center; }

@media (max-width: 720px) {
  .rig-cross { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; }
  .rig-cell { grid-column: auto !important; grid-row: auto !important; }
  .rig-bar { flex-wrap: wrap; }
  .rig-bar #rigStitch { margin-left: 0; width: 100%; }
}

/* A-Frame VR button */
.a-enter-vr { right: 14px; bottom: 14px; }
.a-enter-vr-button { background-color: rgba(11,11,11,0.8) !important; border: 1px solid var(--line2) !important; border-radius: 0 !important; }
