:root{
  --pane-image: url("img/prisoners.gif");
  --hud-w: 420px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:#000;
  color:#e7ecff;
  font: 400 16px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  overflow:hidden;
}

#stars{
  position:fixed;
  inset:0;
  display:block;
  z-index:0;
}

.title{
  position:fixed;
  top:22px;
  left:50%;
  transform:translateX(-50%);
  z-index:3;
  font-size:32px;
  font-weight:600;
  letter-spacing:.2px;
  text-shadow:0 2px 18px rgba(0,0,0,.65);
  user-select:none;
}

.stage{
  position:fixed;
  inset:0;
  z-index:1;
  display:grid;
  place-items:center;
  pointer-events:none;
}

.wrapper{
  width:min(82vmin, 900px);
  aspect-ratio: 3 / 2;
  display:grid;
  place-items:center;
  transform-style:preserve-3d;
  will-change: transform;
  pointer-events:auto;
}

.pane{
  position:relative;
  width:100%;
  height:100%;
  border-radius:8px;
  background-image: var(--pane-image);
  background-size:cover;
  background-position:center;
  box-shadow:
    0 0 0 2px rgba(255,255,255,.45),
    0 22px 70px rgba(0,0,0,.65);
  overflow:hidden;
}

/* subtle sheen */
.pane::after{
  content:"";
  position:absolute;
  inset:-40%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), rgba(255,255,255,0) 55%);
  transform: rotate(18deg);
  pointer-events:none;
}

/* Orientation markers */
.corner{
  position:absolute;
  font-size:14px;
  font-weight:700;
  letter-spacing:.5px;
  color:rgba(255,255,255,.9);
  text-shadow: 0 0 6px rgba(0,0,0,.8);
  pointer-events:none;
  user-select:none;
}
.corner.a{ top:8px; left:10px; }
.corner.b{ top:8px; right:10px; }
.corner.c{ bottom:8px; right:10px; }
.corner.d{ bottom:8px; left:10px; }

.pane-video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}

.footer{
  position:fixed;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  z-index:2;
  font-size:13px;
  opacity:.85;
  text-shadow:0 2px 12px rgba(0,0,0,.6);
  user-select:none;
}

/* Floating buttons */
.info-btn,
.audio-btn{
  position:fixed;
  z-index:6;
  width:40px;
  height:40px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color:#e7ecff;
  cursor:pointer;
  display:grid;
  place-items:center;
  backdrop-filter: blur(10px);
}

.info-btn{ right:18px; bottom:18px; }
.audio-btn{ right:18px; top:18px; }

.info-btn.is-on,
.audio-btn.is-on{
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.14);
}

/* HUD + backdrop */
.hud-backdrop{
  position:fixed;
  inset:0;
  z-index:4;
  background: rgba(0,0,0,.25);
}

.hud{
  position:fixed;
  right:18px;
  bottom:70px; /* above info button */
  width: min(var(--hud-w), calc(100vw - 36px));
  z-index:5;
  padding:14px 14px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(12,14,20,.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}

.group{ display:flex; gap:10px; flex-wrap:wrap; }

.group.sliders{
  flex-direction:column;
  gap:10px;
  margin-bottom:12px;
}

.row{
  display:grid;
  grid-template-columns: 86px 1fr 64px;
  gap:10px;
  align-items:center;
}

.row label{
  font-size:13px;
  opacity:.95;
  user-select:none;
}

.row .val{
  font-variant-numeric: tabular-nums;
  font-size:13px;
  text-align:right;
  opacity:.9;
  user-select:none;
}

input[type="range"]{
  width:100%;
  touch-action: pan-y;
}

.group.actions{
  justify-content:flex-start;
  gap:10px;
}

.hud button,
.hud .file{
  padding:7px 10px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:10px;
  background: rgba(255,255,255,.06);
  color:#e7ecff;
  cursor:pointer;
  font-size:14px;
  line-height:1;
  user-select:none;
}

.hud button:active{ transform: translateY(1px); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  accent-color: #e7ecff;
  cursor: pointer;
}

/* Labels hidden by default */
.pane .corner {
  opacity: 0;
}

.file{ display:inline-flex; align-items:center; gap:8px; }
.file input{ display:none; }

.hidden-input{
  position:fixed;
  left:-9999px;
  width:1px;
  height:1px;
  opacity:0;
}

/* Mobile tweaks */
@media (max-width: 620px){
  .title{ top:16px; font-size:26px; }
  .hud{
    left:50%;
    right:auto;
    transform: translateX(-50%);
    bottom:70px;
    width: calc(100vw - 24px);
  }
  .row{ grid-template-columns: 76px 1fr 54px; gap:8px; }
}

@media (max-height: 540px){
  .hud{ bottom:60px; }
  .footer{ display:none; }
}
