:root {
  color-scheme: dark;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: #eaf1ee;
  background: #000;
  font-synthesis: none;
  --hud-edge: 28px;
  --panel-width: 310px;
  --panel-padding: 21px;
  --accent: #b5f1df;
  --muted: #99aca5;
  --frame: rgba(181, 241, 223, .27);
  --hud-left: max(var(--hud-edge), env(safe-area-inset-left, 0px));
  --hud-right: max(var(--hud-edge), env(safe-area-inset-right, 0px));
  --hud-top: max(var(--hud-edge), env(safe-area-inset-top, 0px));
  --hud-bottom: max(var(--hud-edge), env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { min-width: 320px; }
#server-room-flashlight { position: relative; width: 100%; height: 100vh; height: 100dvh; isolation: isolate; background: #000; }
#room-stage { position: absolute; inset: 0; overflow: hidden; background: #000; cursor: none; touch-action: none; }
#room-canvas { display: block; width: 100%; height: 100%; }
#room-message { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%); width: min(480px, 80%); padding: 24px; border: 1px solid #50665e; background: #09100d; text-align: center; font: 15px/1.6 system-ui, sans-serif; color: #eaf1ee; }
#room-message[hidden] { display: none; }
#room-reticle { display: none; position: absolute; width: 22px; height: 22px; transform: translate(-50%, -50%); pointer-events: none; opacity: .65; }
#room-reticle::before, #room-reticle::after { content: ""; position: absolute; border: 1px solid #dce9e3; width: 5px; height: 5px; }
#room-reticle::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
#room-reticle::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
#room-reticle span { position: absolute; top: 10px; left: 10px; width: 2px; height: 2px; background: #eaf1ee; }
[data-phase="charging"] #room-reticle { opacity: .2; }
.hud { position: absolute; inset: 0; pointer-events: none; user-select: none; }
.hud-header { position: absolute; inset: var(--hud-top) var(--hud-right) auto var(--hud-left); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.location-mark { --location-title-scale: 1.6; --location-row-gap: 6px; --location-icon-size: calc((1 + var(--location-title-scale)) * 1em + var(--location-row-gap)); display: flex; align-items: stretch; gap: 12px; width: max-content; font-size: 10px; text-shadow: 0 2px 8px #000; }
.location-symbol { position: relative; width: var(--location-icon-size); height: var(--location-icon-size); aspect-ratio: 1; flex: 0 0 auto; }
.location-symbol svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .8; }
.location-copy { display: grid; gap: var(--location-row-gap); }
.location-copy > * { text-box-trim: trim-both; text-box-edge: cap alphabetic; }
.location-copy .eyebrow { font-size: inherit; }
.location-copy h1 { font-size: calc(1em * var(--location-title-scale)); }
@supports (text-box-trim: trim-both) {
  .location-mark { --location-icon-size: calc((1 + var(--location-title-scale)) * 1cap + var(--location-row-gap)); }
}
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; line-height: 1; letter-spacing: .2em; text-transform: uppercase; }
h1 { font-size: 16px; line-height: 1; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; margin: 0; }
.equipment { position: absolute; bottom: var(--hud-bottom); width: var(--panel-width); padding: var(--panel-padding); pointer-events: auto; touch-action: manipulation; background: linear-gradient(120deg, rgba(13, 23, 19, .88), rgba(3, 9, 7, .88)); }
.equipment::before { content: ""; position: absolute; inset: 0; border: 1px solid var(--frame); pointer-events: none; }
.beam-panel { left: var(--hud-left); }
.battery-panel { right: var(--hud-right); --accent: #a1d3f7; --frame: rgba(161, 211, 247, .27); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.panel-heading label, .panel-heading h2 { margin: 0; font-size: 11px; line-height: 1.4; font-weight: 500; text-transform: uppercase; letter-spacing: .17em; }
.panel-heading output { font-size: 30px; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; color: var(--accent); }
.beam-diagram { display: block; width: 100%; height: 90px; margin: 8px 0 2px; }
.diagram-guide { fill: none; stroke: #b5f1df; stroke-opacity: .16; stroke-width: 1; }
.beam-edge { fill: none; stroke: #b5f1df; stroke-opacity: .7; stroke-width: 1; }
.torch-body { fill: #162b23; stroke: #b5f1df; stroke-width: 1.2; }
.torch-detail { fill: none; stroke: #b5f1df; stroke-opacity: .5; stroke-width: 1; }
.range-control { position: relative; }
.range-ticks { position: absolute; top: 3px; left: 8px; right: 8px; height: 24px; background: repeating-linear-gradient(90deg, var(--frame) 0 1px, transparent 1px 10%); pointer-events: none; }
#room-width { --width-progress: 0%; position: relative; display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 32px; margin: 0; padding: 0; background: transparent; cursor: ew-resize; accent-color: var(--accent); touch-action: none; }
#room-width::-webkit-slider-runnable-track { height: 3px; border: 0; background: linear-gradient(to right, var(--accent) var(--width-progress), #38564b var(--width-progress)); }
#room-width::-moz-range-track { height: 3px; border: 0; background: #38564b; }
#room-width::-moz-range-progress { height: 3px; background: var(--accent); }
#room-width::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 24px; margin-top: -10.5px; border: 2px solid var(--accent); border-radius: 1px; background: #15281f; box-shadow: inset 0 0 0 3px #15281f, inset 0 0 0 4px var(--accent); }
#room-width::-moz-range-thumb { width: 9px; height: 21px; border: 2px solid var(--accent); border-radius: 1px; background: #15281f; }
#room-width:focus-visible { outline: 2px solid #eafff7; outline-offset: 5px; }
#room-width:disabled { cursor: not-allowed; opacity: .4; }
.range-labels { display: flex; justify-content: space-between; margin-top: 3px; font-size: 10px; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.range-endpoint { display: grid; gap: 2px; }
.range-endpoint:last-child { text-align: right; }
.range-limit { font-family: system-ui, sans-serif; font-size: 11px; font-weight: 300; line-height: 1.4; text-transform: none; }
.battery-diagram { display: block; width: 100%; height: auto; margin: 19px 0 14px; overflow: visible; }
.battery-shell { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-opacity: .6; }
.battery-rails { fill: none; stroke: var(--accent); stroke-opacity: .25; }
#battery-cells path { fill: var(--accent); }
.battery-empty { opacity: .12; }
.battery-full { opacity: .9; }
.battery-readout { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#room-phase { color: var(--accent); }
#room-time { color: #d6dfda; white-space: nowrap; }
.charge-note { display: flex; align-items: center; gap: 7px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--frame); color: var(--muted); font-size: 10px; line-height: 1.5; letter-spacing: .02em; }
.charge-note svg { width: 10px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1; }
.aim-hint { position: absolute; bottom: var(--hud-bottom); left: 50%; transform: translateX(-50%); display: grid; gap: 4px; margin: 0; font-size: 11px; line-height: 1.4; letter-spacing: .015em; color: var(--muted); text-align: center; white-space: nowrap; text-shadow: 0 1px 6px #000; }
.aim-hint .mobile-hint { display: none; }
[data-battery-color="yellow"] .battery-panel { --accent: #f1d86b; --frame: rgba(241, 216, 107, .3); }
[data-battery-color="red"] .battery-panel { --accent: #ff8383; --frame: rgba(255, 131, 131, .3); }
[data-battery-color="green"] .battery-panel { --accent: #8de6a8; --frame: rgba(141, 230, 168, .3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.no-script { position: absolute; left: 20%; right: 20%; top: 40%; text-align: center; }
@media (max-width: 1279px) { :root { --hud-edge: 22px; --panel-width: 280px; --panel-padding: 18px; } .aim-hint { bottom: calc(var(--hud-edge) + 6px); } .beam-diagram { height: 82px; } }
@media (max-width: 1023px) { :root { --hud-edge: 18px; --panel-width: 264px; } .aim-hint { display: none; } }
@media (min-width: 1440px) { :root { --hud-edge: 32px; --panel-width: 330px; --panel-padding: 24px; } .beam-diagram { height: 100px; } }
@media (min-width: 1920px) { :root { --hud-edge: 40px; --panel-width: 360px; --panel-padding: 26px; } h1 { font-size: 18px; } .eyebrow, .panel-heading label, .panel-heading h2 { font-size: 12px; } .panel-heading output { font-size: 34px; } .beam-diagram { height: 110px; } .range-labels, .charge-note, .aim-hint { font-size: 11px; } .battery-readout { font-size: 12px; } }
@media (min-width: 2560px) { :root { --hud-edge: 48px; --panel-width: 400px; --panel-padding: 28px; } .beam-diagram { height: 120px; } .panel-heading output { font-size: 38px; } }
@media (min-width: 1920px) { .location-mark { font-size: 12px; --location-title-scale: 1.5; } }
@media (max-height: 720px) { :root { --hud-edge: 20px; --panel-padding: 16px; } .beam-diagram { height: 70px; margin: 5px 0 0; } .battery-diagram { margin: 12px 0; } .charge-note { margin-top: 12px; padding-top: 9px; } }

/* Touch targets apply to tablets and hybrid laptops as well as phones. */
@media (any-pointer: coarse), (max-width: 1023px) {
  #room-width { height: 44px; }
  #room-width::-webkit-slider-thumb { width: 26px; height: 32px; margin-top: -14.5px; }
  #room-width::-moz-range-thumb { width: 22px; height: 28px; }
  .range-ticks { top: 9px; left: 13px; right: 13px; }
  .range-labels, .charge-note { font-size: 11px; }
}
@media (max-width: 1023px) {
  .aim-hint { display: grid; top: calc(var(--hud-top) + 60px); bottom: auto; }
  .aim-hint .desktop-hint { display: none; }
  .aim-hint .mobile-hint { display: block; }
}
/* Phones: battery at the top, a full-width beam control within thumb reach. */
@media (max-width: 599px) {
  :root { --hud-edge: 12px; --panel-padding: 14px; }
  .location-mark { gap: 8px; --location-title-scale: 1.3; }
  .eyebrow { font-size: 10px; letter-spacing: .12em; }
  h1 { font-size: 13px; letter-spacing: .1em; }
  .beam-panel { width: auto; right: var(--hud-right); }
  .panel-heading { gap: 8px; }
  .panel-heading label, .panel-heading h2 { letter-spacing: .08em; }
  .panel-heading output { font-size: 26px; }
  .beam-diagram { height: 54px; margin: 4px 0 0; }
  .battery-panel { top: var(--hud-top); bottom: auto; width: 148px; padding: 12px; }
  .battery-panel .panel-heading output { font-size: 23px; }
  .battery-diagram { margin: 10px 0; }
  .battery-readout { flex-direction: column; gap: 2px; }
  .charge-note { display: none; }
  .aim-hint { top: calc(var(--hud-top) + 144px); max-width: calc(100% - var(--hud-left) - var(--hud-right)); }
  #room-message { top: 42%; padding: 16px; font-size: 13px; }
}
@media (max-width: 599px) and (max-height: 620px) {
  .beam-diagram { display: none; }
  .range-control { margin-top: 8px; }
}
/* Short landscape phones keep both controls low and leave the center clear. */
@media (max-width: 1023px) and (max-height: 500px) and (orientation: landscape) {
  :root { --hud-edge: 12px; --panel-padding: 12px; }
  .beam-panel { width: min(240px, calc((100% - var(--hud-left) - var(--hud-right) - 20px) / 2)); right: auto; }
  .battery-panel { width: min(220px, calc((100% - var(--hud-left) - var(--hud-right) - 20px) / 2)); top: auto; bottom: var(--hud-bottom); padding: 12px; }
  .beam-diagram, .charge-note { display: none; }
  .panel-heading output { font-size: 24px; }
  .range-control { margin-top: 6px; }
  .battery-diagram { margin: 10px 0; }
  .battery-readout { flex-direction: column; gap: 2px; }
  .aim-hint { top: var(--hud-top); bottom: auto; }
}
