/* The world map (src/shell/world-scene.js draws it, src/shell/world-layout.js says where everything is). Shared by Pick
   a game (index.html, src/shell/world.js) and any page that shows the world: link this file and put sceneHtml() in a
   .wstage of any size.
   .wstage: the paper sea, full-bleed; a size container. .wmap: the 1920 x 1080 canvas, scaled so its whole height and its 4:3
   middle (SAFE) always show, centred: nothing near its top or bottom edge is ever cut (a browser window is usually wider
   than 16:9; there the paper sea runs on past the canvas's sides). --u is one canvas unit. Inside .wmap everything is
   sized in cqw (1% of the canvas's width), so the composition is the same on every screen. Cheap on a weak classroom PC: the land is one static SVG; a
   place's glow is a ready-made picture faded by opacity and its lift a transform; nothing animates a filter. */
.wstage { position: relative; overflow: hidden; container-type: size; background: #4c9fd6 var(--grain, none); }
.wstage::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='120'%3E%3Cg fill='none' stroke='%23a9dcf7' stroke-width='3.2' stroke-linecap='round' opacity='.75'%3E%3Cpath d='M14 34 q10 -9 20 0 t20 0'/%3E%3Cpath d='M104 92 q10 -9 20 0 t20 0'/%3E%3C/g%3E%3C/svg%3E"); background-size: 9cqw auto; }
.wmap { --u: min(100cqh / 1080, 100cqw / 1440); position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 1920); height: calc(var(--u) * 1080); translate: -50% -50%; container-type: inline-size; }
.wbase { position: absolute; inset: 0; pointer-events: none; will-change: transform; }   /* the still art: one layer, rasterised once */
.wland { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wland .wdie { fill: #fff; stroke: #fff; stroke-width: 26; stroke-linejoin: round; }
.wland .wpaper { stroke: #4a2c1a; stroke-width: 4; stroke-linejoin: round; }
.wland .wzone { stroke: rgba(74, 44, 26, .3); stroke-width: 2; stroke-linejoin: round; }
.wland .wroad-edge, .wland .wroad, .wland .wriver-edge, .wland .wriver, .wland .wriver-shine { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wland .wroad-edge { stroke: #a87a48; stroke-width: 21; }
.wland .wroad { stroke: #f2dcaa; stroke-width: 14; }
.wland .wriver-edge { stroke: #fff; stroke-width: 46; }
.wland .wriver { stroke: #4ea7de; stroke-width: 33; }
.wland .wriver-shine { stroke: #b6e3fb; stroke-width: 3.5; stroke-dasharray: 16 30; }
.wmap img { user-select: none; -webkit-user-drag: none; }
.wsea, .wprop { position: absolute; pointer-events: none; filter: drop-shadow(.15cqw .3cqw 0 rgba(74, 44, 26, .26)); }
.wsea { filter: drop-shadow(0 .3cqw 0 rgba(22, 61, 99, .3)); }
/* a place: its shadow, its glow and its cut-out stacked in one box, the box the cut-out's own shape, so the glow picture
   (20% bigger all round) and the shadow picture (6%) line up with it (tools/world_glow.py) */
.place { position: absolute; will-change: transform; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; outline: none; -webkit-tap-highlight-color: transparent; animation: placein .5s calc(var(--i) * 45ms) cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes placein { from { transform: translateY(4%) scale(.92); opacity: 0; } }
.place img { position: absolute; display: block; pointer-events: none; }
.place .cut { left: 0; top: 0; width: 100%; height: 100%; transform-origin: 50% 85%; transition: transform .34s cubic-bezier(.25, .9, .3, 1.2); }
.place .shadow { left: -6%; top: -6%; width: 112%; height: 112%; opacity: .34; transform: translate(.7%, 2%); transition: transform .34s ease, opacity .34s ease; }
.place .glow { left: -20%; top: -20%; width: 140%; height: 140%; opacity: 0; transition: opacity .34s ease; }
.place.open { cursor: pointer; }
.place.open .cut, .place.open .shadow, .place .glow { will-change: transform, opacity; }
.place.lit { z-index: 3; }
.place.lit .glow { opacity: 1; }
.place.open.lit .cut { transform: translateY(-2.6%) scale(1.035); }
.place.open.lit .shadow { transform: translate(1.4%, 5%) scale(1.035); opacity: .5; }
/* asleep: the same picture, a little quieter, and its name on a plain paper tab with a "soon" chip (the .tab rules below) */
.place.asleep .cut { filter: saturate(.72) brightness(.98); }
.place .tab.sleep { font-size: 1.6cqw; background: var(--paper, #fffaf0) var(--grain, none); padding: .32cqw .5cqw .4cqw .85cqw; border-width: .17cqw; box-shadow: 0 .26cqw 0 rgba(74, 44, 26, .35); rotate: .9deg; }
.place .soon { display: inline-flex; align-items: center; gap: .4cqw; margin-left: .55cqw; font: normal 1.1cqw/1 var(--display, "Lilita One", system-ui, sans-serif); letter-spacing: .05em; color: var(--ink, #4a2c1a); background: #dcebf6 var(--grain, none); padding: .24cqw .55cqw .3cqw .45cqw; border-radius: .45cqw; }
.place .soon::before { content: ""; width: .5cqw; height: .5cqw; border-radius: 50%; border: .14cqw solid var(--ink, #4a2c1a); background: #4c9fd6; }
@media (hover: hover) { .place.asleep:hover .soon { animation: snooze .7s ease-in-out; } }
@keyframes snooze { 30% { rotate: -3deg; } 60% { rotate: 10deg; } }
/* an open place's name on a paper tab under it; its Play tab joins the name while it shines (the tab grows both ways
   from its centre, into the room world-layout.js keeps for it) */
.place .tab { position: absolute; z-index: 2; translate: -50% 0; display: flex; align-items: center; white-space: nowrap; pointer-events: none; font: 2cqw/1 var(--display, "Lilita One", system-ui, sans-serif); letter-spacing: .02em; color: var(--ink, #4a2c1a); background: var(--yellow, #ffd84d) var(--grain, none); padding: .4cqw 1.05cqw .5cqw; border: .2cqw solid var(--ink, #4a2c1a); border-radius: .7cqw; box-shadow: 0 .32cqw 0 rgba(74, 44, 26, .45); rotate: -1.2deg; }
.place .tab b { font: inherit; }
.place .play { display: inline-block; overflow: hidden; max-width: 0; margin-left: 0; font: normal 1.5cqw/1 var(--display, "Lilita One", system-ui, sans-serif); color: var(--ink, #4a2c1a); text-shadow: 0 .1em 0 rgba(0, 0, 0, .25); background: var(--green, #57c94f) var(--grain, none); border-radius: .5cqw; padding: .3cqw 0 .38cqw; opacity: 0; transition: max-width .26s cubic-bezier(.2, 1, .4, 1), margin-left .26s, padding .26s, opacity .2s; }
.place.lit .play { max-width: 6cqw; margin-left: .6cqw; padding: .3cqw .65cqw .38cqw; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .place { animation: none; } .place img, .place .play { transition: none; } }

/* Pick a game (src/shell/world.js): the map full-screen under a small Back + title in the top-left sea, and Party
   Pinball's board drawer from the bottom-left, short of Puddle Bay, so the place of the board under the pointer can
   light up on the map */
.world { position: fixed; inset: 0; animation: fade .3s ease-out; }
.worldbar { position: absolute; z-index: 5; top: .45rem; left: .6rem; display: flex; align-items: center; gap: .8rem; pointer-events: none; }
.worldbar .btn { padding: .3em .9em; font-size: 1.05rem; pointer-events: auto; }
.worldtitle { font-size: 1.7rem; color: #fff; -webkit-text-stroke: .18em var(--ink); paint-order: stroke fill; letter-spacing: .03em; rotate: -1deg; }
.world .drawer { --uu: min(100cqh / 1080, 100cqw / 1440); position: absolute; z-index: 6; left: 0; bottom: 0; width: min(100cqw, max(44rem, 50cqw + var(--uu) * 420)); padding: .6rem .9rem .9rem; background: var(--paper) var(--grain); border: .22rem solid var(--ink); border-left: 0; border-bottom: 0; border-radius: 0 1.3rem 0 0; box-shadow: .3rem -.35rem 0 rgba(74, 44, 26, .28); container-type: inline-size; animation: drawerup .32s cubic-bezier(.2, 1.15, .4, 1); }
@keyframes drawerup { from { transform: translateY(105%); } }
.world .drawer header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; } .world .drawer h3 { font-size: 1.8rem; }
.world .drawer .btn { padding: .2em .7em; font-size: 1.05rem; }
.world .boardrow { display: grid; grid-template-columns: repeat(8, 1fr); gap: .55rem; }
@container (max-width: 40rem) { .world .boardrow { grid-template-columns: repeat(4, 1fr); } }
.world .boardpick { display: grid; gap: .3rem; align-content: start; justify-items: center; padding: .3rem .3rem .4rem; background: #fff; border: .16rem solid var(--ink); border-radius: .7rem; font: 600 .88rem/1.1 var(--text); text-align: center; box-shadow: 0 .22rem 0 rgba(74, 44, 26, .3); transition: transform .15s; }
.world .boardpick img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: .13rem solid var(--ink); border-radius: .45rem; }
.world .boardpick:hover, .world .boardpick:focus-visible { background: #fff3a8; transform: translateY(-.15rem); } .world .boardpick.on { background: var(--yellow); }
.world .boardpick:focus-visible, .worldbar .btn:focus-visible, .world .drawer .btn:focus-visible { outline: .22rem solid var(--blue); outline-offset: .15rem; }
.world.boards .place .play { max-width: 0; margin-left: 0; padding: .3cqw 0 .38cqw; opacity: 0; }   /* the boards are open: no Play tab on the map */
@media (prefers-reduced-motion: reduce) { .world, .world .drawer { animation: none; } }
