:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0b1010;
  color: #eff4ed;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow: hidden; }
#experience { position: relative; width: 100vw; height: 100dvh; isolation: isolate; }
#view, canvas { width: 100%; height: 100%; display: block; }
#view { position: absolute; inset: 0; touch-action: none; cursor: grab; }
#view:active { cursor: grabbing; }
header, .controls { position: absolute; left: 0; right: 0; display: flex; align-items: start; justify-content: space-between; pointer-events: none; }
header {
  top: 0; padding: max(16px, env(safe-area-inset-top)) clamp(14px, 3.5vw, 44px) 38px;
  background: linear-gradient(180deg, #080e0dea, #080e0d70 59%, transparent);
}
.identity { border-left: 3px solid #c4f18a; padding: 1px 0 2px 12px; }
h1 { margin: 0 0 3px; font-size: clamp(1.55rem, 3.1vw, 2.65rem); line-height: 1.06; letter-spacing: -.042em; }
.identity span { display: block; font-size: .92rem; color: #e1e8dc; }
.actions, .walk-actions { display: flex; gap: 8px; align-items: center; }
button {
  font-family: inherit;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.2;
  min-height: 42px; padding: 8px 12px; color: #eff4ed; background: #131b18e6;
  border: 1px solid #879e836e; border-radius: 8px; cursor: pointer; pointer-events: auto;
}
button:hover:not(:disabled) { background: #27362f; }
button:focus-visible { outline: 2px solid #d0fca1; outline-offset: 3px; }
#begin { background: #d1f4a3; color: #13200d; border-color: #d1f4a3; }
#begin:hover:not(:disabled) { background: #e3ffc1; }
#begin:disabled { opacity: .58; cursor: wait; }
.controls {
  bottom: 0; align-items: end;
  padding: 32px clamp(14px, 3.5vw, 44px) max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, #070c0aed, #080f0b5e 72%, transparent);
}
#room { font-weight: 700; font-size: clamp(1rem, 2vw, 1.32rem); }
.controls p { margin: 6px 0 0; font-size: .875rem; color: #e1e8dc; }
kbd { display: inline-block; margin-right: 3px; padding: 2px 4px; border: 1px solid #c3d8bf63; border-radius: 4px; background: #26362bc7; font: inherit; font-size: .76rem; }
i { display: inline-block; margin: 0 6px 2px; width: 3px; height: 3px; border-radius: 50%; background: #c6d5c2; }
#loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(340px, calc(100vw - 32px));
  display: grid; gap: 10px; padding: 18px; border: 1px solid #92ae8c5c; border-radius: 12px; background: #17211cec;
}
progress { width: 100%; height: 5px; accent-color: #c4f18a; }
#status {
  position: absolute; bottom: 78px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 30px);
  background: #14221aef; padding: 8px 12px; border-radius: 8px; border: 1px solid #73916c;
  font-size: .9rem; margin: 0;
}
#reticle { width: 5px; height: 5px; border-radius: 50%; background: #fff9; position: absolute; left: 50%; top: 50%; translate: -50% -50%; pointer-events: none; }
.direction, .touch-help { display: none; }
@media (pointer: coarse) {
  .walk-actions, .desktop-help { display: none; }
  .touch-help { display: block; }
  .direction { display: grid; grid-template-columns: repeat(3,44px); grid-template-rows: repeat(2,44px); gap: 4px; touch-action: none; }
  .direction button { width: 44px; padding: 0; font-size: 1.125rem; touch-action: none; }
  .direction button:first-child { grid-column: 2; }
  .direction button:nth-child(2) { grid-row: 2; grid-column: 1; }
  .direction button:nth-child(3) { grid-row: 2; grid-column: 2; }
  .direction button:nth-child(4) { grid-row: 2; grid-column: 3; }
}
@media (max-width: 510px) {
  #fullscreen { display: none; }
  .identity span { font-size: .8rem; }
}
