:root {
  color-scheme: dark;
  --ink: #e8f0e9;
  --muted: #b8ccc4;
  --panel: #142123;
  --line: #56716a;
  --accent: #d2c394;
  font-family: 'Yu Gothic', 'Meiryo', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #0a1316; color: var(--ink); }
[hidden] { display: none !important; }
a { color: #e8d8ab; }
button, input { font: inherit; }
button { color: inherit; background: #1d3030; border: 1px solid #62827a99; border-radius: 6px; padding: 10px 15px; min-height: 44px; cursor: pointer; touch-action: manipulation; }
button:not(:disabled):hover { border-color: var(--accent); background: #273b38; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #f2dba5; outline-offset: 3px; }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--accent); color: #192825; border-color: var(--accent); font-weight: 700; }
button.primary:not(:disabled):hover { background: #f0dfae; }
#game, #view, .vignette, #title, #hud { position: absolute; inset: 0; width: 100%; height: 100%; }
#view { display: block; touch-action: none; }
.vignette { box-shadow: inset 0 0 13vw #030a0aaa; pointer-events: none; }
#title { overflow: auto; padding: max(25px, env(safe-area-inset-top)) 7vw 28px; background: linear-gradient(90deg,#0a171bf5,#0c1a1ddc 40%,#12221f20 76%); }
.brand { font-size: 14px; letter-spacing: .08em; text-decoration: none; }
.title-copy { margin-top: clamp(42px, 9vh, 110px); max-width: 820px; text-shadow: 0 2px 12px #000; }
.eyebrow { letter-spacing: .14em; font-size: 12px; color: #bcd5cc; margin: 0 0 8px; }
h1, h2 { font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-weight: 600; }
h1 { line-height: 1.29; font-size: clamp(30px, 5.4vw, 73px); margin: 0 0 19px; }
h1 em { color: #e8d098; font-style: normal; }
.lead { font-size: clamp(15px, 1.5vw, 20px); line-height: 1.85; }
.note { line-height: 1.75; color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
#error { color: #ffc9b4; }
#hud { pointer-events: none; }
#hud button, #stick { pointer-events: auto; }
.top { position: absolute; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task { padding: 11px 15px; max-width: min(56%, 470px); background: #0c1d20e8; border-left: 2px solid #b5a778; }
.task p:last-child { margin: 0; font-size: 15px; line-height: 1.55; }
.tools { display: flex; gap: 6px; }
.tools button { font-size: 13px; padding-inline: 10px; }
#light[aria-pressed=true] { border-color: #cadaaa; }
.crosshair { position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; border-radius: 50%; background: #fff9dfbb; box-shadow: 0 0 5px #161018; }
#cue { position: absolute; top: 110px; left: max(15px, env(safe-area-inset-left)); padding: 7px 11px; background: #10272bd9; color: #efe0b5; border-radius: 5px; font-size: 13px; }
#cue:empty, #subtitle:empty { display: none; }
#subtitle { position: absolute; bottom: 18%; left: 50%; width: min(760px, 76vw); transform: translateX(-50%); margin: 0; padding: 10px 14px; background: #08181deb; line-height: 1.65; text-align: center; border: 1px solid #47716a; border-radius: 5px; }
#interaction { position: absolute; bottom: 55px; left: 50%; transform: translateX(-50%); text-align: center; max-width: 54vw; }
#interaction p { margin: 0 0 5px; font-size: 12px; color: #e3f2e5; text-shadow: 0 1px 4px #000, 0 1px 4px #000; }
#desktop-hint { position: absolute; bottom: 6px; width: 100%; text-align: center; color: #bfcbc2; font-size: 12px; text-shadow: 0 2px 5px #000; }
#touch { display: none; }
#touch button, #stick, #view { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#stick { position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); left: max(22px, env(safe-area-inset-left)); width: 100px; height: 100px; border: 1px solid #8cb8a991; border-radius: 50%; background: #20333090; touch-action: none; }
#stick i { position: absolute; left: 33px; top: 33px; width: 32px; height: 32px; border-radius: 50%; background: #b5d6bca0; pointer-events: none; }
#stick span { position: absolute; bottom: 7px; inset-inline: 0; text-align: center; font-size: 11px; }
#run, #turn-left, #turn-right { position: absolute; bottom: max(23px, env(safe-area-inset-bottom)); padding: 6px 9px; min-width: 44px; touch-action: none; }
#run { left: max(35px, env(safe-area-inset-left)); bottom: 132px; }
#turn-left { right: max(71px, calc(env(safe-area-inset-right) + 50px)); }
#turn-right { right: max(20px, env(safe-area-inset-right)); }
#modal { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 12px; background: #061013de; }
#modal section { width: min(590px, 100%); max-height: 94dvh; overflow: auto; padding: clamp(17px, 4vw, 32px); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
#modal h2 { margin: 0 0 12px; font-size: clamp(21px, 4.4vw, 30px); }
#dialog-body { line-height: 1.75; font-size: 15px; }
#dialog-body p { margin: 7px 0; }
#dialog-body label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 8px; }
#dialog-body input[type=range] { width: 45%; }
#dialog-actions { margin-bottom: 0; }
@media (pointer: coarse), (max-width: 880px) {
  #touch { display: block; }
  #desktop-hint { display: none; }
  #subtitle { bottom: 125px; width: min(690px, 90vw); font-size: 13px; }
  #interaction { bottom: 37px; }
  #cue { top: 88px; font-size: 11px; max-width: 85vw; }
  .task { padding: 7px 9px; }
  .task p:last-child { font-size: 12px; }
  .tools button { font-size: 11px; padding-inline: 6px; }
}
@media (max-height: 520px) {
  #title { padding-top: 12px; }
  .title-copy { margin-top: 18px; }
  h1 { font-size: clamp(26px, 4.6vw, 48px); margin-bottom: 6px; }
  .lead { margin-block: 6px; font-size: 13px; }
  .actions { margin-block: 9px; }
  #stick { width: 76px; height: 76px; bottom: 13px; }
  #stick i { left: 25px; top: 25px; width: 24px; height: 24px; }
  #run { bottom: 94px; }
  #subtitle { bottom: 83px; }
  #interaction { bottom: 12px; }
}
@media (max-width: 460px) and (orientation: portrait) {
  .top { flex-direction: column; }
  .task { max-width: 100%; }
  #cue { top: 138px; }
  #interaction { bottom: 104px; max-width: 67vw; }
  #subtitle { bottom: 176px; }
}

#wind { position: absolute; top: 88px; right: max(16px, env(safe-area-inset-right)); margin: 0; padding: 6px 10px; background: #12252ce8; border: 1px solid #547973; border-radius: 4px; font-size: 13px; color: #c9d5ce; }
#wind.gust { color: #193430; background: #ecdbad; border-color: #ecdbad; font-weight: 700; }
#target { pointer-events: none; }
.roof-map { position: relative; height: 220px; margin-block: 10px; border: 1px solid #58716a; background: #102023; }
.roof-map .line { position: absolute; height: 3px; background: #b9c9bd; border-radius: 5px; }
.roof-map .marker { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #f7d994; transform: translate(-50%, -50%); }
.roof-map .exit { position: absolute; top: 7px; padding: 1px 6px; transform: translateX(-50%); font-size: 12px; }
.roof-map .exit.safe { background: #374636; color: #ffe7a4; }
@media (pointer: coarse), (max-width: 880px) { #wind { top: initial; right: max(12px, env(safe-area-inset-right)); bottom: 85px; font-size: 11px; } }
@media (max-width: 460px) and (orientation: portrait) { #subtitle { bottom: 184px; } #wind { bottom: 158px; } }
@media (max-height: 520px) { .roof-map { height: 140px; } }
