:root {
  --bg: #050506;
  --chrome: #d8dce0;
  --chrome-dim: rgba(216, 220, 224, 0.52);
  --hairline: rgba(216, 220, 224, 0.14);
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: Helvetica, Arial, sans-serif;
  color: var(--chrome);
}

.stage {
  position: fixed;
  inset: 0;
  isolation: isolate;
  background: var(--bg);
}

#field {
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
  cursor: none;
  touch-action: none;
}

.chrome {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.hud-top {
  position: absolute;
  top: 22px;
  left: 28px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mono);
}

.hud-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chrome-dim);
}

.hud-work {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chrome);
}

.hud-hint {
  position: absolute;
  top: 22px;
  right: 28px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-align: right;
  text-transform: uppercase;
  color: var(--chrome-dim);
}

.meter {
  position: absolute;
  left: 28px;
  bottom: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chrome-dim);
}

.meter[hidden] { display: none; }

.meter-track {
  width: 120px;
  height: 3px;
  background: var(--hairline);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: rgba(216, 220, 224, 0.72);
  transition: width 140ms steps(2, end);
}

.meter-val {
  min-width: 3.2em;
  color: rgba(216, 220, 224, 0.7);
}

.telemetry {
  position: absolute;
  left: 28px;
  bottom: 22px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(216, 220, 224, 0.32);
}

.open {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: #050506;
  padding: 6vh 6vw;
}

.open[hidden] { display: none; }

.open img {
  display: block;
  max-width: min(1280px, 92vw);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.open-meta {
  position: absolute;
  left: 28px;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  pointer-events: none;
}

.open-meta #openTitle {
  color: rgba(232, 226, 216, 0.85);
  font-size: 11px;
}

.open-meta #openRole {
  color: rgba(154, 149, 140, 0.55);
  font-size: 9px;
}

.open-close {
  position: absolute;
  right: 28px;
  top: 26px;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(176, 170, 160, 0.6);
  font: 9px var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 0;
  pointer-events: auto;
}

.open-close:hover,
.open-close:focus-visible {
  color: rgba(232, 226, 216, 0.85);
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .hud-top { left: 16px; top: 16px; flex-direction: column; gap: 4px; }
  .hud-hint { display: none; }
  .meter { left: 16px; bottom: 42px; }
  .meter-track { width: 88px; }
  .telemetry { left: 16px; bottom: 16px; }
  .open-meta { left: 16px; bottom: 16px; }
  .open-close { right: 16px; top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .meter-fill { transition: none; }
}
