/* Pearl Diver v4: voyage map, sea sheet, sky by time of day, message-in-a-bottle results. */
.p-body.map-body { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.map-wrap { direction: ltr; flex: 1; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.map-wrap::-webkit-scrollbar { display: none; }
.world { display: block; height: 100%; aspect-ratio: 3 / 1; width: auto; }
.world .grid { stroke: #fff; stroke-opacity: 0.12; stroke-width: 2; stroke-dasharray: 10 14; fill: none; }
.world .shallow { fill: none; stroke: #b9f4ff; stroke-opacity: 0.55; stroke-width: 34; stroke-linejoin: round; }
.world .land { fill: url(#sand); stroke: #8a5a2b; stroke-width: 5; stroke-linejoin: round; }
.world .inland { fill: #3aa8cf; stroke: #8a5a2b; stroke-width: 4; }
.world .compass circle { fill: rgba(255, 246, 233, 0.22); stroke: #fff6e9; stroke-width: 4; }
.world .compass path { fill: #fff6e9; stroke: #8a5a2b; stroke-width: 3; }
.world .compass text { fill: #fff6e9; font: 700 40px Fredoka, sans-serif; text-anchor: middle; }
.world .whale path { fill: #1d5f86; stroke: #0b3b56; stroke-width: 4; opacity: 0.8; }
.world .whale circle { fill: #fff; }
.world .route { fill: none; stroke: #fff; stroke-opacity: 0.75; stroke-width: 8; stroke-dasharray: 22 18; stroke-linecap: round; }
.world .route.done { stroke: #ffd66b; stroke-opacity: 1; stroke-width: 11; filter: drop-shadow(0 0 6px rgba(255, 214, 107, 0.8)); }
.world .medal { cursor: pointer; }
.world .m-ring { fill: url(#medal); stroke: #7a440c; stroke-width: 5; transform-box: fill-box; transform-origin: center; }
.world .m-face { fill: #0b4d6b; }
.world .m-label { fill: rgba(6, 40, 60, 0.88); stroke: #ffd66b; stroke-width: 3; }
.world .m-name { fill: #fff6e9; font: 700 28px Fredoka, 'Baloo Bhaijaan 2', sans-serif; text-anchor: middle; }
.world .m-stars { fill: #ffe48f; font: 700 26px Fredoka, sans-serif; text-anchor: middle; paint-order: stroke; stroke: #06283a; stroke-width: 6; }
.world .m-lock { fill: #fff6e9; stroke: #fff6e9; stroke-width: 5; fill-opacity: 0.9; }
.world .medal.locked { filter: grayscale(1) brightness(0.8); opacity: 0.75; }
.world .medal.current .m-ring { animation: ringPulse 1.4s ease-in-out infinite; }
@keyframes ringPulse { 50% { transform: scale(1.12); } }
.world .stamp circle { fill: rgba(255, 255, 255, 0.85); stroke: #c0392b; stroke-width: 6; }
.world .stamp text { fill: #c0392b; font: 700 40px sans-serif; text-anchor: middle; }
.world .ship { animation: shipBob 2.2s ease-in-out infinite; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.3)); }
@keyframes shipBob { 50% { translate: 0 -10px; } }
.map-hud { position: absolute; left: calc(var(--u) * 3); bottom: calc(env(safe-area-inset-bottom) + var(--u) * 4); pointer-events: none; }
.map-hud .pass { display: inline-block; padding: 0.35em 0.9em; border-radius: 99px; background: rgba(6, 40, 60, 0.85); color: #ffe48f; font: 700 calc(var(--u) * 3.6) var(--font); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }

.region-sheet { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; background: rgba(2, 22, 34, 0.45); animation: deckIn 0.2s ease both; }
.rs-card { position: relative; width: 100%; padding: calc(var(--u) * 6) calc(var(--u) * 5) calc(env(safe-area-inset-bottom) + var(--u) * 6); border-radius: calc(var(--u) * 7) calc(var(--u) * 7) 0 0;
  background: linear-gradient(#fffaf1, #ecd9b6); color: #5a3a16; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35); animation: rise 0.4s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.rs-card h3 { margin: 0 0 0.4em; font: 700 calc(var(--u) * 7) var(--font); }
.rs-close { position: absolute; top: calc(var(--u) * 4); right: calc(var(--u) * 4); width: calc(var(--u) * 9); height: calc(var(--u) * 9); border: 0; border-radius: 50%; background: rgba(90, 58, 22, 0.12); color: #5a3a16; font: 700 calc(var(--u) * 4.5) var(--font); }
[dir=rtl] .rs-close { right: auto; left: calc(var(--u) * 4); }
.rs-sig { display: flex; align-items: center; gap: 0.6em; margin-bottom: 0.6em; }
.rs-sig img { width: calc(var(--u) * 14); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25)); }
.rs-sig small { display: block; font: 600 calc(var(--u) * 3.2) var(--font); color: #2e7d9b; }
.rs-sig b { font: 700 calc(var(--u) * 5.2) var(--font); }
.rs-fact { padding: 0.7em 0.9em; border-radius: 1em; background: rgba(46, 125, 155, 0.1); margin-bottom: 0.9em; }
.rs-fact b { font: 700 calc(var(--u) * 3.6) var(--font); color: #c27716; }
.rs-fact p { margin: 0.3em 0 0; font: 500 calc(var(--u) * 3.6) var(--font); line-height: 1.4; }
.rs-levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: calc(var(--u) * 2); }

/* the sky over the deck follows the real time of day */
.deck-scene.sky-dawn { background: linear-gradient(#5b6fb8 0%, #e79ab0 40%, #ffc89a 65%, #ffe9b8 80%); }
.deck-scene.sky-day { background: linear-gradient(#3fa9e8 0%, #7fcff2 45%, #c9efff 75%, #e8f8ff 82%); }
.deck-scene.sky-day .deck-sun { top: 30%; left: 70%; background: radial-gradient(circle, #fffbe6 0 22%, rgba(255, 248, 200, 0.7) 34%, rgba(255, 240, 180, 0) 68%); }
.deck-scene.sky-night { background: linear-gradient(#070b2a 0%, #16205a 45%, #2a3d7a 72%, #3d5a8f 82%); }
.deck-scene.sky-night .deck-sun { left: 26%; top: 28%; width: 22%; background: radial-gradient(circle, #f4f6ff 0 30%, rgba(220, 230, 255, 0.35) 42%, rgba(200, 215, 255, 0) 70%); }
.deck-scene.sky-night::before { content: ''; position: absolute; inset: 0 0 45% 0; opacity: 0.9; animation: twinkle 3s ease-in-out infinite alternate;
  background-image: radial-gradient(2px 2px at 12% 18%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 8%, #fff, transparent), radial-gradient(2px 2px at 48% 26%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 64% 12%, #fff, transparent), radial-gradient(2px 2px at 82% 22%, #fff, transparent), radial-gradient(1.5px 1.5px at 90% 6%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 6% 36%, #fff, transparent), radial-gradient(2px 2px at 72% 38%, #fff, transparent), radial-gradient(1.5px 1.5px at 40% 40%, #fff, transparent); }
@keyframes twinkle { to { opacity: 0.5; } }
.deck-scene.sky-night .deck-sea { background: linear-gradient(#1b4f7a, #0a2a45); }
.deck-scene.sky-night .deck-ship { filter: brightness(0.7) drop-shadow(0 8px 6px rgba(0, 0, 0, 0.4)); }

.res-bottle { width: 100%; padding: 0.6em 0.9em; border-radius: 1em; background: linear-gradient(#f9eccb, #ead2a0); color: #5a3a16; box-shadow: inset 0 0 0 2px rgba(138, 90, 43, 0.3); }
.res-bottle b { display: flex; align-items: center; gap: 0.4em; font: 700 calc(var(--u) * 3.6) var(--font); color: #8a5a2b; }
.res-bottle p { margin: 0.25em 0 0; font: 500 calc(var(--u) * 3.3) var(--font); line-height: 1.35; }
.world .pin path { stroke: #fff6e9; stroke-width: 4; stroke-dasharray: 6 8; opacity: 0.85; }
.world .pin circle { fill: #ffd66b; stroke: #7a440c; stroke-width: 4; }
/* the event banner made the bottom block taller: the hero now stands on the deck above it instead of over it */
.home-hero { bottom: calc(var(--u) * 68); height: calc(var(--u) * 56); }
/* on the results board the buttons fill the bottom: the mascot talks from the sky above it */
body[data-mode=results] .mascot { bottom: auto; top: calc(env(safe-area-inset-top) + var(--u) * 17); }
