:root { color-scheme: light; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; background: #91cce5; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
.island-view { --pad-bottom: calc(clamp(14px, 3vw, 30px) + env(safe-area-inset-bottom)); position: relative; width: 100%; height: 100dvh; min-height: 380px; overflow: hidden; background: #6da9cf; }
.island-view::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--sun-wash-opacity, 1); background: radial-gradient(ellipse 75% 90% at 104% 5%, rgba(255,250,216,.94) 0%, rgba(255,235,170,.55) 29%, rgba(255,231,164,.16) 55%, rgba(255,241,194,0) 79%); }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas.dragging { cursor: grabbing; }
.loading { position: absolute; z-index: 10; inset: 0; display: grid; place-items: center; background: #fff9e9; color: #765d45; opacity: 1; pointer-events: auto; transition: opacity .3s ease-out; animation: loadingFailsafe 40s step-end forwards; }
.loading[hidden] { display: none; pointer-events: none; }
.loading.is-finished { opacity: 0; pointer-events: none; }
.loading-content { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem; font-size: .9rem; font-weight: 700; letter-spacing: .08em; text-align: center; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid rgba(184,147,106,.22); border-top-color: #B8936A; border-radius: 50%; animation: loadingSpin .8s linear infinite; }
@keyframes loadingSpin { to { transform: rotate(360deg); } }
@keyframes loadingFailsafe { 0%, 99.9% { visibility: visible; } 100% { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .loading { transition: none; } .loading-spinner { animation: none; } }
#door-fade { position: absolute; z-index: 4; inset: 0; background: #fff9e9; opacity: 0; pointer-events: none; transition: opacity .25s ease-out; }
#door-fade.is-loading { display: grid; place-content: center; gap: 1rem; padding-inline: 1.25rem; overflow-wrap: anywhere; text-align: center; color: #B8936A; font-size: .9rem; pointer-events: auto; opacity: 1; transition: none; }
#door-fade.is-loading::before { content: ''; justify-self: center; width: 32px; height: 32px; border: 3px solid rgba(184,147,106,.22); border-top-color: #B8936A; border-radius: 50%; animation: loadingSpin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { #door-fade { display: none; } }
@media (prefers-reduced-motion: reduce) { #door-fade.is-loading { display: grid; transition: none; } #door-fade.is-loading::before { animation: none; } }
.top-left-ui { --ui-top: calc(12px + env(safe-area-inset-top)); position: absolute; z-index: 3; top: var(--ui-top); left: calc(12px + env(safe-area-inset-left)); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: min(248px, calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))); pointer-events: none; }
/* Only actual buttons receive input; text and gaps pass through to the scene.
   The action rack stays in the upper half even in short landscape viewports. */
.action-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; max-height: calc(50dvh - var(--ui-top) - 6px); overflow-y: auto; scrollbar-width: thin; }
.top-right-ui { position: absolute; z-index: 3; top: calc(54px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: min(340px, calc(100% - 280px - env(safe-area-inset-left) - env(safe-area-inset-right))); pointer-events: none; }
#site-top { position: absolute; z-index: 13; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); display: inline-flex; align-items: center; justify-content: center; min-height: 36px; max-width: calc(50vw - 16px); padding: 6px 10px; border: 1px solid #6E542F; border-radius: 12px; background: #8A6A3F; color: #fff; box-shadow: 0 7px 24px rgba(30,90,96,.13); font: 700 .75rem/1.25 "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; text-align: center; text-decoration: none; white-space: normal; overflow-wrap: anywhere; pointer-events: auto; touch-action: manipulation; }
#site-top:hover, #site-top:active { background: #7A5C34; color: #fff; }
#site-top:focus-visible { outline: 2px solid #3E2C18; outline-offset: 2px; }
html[data-loading="loading"] #site-top { visibility: hidden; pointer-events: none; }
#hud { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 6px; width: 100%; max-width: 100%; padding: 6px 8px; border: 1px solid #B8936A; border-radius: 10px; background: rgba(255,249,231,.8); color: #B8936A; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
#hud[hidden] { display: none; }
#hud button { pointer-events: auto; }
#hud-weather { font-size: 16px; line-height: 1; }
.hud-row { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px; min-width: 0; }
.hud-row-label { font-size: 10px; line-height: 1; font-weight: 700; color: #B8936A; }
.weather-switcher { display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 2px; min-width: 0; max-width: 100%; padding: 2px; border-radius: 8px; background: rgba(255,249,231,.65); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-padding-inline: 2px; scroll-snap-type: x proximity; scrollbar-width: none; }
.weather-switcher::-webkit-scrollbar { display: none; }
.weather-switcher button { flex: 0 0 auto; scroll-snap-align: start; padding: 4px 4px; border: 0; border-radius: 99px; background: transparent; color: #82654a; font: inherit; font-size: 11px; line-height: 1.2; white-space: nowrap; cursor: pointer; touch-action: manipulation; }
.weather-switcher button[aria-pressed="true"] { background: #B8936A; color: #fff9e9; }
.weather-switcher button:focus-visible { outline: 2px solid #B8936A; outline-offset: 1px; }
.time-switcher { flex-wrap: nowrap; }
.action-hint, .bicycle-hint { position: relative; flex-shrink: 0; max-width: 100%; margin: 0; padding: 6px 8px; border: 1px solid rgba(184,147,106,.55); border-radius: 8px; background: rgba(255,249,231,.78); color: #72583f; font-size: 11px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; pointer-events: none; }
.bicycle-hint { white-space: pre-line; }
.bicycle-hint.is-highlighted { border-color: #B8936A; background: rgba(255,249,231,.94); box-shadow: inset 3px 0 #B8936A; }
.stand-button, .bicycle-drive { position: relative; flex-shrink: 0; max-width: 100%; min-height: 32px; padding: 6px 10px; border: 1px solid rgba(184,147,106,.65); border-radius: 9px; background: rgba(255,249,231,.8); color: #654b35; font: 700 12px/1.4 "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; cursor: pointer; pointer-events: auto; touch-action: manipulation; }
.stand-button:hover, .bicycle-drive:hover { background: #fff8e9; }
.stand-button:focus-visible, .bicycle-drive:focus-visible { outline: 2px solid #B8936A; outline-offset: -2px; }
.action-hint:empty { display: none; }
.stand-button[hidden] { display: none; }
.bicycle-hint[hidden], .bicycle-drive[hidden] { display: none; }
.bicycle-drive { touch-action: none; user-select: none; -webkit-user-select: none; }
.bicycle-drive.active, .bicycle-drive[aria-pressed="true"] { background: #B8936A; color: #fff9e9; }
.dpad { position: relative; align-self: flex-end; display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 48px); gap: 4px; margin-top: 18px; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; --ui-peek-x: 8px; --ui-peek-y: 0px; }
.dpad[hidden] { display: none; }
.dpad-button { display: grid; place-items: center; width: 100%; height: 100%; padding: 0; border: 1px solid rgba(255,255,255,.82); border-radius: 17px; background: rgba(255,249,231,.82); color: #B8936A; box-shadow: 0 5px 18px rgba(30,90,96,.16); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); font: 700 1.8rem Georgia, serif; line-height: 1; cursor: pointer; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dpad-button.active, .dpad-button:active { background: #B8936A; color: #fff; }
.dpad-button:focus-visible { outline: 2px solid #B8936A; outline-offset: 2px; }
.dpad[aria-disabled="true"] { --ui-peek-opacity: .45; }
.dpad-button.up { grid-area: 1 / 2; }
.dpad-button.down { grid-area: 3 / 2; }
.dpad-button.left { grid-area: 2 / 1; }
.dpad-button.right { grid-area: 2 / 3; }
.dpad-button.turn-left { grid-area: 1 / 3; font-size: 1.35rem; }
.dpad-button.turn-right { grid-area: 3 / 3; font-size: 1.35rem; }
.error { position: absolute; top: 50%; left: 50%; width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 1rem 1.3rem; transform: translate(-50%,-50%); border-radius: 12px; background: #fff8e9; color: #70523c; font-size: .85rem; }
.error[hidden] { display: none; }
/* Persistent overlays start hidden, including before the module is loaded. */
:where(#house-toggle, #house-panel, #hud, .dpad) {
  opacity: 0;
  visibility: hidden;
  translate: var(--ui-peek-x, -8px) var(--ui-peek-y, -10px);
  transition: opacity .2s ease-out, translate .2s ease-out, visibility 0s linear .2s;
}
#hud, #house-toggle, #house-panel { --ui-peek-x: 8px; }
body.ui-peek-houses :is(#house-toggle, #house-panel),
body.ui-peek-hud #hud, body.ui-peek-dpad .dpad,
:is(#house-toggle, #house-panel, #hud, .dpad):focus-within {
  opacity: var(--ui-peek-opacity, 1);
  visibility: visible;
  translate: 0 0;
  transition-delay: 0s;
}
/* Descendant buttons normally opt into pointer events. Disable them immediately
   on hiding, including during the fade; inert also prevents accidental focus. */
body:not(.ui-peek-houses) :is(#house-toggle, #house-panel, #house-panel *),
body:not(.ui-peek-hud) :is(#hud, #hud *),
body:not(.ui-peek-dpad) :is(.dpad, .dpad *) { pointer-events: none !important; }
@media (prefers-reduced-motion: reduce) {
  :is(#house-toggle, #house-panel, #hud, .dpad) {
    --ui-peek-x: 0px;
    --ui-peek-y: 0px;
    transition: none;
  }
}
@media (max-width: 600px) { .top-right-ui { top: calc(72px + env(safe-area-inset-top)); width: min(224px, 48vw); } #hud { font-size: 11px; } #site-top { font-size: .68rem; } .dpad { grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(3, 40px); } }
@media (max-width: 600px) { .top-left-ui { width: calc(50% - 24px - env(safe-area-inset-left)); } }
@media (max-height: 500px) { .stand-button, .bicycle-drive { min-height: 28px; padding: 4px 8px; } .action-controls { gap: 4px; } .bicycle-hint { padding: 4px 6px; font-size: 10px; line-height: 1.4; } }
@media (pointer: coarse) and (min-height: 501px) { .stand-button, .bicycle-drive { min-height: 40px; } }

#house-toggle, #house-panel { position: relative; border: 1px solid #B8936A; border-radius: 12px; background: rgba(255,249,231,.92); color: #765d45; box-shadow: 0 7px 24px rgba(30,90,96,.13); pointer-events: auto; }
#house-toggle { max-width: 100%; min-width: 0; min-height: 36px; padding: 6px 10px; font: inherit; font-size: .75rem; font-weight: 700; line-height: 1.3; white-space: normal; text-align: center; cursor: pointer; touch-action: manipulation; }
#house-toggle:hover { background: #F3E4C4; color: #765d45; }
#house-panel { width: 100%; padding: 10px; max-height: 30dvh; overflow-y: auto; overscroll-behavior: contain; }
#house-panel h2 { margin: 0 0 8px; font-size: .85rem; line-height: 1.35; color: #B8936A; overflow-wrap: anywhere; }
#house-list { display: grid; gap: 5px; }
#house-list button { width: 100%; min-height: 44px; height: auto; border: 1px solid rgba(184,147,106,.45); border-radius: 8px; padding: 8px; background: rgba(184,147,106,.12); color: #654b35; font: inherit; font-size: .8rem; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; text-align: left; cursor: pointer; touch-action: manipulation; }
#house-list button { transition: transform .12s ease, background .12s ease, box-shadow .12s ease; }
#house-list button:active, #house-list button[data-feedback="pending"] { transform: translateY(2px); background: #B8936A; color: #fff; box-shadow: inset 0 2px 4px #765d4566; }
#house-list button[data-feedback="success"] { background: #B8936A; color: #fff; }
#house-list button[data-feedback="error"] { border-color: #a05139; background: #f4ded2; }
.house-warp-status { margin: 8px 0 0; font-size: .75rem; line-height: 1.4; overflow-wrap: anywhere; }
.house-warp-status:empty { display: none; }
@media (prefers-reduced-motion: reduce) { #house-list button { transition: none; } }
#house-list button:disabled { opacity: .5; cursor: default; }
#house-toggle:focus-visible, #house-list button:focus-visible { outline: 2px solid #B8936A; outline-offset: 2px; }
#house-toggle[hidden], #house-panel[hidden] { display: none; }
.door-button { border-color: #B8936A; }

.dpad-button[aria-disabled="true"] { opacity: .45; }
.stand-button:disabled { opacity: .45; cursor: default; }

.secretary-popup { position: absolute; z-index: 6; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); background: rgba(60,43,30,.06); pointer-events: none; }
.secretary-popup[hidden] { display: none; }
.secretary-card { width: min(400px, 100%); padding: 16px; border: 1px solid #B8936A; border-radius: 14px; background: rgba(255,249,231,.97); box-shadow: 0 8px 28px rgba(60,43,30,.16); color: #654b35; text-align: center; pointer-events: auto; }
.secretary-card p { margin: 0 0 12px; font-size: .9rem; line-height: 1.6; }
.secretary-choices { display: flex; gap: 12px; }
.secretary-choices button { flex: 1; min-height: 44px; border: 1px solid #B8936A; border-radius: 9px; background: #fff9e9; color: #654b35; font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; }
#door-yes, #secretary-yes { background: #B8936A; color: #fff9e9; }
.secretary-choices button:focus-visible { outline: 2px solid #B8936A; outline-offset: 3px; }
@media (max-height: 500px) { .secretary-card { width: min(460px, 100%); padding: 10px 14px; } .secretary-card p { margin-bottom: 6px; font-size: .8rem; } }

#reception-yes { background: #B8936A; color: #fff9e9; }

#door-popup, #reception-stairs { z-index: 12; }
#reception-stairs { pointer-events: auto; }
/* The sheet paints over the town, but an empty backdrop must not eat the warp column. */
#door-popup { pointer-events: none; }

/* s261: a translucent parchment welcome card over the live town. */
.welcome-pop {
  position: fixed;
  inset: 0;
  z-index: 20;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: rgb(36 24 16 / 9%);
  opacity: 0;
  transition: opacity 1.3s ease;
}
.welcome-pop.is-visible { opacity: 1; }
/* s263: fit independently of the card's entrance/exit animation. */
.welcome-fit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(720px, 92vw);
  overflow: visible;
  transform: translate(-50%, -50%) scale(var(--welcome-fit-scale, 1));
  transform-origin: center;
}
.welcome-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  overflow: visible;
  padding: clamp(10px, 3dvh, 32px) clamp(16px, 4vmin, 44px) clamp(10px, 2.5dvh, 26px);
  border: 10px ridge #69452b;
  border-radius: 12px;
  /* Alpha belongs to the paper alone; text and fittings stay opaque. */
  background:
    radial-gradient(ellipse at 12% 8%, rgb(166 110 51 / 16%), transparent 42%),
    radial-gradient(ellipse at 92% 94%, rgb(166 110 51 / 18%), transparent 45%),
    linear-gradient(115deg, rgb(253 238 204 / 88%), rgb(248 229 192 / 86%) 50%, rgb(250 235 206 / 89%));
  box-shadow: 0 0 0 1px #d4b079, 0 0 0 3px #453020,
    inset 0 0 0 2px #b28a54, inset 0 0 0 5px rgb(91 55 24 / 18%),
    inset 0 0 25px rgb(96 57 25 / 24%), 0 14px 48px rgb(27 17 10 / 30%);
  color: #3e2516;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", serif;
  transform: scale(.965);
  transition: transform 1.3s cubic-bezier(.2, .65, .3, 1);
}
.welcome-pop.is-visible .welcome-card { transform: scale(1); }
.welcome-pop.is-closing { opacity: 0; transition-duration: .3s; }
.welcome-pop.is-closing .welcome-card { transform: scale(.985); transition-duration: .3s; }
.welcome-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #79532d;
  opacity: .19;
  pointer-events: none;
}
.welcome-content { position: relative; text-align: center; }
.welcome-compass { display: block; width: clamp(120px, 28vmin, 225px); height: clamp(30px, 7dvh, 66px); margin: clamp(-12px, -1dvh, -4px) auto clamp(4px, 1dvh, 10px); color: #73512d; }
.welcome-card h1 { margin: 0; font-size: clamp(20px, min(4.2vw, 4.4dvh), 32px); font-weight: 700; line-height: 1.45; text-wrap: balance; }
.welcome-subtitle { margin: clamp(4px, 1dvh, 10px) 0 0; font-size: clamp(13px, min(2.4vw, 2.4dvh), 17px); font-weight: 600; line-height: 1.8; text-wrap: balance; }
.welcome-divider { display: flex; align-items: center; justify-content: center; gap: 8px; width: 65%; margin: clamp(2px, .6dvh, 6px) auto 2px; color: #9b794d; }
.welcome-divider::before, .welcome-divider::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, #aa8658); }
.welcome-divider::after { transform: rotate(180deg); }
.welcome-divider span { font-size: clamp(14px, 2dvh, 18px); line-height: 1; }
.welcome-instructions { list-style: none; padding: 0; margin: 0; text-align: left; }
.welcome-instructions li { display: grid; grid-template-columns: clamp(64px, min(18vw, 14dvh), 132px) minmax(0, 1fr); gap: clamp(10px, 3vmin, 28px); align-items: center; padding: clamp(4px, 1.2dvh, 12px) 6px; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; font-size: clamp(13px, min(2.5vw, 2.5dvh), 18px); font-weight: 500; line-height: 1.8; overflow-wrap: anywhere; }
.welcome-instructions li + li { border-top: 1px solid rgb(139 103 60 / 48%); }
.welcome-icon { display: grid; place-items: center; padding: clamp(3px, .6dvh, 6px) clamp(4px, .8dvh, 8px); border: 1px solid #a38256; border-radius: 45%; background: rgb(255 244 220 / 15%); }
.welcome-icon svg { display: block; width: 100%; height: auto; }
.welcome-footer { margin: clamp(4px, 1.2dvh, 12px) 0 clamp(6px, 1.6dvh, 16px); font-size: clamp(13px, min(2.3vw, 2.3dvh), 17px); font-weight: 600; line-height: 1.8; text-wrap: balance; }
.welcome-close, .welcome-explore { color: #fff3d2; background: linear-gradient(#74502f, #422817); border: 1px solid #e0bb70; box-shadow: 0 0 0 2px #50351f, inset 0 0 0 3px #8b663b, 0 3px 8px rgb(50 27 9 / 25%); cursor: pointer; touch-action: manipulation; }
.welcome-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; padding: 8px; border-radius: 50%; }
.welcome-close svg { width: 24px; height: 24px; stroke-width: 2; }
.welcome-explore { min-height: clamp(44px, 6dvh, 52px); max-width: 100%; padding: clamp(4px, .8dvh, 8px) clamp(24px, 6vmin, 58px); border-radius: 20px 8px; font: 700 clamp(18px, min(3.5vw, 3.8dvh), 27px)/1.5 "Yu Mincho", "Hiragino Mincho ProN", serif; letter-spacing: .08em; overflow-wrap: anywhere; }
.welcome-close:hover, .welcome-explore:hover { background: linear-gradient(#89603a, #58351d); }
.welcome-close:focus-visible, .welcome-explore:focus-visible { outline: 3px solid #51351e; outline-offset: 4px; }
.welcome-corner { position: absolute; z-index: 1; width: clamp(34px, 7vw, 52px); height: clamp(34px, 7vw, 52px); pointer-events: none; }
.welcome-corner--tl { top: -7px; left: -7px; }
.welcome-corner--tr { top: -7px; right: -7px; transform: rotate(90deg); }
.welcome-corner--bl { bottom: -7px; left: -7px; transform: rotate(-90deg); }
.welcome-corner--br { bottom: -7px; right: -7px; transform: rotate(180deg); }
@media (max-width: 480px) {
  .welcome-card { border-width: 8px; }
  .welcome-close { top: 8px; right: 8px; }
  .welcome-instructions li { padding-inline: 0; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .welcome-compass { width: clamp(84px, 25dvh, 120px); height: clamp(24px, 7dvh, 34px); }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-pop, .welcome-card { transition: none; }
  .welcome-card, .welcome-pop.is-closing .welcome-card { transform: none; }
}
/* s261: keep Japanese phrases intact when wrapping */
.welcome-card h1, .welcome-card p { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }

/* s265: slower, softer entrance; page 2/2 (town map); unified headings; smaller buttons. */
.welcome-pop { transition: opacity 2.2s cubic-bezier(.22, .61, .36, 1); }
.welcome-card { transform: translateY(18px) scale(.955); transition: transform 2.2s cubic-bezier(.16, .84, .3, 1); }
.welcome-pop.is-visible .welcome-card { transform: none; }
.welcome-pop.is-closing { transition-duration: .4s; }
.welcome-pop.is-closing .welcome-card { transform: scale(.985); transition-duration: .4s; }
.welcome-card.is-turning .welcome-content:not(.is-off) { animation: welcome-turn .6s ease-out; }
@keyframes welcome-turn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.welcome-head2 { position: relative; display: flex; align-items: center; justify-content: center; min-height: clamp(44px, 9dvh, 76px); margin: 0 0 clamp(2px, .8dvh, 8px); }
.welcome-compass2 { position: absolute; left: 0; top: 50%; width: clamp(44px, 9dvh, 76px); height: clamp(44px, 9dvh, 76px); transform: translateY(-50%); color: #7a5433; stroke-width: 1.2; }
.welcome-card h1.welcome-title { position: relative; margin: 0; padding: 0 clamp(48px, 10dvh, 80px); color: #4a2c16; font-size: clamp(20px, min(4.2vw, 4.4dvh), 32px); font-weight: 700; line-height: 1.45; letter-spacing: .04em; text-wrap: balance; }
.welcome-cloud { position: absolute; right: clamp(-10px, -1vw, 0px); top: -.35em; width: 2.1em; height: .9em; }
.welcome-nav { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2.4vmin, 22px); flex-wrap: wrap; margin-top: clamp(4px, 1dvh, 10px); }
.welcome-page-no { color: #6b4a2c; font: 700 clamp(13px, 1.9dvh, 16px)/1 "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; letter-spacing: .1em; white-space: nowrap; }
.welcome-explore, .welcome-next, .welcome-prev { min-height: 38px; padding: 4px clamp(14px, 3vmin, 24px); border-radius: 999px; font: 700 clamp(14px, min(2.4vw, 2.4dvh), 17px)/1.4 "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; letter-spacing: .06em; white-space: nowrap; }
.welcome-next, .welcome-prev { color: #fff3d2; background: linear-gradient(#8a5a36, #6a4126); border: 1px solid #e0bb70; box-shadow: 0 0 0 2px #50351f, 0 3px 8px rgb(50 27 9 / 25%); cursor: pointer; touch-action: manipulation; }
.welcome-next:hover, .welcome-prev:hover { background: linear-gradient(#9c6a42, #7a4c2c); }
.welcome-next:focus-visible, .welcome-prev:focus-visible { outline: 3px solid #51351e; outline-offset: 4px; }
.welcome-p2-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(10px, 2.6vmin, 28px); align-items: center; }
.welcome-map2 { display: block; width: 100%; height: auto; max-height: min(62dvh, 560px); object-fit: contain; }
.welcome-guides { display: grid; gap: clamp(8px, 2dvh, 18px); }
.welcome-guide { display: grid; justify-items: center; gap: 4px; padding: clamp(8px, 2.2dvh, 22px) clamp(10px, 2vmin, 18px); border: 3px solid #d7b48a; border-radius: 18px; background: rgb(255 250 240 / 92%); box-shadow: inset 0 0 0 2px #f3e3c6; text-align: center; }
.welcome-pin { width: clamp(36px, 7dvh, 58px); height: auto; }
.welcome-guide p { margin: 0; color: #4a3220; font: 700 clamp(13px, min(2.2vw, 2.4dvh), 18px)/1.6 "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; }
@media (max-aspect-ratio: 4/5) {
  .welcome-p2-body { grid-template-columns: 1fr; }
  .welcome-map2 { max-height: 46dvh; margin: 0 auto; }
  .welcome-guides { grid-template-columns: 1fr 1fr; }
  .welcome-guide p { font-size: clamp(11px, 3.2vw, 14px); }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-pop, .welcome-card { transition: none; }
  .welcome-card, .welcome-pop.is-visible .welcome-card { transform: none; }
  .welcome-card.is-turning .welcome-content:not(.is-off) { animation: none; }
}
@media (max-width: 520px) {
  .welcome-card h1.welcome-title { padding: 0 34px; font-size: clamp(18px, 5.4vw, 22px); }
  .welcome-compass2 { width: 36px; height: 36px; left: -6px; }
}
.welcome-guide p { word-break: keep-all; overflow-wrap: normal; }
.welcome-card h1.welcome-title { word-break: keep-all; overflow-wrap: normal; }
.welcome-map2 { max-height: min(66dvh, 600px); }

/* s270: both pages share one panel size (stacked in one grid cell); larger body text. */
.welcome-fit { width: min(900px, 94vw); }
.welcome-card { display: grid; }
.welcome-card > .welcome-content { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; }
.welcome-content.is-off { visibility: hidden; pointer-events: none; }
.welcome-subtitle { font-size: clamp(15px, min(2.7vw, 2.7dvh), 20px); }
.welcome-instructions li { font-size: clamp(14px, min(2.8vw, 2.8dvh), 21px); }
.welcome-footer { font-size: clamp(14px, min(2.6vw, 2.6dvh), 20px); }
.welcome-guide p { font-size: clamp(14px, min(2.5vw, 2.7dvh), 21px); }
.welcome-explore, .welcome-next, .welcome-prev { font-size: clamp(15px, min(2.6vw, 2.6dvh), 19px); min-height: 40px; }
.welcome-page-no { font-size: clamp(14px, 2.1dvh, 18px); }
.welcome-map2 { max-height: min(70dvh, 640px); }
@media (max-aspect-ratio: 4/5) {
  .welcome-fit { width: 92vw; }
  .welcome-map2 { max-height: 48dvh; }
  .welcome-guide p { font-size: clamp(12px, 3.5vw, 15px); }
  .welcome-instructions li { font-size: clamp(13px, 3.7vw, 16px); }
}
/* s274: all fixed action bubbles, including controller-owned buttons. Keep
   touch bicycle driving controls; E and scene picking still own interactions. */
#action-hint, #stand-button,
#action-controls > .stand-button, #action-controls > .action-hint,
#action-controls > .bicycle-hint { display: none !important; }
.choice-key { display: inline-block; min-width: 1.5em; margin-left: .35em; padding: 0 .3em; border: 1px solid currentColor; border-radius: 4px; font: 700 .78em/1.4 system-ui, sans-serif; opacity: .85; }
/* Avatar-anchored E hint. The s272 fixed action controls remain hidden. */
.seating-key-hint {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 12;
  padding: 2px 5px;
  border: 1px solid rgb(184 147 106 / 65%);
  border-radius: 5px;
  background: rgb(255 248 234 / 78%);
  color: #795b39;
  font: 500 11px/1.4 system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.seating-key-hint[hidden] { display: none; }
.seating-key-hint.is-actionable { pointer-events: auto; cursor: pointer; }

/* s276: page1 footer text below nav, centered */
.welcome-footer--below { text-align: center; margin: clamp(6px, 1.4dvh, 14px) auto 0; max-width: 100%; }

/* s277: page-1 text stays put; its nav sits at the card bottom like page 2. */
.welcome-page1 { justify-content: flex-start; }
.welcome-p1-top { flex: 1 1 0; }
@media (max-width: 600px) { .welcome-p1-top { flex-basis: 60px; } }
.welcome-nav-ghost { flex: none; height: 40px; margin-top: clamp(4px, 1dvh, 10px); }
.welcome-p1-gap { flex: 1 0 0; min-height: 14px; }
.welcome-nav--p1 { flex: none; }
.welcome-page2 > .welcome-nav { margin-top: auto; }
