/* The interface is a playable world. HTML controls mirror its touch targets
   and follow their places through anchors published by the 3D scene. */
#world-layer { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(180deg, #d7ebf1 0%, #b6dbe7 55%, #9ccfdf 100%); }
#world-host { position: absolute; inset: 0; }
#world-host canvas { display: block; width: 100%; height: 100%; touch-action: pinch-zoom; }
#app { position: relative; z-index: 1; pointer-events: none; }
.world-app { --paper-edge: 0 4px 0 var(--ls-color-ink); width: 100%; height: 100dvh; position: relative; }
.world-app button,.world-app a,.world-app input,.world-app summary,.world-app select { pointer-events: auto; }

/* Illustrated fallback: sea, islands and the companion's poster, per place.
   It is the first paint and the lasting view when WebGL or a model fails. */
.world-fallback { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#world-layer[data-scene="true"]:not([data-failed="true"]) .world-fallback { display: none; }
.fallback-sea { position: absolute; inset: 0; background: repeating-radial-gradient(ellipse at 50% 115%, transparent 0 38px, rgb(255 255 255 / 14%) 39px 41px); }
.fallback-island { position: absolute; display: flex; justify-content: center; align-items: center; gap: 4%; width: 30%; height: 22%; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #d5e8c6, #b4d29f); box-shadow: 0 14px 0 #e9dcb8, 0 0 0 10px rgb(255 249 237 / 50%); }
#world-layer .world-fallback .fallback-island img { width: 40%; height: 70%; object-fit: contain; }
.fallback-book { left: 3%; top: 26%; border-radius: 14px; background: linear-gradient(90deg, var(--ls-color-paper) 0 48.5%, #e6dfcf 49.5% 50.5%, var(--ls-color-paper) 51.5%); box-shadow: 0 0 0 7px var(--ls-color-navy), 0 12px 0 7px var(--ls-color-navy); }
.fallback-concepts { right: 3%; top: 26%; }
.fallback-home { left: 33%; top: 58%; width: 34%; height: 22%; }
#world-layer[data-view="book"] :is(.fallback-home,.fallback-concepts),#world-layer[data-view="concepts"] :is(.fallback-home,.fallback-book) { display: none; }
#world-layer[data-view="book"] .fallback-book { left: 7%; width: 72%; top: 22%; height: 58%; }
#world-layer[data-view="concepts"] .fallback-concepts { left: 7%; right: auto; width: 86%; top: 26%; height: 54%; }
#world-layer:is([data-view="book"],[data-view="concepts"]) .fallback-island img { position: absolute; width: 18%; height: 18%; bottom: 6%; right: 6%; opacity: .5; }
#world-layer .world-fallback .fallback-character { position: absolute; height: min(26%, 260px); width: auto; max-width: none; object-fit: contain; left: var(--px, 50%); top: var(--py, 78%); transform: translate(-50%, -96%); }
@media (max-aspect-ratio: 1/1) {
  .fallback-island { width: 42%; height: 18%; }
  .fallback-home { left: 29%; width: 42%; }
  #world-layer[data-view="book"] .fallback-book { left: 5%; width: 90%; top: 24%; height: 50%; }
}

/* HUD: chunky paper controls, like thick card pressed into the world. */
.world-hud { position: absolute; top: max(20px,env(safe-area-inset-top)); left: max(24px,env(safe-area-inset-left)); right: max(24px,env(safe-area-inset-right)); display: flex; align-items: center; justify-content: space-between; gap: 24px; z-index: 12; pointer-events: none; }
.world-hud .header-actions { display: flex; gap: 12px; }
.world-app .world-hud .ls-icon-button,.world-app .world-dock .ls-icon-button,.world-app .dock-home,.world-app .world-hud .profile-switch { border: 2px solid var(--ls-color-ink); background: var(--ls-color-paper); box-shadow: var(--paper-edge); border-radius: 20px; transition: transform var(--ls-motion-press) var(--ls-ease), box-shadow var(--ls-motion-press) var(--ls-ease), background-color var(--ls-motion-feedback); }
.world-app .world-hud .ls-icon-button:active,.world-app .world-dock .ls-icon-button:active,.world-app .dock-home:active,.world-app .world-hud .profile-switch:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ls-color-ink); }
.world-app .world-hud .ls-icon-button[aria-pressed="true"] { background: var(--ls-color-sun-soft); }
.world-hud .profile-switch { max-width: min(42vw,340px); border-radius: 999px !important; padding: 3px 22px 3px 3px; gap: 10px; }
.world-hud .profile-switch img { width: 54px; height: 54px; border-radius: 50%; background: var(--ls-color-mint-soft); }
.world-hud .profile-switch span { font: 700 20px/1 var(--ls-font-display); }
@media (hover: hover) and (pointer: fine) {
  .world-app .world-hud .ls-icon-button:hover,.world-app .world-dock .ls-icon-button:hover,.world-app .dock-home:hover,.world-app .world-hud .profile-switch:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ls-color-ink); }
}

.world-app #main { position: absolute; inset: 0; padding: 0; overflow: visible; pointer-events: none; z-index: 5; transition: opacity 200ms ease; }
.world-home,.book-world,.concept-world,.garden-world { position: absolute; inset: 0; }

/* Title banner: a paper ribbon with folded tails. */
.world-title { position: absolute; z-index: 6; top: calc(max(20px,env(safe-area-inset-top)) + 84px); left: 50%; transform: translateX(-50%); margin: 0; pointer-events: none; filter: drop-shadow(0 4px 0 rgb(36 62 59 / 16%)); }
.world-title > span { position: relative; display: block; padding: 6px 34px 8px; background: var(--ls-color-paper); border: 2px solid var(--ls-color-ink); border-radius: 16px; font: 700 clamp(28px,3.2vw,40px)/1.15 var(--ls-font-display); color: var(--ls-color-ink); white-space: nowrap; }
.world-title::before,.world-title::after { content: ''; position: absolute; top: 14px; width: 34px; height: calc(100% - 10px); background: var(--ls-color-sun); border: 2px solid var(--ls-color-ink); z-index: -1; }
.world-title::before { left: -22px; border-radius: 8px 0 0 8px; clip-path: polygon(0 0,100% 0,100% 100%,0 100%,38% 50%); }
.world-title::after { right: -22px; border-radius: 0 8px 8px 0; clip-path: polygon(0 0,100% 0,62% 50%,100% 100%,0 100%); }
.book-world .world-title::before,.book-world .world-title::after { background: var(--ls-color-sky); }
.concept-world .world-title::before,.concept-world .world-title::after { background: var(--ls-color-coral); }
@media (min-width: 1000px) and (min-aspect-ratio: 1/1) { .world-title { top: max(22px,env(safe-area-inset-top)); } }

/* Destinations on the hub: the whole island is the button, its sign names it. */
.world-gate { position: fixed; left: var(--gx, 3%); top: var(--gy, 24%); width: var(--gw, 44%); height: var(--gh, 44%); border: 0; border-radius: 42%; padding: 0; background: transparent; color: var(--ls-color-ink); }
.gate-sign { position: absolute; left: var(--sx, 50%); top: var(--sy, 88%); transform: translate(-50%, -50%); display: grid; justify-items: center; min-width: 0; }
.gate-plaque { display: inline-flex; align-items: center; gap: 12px; background: var(--ls-color-paper); border-radius: 22px; min-height: 68px; padding: 10px 24px; box-shadow: 0 5px 0 var(--ls-color-ink),0 14px 26px rgb(36 62 59 / 14%); border: 2px solid var(--ls-color-ink); transform: rotate(-3deg); transition: transform 220ms var(--ls-ease), background-color 220ms; }
.gate-plaque strong { font: 700 clamp(22px,2.6vw,34px)/1.1 var(--ls-font-display); white-space: nowrap; }
.gate-plaque .icon { width: 34px; height: 34px; }
.gate-concepts .gate-plaque { transform: rotate(3deg); }
.world-gate:hover .gate-plaque,.world-gate.is-chosen .gate-plaque { transform: translateY(-5px) rotate(0); }
.world-gate:focus-visible { outline: none; box-shadow: none; }
.world-gate:focus-visible .gate-plaque { outline: var(--ls-stroke-focus) solid var(--ls-color-navy); outline-offset: 5px; }

/* Anchored controls move with the world, frame by frame: no transition of their
   own position, even the design system's 0.01 ms one under reduced motion. */
.world-gate,.station,.companion-hit { transition: none; }

/* Stations: floating medallions above their place in the world. */
.station { position: fixed; left: 0; top: 0; z-index: 2; translate: calc(var(--x, 50vw) - 50%) calc(var(--y, 50vh) - 100%); display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; min-height: 64px; padding: 0 0 14px; border: 0; background: transparent; color: var(--ls-color-ink); }
.station::after { content: ''; position: absolute; bottom: 2px; left: 50%; width: 16px; height: 16px; background: var(--ls-color-paper); border-right: 2px solid var(--ls-color-ink); border-bottom: 2px solid var(--ls-color-ink); transform: translateX(-50%) rotate(45deg); border-radius: 0 0 4px 0; }
.station-medal { position: relative; z-index: 1; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--ls-color-paper); border: 3px solid var(--ls-color-ink); box-shadow: 0 5px 0 var(--ls-color-ink); transition: transform 220ms var(--ls-ease), background-color 220ms; animation: station-float 3.2s ease-in-out calc(var(--i, 0) * -0.53s) infinite; }
.concept-bubble .station-medal img { width: 60px; height: 60px; object-fit: contain; }
.concept-bubble[data-category="lire"] .station-medal { background: var(--ls-color-sky-soft); }
.concept-bubble[data-category="compter"] .station-medal { background: var(--ls-color-sun-soft); }
.concept-bubble[data-category="observer"] .station-medal { background: var(--ls-color-coral-soft); }
.station-label { position: relative; z-index: 2; max-width: 138px; margin-top: -20px; padding: 3px 12px 4px; border-radius: 12px; background: var(--ls-color-paper); border: 2px solid var(--ls-color-ink); box-shadow: 0 3px 0 var(--ls-color-ink); font: 700 17px/1.12 var(--ls-font-display); text-align: center; text-wrap: balance; }
/* Pages: the medallion is a sticker on its pop-up card, centred on it. It is a
   page of the manual with its number, or an open double page with a number on
   each side of the spine, so the child finds the page they have in their book. */
.page-stone { translate: calc(var(--x, 50vw) - 50%) calc(var(--y, 50vh) - 50%); padding: 0; }
.page-stone::after { display: none; }
.page-stone .station-medal { border-radius: 16px; background: var(--ls-color-white); overflow: hidden; }
.page-stone:not([data-pages="1"]) .station-medal { width: 132px; }
.page-numbers { display: flex; width: 100%; height: 100%; font: 800 40px/1 var(--ls-font-reading); font-variant-numeric: lining-nums tabular-nums; }
.page-numbers > span { flex: 1; display: grid; place-items: center; }
.page-numbers > span + span { border-left: 3px solid var(--ls-color-ink); }
.page-numbers[data-long="true"] { font-size: 30px; }
.station:hover .station-medal,.station:focus-visible .station-medal { transform: translateY(-4px) scale(1.04); }
.station:focus-visible { outline: none; box-shadow: none; }
.station:focus-visible .station-medal { outline: var(--ls-stroke-focus) solid var(--ls-color-navy); outline-offset: 5px; }
.station.is-near .station-medal { background: var(--ls-color-sun-soft); transform: scale(1.12); box-shadow: 0 5px 0 var(--ls-color-ink), 0 0 0 7px rgb(255 249 237 / 85%), 0 0 0 10px var(--ls-color-action); }
.station.is-chosen .station-medal { animation: station-pop 520ms var(--ls-ease); }
@keyframes station-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes station-pop { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 65% { transform: scale(0.94); } 100% { transform: scale(1); } }

/* The way home, in each place: a small signpost at the bridge. */
.home-gate { padding-bottom: 12px; }
.home-gate[data-offscreen="true"] { visibility: hidden; }
.home-sign { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--ls-color-paper); border: 2px solid var(--ls-color-ink); box-shadow: 0 4px 0 var(--ls-color-ink); transition: transform 220ms var(--ls-ease), background-color 220ms; }
.home-gate.is-near .home-sign { background: var(--ls-color-sun-soft); transform: scale(1.1); }

/* Invitation shared by gates and stations when the companion is close. */
.gate-invitation { position: absolute; top: calc(100% + 12px); left: 50%; z-index: 3; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: 18px; background: var(--ls-color-action); color: var(--ls-color-paper); border: 2px solid var(--ls-color-ink); box-shadow: 0 4px 0 var(--ls-color-ink); white-space: nowrap; opacity: 0; visibility: hidden; transform: translate(-50%,6px); pointer-events: none; }
/* On a station the invitation is a compact badge on the medallion's corner,
   turned towards the centre of the screen so it never covers a neighbour. */
.station .gate-invitation { top: -18px; left: calc(50% + 18px); min-height: 46px; padding: 6px 10px; gap: 6px; border-radius: 16px; transform: none; }
.station[data-side="left"] .gate-invitation { left: auto; right: calc(50% + 18px); }
.station .gate-touch > span,.station .gate-key-label { display: none; }
.station .gate-key { padding-left: 0; border-left: 0; }
.station.is-near .gate-invitation { transform: none; animation-name: station-invite; }
@keyframes station-invite { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.home-gate .gate-invitation { top: -16px; }
.gate-touch { display: inline-flex; align-items: center; gap: 8px; font: 800 18px/1 var(--ls-font-reading); }
.gate-touch .icon { width: 26px; height: 26px; filter: brightness(0) invert(1); }
.gate-key { display: none; align-items: center; gap: 6px; font: 800 17px/1 var(--ls-font-reading); }
.gate-key-label::before { content: ' '; }
.gate-key > span { font-size: 22px; }
.is-near .gate-invitation { opacity: 1; visibility: visible; transform: translate(-50%,0); animation: gate-invite 780ms var(--ls-ease) both; pointer-events: auto; }
.world-gate.is-near .gate-sign { animation: gate-awaken 780ms cubic-bezier(.22,.8,.3,1) both; }
.world-gate.is-near .gate-plaque { background: var(--ls-color-action); color: var(--ls-color-paper); transform: rotate(0); box-shadow: 0 5px 0 var(--ls-color-ink),0 0 0 6px var(--ls-color-paper),0 15px 28px rgb(36 62 59 / 18%); }
.world-gate.is-near .gate-plaque .icon { filter: brightness(0) invert(1); }
.is-near .gate-touch .icon { animation: gate-tap 900ms ease-in-out 2; }
@keyframes gate-awaken { 0% { transform: translate(-50%,-50%); } 45% { transform: translate(-50%,calc(-50% - 13px)); } 72% { transform: translate(-50%,calc(-50% - 3px)); } 100% { transform: translate(-50%,calc(-50% - 6px)); } }
@keyframes gate-invite { 0% { transform: translate(-50%,8px) scale(.9); } 100% { transform: translate(-50%,0) scale(1); } }
@keyframes gate-tap { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-4px); } 65% { transform: translateY(1px); } }
@media (hover:hover) and (pointer:fine) {
  .gate-key { display: inline-flex; padding-left: 12px; border-left: 1px solid rgb(255 249 237 / 45%); }
  .gate-touch > span { display: none; }
}

/* The companion: tap to greet; a bubble carries short spoken lines. */
.companion-hit { position: fixed; left: 0; top: 0; z-index: 1; width: var(--cw, 80px); height: var(--ch, 120px); translate: calc(var(--cx, 50vw) - 50%) calc(var(--cy, 70vh) - 50%); border: 0; border-radius: 40%; background: transparent; }
.companion-hit[data-visible="false"] { visibility: hidden; }
.companion-hit:focus-visible { outline: var(--ls-stroke-focus) solid var(--ls-color-navy); outline-offset: 4px; box-shadow: none; }
.companion-hint { position: absolute; left: calc(50% + 30px); top: -22px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--ls-color-paper); border: 2px solid var(--ls-color-ink); box-shadow: 0 4px 0 var(--ls-color-ink); animation: hint-nudge 2.8s ease-in-out infinite; }
.companion-hint .icon { width: 28px; height: 28px; }
@keyframes hint-nudge { 0%,70%,100% { transform: translateY(0) rotate(0); } 78% { transform: translateY(-6px) rotate(-8deg); } 86% { transform: translateY(0) rotate(4deg); } }
.companion-bubble { position: fixed; left: 0; top: 0; z-index: 4; translate: calc(var(--bx, 50vw) - 50%) calc(var(--by, 50vh) - 100% - 22px); width: max-content; max-width: min(250px, 72vw); margin: 0; padding: 10px 18px 12px; border-radius: 20px; background: var(--ls-color-white); border: 2px solid var(--ls-color-ink); box-shadow: 0 4px 0 var(--ls-color-ink); font: 700 21px/1.2 var(--ls-font-display); text-align: center; pointer-events: none; opacity: 0; transform: scale(.6); transform-origin: 50% 110%; transition: opacity 180ms ease, transform 260ms var(--ls-ease); }
.companion-bubble::after { content: ''; position: absolute; left: 50%; bottom: -10px; width: 16px; height: 16px; background: var(--ls-color-white); border-right: 2px solid var(--ls-color-ink); border-bottom: 2px solid var(--ls-color-ink); transform: translateX(-50%) rotate(45deg); }
.companion-bubble.is-visible { opacity: 1; transform: scale(1); }

/* Dock. */
.world-dock { position: absolute; z-index: 12; left: max(24px,env(safe-area-inset-left)); right: max(24px,env(safe-area-inset-right)); bottom: max(20px,env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; pointer-events: none; }
.world-dock > .ls-icon-button { justify-self: end; }
.world-signature { display: flex; align-items: center; gap: 18px; }
.world-wordmark { font: 800 22px/1 var(--ls-font-display); color: var(--ls-color-action); letter-spacing: -.5px; padding: 8px 14px; background: rgb(255 249 237 / 82%); border-radius: 14px; }
.world-wordmark span { font-weight: 500; font-size: 17px; }
.dock-home { display: inline-flex; justify-self: start; align-items: center; min-height: 64px; min-width: 64px; gap: 10px; padding: 10px 22px 10px 16px; color: var(--ls-color-ink) !important; text-decoration: none; font: 700 22px/1 var(--ls-font-display); }
.dock-home .icon { width: 32px; height: 32px; }
.adventure-token { position: relative; width: 76px; height: 76px; border: 3px solid var(--ls-color-ink); border-radius: 50%; background: var(--ls-color-mint-soft); display: grid; place-items: center; box-shadow: 0 5px 0 var(--ls-color-ink); text-decoration: none; transition: transform var(--ls-motion-press) var(--ls-ease); }
.adventure-token:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ls-color-ink); }
.adventure-token > img { width: 60px; height: 60px; }
.adventure-token > span { position: absolute; right: -8px; bottom: -4px; display: grid; place-items: center; width: 30px; height: 30px; background: var(--ls-color-sun); color: var(--ls-color-ink); border: 2px solid var(--ls-color-ink); border-radius: 50%; font-size: 16px; font-weight: 800; }
.keyboard-hint { display: none; gap: 4px; }
.keyboard-hint kbd { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ls-color-paper); border: 2px solid var(--ls-color-ink); box-shadow: 0 2px 0 var(--ls-color-ink); font: 800 16px/1 var(--ls-font-body); }
@media (hover:hover) and (pointer:fine) and (min-width:900px) { .keyboard-hint { display: inline-flex; } }

/* Pause: the world waits under a soft veil with one big resume button. */
.pause-veil { position: absolute; inset: 0; z-index: 11; display: grid; place-items: center; background: rgb(255 249 237 / 52%); pointer-events: auto; }
.pause-veil[hidden] { display: none; }
.pause-resume { display: grid; justify-items: center; gap: 8px; min-width: 150px; min-height: 150px; padding: 22px 26px 18px; border-radius: 32px; border: 3px solid var(--ls-color-ink); background: var(--ls-color-action); color: var(--ls-color-paper); box-shadow: 0 6px 0 var(--ls-color-ink); font: 700 26px/1 var(--ls-font-display); }
.pause-resume .icon { width: 64px; height: 64px; filter: brightness(0) invert(1); }
.pause-resume:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ls-color-ink); }

/* A puff of clouds covers the change of place, then parts. */
.cloud-wipe { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.cloud-wipe i { --side: -1; --size: 70vmax; position: absolute; top: calc(var(--row) * 1%); left: calc(50% - var(--size) / 2 + var(--shift) * 1vmax); width: var(--size); height: calc(var(--size) * .72); border-radius: 50%; background: radial-gradient(circle at 38% 34%, #ffffff 0 42%, #f4f7f6 64%, #e2eef0 100%); box-shadow: inset -10px -14px 0 rgb(121 189 211 / 18%); transform: translateX(calc(var(--side) * 120vmax)); opacity: 0; }
.cloud-wipe i:nth-child(odd) { --side: 1; }
.cloud-wipe i:nth-child(1) { --row: -24; --shift: -30; }
.cloud-wipe i:nth-child(2) { --row: -20; --shift: 26; --size: 64vmax; }
.cloud-wipe i:nth-child(3) { --row: 8; --shift: -38; --size: 60vmax; }
.cloud-wipe i:nth-child(4) { --row: 10; --shift: 30; --size: 74vmax; }
.cloud-wipe i:nth-child(5) { --row: 30; --shift: -10; --size: 66vmax; }
.cloud-wipe i:nth-child(6) { --row: 34; --shift: 12; --size: 62vmax; }
.cloud-wipe i:nth-child(7) { --row: 52; --shift: -34; --size: 72vmax; }
.cloud-wipe i:nth-child(8) { --row: 56; --shift: 34; --size: 64vmax; }
.cloud-wipe i:nth-child(9) { --row: 74; --shift: -6; --size: 76vmax; }
.cloud-wipe i:nth-child(10) { --row: 70; --shift: 22; --size: 58vmax; }
.cloud-wipe.is-covering i { animation: cloud-in 520ms cubic-bezier(.3,.1,.4,1) calc(var(--i) * 18ms) both; }
.cloud-wipe.is-revealing i { animation: cloud-out 640ms cubic-bezier(.5,0,.6,1) calc(var(--i) * 22ms) both; }
@keyframes cloud-in { from { transform: translateX(calc(var(--side) * 120vmax)); opacity: 1; } to { transform: translateX(0); opacity: 1; } }
@keyframes cloud-out { from { transform: translateX(0); opacity: 1; } to { transform: translateX(calc(var(--side) * -120vmax)); opacity: 1; } }
#app[data-transition="cover"] #main { opacity: 0; transition: opacity 160ms ease; }
#app[data-transition="reveal"] :is(.station,.world-gate,.world-title) { animation: place-in 560ms var(--ls-ease) calc(180ms + var(--i, 0) * 70ms) both; }
@keyframes place-in { from { opacity: 0; scale: .6; } 60% { opacity: 1; scale: 1.08; } to { opacity: 1; scale: 1; } }

/* Everything in the world holds still with pause, a card or a hidden tab. */
.world-app[data-motion-paused="true"] * { animation-play-state: paused !important; }
.world-app[data-motion-paused="true"] :is(.pause-veil,.pause-veil *) { animation-play-state: running !important; }
#world-layer[data-paused="true"] .cloud-wipe i { animation-play-state: running; }

/* Non-world screens. */
.world-app[data-screen="adult"] { background: var(--ls-color-paper); }
.world-app[data-screen="adult"] #main { inset: 110px 28px 114px; overflow-y: auto; overflow-x: hidden; padding: 0 16px 28px; pointer-events: auto; position: absolute; }
.world-app[data-screen="adult"] .metric { position: relative; }
.world-app[data-screen="decouvertes"] #main { inset: 110px 32px 120px; overflow-y: auto; pointer-events: auto; }
.world-app .preview-banner,.world-app .storage-banner { position: relative; z-index: 20; pointer-events: auto; margin: 104px 28px 20px; }
.world-app .child-page { min-height: 450px; }
.world-app .discovery-card { background: rgb(255 249 237 / 94%); }
.platform dialog { z-index: 50; }
.journey-floating { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); text-align: center; padding: 15px 28px; border-radius: 24px; background: var(--ls-color-paper); border: 2px solid var(--ls-color-ink); box-shadow: 0 5px 0 var(--ls-color-ink); }
.journey-floating strong { display: block; font: 700 30px/1.2 var(--ls-font-display); white-space: nowrap; }
.journey-floating > span { display: block; font-size: 18px; }
.world-progress-path { position: absolute; left: 12%; right: 12%; bottom: 16%; display: flex; justify-content: space-between; gap: 24px; list-style: none; padding: 0; margin: 0; }
.world-progress-path li { text-align: center; position: relative; }
.world-progress-path button { display: grid; place-items: center; width: 100px; height: 100px; border: 3px solid var(--ls-color-ink); border-radius: 50%; background: var(--ls-color-paper); box-shadow: 0 6px 0 var(--ls-color-ink); }
.world-progress-path img { width: 76px; height: 76px; }
.world-progress-path button > span { position: absolute; top: 72px; right: -6px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--ls-color-ink); background: var(--ls-color-sun); border: 2px solid var(--ls-color-ink); font-size: 17px; }
.world-progress-path strong { display: inline-block; min-height: 22px; font-size: 17px; margin-top: 14px; padding: 4px 12px; border-radius: 12px; background: var(--ls-color-paper); border: 2px solid var(--ls-color-ink); }
.world-progress-path [aria-current] button { outline: 5px solid var(--ls-color-action); outline-offset: 5px; }

/* Portrait and small screens. */
@media (max-aspect-ratio: 1/1) {
  .world-hud { top: max(16px,env(safe-area-inset-top)); left: 16px; right: 16px; }
  .world-title { top: calc(max(16px,env(safe-area-inset-top)) + 82px); }
  .gate-plaque { gap: 9px; padding: 10px 16px; border-radius: 20px; min-height: 64px; }
  .gate-plaque strong { font-size: 26px; }
  .gate-plaque .icon { width: 28px; height: 28px; }
  .world-progress-path { left: 8%; right: 8%; }
}
@media (max-width: 600px) {
  .world-hud { top: max(12px,env(safe-area-inset-top)); left: 12px; right: 12px; gap: 12px; }
  .world-hud .profile-switch { width: 64px; max-width: none; padding: 3px; }
  .world-hud .profile-switch span { display: none; }
  .world-hud .fullscreen-button { display: none; }
  .world-hud .header-actions { gap: 12px; }
  .world-title { top: calc(max(12px,env(safe-area-inset-top)) + 78px); }
  .world-title > span { font-size: 26px; padding: 4px 22px 6px; }
  .world-title::before,.world-title::after { width: 26px; top: 12px; }
  .world-title::before { left: -16px; }
  .world-title::after { right: -16px; }
  .gate-plaque { gap: 6px; padding: 8px 12px; min-height: 64px; border-radius: 18px; }
  .gate-plaque strong { font-size: 21px; }
  .gate-plaque .icon { display: none; }
  .station-medal { width: 64px; height: 64px; }
  .page-stone:not([data-pages="1"]) .station-medal { width: 104px; }
  .page-numbers { font-size: 30px; }
  .page-numbers[data-long="true"] { font-size: 23px; }
  .concept-bubble .station-medal img { width: 48px; height: 48px; }
  .concept-bubble .station-label { position: absolute; top: calc(100% - 6px); max-width: 140px; font-size: 15px; opacity: 0; visibility: hidden; transition: opacity 180ms; }
  .concept-bubble:is(.is-near,:focus-visible) .station-label { opacity: 1; visibility: visible; }
  .gate-invitation { gap: 8px; padding-inline: 10px; }
  .gate-touch,.gate-key { font-size: 16px; }
  .companion-bubble { font-size: 18px; }
  .world-dock { left: 12px; right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); gap: 12px; }
  .world-wordmark { font-size: 18px; padding: 6px 10px; }
  .world-wordmark span { font-size: 14px; }
  .adventure-token { width: 70px; height: 70px; }
  .adventure-token > img { width: 54px; height: 54px; }
  .dock-home { padding: 10px 14px; }
  .dock-home span { display: none; }
  .journey-floating strong { font-size: 24px; }
  .world-progress-path { left: 14px; right: 14px; gap: 12px; }
  .world-progress-path button { width: 64px; height: 64px; }
  .world-progress-path img { width: 50px; height: 50px; }
  .world-progress-path button > span { width: 26px; height: 26px; font-size: 14px; top: 44px; }
  .world-progress-path strong { font-size: 12px; padding: 3px 6px; }
  .world-app[data-screen="adult"] #main { inset: 98px 12px 112px; padding-inline: 4px; }
  .world-app[data-screen="decouvertes"] #main { inset: 100px 16px 112px; }
  .world-app .preview-banner,.world-app .storage-banner { margin-inline: 12px; }
  .adult .section-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .adult .section-note { max-width: none; text-align: left; }
}
@media (max-width:360px) {
  .gate-plaque { max-width: 100%; padding-inline: 10px; transform: rotate(-2deg); }
  .gate-plaque strong { font-size: 19px; }
  .gate-concepts .gate-plaque { transform: rotate(2deg); }
  .world-title > span { font-size: 23px; }
}
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .world-hud { top: 10px; }
  .world-title { top: 12px; }
  .world-title > span { font-size: 24px; }
  .world-dock { bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-plaque,.station-medal,.home-sign,.companion-bubble { transition: none; }
  .station-medal,.companion-hint { animation: none; }
  .world-gate:hover .gate-plaque,.world-gate.is-chosen .gate-plaque { transform: none; }
  .is-near :is(.gate-sign,.gate-invitation,.gate-touch .icon) { animation: none; }
  .world-gate.is-near .gate-sign { transform: translate(-50%,-50%); }
  #app[data-transition] :is(.station,.world-gate,.world-title) { animation: none; }
}
@media (forced-colors: active) {
  .station-medal,.gate-plaque,.home-sign,.companion-bubble,.world-title > span { border-color: CanvasText; }
  .station.is-near .station-medal,.world-gate.is-near .gate-plaque { outline: 4px solid Highlight; }
}
