:root {
  --bg: #040405;
  --chrome: #d4d8dc;
  --chrome-dim: rgba(212, 216, 220, 0.5);
  --hairline: rgba(212, 216, 220, 0.12);
  --standby: #c83228;
  --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);
}

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

body.standby #room {
  cursor: 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.22em;
  text-transform: uppercase;
  color: var(--chrome-dim);
  transition: color 420ms ease, letter-spacing 420ms ease;
}

body.standby .hud-label {
  color: rgba(200, 50, 40, 0.72);
  letter-spacing: 0.28em;
}

.hud-work {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--chrome);
  max-width: min(48vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.standby-badge {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(200, 50, 40, 0.55);
  animation: standbyPulse 3.2s ease-in-out infinite;
}

@keyframes standbyPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

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

.open {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: #040405;
  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.05);
}

.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(228, 232, 236, 0.88);
  font-size: 11px;
}

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

.open-close {
  position: absolute;
  right: 28px;
  top: 26px;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(176, 180, 184, 0.58);
  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(228, 232, 236, 0.88);
  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; }
  .standby-badge { top: 16px; font-size: 9px; }
  .telemetry { left: 16px; bottom: 16px; }
  .open-meta { left: 16px; bottom: 16px; }
  .open-close { right: 16px; top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .standby-badge { animation: none; opacity: 0.7; }
}
