:root {
  color-scheme: light;
  --forest: #123f3b;
  --jade: #1f6f64;
  --ivory: #fff9e9;
  --mist: #d0e8de;
  --sun: #f5ac52;
  --orange: #ed9050;
  --body-font: "IBM Plex Sans Thai", Tahoma, sans-serif;
  --title-font: "Mitr", "IBM Plex Sans Thai", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: #7bafa2; color: var(--forest); font: 400 15px/1.6 var(--body-font); -webkit-font-smoothing: antialiased; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button, a { touch-action: manipulation; }
button:disabled { opacity: .6; cursor: wait; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, canvas:focus-visible { outline: 3px solid var(--sun); outline-offset: 5px; }
button { -webkit-appearance: none; appearance: none; }
svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.explore-shell, #world { position: fixed; inset: 0; }
#world { overflow: hidden; touch-action: none; }
#world canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.start-screen { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 112px 6vw 100px; color: var(--ivory); background: linear-gradient(90deg, rgba(7, 41, 34, .9), rgba(11, 47, 39, .68) 32%, rgba(11, 47, 39, .08) 68%), linear-gradient(0deg, rgba(10, 40, 33, .65), transparent 24%); }
.start-header { position: absolute; top: max(28px, env(safe-area-inset-top)); left: 4vw; right: 4vw; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.explore-brand { display: inline-flex; align-items: center; gap: 12px; font: 500 24px/1.15 var(--title-font); }
.brand-symbol { display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid #fff9e940; border-radius: 50%; }
.brand-symbol svg { width: 31px; height: 31px; stroke-width: 1.1; }
.explore-brand small { display: block; margin-top: 5px; font: 400 10px/1.4 var(--body-font); opacity: .8; }
.home-link { display: flex; align-items: center; gap: 13px; padding: 9px 17px; border: 1px solid #fff9e966; border-radius: 25px; font-size: 12px; background: #123f3b30; }
.home-link:hover { background: #123f3b80; }
.home-link span { font-size: 18px; }
.start-copy { width: min(510px, 47vw); }
.adventure-label { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; font-size: 13px; color: #d3e7ce; }
.adventure-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 12px #f5ac5240; }
.start-copy h1 { margin: 0 0 24px -4px; font: 500 clamp(62px, 6.8vw, 106px)/1.18 var(--title-font); letter-spacing: -.04em; text-shadow: 0 5px 35px #123f3b33; }
.start-description { margin: 0 0 30px; font-size: clamp(14px, 1.18vw, 17px); line-height: 1.9; color: #e0ebdc; }
.start-actions { display: flex; align-items: flex-start; flex-direction: column; gap: 12px; }
.primary-button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 26px; padding: 13px 25px; border: 0; border-radius: 10px; background: var(--orange); color: #273b2e; font-weight: 600; box-shadow: 0 4px 0 #ae6337, 0 8px 24px #082a2a25; transition: background .15s, transform .15s; }
.primary-button:not(:disabled):hover { background: #ffb46e; transform: translateY(-1px); }
.primary-button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 2px 0 #ae6337; }
.primary-button svg { width: 22px; height: 22px; }
.start-button { min-width: 234px; min-height: 59px; font-size: 18px; gap: 38px; }
.continue-button { padding: 7px 0; color: var(--ivory); background: none; border: 0; border-bottom: 1px solid #fff9e960; font-size: 13px; }
.start-save-note { margin: 19px 0 0; color: #c5d9c9; font-size: 11px; }
.loading-status { display: flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 12px; color: #e2edce; }
.loading-spinner { width: 13px; height: 13px; border: 2px solid #fff9e940; border-top-color: var(--sun); border-radius: 50%; animation: loading-turn 1s linear infinite; }
@keyframes loading-turn { to { transform: rotate(360deg); } }
.scene-caption { position: absolute; bottom: 138px; right: 5vw; display: flex; align-items: center; gap: 15px; padding: 16px 0; color: white; text-shadow: 0 2px 6px #123f3b; }
.scene-caption > svg { width: 37px; height: 37px; stroke-width: 1.1; opacity: .9; }
.scene-caption span { font-size: 11px; }
.scene-caption strong { display: block; margin-top: 4px; font-size: 15px; font-weight: 500; }
.start-footer { position: absolute; bottom: max(26px, env(safe-area-inset-bottom)); left: 4vw; right: 4vw; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid #fff9e929; }
.start-controls { display: flex; flex-wrap: wrap; gap: 23px; color: #d8e4d5; font-size: 11px; }
.start-controls > span { display: inline-flex; align-items: center; gap: 7px; }
.start-controls svg { width: 20px; height: 20px; }
kbd { display: inline-flex; align-items: center; justify-content: center; padding: 2px 6px; border: 1px solid currentColor; border-radius: 4px; font: 500 10px/1.5 var(--body-font); white-space: nowrap; }
.start-controls kbd { border-color: #fff9e95c; }
.start-footer > small { font-size: 10px; color: #d1dfd0; }
.touch-hint { display: none; }

/* The HUD remains transparent to pointer input except for its actual controls. */
.game-hud { display: none; position: fixed; inset: 0; z-index: 3; pointer-events: none; user-select: none; }
body.is-playing .game-hud { display: block; }
.game-hud button, .game-hud a { pointer-events: auto; }
.hud-top { position: absolute; inset: max(22px, env(safe-area-inset-top)) 25px auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.glass-panel { background: #fffbeeeb; box-shadow: 0 5px 25px #11372b15; border: 1px solid #ffffff5c; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.explorer-status { display: flex; align-items: center; gap: 17px; min-height: 71px; padding: 10px 17px 10px 11px; border-radius: 14px; }
.explorer-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 11px; background: #e3ecda; color: var(--jade); }
.explorer-avatar svg { width: 33px; height: 33px; stroke-width: 1.3; }
.explorer-status-copy { display: flex; flex-direction: column; gap: 1px; }
.explorer-name { font-size: 11px; font-weight: 600; }
.health { color: #d67650; font-size: 16px; line-height: 1.2; letter-spacing: 3px; white-space: nowrap; }
.status-divider { align-self: stretch; width: 1px; margin: 5px 0; background: #123f3b19; }
.collectible-count { display: flex; align-items: center; gap: 8px; }
.collectible-count > svg { color: #a07b32; width: 26px; height: 26px; }
.collectible-count > span { display: flex; flex-direction: column; }
.collectible-count small { font-size: 9px; color: #647366; }
.collectible-count strong { font: 500 18px/1.2 var(--title-font); white-space: nowrap; }
.shard-count > svg { color: #2f9d93; width: 21px; }
.shard-count strong { font-size: 17px; }
.hud-location { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; flex-direction: column; gap: 3px; color: var(--ivory); text-shadow: 0 2px 6px #0d3837bb; }
#zoneName { font: 400 17px var(--title-font); white-space: nowrap; }
.session-time { font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.hud-tools { display: flex; align-items: center; gap: 9px; }
.icon-button { width: 45px; height: 45px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #ffffff6b; border-radius: 12px; background: #fffbeeeb; color: var(--forest); box-shadow: 0 3px 16px #123f3b12; transition: background .15s; }
.icon-button:hover { background: white; }
.icon-button svg { width: 21px; height: 21px; }
.sound-button[aria-pressed="false"] { color: #7b8579; }
.sound-button[aria-pressed="false"]::after { content: ""; position: absolute; width: 26px; height: 1.5px; background: currentColor; transform: rotate(-45deg); }
.mission-panel { position: absolute; top: calc(max(22px, env(safe-area-inset-top)) + 84px); left: 25px; max-width: 315px; display: flex; align-items: flex-start; gap: 12px; padding: 13px 18px; border-radius: 12px; }
.mission-marker { font-size: 25px; color: #af7f3e; line-height: 1.3; }
.mission-label { display: block; color: #73806e; font-size: 10px; }
.mission-panel p { margin: 3px 0; font-size: 13px; font-weight: 600; }
.objective-distance { font-size: 11px; color: var(--jade); }
.toast { position: absolute; top: 25%; left: 50%; width: max-content; max-width: min(85vw, 470px); padding: 12px 22px; color: var(--ivory); background: #15483ff0; box-shadow: 0 5px 25px #0a392540; border: 1px solid #d2e4bb40; border-radius: 30px; text-align: center; font-size: 14px; transform: translateX(-50%) translateY(-10px); opacity: 0; transition: opacity .2s, transform .2s; }
.toast:empty { display: none; }
.toast.visible, .toast.is-visible, .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.interact-button { position: absolute; bottom: 24%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 11px 24px 11px 13px; border: 1px solid #ffffff91; border-radius: 11px; background: var(--ivory); color: var(--forest); box-shadow: 0 5px 25px #103e4140; font-weight: 600; white-space: nowrap; }
.interact-button kbd { font-size: 14px; padding: 3px 9px; color: var(--ivory); background: var(--jade); border-color: var(--jade); }
.energy-panel { position: absolute; bottom: max(35px, calc(env(safe-area-inset-bottom) + 12px)); left: 29px; width: 165px; }
.energy-panel > span { display: flex; justify-content: space-between; color: var(--ivory); font-size: 11px; text-shadow: 0 1px 4px #123f3baa; }
.energy-panel small { font-size: 9px; opacity: .8; }
.energy-panel progress { display: block; width: 100%; height: 6px; margin-top: 6px; overflow: hidden; border: 0; border-radius: 5px; appearance: none; background: #123f3b66; accent-color: #c5e99c; }
.energy-panel progress::-webkit-progress-bar { border-radius: 5px; background: #123f3b66; }
.energy-panel progress::-webkit-progress-value { border-radius: 5px; background: #c5e99c; transition: width .15s; }
.energy-panel progress::-moz-progress-bar { border-radius: 5px; background: #c5e99c; }
.game-keyboard-hint { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 14px; border-radius: 8px; background: #143e3670; color: #f0f3de; font-size: 9px; white-space: nowrap; }
.game-keyboard-hint kbd { border-color: #fff9e94d; font-size: 9px; }
.game-keyboard-hint i { width: 1px; height: 12px; margin: 0 2px; background: #fff9e929; }
.minimap-panel { position: absolute; right: 25px; bottom: max(25px, env(safe-area-inset-bottom)); width: 178px; padding: 10px; border-radius: 15px; background: #fffbeeee; border: 1px solid #ffffff70; box-shadow: 0 4px 20px #0b3d3b22; }
.minimap-heading { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-size: 10px; }
.minimap-heading svg { width: 15px; height: 15px; }
.minimap-heading > span:last-child { margin-left: auto; font-size: 9px; }
#minimap { display: block; width: 156px; height: 156px; border-radius: 7px; background: #cddcca; }
.minimap-note { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 7px; font-size: 9px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.player-dot { background: #f4f9e9; border: 2px solid #185d53; }
.relic-dot { background: #edb34c; transform: rotate(45deg); border-radius: 1px; }
.gate-dot { background: #ab69b3; }
.danger-dot { background: #ca7956; }
.touch-controls { display: none; position: absolute; inset: 0; pointer-events: none; }
body.is-touch .touch-controls { display: block; }
body.is-touch .desktop-hint, body.is-touch .energy-panel small { display: none; }
body.is-touch .touch-hint { display: block; }
.joystick { position: absolute; left: max(30px, env(safe-area-inset-left)); bottom: max(33px, calc(env(safe-area-inset-bottom) + 20px)); display: grid; place-items: center; width: 116px; height: 116px; border: 1px solid #fff9e95c; border-radius: 50%; background: #123f3b35; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); pointer-events: auto; touch-action: none; }
.joystick-ring { width: 80px; height: 80px; border: 1px dashed #fff9e940; border-radius: 50%; }
.joystick-knob { position: absolute; width: 46px; height: 46px; border: 1px solid #fff9e9c4; border-radius: 50%; background: #fff9e9ab; box-shadow: 0 3px 15px #123f3b25; pointer-events: none; }
.touch-actions { position: absolute; bottom: max(41px, calc(env(safe-area-inset-bottom) + 23px)); right: max(28px, env(safe-area-inset-right)); display: flex; align-items: flex-end; gap: 15px; }
.touch-button { display: flex; align-items: center; flex-direction: column; justify-content: center; width: 65px; height: 65px; border: 1px solid #fff9e9a0; border-radius: 50%; background: #fff9e9c9; color: var(--forest); font-size: 12px; font-weight: 600; touch-action: none; pointer-events: auto; }
.jump-button { width: 76px; height: 76px; }
.jump-button svg { width: 25px; height: 25px; }
.jump-button span { font-size: 10px; }
.touch-button:active { background: var(--sun); }
body.is-touch .energy-panel { left: max(36px, env(safe-area-inset-left)); bottom: max(163px, calc(env(safe-area-inset-bottom) + 150px)); width: 104px; }
body.is-touch .minimap-panel { bottom: max(155px, calc(env(safe-area-inset-bottom) + 142px)); width: 136px; }
body.is-touch #minimap { width: 114px; height: 114px; }

/* Native dialogs stop background keyboard input and keep focus on the task. */
.game-dialog { width: calc(100vw - 32px); max-width: 460px; max-height: calc(100dvh - 40px); padding: 34px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #ffffff96; border-radius: 23px; background: var(--ivory); color: var(--forest); box-shadow: 0 25px 100px #052e3866; }
.game-dialog::backdrop { background: #093f3b9e; backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.dialog-eyebrow { display: block; margin-bottom: 4px; color: #667c68; font-size: 12px; }
.game-dialog h2 { margin: 0; font: 400 29px/1.5 var(--title-font); letter-spacing: -.02em; }
.dialog-description { margin: 13px 0 24px; color: #637665; font-size: 14px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 24px; }
.close-button { width: 38px; height: 38px; border: 1px solid #123f3b24; border-radius: 50%; background: transparent; box-shadow: none; }
.map-dialog { max-width: 880px; padding: 25px 29px 18px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 28px; }
.full-map-wrap { position: relative; align-self: start; border: 5px solid #e1e9d7; border-radius: 15px; overflow: hidden; background: #cddcca; }
#fullMap { display: block; width: 100%; height: auto; }
.map-north { position: absolute; top: 13px; right: 15px; color: var(--forest); font-size: 13px; font-weight: 600; }
.map-journal h3 { margin: 0 0 17px; font-size: 14px; font-weight: 600; }
.relic-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; font-size: 12px; }
.relic-list li { display: flex; align-items: center; gap: 9px; color: #5d6f5d; }
.relic-list li::before { content: "◇"; color: #af8737; font-size: 18px; }
.relic-list li.collected, .relic-list li.is-collected { color: var(--jade); }
.relic-list li.collected::before, .relic-list li.is-collected::before { content: "✓"; color: var(--jade); }
.map-legend { display: grid; grid-template-columns: 1fr; gap: 10px; padding-top: 19px; border-top: 1px solid #123f3b1f; }
.map-legend > span { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #657260; }
.map-note { margin: 22px 0 0; font-size: 11px; line-height: 1.8; color: #657260; }
.dialog-footnote { margin: 17px 0 0; text-align: center; color: #73836f; font-size: 10px; }
.pause-dialog, .win-dialog { text-align: center; }
.dialog-emblem { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 50%; background: #e6edda; color: var(--jade); }
.dialog-emblem svg { width: 41px; height: 41px; stroke-width: 1.2; }
.pause-dialog > .primary-button, .win-dialog > .primary-button { width: 100%; }
.control-guide { margin-top: 23px; padding: 14px 0; border-block: 1px solid #123f3b1a; text-align: left; font-size: 12px; }
.control-guide summary { cursor: pointer; font-weight: 500; }
.control-guide dl { margin: 14px 0 0; }
.control-guide dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.control-guide dt { font-size: 11px; }
.control-guide dd { margin: 0; color: #657760; font-size: 11px; }
.control-guide .touch-hint { margin: 12px 0 0; color: #657760; }
.pause-secondary { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 26px; margin-top: 20px; font-size: 12px; }
.pause-secondary button { padding: 3px 0; border: 0; border-bottom: 1px solid #123f3b40; background: none; color: #617260; font-size: 12px; }
.pause-secondary a:hover, .dialog-home-link:hover { text-decoration: underline; }
.win-emblem { display: grid; place-items: center; width: 78px; height: 85px; margin: 0 auto 18px; border: 1px solid #cea75560; border-radius: 35px 35px 15px 15px; background: #f1e7bc; color: #9c7439; }
.win-emblem svg { width: 43px; height: 43px; stroke-width: 1.2; }
.win-dialog h2 { font-size: 32px; line-height: 1.45; }
.win-stats { display: flex; margin: 0 0 25px; padding: 16px 0; border-block: 1px solid #123f3b1a; }
.win-stats > span { width: 50%; color: #667860; font-size: 11px; }
.win-stats > span + span { border-left: 1px solid #123f3b1a; }
.win-stats strong { display: block; margin-top: 3px; color: var(--forest); font: 500 25px var(--title-font); }
.dialog-home-link { display: block; margin-top: 20px; color: #647560; font-size: 12px; }
.error-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 25px; background: #123f3bea; backdrop-filter: blur(10px); }
.error-screen > div { width: min(440px, 100%); padding: 35px; border-radius: 22px; background: var(--ivory); text-align: center; }
.error-symbol { width: 48px; height: 48px; margin: 0 auto 18px; color: var(--jade); }
.error-screen h2 { font: 400 24px var(--title-font); }
.error-screen p { font-size: 14px; color: #627760; }
.error-screen .primary-button { margin-top: 10px; }
.noscript-notice { position: fixed; inset: auto 15px 15px; z-index: 30; padding: 20px; border-radius: 14px; background: var(--ivory); text-align: center; }
.noscript-notice a { margin-left: 15px; text-decoration: underline; }

@media (min-width: 1600px) {
  .start-copy { margin-left: 3vw; }
  .start-copy h1 { font-size: 116px; }
  .start-description { font-size: 19px; }
  .start-header, .start-footer { left: 5vw; right: 5vw; }
}
@media (max-width: 1100px) {
  .hud-location { position: static; transform: none; margin: 3px 0 0 auto; }
  #zoneName { font-size: 14px; }
  .game-keyboard-hint { bottom: 24px; font-size: 8px; gap: 5px; }
  .game-keyboard-hint kbd { font-size: 8px; }
  .minimap-panel { width: 148px; }
  #minimap { width: 126px; height: 126px; }
  .energy-panel { width: 130px; }
  .scene-caption { right: 4vw; }
  .start-controls { gap: 15px; }
  .start-footer { gap: 14px; }
}
@media (max-width: 760px) {
  .start-screen { padding: 110px 7vw 130px; justify-content: center; background: linear-gradient(90deg, rgba(7, 41, 34, .88), rgba(11, 47, 39, .55) 55%, rgba(11, 47, 39, .12)), linear-gradient(0deg, rgba(10, 40, 33, .65), transparent 28%); }
  .start-header { top: max(23px, env(safe-area-inset-top)); left: 6vw; right: 6vw; }
  .start-copy { width: 100%; }
  .start-copy h1 { font-size: clamp(64px, 12vw, 89px); }
  .start-description { font-size: 14px; }
  .start-footer { left: 6vw; right: 6vw; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 16px; }
  .start-footer > small { font-size: 9px; }
  .start-controls { gap: 10px 15px; }
  .start-controls > span:last-child { display: none; }
  .start-footer .touch-hint { margin: 0; font-size: 11px; }
  .scene-caption { display: none; }
  .home-link { padding: 6px 10px; font-size: 10px; }
  .explore-brand { font-size: 21px; gap: 8px; }
  .brand-symbol { width: 37px; height: 37px; }
  .brand-symbol svg { width: 27px; height: 27px; }
  .explore-brand small { font-size: 8px; }
  .hud-top { inset: max(12px, env(safe-area-inset-top)) 12px auto; gap: 7px; flex-wrap: wrap; }
  .explorer-status { gap: 11px; padding: 8px 11px; min-height: 59px; border-radius: 12px; }
  .explorer-avatar { display: none; }
  .explorer-name { font-size: 9px; }
  .health { font-size: 13px; letter-spacing: 1px; }
  .collectible-count { gap: 5px; }
  .collectible-count > svg { width: 22px; height: 22px; }
  .collectible-count small { font-size: 8px; }
  .collectible-count strong { font-size: 16px; }
  .shard-count > svg { width: 18px; }
  .shard-count strong { font-size: 14px; }
  .hud-tools { gap: 6px; margin-left: auto; }
  .hud-tools .icon-button { width: 36px; height: 36px; border-radius: 10px; }
  .icon-button svg { width: 18px; height: 18px; }
  .hud-location { position: absolute; top: 45px; right: 1px; gap: 1px; margin: 0; align-items: flex-end; }
  #zoneName { font-size: 10px; }
  .session-time { font-size: 9px; }
  .mission-panel { left: 12px; top: calc(max(12px, env(safe-area-inset-top)) + 70px); max-width: 240px; padding: 10px 13px; gap: 8px; }
  .mission-panel p { font-size: 11px; }
  .mission-label, .objective-distance { font-size: 9px; }
  .mission-marker { font-size: 21px; }
  .game-keyboard-hint { display: none; }
  .minimap-panel { right: 12px; width: 126px; padding: 7px; border-radius: 12px; }
  #minimap { width: 110px; height: 110px; }
  .minimap-heading { font-size: 8px; gap: 3px; margin-bottom: 5px; }
  .minimap-heading svg { width: 13px; height: 13px; }
  .minimap-heading > span:last-child { font-size: 8px; }
  .minimap-note { font-size: 8px; margin-top: 5px; }
  body.is-touch .minimap-panel { width: 118px; }
  body.is-touch #minimap { width: 102px; height: 102px; }
  .toast { font-size: 12px; padding: 10px 17px; top: 30%; }
  .interact-button { bottom: 30%; min-height: 44px; font-size: 12px; gap: 8px; padding: 9px 18px; }
  .energy-panel { left: 15px; bottom: 28px; }
  .map-dialog { padding: 20px; }
  .dialog-heading { margin-bottom: 16px; }
  .game-dialog h2 { font-size: 25px; }
  .map-layout { grid-template-columns: minmax(0, 1fr) 150px; gap: 18px; }
  .map-journal h3 { margin-bottom: 12px; font-size: 12px; }
  .relic-list { gap: 7px; margin-bottom: 17px; font-size: 10px; }
  .map-legend { gap: 8px; padding-top: 14px; }
  .map-legend > span, .map-note { font-size: 9px; }
  .map-note { margin-top: 15px; }
}
@media (max-width: 500px) {
  .adventure-label { font-size: 11px; margin-bottom: 15px; }
  .start-copy h1 { font-size: clamp(62px, 16.5vw, 83px); margin-bottom: 24px; }
  .start-description { margin-bottom: 24px; font-size: 13px; }
  .start-button { min-width: 214px; min-height: 55px; font-size: 16px; }
  .map-layout { grid-template-columns: 1fr; gap: 19px; }
  .full-map-wrap { width: 100%; max-width: min(100%, 41dvh); margin-inline: auto; }
  .map-journal { display: grid; grid-template-columns: 1.1fr 1fr; column-gap: 16px; }
  .map-journal h3 { grid-column: 1; }
  .relic-list { grid-column: 1; margin: 0; }
  .map-legend { grid-column: 2; grid-row: 1 / span 2; align-content: start; padding-top: 0; padding-left: 14px; border-top: 0; border-left: 1px solid #123f3b1f; }
  .map-note { display: none; }
  .dialog-footnote { font-size: 9px; }
  .game-dialog { padding: 25px; }
  .map-dialog { padding: 18px; }
  .joystick { left: max(23px, env(safe-area-inset-left)); width: 108px; height: 108px; }
  .touch-actions { right: max(18px, env(safe-area-inset-right)); gap: 11px; }
  .jump-button { width: 68px; height: 68px; }
  .run-button { width: 56px; height: 56px; }
}
@media (max-height: 740px) and (min-width: 761px) {
  .start-screen { padding-top: 100px; padding-bottom: 88px; }
  .start-copy h1 { font-size: clamp(60px, 6.7vw, 86px); margin-bottom: 14px; }
  .adventure-label { margin-bottom: 12px; }
  .start-description { margin-bottom: 21px; font-size: 14px; }
  .start-button { min-height: 52px; font-size: 16px; }
  .start-save-note { margin-top: 13px; }
  .scene-caption { bottom: 109px; }
}
@media (max-height: 670px) and (max-width: 760px) and (orientation: portrait) {
  .start-screen { padding-top: 95px; padding-bottom: 99px; }
  .start-copy h1 { font-size: 61px; margin-bottom: 14px; }
  .adventure-label { margin-bottom: 9px; }
  .start-description { margin-bottom: 19px; font-size: 12px; }
  .start-save-note { margin-top: 13px; font-size: 10px; }
  .start-footer { bottom: max(16px, env(safe-area-inset-bottom)); gap: 5px; padding-top: 11px; }
  .start-header { top: max(17px, env(safe-area-inset-top)); }
  .loading-status { margin-top: 12px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .start-screen { padding: 73px 7vw 60px; }
  .start-header { top: max(14px, env(safe-area-inset-top)); left: max(4vw, env(safe-area-inset-left)); right: max(4vw, env(safe-area-inset-right)); }
  .explore-brand { font-size: 19px; }
  .brand-symbol { width: 34px; height: 34px; }
  .explore-brand small { font-size: 8px; }
  .start-copy { position: relative; width: 100%; }
  .adventure-label { font-size: 10px; margin-bottom: 8px; }
  .start-copy h1 { font-size: clamp(42px, 11dvh, 61px); margin: 0 0 10px; line-height: 1.18; }
  .start-description { font-size: 10px; line-height: 1.7; margin: 0; }
  .start-actions { position: absolute; bottom: 32px; left: 48%; gap: 7px; }
  .start-button { min-width: 190px; min-height: 47px; font-size: 14px; gap: 25px; }
  .continue-button { font-size: 10px; }
  .start-save-note { position: absolute; bottom: -9px; left: 48%; font-size: 9px; }
  .loading-status { position: absolute; bottom: -26px; left: 48%; font-size: 9px; }
  .start-footer { flex-direction: row; align-items: center; padding-top: 10px; bottom: max(14px, env(safe-area-inset-bottom)); left: max(4vw, env(safe-area-inset-left)); right: max(4vw, env(safe-area-inset-right)); }
  .start-controls { gap: 12px; font-size: 9px; }
  .start-footer .touch-hint { font-size: 9px; margin: 0; }
  .start-footer > small { font-size: 8px; }
  .scene-caption { display: none; }
  .hud-top { inset: max(10px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) auto max(15px, env(safe-area-inset-left)); }
  .hud-location { display: none; }
  .explorer-status { min-height: 52px; padding-block: 7px; }
  .explorer-avatar { width: 34px; height: 34px; }
  .explorer-avatar svg { width: 25px; height: 25px; }
  .hud-tools .icon-button { width: 35px; height: 35px; }
  .mission-panel { top: calc(max(10px, env(safe-area-inset-top)) + 60px); left: max(15px, env(safe-area-inset-left)); max-width: 250px; padding: 8px 12px; }
  .mission-label { display: none; }
  .mission-panel p { font-size: 10px; margin: 0; }
  .objective-distance { font-size: 9px; }
  .mission-marker { font-size: 20px; }
  body.is-touch .minimap-panel { top: 57px; right: max(15px, env(safe-area-inset-right)); bottom: auto; width: 92px; padding: 5px; border-radius: 9px; }
  body.is-touch #minimap { width: 80px; height: 80px; }
  .minimap-heading, .minimap-note { display: none; }
  .joystick { bottom: max(19px, env(safe-area-inset-bottom)); width: 93px; height: 93px; }
  .joystick-ring { width: 64px; height: 64px; }
  .joystick-knob { width: 39px; height: 39px; }
  .touch-actions { bottom: max(21px, env(safe-area-inset-bottom)); gap: 13px; }
  .run-button { width: 52px; height: 52px; }
  .jump-button { width: 63px; height: 63px; }
  body.is-touch .energy-panel { bottom: max(123px, calc(env(safe-area-inset-bottom) + 108px)); width: 88px; left: 32px; }
  .energy-panel > span { font-size: 9px; }
  .interact-button { bottom: 13%; min-height: 41px; font-size: 12px; }
  .toast { top: 30%; font-size: 11px; padding: 9px 15px; }
  .game-keyboard-hint { display: none; }
  .game-dialog { max-height: calc(100dvh - 24px); padding: 21px 28px; }
  .dialog-emblem { display: none; }
  .game-dialog h2 { font-size: 24px; }
  .dialog-description { margin: 8px 0 17px; font-size: 12px; }
  .pause-dialog > .primary-button { min-height: 43px; padding-block: 9px; }
  .control-guide { margin-top: 16px; padding-block: 10px; }
  .pause-secondary { margin-top: 12px; }
  .map-dialog { max-width: 720px; padding: 15px 23px; }
  .dialog-heading { margin-bottom: 12px; }
  .dialog-eyebrow { font-size: 10px; }
  .map-layout { grid-template-columns: minmax(0, 1fr) 190px; gap: 25px; }
  .full-map-wrap { max-width: 59dvh; margin-inline: auto; }
  .map-journal h3 { font-size: 11px; margin-bottom: 8px; }
  .relic-list { gap: 2px; margin-bottom: 9px; font-size: 10px; }
  .relic-list li::before { font-size: 15px; }
  .map-legend { grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 9px; }
  .map-legend > span { font-size: 8px; gap: 4px; }
  .map-note { display: none; }
  .dialog-footnote { margin-top: 8px; font-size: 8px; }
  .win-emblem { width: 45px; height: 45px; margin-bottom: 9px; border-radius: 12px; }
  .win-emblem svg { width: 28px; height: 28px; }
  .win-dialog h2 br { display: none; }
  .win-dialog h2 { font-size: 24px; }
  .win-stats { padding-block: 9px; margin-bottom: 16px; }
  .win-stats strong { font-size: 20px; }
  .dialog-home-link { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ——— Trail progression: level, stages, missions ——————————————————— */
.explorer-avatar { display: grid; font: 500 22px/1 var(--title-font); color: var(--jade); }
.explorer-avatar strong { font-weight: 500; }
.explorer-status-copy { min-width: 132px; }
.xp-bar { display: block; width: 100%; height: 5px; margin: 4px 0 3px; border-radius: 4px; background: #123f3b1f; overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--sun), #7fd0a8); transition: width .3s ease; }
.xp-text { font-size: 9px; color: #6d7c6c; white-space: nowrap; }
#stageChip { padding: 2px 10px; border-radius: 20px; background: #123f3b6b; font-size: 10px; letter-spacing: .02em; }
.objective-hint { display: block; margin-bottom: 2px; font-size: 10px; color: #7e8c78; }

.stage-preview { display: flex; flex-direction: column; gap: 7px; margin: 0 0 26px; padding: 0; list-style: none; counter-reset: stage; }
.stage-preview li { display: flex; align-items: baseline; gap: 10px; padding-left: 26px; position: relative; color: #dceadb; }
.stage-preview li::before { counter-increment: stage; content: counter(stage); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #fff9e957; border-radius: 50%; font-size: 10px; }
.stage-preview strong { font: 500 14px var(--title-font); }
.stage-preview small { font-size: 10px; color: #b8cdb9; }

/* ——— Station dialog: the learning mission ————————————————————————— */
.station-dialog { max-width: 560px; padding: 26px 30px 24px; }
.station-headline { display: flex; align-items: flex-start; gap: 14px; }
.station-emoji { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 auto; border-radius: 15px; background: #eef1e2; font-size: 27px; }
.station-dialog h2 { font-size: 25px; line-height: 1.35; }
.station-meta { margin: 3px 0 0; color: #6c7d6b; font-size: 11px; }
.station-steps { display: flex; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
.station-steps li { display: flex; align-items: center; gap: 6px; flex: 1; padding: 6px 8px; border-radius: 9px; background: #123f3b0d; color: #7c8b78; font-size: 10px; }
.station-steps li i { display: grid; place-items: center; width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%; background: #ffffffcc; font-style: normal; font-size: 9px; font-weight: 600; }
.station-steps li.is-done { background: #d8ead8; color: var(--jade); }
.station-steps li.is-done i { background: var(--jade); color: var(--ivory); }
.station-body { min-height: 190px; }
.station-eyebrow { margin: 0 0 8px; color: #75886f; font-size: 11px; letter-spacing: .04em; }
.station-hook, .station-card-title, .station-question-text { margin: 0 0 12px; font: 500 20px/1.5 var(--title-font); }
.station-card-title { display: flex; align-items: flex-start; gap: 10px; }
.station-card-icon { font-size: 24px; line-height: 1.2; }
.station-question { margin: 0 0 16px; font-size: 15px; line-height: 1.85; color: #40554a; }
.station-idea, .station-card-body, .station-takeaway { margin: 0 0 14px; font-size: 14px; line-height: 1.95; color: #4b5c50; }
.station-figure { margin: 0 0 16px; border-radius: 14px; overflow: hidden; background: #e6ece0; }
.station-figure img { display: block; width: 100%; height: 168px; object-fit: cover; }
.station-fact, .station-extra { margin: 0 0 14px; padding: 12px 15px; border-left: 3px solid var(--sun); border-radius: 0 10px 10px 0; background: #f6efdb; font-size: 13px; line-height: 1.85; color: #5a5334; }
.station-extra { border-left-color: var(--jade); background: #e9f2e6; color: #3f5a4a; }
.station-reward { margin: 16px 0 0; color: #7d8b76; font-size: 11px; }
.check-options { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.check-option { padding: 14px 17px; border: 1px solid #123f3b26; border-radius: 12px; background: #fffdf5; color: var(--forest); text-align: left; font-size: 14px; line-height: 1.6; transition: border-color .15s, background .15s; }
.check-option:not(:disabled):not(.is-correct):not(.is-wrong):hover { border-color: var(--jade); background: #f3f8ee; }
.check-option:disabled { opacity: 1; cursor: default; }
.check-option.is-correct { border-color: #2f8f6b; background: #e2f3e6; font-weight: 600; }
.check-option.is-wrong { border-color: #c9705a; background: #f9e9e2; }
.check-feedback { margin: 0; padding: 13px 16px; border-radius: 12px; font-size: 13px; line-height: 1.8; }
.check-feedback.is-ok { background: #e2f3e6; color: #2c6a4c; }
.check-feedback.is-no { background: #f9ecdf; color: #8a5330; }
.station-badge { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 15px 17px; border: 1px dashed #c8a55e; border-radius: 15px; background: #fdf5e2; }
.station-badge-emoji { font-size: 38px; line-height: 1; }
.station-badge strong { display: block; font: 500 17px var(--title-font); }
.station-badge small { color: #8a7c58; font-size: 11px; }
.station-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #123f3b17; }
.station-actions .primary-button { flex: 1; gap: 12px; }
.ghost-button { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid #123f3b2b; border-radius: 10px; background: transparent; color: #5d6f5d; font-size: 13px; }
.ghost-button:hover { border-color: var(--jade); color: var(--jade); }

/* ——— Journal ——————————————————————————————————————————————————— */
.journal-dialog { max-width: 720px; }
.journal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; padding: 16px 0; border-block: 1px solid #123f3b1a; }
.journal-stat { display: flex; flex-direction: column; gap: 3px; }
.journal-stat small { color: #7a8a74; font-size: 10px; }
.journal-stat strong { font: 500 16px var(--title-font); }
.journal-stage { margin-bottom: 26px; }
.journal-stage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.journal-stage-head h3 { margin: 0; font: 500 17px var(--title-font); }
.journal-chip { padding: 3px 11px; border-radius: 20px; background: #e2eddc; color: var(--jade); font-size: 10px; white-space: nowrap; }
.journal-chip.is-locked { background: #ece9df; color: #8b8b7d; }
.journal-stage-area { margin: 5px 0 14px; color: #778772; font-size: 11px; line-height: 1.7; }
.journal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 11px; }
.journal-card { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid #123f3b1c; border-radius: 13px; background: #fffdf6; }
.journal-card.is-done { border-color: #b6d3b5; background: #f1f8ec; }
.journal-card.is-locked { opacity: .55; }
.journal-badge { font-size: 26px; line-height: 1.1; }
.journal-card strong { display: block; font-size: 13px; }
.journal-card small { display: block; margin-top: 2px; color: #7d8b78; font-size: 10px; }
.journal-card em { display: block; margin-top: 6px; color: #98793d; font-size: 11px; font-style: normal; font-weight: 600; }
.journal-card p { margin: 6px 0 0; color: #5f7060; font-size: 11px; line-height: 1.75; }
.journal-body { max-height: 46dvh; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }

/* ——— Stage clear ————————————————————————————————————————————————— */
.stage-dialog { text-align: center; }
.stage-dialog .dialog-emblem { background: #f5ecd3; color: #a3803c; }
.stage-next { margin: 0 0 22px; padding: 13px 16px; border-radius: 12px; background: #eef2e5; color: #4f6152; font-size: 12px; line-height: 1.8; }
.stage-next:empty { display: none; }
.stage-dialog .primary-button { width: 100%; }

#mapList li::before { content: none; }
.map-index { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 auto; border-radius: 50%; color: #22392f; font: 700 10px/1 var(--body-font); }
#mapList li.is-collected .map-index { background: var(--jade) !important; color: var(--ivory); }
#mapList li.is-locked .map-index { background: #b7bdb2 !important; }
#mapList small { margin-left: auto; white-space: nowrap; }
.map-legend .camp-dot { border-radius: 2px; background: #edd39a; }
.map-legend .border-dot { width: 14px; height: 0; border-top: 2px dashed #c9b57e; border-radius: 0; }
#mapList li.is-locked { opacity: .55; }
#mapList li > span:nth-child(2) { flex: 1; }
.win-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: center; }
.win-stats > span { width: auto; }
.win-stats > span + span { border-left: 0; }
.win-stats strong { font-size: 20px; }

@media (max-height: 830px) and (min-width: 761px) {
  .full-map-wrap { max-width: min(100%, 62dvh); margin-inline: auto; }
}
@media (max-width: 760px) {
  .explorer-avatar { width: 36px; height: 36px; font-size: 17px; border-radius: 9px; }
  .explorer-status-copy { min-width: 104px; }
  .xp-text { font-size: 8px; }
  .station-dialog { padding: 20px 20px 18px; }
  .station-steps li span { display: none; }
  .station-steps li { justify-content: center; }
  .station-emoji { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; }
  .station-dialog h2 { font-size: 21px; }
  .station-actions { flex-direction: column-reverse; align-items: stretch; gap: 9px; }
  .station-actions .ghost-button { justify-content: center; }
  .journal-stats { grid-template-columns: repeat(2, 1fr); }
  .journal-grid { grid-template-columns: 1fr; }
  .stage-preview { display: none; }
}
