/* M104 - 3D shell page styles. Dark basalt + lava orange, matching the game's menu idiom. */
html, body { margin: 0; height: 100%; background: #0b0710; overflow: hidden; }
body { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #ffe8c8; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.28s ease; z-index: 40; }
#fade.on { opacity: 1; }
#hud { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; pointer-events: none; }
#hud .title { font-weight: 700; letter-spacing: 3px; color: #ffd9a8; text-shadow: 0 0 10px rgba(255,140,50,0.6); }
#hud .area { color: #d8a06c; letter-spacing: 2px; font-size: 13px; }
#hud .spacer { flex: 1; }
#hud button { pointer-events: auto; }
.btn { font: 700 13px ui-monospace, Consolas, monospace; letter-spacing: 2px; color: #ffe8c8; background: rgba(60,24,12,0.85); border: 2px solid #b05a24; border-radius: 6px; padding: 8px 16px; cursor: pointer; }
.btn:hover:not(:disabled) { background: rgba(120,50,20,0.95); border-color: #ffb060; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 11px; }
#help { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; padding: 8px 14px; font-size: 12px; color: #b98a63; letter-spacing: 1px; pointer-events: none; display: flex; gap: 18px; flex-wrap: wrap; }
#active { color: #ffb060; }
#settings { position: fixed; top: 54px; right: 12px; width: 300px; z-index: 30; background: rgba(12,5,10,0.94); border: 2px solid #8a4a1e; border-top: 3px solid #ff8c3a; border-radius: 8px; padding: 14px 16px; max-height: calc(100% - 130px); overflow-y: auto; }
#settings.hidden { display: none; }
.setHead { display: flex; justify-content: space-between; align-items: center; letter-spacing: 3px; color: #ffcf9e; margin-bottom: 10px; }
.setSec { margin-bottom: 12px; }
.setTitle { font-size: 11px; letter-spacing: 2px; color: #ffb060; margin-bottom: 6px; }
.segRow { display: flex; gap: 8px; }
.seg { flex: 1; font: 700 12px ui-monospace, Consolas, monospace; letter-spacing: 1px; color: #ffe8c8; background: rgba(60,24,12,0.7); border: 2px solid #7a3c1a; border-radius: 5px; padding: 7px 6px; cursor: pointer; }
.seg.sel { border-color: #ffb060; background: rgba(120,50,20,0.95); }
.setSub { font-size: 11px; color: #b98a63; margin-top: 5px; min-height: 14px; }
.setFoot { font-size: 11px; color: #7a5a40; margin-top: 6px; }
#toast { position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%); z-index: 35; background: rgba(12,5,10,0.92); border: 2px solid #b05a24; border-radius: 6px; padding: 10px 18px; font-size: 13px; letter-spacing: 1px; display: none; max-width: 80%; text-align: center; }
#toast.show { display: block; }
/* M104-r18: contextual sit/stand prompt for the lobby couches (app.js owns
   the element; shown only in the lobby near a seat, or while seated). */
#sitPrompt { position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%); z-index: 35; background: rgba(12,5,10,0.88); border: 2px solid #b05a24; border-radius: 6px; padding: 8px 16px; font-size: 13px; letter-spacing: 1px; display: none; white-space: nowrap; }
#sitPrompt.show { display: block; }

/* M104-r1: twin-stick touch UI for the mobile flat preview. Left stick = walk,
   right stick = look. Buttons ride above the right stick. Zones sit below the
   HUD/settings so panel touches always reach the panel first. */
#touchUI { position: fixed; inset: 0; z-index: 15; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; }
#joyZone { position: absolute; left: 0; top: 35%; width: 50%; height: 65%; pointer-events: none; touch-action: none; }
#lookZone { position: absolute; right: 0; top: 35%; width: 50%; height: 65%; pointer-events: none; touch-action: none; }
#touchUI.armed #joyZone, #touchUI.armed #lookZone { pointer-events: auto; }
.tStick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255,176,96,0.45); background: rgba(40,18,10,0.22); display: none; pointer-events: none; }
.tStick.on { display: block; }
.tKnob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; border-radius: 50%; border: 2px solid rgba(255,176,96,0.75); background: rgba(150,64,24,0.78); transform: translate(-50%,-50%); }
#touchBtns { position: absolute; right: 14px; bottom: 180px; display: flex; align-items: flex-end; gap: 12px; }
/* M104-r13: the left movement stick ports the 2D M113/M114/M115 proportions -
   200px base disc, 84px knob, rim = 100px. The knob renders two-state like
   2D M114: RUN stays connected to the pad; SPRINTING detaches with the amber
   glow, so off-the-pad + glow reads as sprint and on-the-pad reads as
   run/recovering. Transition on box-shadow only; transform stays instant. */
#stickL { width: 200px; height: 200px; margin: -100px 0 0 -100px; }
#stickL .tKnob { width: 84px; height: 84px; }
#stickL .tKnob.sprinting { border-color: #ffd9a0; background: rgba(196,96,30,0.9);
  box-shadow: 0 0 18px 8px rgba(255,160,60,0.75), 0 0 34px 14px rgba(255,90,20,0.35);
  transition: box-shadow 90ms ease-out; }
/* M104-r13: fullscreen corner button (mirrors the 2D game's #fsToggle, M60/M70)
   + shared menu-nav visible focus. btnFs sits bottom-right: clear of the HUD
   row, the vitals, and the touch clusters (which ride at bottom:180px). */
#btnFs { position: fixed; right: 14px; bottom: 14px; width: 44px; height: 44px; z-index: 20;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  color: #ffe8c8; background: rgba(60,24,12,0.85); border: 2px solid #b05a24; border-radius: 8px; }
#btnFs:hover { background: rgba(120,50,20,0.95); border-color: #ffb060; }
#btnFs svg { width: 22px; height: 22px; display: block; pointer-events: none; }
#btnFs .icExit { display: none; }
#btnFs.on .icOn { display: none; }
#btnFs.on .icExit { display: block; }
/* M104-r15: volume control — the 2D #audioToggle/#volumeSlider idiom as a
   bottom-left corner chip (mirrors #btnFs). The slider docks to its right and
   auto-hides (the .closed class) 3 s after the last touch. */
#btnVol { position: fixed; left: 14px; bottom: 14px; width: 44px; height: 44px; z-index: 20;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  color: #ffe8c8; background: rgba(60,24,12,0.85); border: 2px solid #b05a24; border-radius: 8px; }
#btnVol:hover { background: rgba(120,50,20,0.95); border-color: #ffb060; }
#btnVol svg { width: 22px; height: 22px; display: block; pointer-events: none; }
#btnVol .icOff { display: none; }
#btnVol.muted .icOn { display: none; }
#btnVol.muted .icOff { display: block; }
#btnVol.muted { color: #9a7355; border-color: #6e4a26; }
#volSlider { position: fixed; left: 14px; bottom: 66px; width: 160px; height: 44px; z-index: 20;
  margin: 0; padding: 0 6px; box-sizing: border-box; cursor: pointer; background: rgba(12,5,10,0.9);
  border: 2px solid #8a4a1e; border-radius: 8px; -webkit-appearance: none; appearance: none;
  touch-action: none; transition: opacity 0.18s ease, transform 0.18s ease; }
#volSlider.closed { opacity: 0; transform: translateY(12px); pointer-events: none; }
#volSlider:focus { outline: none; }
#volSlider::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: rgba(60,24,12,0.85); border: 2px solid #8a4a1e; box-sizing: border-box; }
#volSlider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #ffb060; border: 2px solid #571d0e; box-shadow: 0 0 8px rgba(255,140,50,0.5); }
#volSlider::-moz-range-track { height: 8px; border-radius: 4px; background: rgba(60,24,12,0.85); border: 2px solid #8a4a1e; box-sizing: border-box; }
#volSlider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #ffb060; border: 2px solid #571d0e; box-shadow: 0 0 8px rgba(255,140,50,0.5); }
#volSlider:not(.closed).muted { opacity: 0.45; }
/* M104-r13: small screens - the lobby HUD carries 4 buttons (ENTER VR,
   SETTINGS, 180°, GAMES HUB); shrink the row so none clip off the edge. */
@media (max-width: 700px) {
  #hud { gap: 6px; padding: 8px 10px; }
  #hud .title { display: none; } /* phones: the area label suffices; frees ~110px for the 4 buttons */
  #hud .area { font-size: 11px; }
  #hud .btn { padding: 7px 9px; font-size: 12px; }
}
/* M104-r13: visible focus for menu navigation (gamepad roving highlight +
   keyboard). Every menu option is a real <button>, so Tab/Enter work natively. */
.navFocus { outline: 3px solid #ffd9a0 !important; outline-offset: 2px; }
button:focus-visible { outline: 3px solid #ffd9a0; outline-offset: 2px; }
.tBtn { pointer-events: auto; touch-action: none; width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,176,96,0.55); background: rgba(40,18,10,0.45); color: #ffe8c8; font: 700 11px ui-monospace, Consolas, monospace; letter-spacing: 1px; padding: 0; cursor: pointer; }
.tBtn.tJump { width: 96px; height: 96px; font-size: 15px; }
.tBtn.on { background: rgba(150,64,24,0.78); border-color: #ffb060; }

/* M104-r7: vitals HUD (HP green / STA purple, the 2D game's bar colors) + red
   damage vignette. Bars are always visible; staMax growth (purple vials)
   is reflected in the STA bar's scale. */
#vitals { position: fixed; top: 56px; left: 14px; z-index: 20; pointer-events: none; display: flex; flex-direction: column; gap: 6px; }
.vrow { display: flex; align-items: center; gap: 8px; }
.vrow .vlabel { font-size: 11px; letter-spacing: 2px; color: #ffd9a8; width: 26px; }
.vbar { width: 170px; height: 12px; background: rgba(20,10,8,0.75); border: 1px solid #7a4a28; border-radius: 3px; overflow: hidden; }
.vfill { height: 100%; width: 100%; transition: width 0.12s linear; }
#hpFill { background: #57e06a; }
#staFill { background: #b05ce8; }
.vrow.hit .vfill { animation: hpPulse 0.6s ease; }
@keyframes hpPulse { 50% { filter: brightness(1.8); } }
.vnum { font-size: 11px; color: #ffe8c8; min-width: 30px; }
#dmgFlash { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255,0,0,0) 55%, rgba(255,20,10,0.55) 100%); }

/* M104-r7: narrow screens - the hud buttons wrap to two rows, so the vitals
   panel drops below them and the bars narrow to fit. */
@media (max-width: 640px) {
  #hud .title { font-size: 12px; letter-spacing: 2px; }
  .btn { padding: 6px 10px; font-size: 11px; }
  #vitals { top: 108px; }
  .vbar { width: 120px; }
}

/* M104-r4: level-complete panel (fire gameplay). The sim freezes behind it. */
#completePanel { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 45; background: rgba(12,5,10,0.95); border: 2px solid #8a4a1e; border-top: 3px solid #ff8c3a; border-radius: 10px; padding: 26px 38px; text-align: center; }
#completePanel.hidden { display: none; }
/* M104-r19: pause panel - the complete panel's idiom (dark panel, .btn
   row); the sim is frozen behind it by app.js's paused state. */
#pausePanel { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 45; background: rgba(12,5,10,0.95); border: 2px solid #8a4a1e; border-top: 3px solid #ff8c3a; border-radius: 10px; padding: 26px 38px; text-align: center; }
#pausePanel.hidden { display: none; }
.pauseRow { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
/* M104-r19: touch pause button - top-right below the header row (which
   ends ~54px), above the touch layer's zones; on narrow screens the
   header wraps to two rows, so the button drops below them. */
#tPause { position: absolute; top: 66px; right: 14px; font-size: 15px; }
@media (max-width: 700px) { #tPause { top: 112px; } }
.compTitle { font-size: 22px; font-weight: 700; letter-spacing: 4px; color: #ffcf9e; text-shadow: 0 0 12px rgba(255,140,50,0.7); }
.compWorld { margin-top: 8px; font-size: 14px; letter-spacing: 3px; color: #ffb060; }
.compTime { margin: 12px 0 18px; font-size: 20px; letter-spacing: 2px; color: #ffe8c8; }
.compRow { display: flex; gap: 12px; justify-content: center; }
