:root { color-scheme: dark; font-family: system-ui, sans-serif; color: #fff1d7; background: #21171c; }
* { box-sizing: border-box; }
body { margin: 0; }
main { position: relative; isolation: isolate; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
header { position: absolute; top: 18px; left: 20px; right: 20px; display: flex; align-items: center; gap: 12px; pointer-events: none; }
h1, #room, #hint, #loading { margin: 0; border: 1px solid #be9264; background: #271b22eb; padding: 9px 13px; }
h1 { font-family: Georgia, 'Yu Mincho', serif; font-size: clamp(19px, 2.6vw, 29px); font-weight: 700; }
#room { font-size: 13px; color: #f5dcbc; }
.tools { pointer-events: auto; margin-left: auto; display: flex; gap: 6px; }
button, a { color: inherit; border: 1px solid #be9264; background: #271b22eb; padding: 9px 12px; font: inherit; text-decoration: none; cursor: pointer; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid #ffdb96; outline-offset: -3px; }
button:active, button[data-pressed='true'], a:hover { background: #704831; }
button:disabled { opacity: .5; cursor: default; }
#loading { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); max-width: 88vw; width: max-content; }
#hint { position: absolute; bottom: 18px; left: 20px; font-size: 13px; }
.directions { position: absolute; right: 20px; bottom: 18px; display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; touch-action: none; }
.directions button { padding: 0; height: 44px; }
.directions button:first-child { grid-column: 2; }
.directions button:nth-child(2) { grid-column: 1; }
@media (max-width: 620px) {
  header { top: 10px; left: 10px; right: 10px; display: grid; grid-template-columns: 1fr auto; gap: 5px; }
  h1, #room, #hint { padding: 6px 8px; }
  h1, #room { justify-self: start; }
  #room { grid-row: 2; }
  .tools { grid-area: 1 / 2; font-size: 12px; }
  #hint { max-width: calc(100% - 176px); left: 10px; bottom: 12px; font-size: 11px; }
  .directions { bottom: 12px; right: 10px; }
}
