:root {
  --ui-fade: 0.75s;
  --pane-w: 60vmin;
  --pane-h: calc(var(--pane-w) / 1.5);
  --pane-max-w: min(82vmin, 900px);
  --pane-max-h: min(70vmin, 720px);
  --pane-image: url("img/prisoners.gif");
}
* { 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, .credit {
  position: fixed; width: 100%; text-align: center; letter-spacing: .04em;
  text-shadow: 0 2px 14px rgba(0,0,0,.65); z-index: 3;
}
.title { top: 18px; font-size: clamp(20px,3.6vmin,44px); font-weight: 700; }
.credit { bottom: 14px; font-size: 12px; opacity: .85; }
.zone { position: fixed; inset: 0; display: grid; place-items: center; perspective: 1200px; z-index: 2; }
.wrapper { will-change: transform; transform-origin: 50% 50%; user-select: none; touch-action: none; cursor: grab; }
.wrapper.dragging { cursor: grabbing; }
.pane {
  width: var(--pane-w); height: var(--pane-h);
  transform-origin: 50% 50%;
  background:
    radial-gradient(100% 120% at 10% 10%, rgba(255,255,255,.25), transparent 45%),
    linear-gradient(105deg,
      rgba(255,255,255,0.28) 0%,
      rgba(255,255,255,0.12) 24%,
      rgba(255,255,255,0.0) 50%,
      rgba(0,150,255,0.08) 64%,
      rgba(255,255,255,0.2) 100%),
    var(--pane-image) center/cover no-repeat;
  border: 1.5px solid rgba(255,255,255,.85);
  box-shadow:
    inset 0 0 22px rgba(255,255,255,.15),
    inset 0 0 2px rgba(255,255,255,.9),
    0 20px 40px rgba(0,0,0,.55);
  /* Ensure pane itself doesn't "eat" interaction vs wrapper; both are fine */
  pointer-events: auto;
}
.hud {
  position: fixed; left: 14px; bottom: 14px; display:flex; gap:14px; align-items:center;
  padding:10px 12px; background: rgba(10,14,24,.56); border:1px solid rgba(255,255,255,.18);
  border-radius:12px; backdrop-filter: blur(6px); z-index: 4; transition: opacity var(--ui-fade) ease;
}
.hud.hide { opacity: 0; pointer-events: none; }
.hud label { display:flex; align-items:center; gap:8px; font-size:12px; opacity:.9; }
.hud input[type="range"] { width: 120px; }
.hud .val { min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; opacity: .95; }
.hud .file { padding:6px 10px; border:1px solid rgba(255,255,255,.25); border-radius:8px; cursor:pointer; }
.hud .file input { display:none; }
.hud button {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: #e7ecff;
  cursor: pointer;
}
.hud button:active { transform: translateY(1px); }
@media (max-width:700px){
  .hud{ left:50%; transform: translateX(-50%); bottom:10px; gap:10px; flex-wrap: wrap; }
  .hud input[type="range"]{ width:90px; }
  .hud .val { min-width: 48px; }
}
