:root {
    color-scheme: dark;
    --ink: #102b32;
    --panel: #123941;
    --text: #fff7df;
    --muted: #bed6d1;
    --gold: #ffcb72;
    --blue: #aee6ff;
    --mint: #96f2cf;
    --lilac: #ded0ff;
    --rose: #ffb4a2;
    --sky: #adecfa;
    --brass: #e9c58b;
    --brass-line: #d9b27d70;
    --deep-panel: linear-gradient(155deg, #20374b, #111e32 75%);
    --display-face: Georgia, "Noto Serif", serif;
    font-family: system-ui, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: #0a1423; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button:enabled { cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid #ffde94; outline-offset: 3px; }
h1, h2, h3, p, ul { margin: 0; }
svg { width: 1.2em; height: 1.2em; display: block; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gold { color: var(--gold); }
.blue { color: var(--blue); }
.mint { color: var(--mint); }
.lilac { color: var(--lilac); }
.rose { color: var(--rose); }
.sky { color: var(--sky); }

.game-shell {
    position: relative; isolation: isolate; width: min(100%, 520px); margin-inline: auto; height: 100vh; height: 100dvh; display: grid;
    grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr);
    overflow-x: clip;
    background: linear-gradient(180deg, #08142440, transparent 53%, #17213652),
        #122940 url("skywheel-dusk.webp") center 58% / cover no-repeat;
    box-shadow: 0 0 80px #0008;
}
.game-shell[data-screen="spin"] {
    --wheel-hue: 156;
    --wheel-edge: #a5c584;
    --wheel-foil: #e9efbb;
}
.game-shell[data-screen="spin"][data-wheel-theme="ember"] { --wheel-hue: 15; --wheel-edge: #df9961; --wheel-foil: #ffe0b3; }
.game-shell[data-screen="spin"][data-wheel-theme="twilight"] { --wheel-hue: 259; --wheel-edge: #b5a1ea; --wheel-foil: #ede0ff; }
.game-shell[data-screen="spin"][data-wheel-theme="frost"] { --wheel-hue: 201; --wheel-edge: #a1cfe6; --wheel-foil: #e0f8ff; }
.game-shell[data-screen="spin"][data-wheel-theme="gilded"] { --wheel-hue: 38; --wheel-edge: #dfb06d; --wheel-foil: #fff0bd; }
.game-shell[data-screen="spin"][data-wheel-theme="tide"] { --wheel-hue: 177; --wheel-edge: #7ac9c2; --wheel-foil: #d0fff3; }
.game-shell[data-screen="spin"][data-wheel-theme="storm"] { --wheel-hue: 222; --wheel-edge: #8fb1ee; --wheel-foil: #dae8ff; }
.game-shell[data-screen="spin"][data-wheel-theme="blossom"] { --wheel-hue: 327; --wheel-edge: #d399c2; --wheel-foil: #ffe1ed; }
.wheel-scenery {
    display: none; position: absolute; z-index: -1; inset: 0; pointer-events: none; isolation: isolate;
    background: var(--map-art, none) center 55% / cover no-repeat;
}
.game-shell[data-screen="spin"] .wheel-scenery { display: block; }
.wheel-scenery::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, #0b1626 0%, #0a142ad6 12%, #0e17276b 37%, #131a2a20 70%, #0b142867 100%);
}
.topbar {
    position: relative; z-index: 1; padding: 4px 12px 8px;
    border-bottom: 1px solid var(--brass-line);
    background: radial-gradient(ellipse at 0% 0%, #253c52, transparent 74%), #101d30;
    box-shadow: 0 4px 12px #102d4b55;
}
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 3px; }
.masthead-actions { display: flex; flex: none; align-items: center; }
.brand {
    display: inline-flex; align-items: center; gap: 7px; min-width: 0;
    color: #fff1d2; text-shadow: 0 2px 4px #0b2330b0;
    font: 800 clamp(1rem, 5.65vw, 1.55rem)/1 Georgia, serif;
}
.brand img {
    display: block; width: clamp(27px, 9.5vw, 37px); height: auto; aspect-ratio: 1;
    object-fit: contain; flex: none; filter: drop-shadow(0 2px 2px #10283990);
}
.help-button {
    width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
    color: #ffdb93; border: 1px solid #b48f59; border-radius: 11px; background: #15454ded; box-shadow: 0 3px #10323c6e;
}
.help-button svg { width: 23px; height: 23px; }
.masthead-actions .help-button {
    width: clamp(27px, 9.4vw, 44px); height: 44px; color: #e7d5af;
    border: 0; border-radius: 50%; background: transparent; box-shadow: none;
}
.masthead-actions .help-button svg { width: 19px; height: 19px; }
.masthead-actions .help-button:active { background: #dfeddf18; }
.masthead-actions .help-button:focus-visible { outline-offset: -3px; }
.wallet {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px;
}
.wallet-item {
    --wallet-color: #d5e7f2;
    position: relative; min-width: 0; min-height: 46px; display: grid;
    grid-template-columns: auto minmax(0, 1fr); align-items: center;
    gap: 4px; padding: 4px 5px; text-align: left;
    border: 1px solid #a0b8d14d; border-radius: 11px;
    background: linear-gradient(152deg, #25364b, #132136 84%);
    box-shadow: inset 0 1px #f8f9ff13, 0 3px 7px #070e1b70;
}
.wallet-item > .token { width: clamp(18px, 5.85vw, 27px); filter: drop-shadow(0 2px 2px #080f1e9c); }
.wallet-reading { display: grid; min-width: 0; gap: 2px; }
.wallet-reading strong {
    color: #f9f4e7; font-size: clamp(.8rem, 3.5vw, 1.03rem); font-weight: 800;
    font-variant-numeric: tabular-nums; line-height: 1.15;
}
.wallet-label { color: var(--wallet-color); font-size: .63rem; font-weight: 710; line-height: 1; white-space: nowrap; }
.coin-wallet { --wallet-color: #ffdf9f; }
.part-wallet { --wallet-color: #bbdce9; }
.spin-wallet { --wallet-color: #b7efd5; border-color: #9bdabe82; background: linear-gradient(152deg, #244c4e, #162b3b 84%); }
.spin-wallet strong { color: #d6ffec; }
.bomb-wallet { --wallet-color: #dac7f1; }
.wallet-item:active { filter: brightness(1.15); }
.wallet-item:focus-visible { outline-offset: -3px; }

.screen {
    min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
    scrollbar-width: thin; scrollbar-color: #a7bdcd57 transparent; padding: 10px 15px 16px;
}
.skywheel {
    display: flex; flex-direction: column; align-items: center;
    overflow: hidden; overflow: clip;
    gap: clamp(9px, 1.55vh, 15px); padding-top: 8px;
}
.wheel-heading {
    width: min(100%, 455px); flex: none; min-width: 0; display: flex;
    align-items: center; justify-content: space-between; gap: 10px; padding: 2px 3px 1px;
}
.wheel-heading-copy { min-width: 0; }
.game-shell[data-screen="spin"] .topbar {
    border-bottom-color: hsl(var(--wheel-hue) 34% 72% / .26);
    background: radial-gradient(ellipse at 0% 0%, hsl(var(--wheel-hue) 28% 20%), transparent 74%), #111d30f0;
}
.wheel-heading h1 {
    color: var(--wheel-foil); text-shadow: 0 2px #0b1524, 0 4px 13px #050a14a6;
    font: 800 clamp(1.85rem, 9.1vw, 3.02rem)/.99 var(--display-face);
    letter-spacing: -.055em;
}
.wheel-location {
    display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 5px;
    color: #edf3f7; font-size: .72rem; font-weight: 700;
    text-shadow: 0 1px 4px #071020;
}
.wheel-location strong {
    flex: none; padding: 3px 6px; border: 1px solid hsl(var(--wheel-hue) 36% 70% / .6); border-radius: 6px;
    color: var(--wheel-foil); background: #112033ec; font-size: .63rem;
}
.wheel-location span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.encounter-key { display: flex; flex: none; flex-wrap: wrap; justify-content: end; gap: 5px; }
.encounter-key > span {
    display: inline-flex; align-items: center; gap: 3px; padding: 2px 4px;
    color: #dbe8ef; background: #122235e8; border: 1px solid #9bb4c46a; border-radius: 7px; font-size: .65rem;
}
.encounter-key b, .encounter-key svg { color: var(--wheel-foil); }
.machine {
    position: relative; width: min(100%, 455px); min-height: 0; flex: 0 1 auto;
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px;
    padding: 10px; border: 3px solid transparent; border-radius: 26px;
    background:
        linear-gradient(155deg, hsl(var(--wheel-hue) 20% 30%), #202c42 27%, #162337 74%, hsl(var(--wheel-hue) 19% 26%)) padding-box,
        linear-gradient(135deg, var(--wheel-foil), var(--wheel-edge) 32%, hsl(var(--wheel-hue) 24% 27%) 61%, var(--wheel-edge) 84%, hsl(var(--wheel-hue) 22% 33%)) border-box;
    box-shadow: inset 0 0 0 1px #e7eac35c, inset 0 2px 4px #eef7dd38, 0 4px #090f1c, 0 13px 23px #060e1b94;
}
.machine::before, .machine::after {
    content: ""; position: absolute; z-index: 1; top: 61%; width: 6px; aspect-ratio: 1;
    border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle at 33% 28%, var(--wheel-foil), var(--wheel-edge) 50%, #263243 74%);
    box-shadow: 0 1px 2px #050b14;
}
.machine::before { left: 1px; }
.machine::after { right: 1px; }
.machine-win .spin-result { animation: marquee-win 650ms ease-out; }
@keyframes marquee-win {
    30% { box-shadow: inset 0 0 26px #ffdf8888, 0 0 14px #ffe896; }
}
.win-effects { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.win-effects i {
    position: absolute; left: var(--x); top: var(--y); width: 16px; height: 16px; background: #fff4a4;
    clip-path: polygon(50% 0%, 66% 36%, 100% 50%, 66% 64%, 50% 100%, 34% 64%, 0% 50%, 34% 36%);
    animation: sparkle 650ms ease-out both;
}
.win-effects i:nth-child(3n) { width: 11px; height: 11px; background: #ccfff0; }
.machine[data-win="triple"] .reel-window::after { animation: payline-flare 850ms ease-out; }
@keyframes payline-flare {
    0%, 100% { box-shadow: none; }
    28% { box-shadow: inset 0 0 24px #ffd17a, 0 0 18px #ffe293; }
}
.machine[data-win="triple"] .reel-window::before { animation: jackpot-sweep 960ms ease-out; }
@keyframes jackpot-sweep {
    0% { opacity: 0; transform: translateY(-50%) scaleX(.24); }
    22% { opacity: .95; transform: translateY(-50%) scaleX(1); }
    100% { opacity: 0; transform: translateY(-50%) scaleX(1); }
}
.machine[data-win="triple"] .triple-badge, .rival-top .rival-triple { animation: multiplier-reveal 580ms cubic-bezier(.21,.82,.28,1); }
@keyframes multiplier-reveal {
    0% { opacity: .35; transform: scale(.75); }
    46% { opacity: 1; transform: scale(1.14); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes sparkle {
    0% { opacity: 0; transform: translateY(12px) scale(.3) rotate(0); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--drift), -39px) scale(1.13) rotate(55deg); }
}
.game-effects { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.reward-token { position: absolute; width: 28px; animation: reward-flight 660ms ease-in-out both; }
@keyframes reward-flight {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
    15% { opacity: 1; }
    48% { transform: translate(-50%, -50%) translate3d(calc(var(--dx) * .38 + var(--arc)), calc(var(--dy) * .33), 0) scale(1.2); }
    88% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) translate3d(var(--dx), var(--dy), 0) scale(.58); }
}
.wallet-item.reward-glow { animation: collect-reward 470ms 470ms ease-out both; }
@keyframes collect-reward {
    42% { box-shadow: inset 0 0 14px #fff0a86e, 0 0 9px #ffe1a483; }
}
.spin-result {
    display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 59px;
    padding: 6px 10px; text-align: center; border: 1px solid #e8bc8582; border-radius: 14px 14px 10px 10px;
    background: radial-gradient(ellipse at 50% 125%, hsl(var(--wheel-hue) 34% 28%), transparent 76%), #102133;
    box-shadow: inset 0 2px 7px #081320a6, 0 1px #f0d7a626;
}
.spin-result:has(.storm-discovery:not([hidden])) {
    border-color: #d5a8f7a8;
    background: radial-gradient(ellipse at 50% 125%, #573866, transparent 80%), #1d2440;
}
.spin-result:has(.triple-badge:not([hidden])) { border-color: #f3cb87bd; }
.result-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px 7px; }
.spin-result strong { color: #ffecbb; text-shadow: 0 2px #09121f; font: 800 clamp(1.12rem, 5vw, 1.48rem)/1.13 var(--display-face); }
.spin-result span { color: #d9eceb; font-size: .78rem; line-height: 1.25; }
.spin-result .triple-badge {
    padding: 2px 7px; border: 1px solid #ffe0a1; border-radius: 7px;
    color: #35231c; background: linear-gradient(#fff6cf, #e9b36c);
    box-shadow: inset 0 1px #fff9e7, 0 2px 6px #22170980;
    font-size: .79rem; font-weight: 900; font-variant-numeric: tabular-nums;
}
.reel-frame {
    min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); overflow: hidden;
    border: 1px solid #c19b6dbf; border-radius: 12px; padding: 5px; background: #0b1724;
    box-shadow: 0 1px #f9d49238, inset 0 2px 8px #040910;
}
.reel-window {
    --cell: clamp(54px, 10.1svh, 102px);
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; position: relative;
    height: calc(var(--cell) * 2.67); max-height: 100%; min-height: 0;
    padding: 0 6px; isolation: isolate;
}
.reel-window::before {
    content: ""; position: absolute; z-index: 3; inset: 50% 0 auto;
    height: 3px; background: linear-gradient(90deg, transparent, #fff7ce 20% 80%, transparent);
    box-shadow: 0 0 16px 6px #ffd07f9c; pointer-events: none; opacity: 0;
}
.reel-window::after {
    position: absolute; z-index: 1; inset: 0; content: ""; background: linear-gradient(#3428274c, transparent 34%, transparent 66%, #34282747);
    border-radius: 7px; pointer-events: none;
}
.payline-marker {
    position: absolute; z-index: 2; top: 50%; width: 11px; height: 17px;
    background: linear-gradient(#fff4bc, #e9b06a); filter: drop-shadow(0 1px #784e33);
}
.payline-marker.left { left: -4px; transform: translateY(-50%); clip-path: polygon(0 0, 100% 50%, 0 100%, 27% 50%); }
.payline-marker.right { right: -4px; transform: translateY(-50%); clip-path: polygon(100% 0, 0 50%, 100% 100%, 73% 50%); }
.reel {
    position: relative; overflow: hidden; min-width: 0; min-height: 100%;
    border-radius: 6px; background: linear-gradient(90deg, #c8b391 0%, #f4e4bf 15%, #fff7e4 50%, #eddbb2 88%, #b7a285);
    box-shadow: inset 0 2px #fff9d6, inset 0 0 7px #7853334a;
}
.reel-strip { position: absolute; top: 50%; inset-inline: 0; transform: translateY(-50%); }
.reel-moving .reel-strip { will-change: transform; }
.machine-rolling .reel-frame {
    border-color: #ffce82;
    box-shadow: 0 0 13px #ffcf71b8, inset 0 0 7px #ffdbaa65;
}
.machine-rolling .payline-marker { background: #fff2cb; }
.reel-moving::after {
    content: ""; position: absolute; inset: -84px 0 0; pointer-events: none;
    background: repeating-linear-gradient(transparent 0 38px, #fff6c98f 57px, transparent 84px);
    animation: reel-streaks 460ms linear infinite;
}
@keyframes reel-streaks { to { transform: translateY(84px); } }
.tile { height: var(--cell); display: grid; place-items: center; opacity: .58; }
.tile.active { opacity: 1; border-block: 1px solid #be9358; background: #fffdf08a; }
.tile.reel-match { background: #fff0b8; box-shadow: inset 0 0 20px #e5a94f70, inset 0 0 0 1px #fff5c3; }
.reel-moving .tile { opacity: .8; }
.reel-moving .tile.active { border-color: transparent; background: transparent; }
.reel-moving .token { filter: none; transform: scaleY(1.12); }
.token {
    width: min(var(--cell, 89px), 23vw); aspect-ratio: 1; display: block; flex: none;
    background: url("reel-symbols.webp") var(--token-x, 0%) var(--token-y, 0%) / 300% 200% no-repeat;
    filter: drop-shadow(0 4px 3px #6f492a61);
}
.token-gear { --token-x: 50%; }
.token-spark { --token-x: 100%; }
.token-shield { --token-y: 100%; }
.token-chest { --token-x: 50%; --token-y: 100%; }
.token-wind { --token-x: 100%; --token-y: 100%; }
.token-bomb { background: url("cloud-bomb.webp") center / contain no-repeat; }
.machine-win .reel-match .token { animation: bounce-token 390ms ease-out; }
@keyframes bounce-token {
    37% { transform: translateY(-4px) scale(1.12); }
    72% { transform: translateY(1px) scale(.97); }
}
.machine-controls {
    display: grid; grid-template-columns: auto minmax(63px, 1fr) auto; align-items: center; gap: 8px; padding: 4px;
    color: #fff5d4; border: 1px solid #c09e6b88; border-radius: 9px 9px 13px 13px;
    background: linear-gradient(#223b50, #122739); box-shadow: inset 0 1px #ffffff26;
}
.stake-button {
    min-width: 69px; min-height: 44px; display: grid; align-content: center; gap: 2px; padding: 3px 6px;
    text-align: center; color: #4a3526; font-size: .92rem; line-height: 1;
    border: 1px solid #ffe0a0; border-radius: 7px; background: linear-gradient(#fff0bd, #edbc73);
}
.stake-button > span { display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: .65rem; font-weight: 800; }
.stake-button:disabled { opacity: .72; }
.reserve { display: grid; gap: 3px; min-width: 0; color: #d9e9db; text-align: center; font-size: .72rem; line-height: 1.2; font-weight: 750; }
.reserve strong { color: #d5ffec; font-size: .83rem; font-variant-numeric: tabular-nums; }
.track { height: 7px; border-radius: 20px; background: #0b262c; overflow: hidden; }
.track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #56cbae, #a3efd0); transition: width .2s ease; }
.protection { display: flex; align-items: center; gap: 2px; padding-right: 3px; white-space: nowrap; font-size: .78rem; }
.protection svg { width: 21px; height: 21px; }

.spin-actions { display: flex; flex: none; width: min(100%, 455px); gap: 8px; justify-content: center; align-items: center; }
.launch {
    position: relative;
    flex: 1; min-height: 68px; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 7px 12px; border: 2px solid #fff0a8; border-radius: 24px;
    background: linear-gradient(#43caa2, #119579 62%, #0b6a62);
    box-shadow: inset 0 2px #ecffcb70, 0 6px #134e50, 0 7px 0 1px #8e6d42, 0 10px 17px #22514b8c;
    color: #fffce5; text-shadow: 0 2px #186256; font-weight: 950; font-size: clamp(1.32rem, 6vw, 1.85rem); line-height: 1;
}
.launch span[data-icon] svg { width: 1.15em; height: 1.15em; }
.launch > [data-icon] {
    position: absolute; left: clamp(9px, 4vw, 16px); display: grid; place-items: center;
    width: clamp(36px, 12vw, 48px); aspect-ratio: 1; border: 1px solid #e3fff580;
    border-radius: 50%; background: #06493b61; box-shadow: inset 0 1px 3px #092c2e54;
    font-size: .96em;
}
.launch > [data-icon] + span { margin-left: 24px; }
.launch strong { display: block; font-size: inherit; }
.launch small { display: block; color: #e3fde7; margin-top: 4px; font-size: .71rem; line-height: 1.2; font-weight: 800; }
.launch small:empty { display: none; }
.launch:active:enabled { transform: translateY(3px); box-shadow: inset 0 2px #ecffcb70, 0 3px #134e50, 0 4px 0 1px #88613c; }
.launch:disabled { color: #dfede0; border-color: #bfd1a4; background: linear-gradient(#3f7b76, #305c62); font-size: 1.1rem; }
.auto-button {
    min-width: 69px; min-height: 62px; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 4px 6px;
    border: 1px solid #dcca81; border-radius: 19px; background: linear-gradient(#276467, #17444d);
    box-shadow: 0 3px #193c45; color: #eff8de; font-size: .83rem; font-weight: 800;
}
.auto-button[aria-pressed="true"] { color: #143f36; background: #99e8b4; }
.auto-button:disabled { opacity: .7; }

.treasure-trail {
    display: flex; flex: none; align-items: center; gap: 9px; width: min(100%, 455px); padding: 8px 10px;
    border: 1px solid var(--brass-line); border-radius: 13px; background: var(--deep-panel);
    box-shadow: 0 4px 12px #0b122554, inset 0 1px #fff3b52c;
}
.trail-chest { color: #ffcf80; display: grid; place-items: center; flex: none; width: 34px; }
.trail-content { flex: 1; }
.trail-label { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 4px; }
.trail-label strong { color: #ffdda1; font-size: .83rem; }
.trail-label span { color: #dceee2; font-size: .73rem; }
.trail-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.trail-steps span { height: 6px; background: #0b2630; border: 1px solid #af9d6770; border-radius: 6px; }
.trail-steps span.lit { background: linear-gradient(#fff3a4, #eab14a); border-color: #ffe19c; box-shadow: 0 0 5px #ffc96365; }

.game-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 6px 7px;
    border-top: 2px solid #d4a666; background: linear-gradient(#23646b, #123e48);
    box-shadow: 0 -4px 9px #15454b65;
}
.game-nav button {
    position: relative; display: grid; place-items: center; align-content: center; gap: 3px; min-height: 48px;
    padding: 3px; color: #d6eae4; border: 1px solid transparent; background: transparent;
    border-radius: 10px; font-size: .76rem; font-weight: 800;
}
.game-nav svg { width: 21px; height: 21px; }
.game-nav button[aria-current="page"] { color: #ffdf93; border-color: #c8985e; background: #153d48; box-shadow: inset 0 1px #fff6cc22; }
.ready-dot { position: absolute; top: 4px; right: 10px; width: 8px; height: 8px; background: #ffc96a; box-shadow: 0 0 9px #ffbc70; border-radius: 50%; }

.island[data-island="0"], .island-stop[data-island="0"] { --island-image: url("island.webp"); }
.island[data-island="1"], .island-stop[data-island="1"] { --island-image: url("emberwake.webp"); }
.island[data-island="2"], .island-stop[data-island="2"] { --island-image: url("starfall.webp"); }
.island-stop[data-island="3"] { --island-image: url("map-frost.webp"); }
.island-stop[data-island="4"] { --island-image: url("map-jade.webp"); }
.island-stop[data-island="5"] { --island-image: url("map-dunes.webp"); }
.island-stop[data-island="6"] { --island-image: url("map-moonreef.webp"); }
.island-stop[data-island="7"] { --island-image: url("map-thunder.webp"); }
.island-stop[data-island="8"] { --island-image: url("map-copperwood.webp"); }
.island-stop[data-island="9"] { --island-image: url("map-prism.webp"); }
.island-stop[data-island="10"] { --island-image: url("map-nimbus.webp"); }
.island-stop[data-island="11"] { --island-image: url("map-dawnspire.webp"); }
.island-stop[data-island="12"] { --island-image: url("map-glassharbor.webp"); }
.island-stop[data-island="13"] { --island-image: url("map-cinderbloom.webp"); }
.island-stop[data-island="14"] { --island-image: url("map-auroraforge.webp"); }
.island-stop[data-island="15"] { --island-image: url("map-celestialgrove.webp"); }
.world-land[data-island="0"] { --map-art: url("map-bramble.webp"); }
.world-land[data-island="1"] {
    --map-art: url("map-ember.webp");
    --dock-x: 28%; --dock-y: 55%; --mill-x: 21%; --mill-y: 39%;
    --beacon-y: 27%; --workshop-y: 41%;
}
.world-land[data-island="2"] {
    --map-art: url("map-starfall.webp");
    --dock-x: 67%; --dock-y: 60%; --market-x: 23%; --market-y: 39%;
    --workshop-x: 76%;
}
.world-land[data-island="3"] {
    --map-art: url("map-frost.webp");
    --workshop-x: 50%; --workshop-y: 29%; --beacon-x: 78%; --beacon-y: 43%;
    --mill-x: 68%; --mill-y: 62%; --market-x: 30%; --market-y: 56%;
}
.world-land[data-island="4"] {
    --map-art: url("map-jade.webp"); --dock-x: 27.4%; --dock-y: 54%; --mill-x: 21.3%; --mill-y: 39%;
    --beacon-y: 32.4%; --market-y: 59%;
}
.world-land[data-island="5"] {
    --map-art: url("map-dunes.webp"); --market-x: 21%; --market-y: 40%; --dock-x: 68%; --dock-y: 61%;
    --beacon-y: 33.8%; --workshop-y: 44%; --mill-x: 26.5%; --mill-y: 56%;
}
.world-land[data-island="6"] {
    --map-art: url("map-moonreef.webp"); --market-x: 27.3%; --market-y: 54%; --mill-x: 66.8%; --mill-y: 58%;
    --beacon-y: 33.7%; --workshop-y: 43.2%;
}
.world-land[data-island="7"] {
    --map-art: url("map-thunder.webp"); --beacon-x: 77.8%; --beacon-y: 42.6%; --workshop-x: 50%; --workshop-y: 32%;
    --market-y: 58.8%; --mill-y: 54.3%;
}
.world-land[data-island="8"] {
    --map-art: url("map-copperwood.webp"); --dock-x: 20%; --dock-y: 42%; --beacon-y: 33%;
    --workshop-y: 45%; --mill-x: 26%; --mill-y: 56.5%; --market-x: 67%; --market-y: 60%;
}
.world-land[data-island="9"] {
    --map-art: url("map-prism.webp"); --dock-x: 65.5%; --dock-y: 59.5%; --beacon-x: 50%; --beacon-y: 30%;
    --workshop-x: 20%; --workshop-y: 39%; --mill-x: 27%; --mill-y: 54%; --market-x: 78%; --market-y: 42%;
}
.world-land[data-island="10"] {
    --map-art: url("map-nimbus.webp"); --dock-x: 27%; --dock-y: 55%; --beacon-x: 50%; --beacon-y: 32%;
    --workshop-y: 43%; --mill-x: 67%; --mill-y: 59%; --market-x: 21%; --market-y: 40%;
}
.world-land[data-island="11"] {
    --map-art: url("map-dawnspire.webp"); --dock-x: 67%; --dock-y: 58%; --beacon-x: 77%; --beacon-y: 42%;
    --workshop-x: 50%; --workshop-y: 30.5%; --mill-x: 20%; --mill-y: 40%; --market-x: 27%; --market-y: 54.5%;
}
.world-land[data-island="12"] {
    --map-art: url("map-glassharbor.webp"); --dock-x: 20%; --dock-y: 37.4%; --beacon-y: 30%;
    --workshop-x: 78%; --workshop-y: 40.5%; --mill-x: 26%; --mill-y: 51.3%; --market-x: 66%; --market-y: 55.6%;
}
.world-land[data-island="13"] {
    --map-art: url("map-cinderbloom.webp"); --dock-x: 65.4%; --dock-y: 52%; --beacon-x: 77%; --beacon-y: 39.2%;
    --workshop-x: 49.6%; --workshop-y: 29.8%; --mill-x: 20.4%; --mill-y: 37.2%; --market-x: 27.3%; --market-y: 49.2%;
}
.world-land[data-island="14"] {
    --map-art: url("map-auroraforge.webp"); --dock-x: 28%; --dock-y: 51.3%; --beacon-y: 30.8%;
    --workshop-x: 20%; --workshop-y: 38.2%; --mill-x: 69%; --mill-y: 54.9%; --market-x: 79%; --market-y: 40.3%;
}
.world-land[data-island="15"] {
    --map-art: url("map-celestialgrove.webp"); --dock-x: 77.7%; --dock-y: 40.5%; --beacon-x: 49.6%; --beacon-y: 32%;
    --workshop-x: 68%; --workshop-y: 53.8%; --mill-x: 27%; --mill-y: 51.3%; --market-x: 20%; --market-y: 39%;
}
[data-light="1"] { --terrain-hue: -16deg; --terrain-saturation: .92; --terrain-brightness: .91; }
[data-light="2"] { --terrain-hue: 18deg; --terrain-saturation: 1.1; --terrain-brightness: 1.05; }
[data-light="3"] { --terrain-hue: -38deg; --terrain-saturation: .94; --terrain-brightness: .97; }
[data-light="4"] { --terrain-hue: 36deg; --terrain-saturation: 1.06; --terrain-brightness: .9; }
[data-light="5"] { --terrain-hue: 7deg; --terrain-saturation: .74; --terrain-brightness: 1.07; }
[data-light="6"] { --terrain-hue: -26deg; --terrain-saturation: 1.18; --terrain-brightness: 1.04; }
[data-light="7"] { --terrain-hue: 55deg; --terrain-saturation: .91; --terrain-brightness: 1.02; }
[data-light="8"] { --terrain-hue: -46deg; --terrain-saturation: 1.12; --terrain-brightness: .89; }
[data-light="9"] { --terrain-hue: 24deg; --terrain-saturation: 1.24; --terrain-brightness: 1.09; }
[data-light="10"] { --terrain-hue: -7deg; --terrain-saturation: 1.07; --terrain-brightness: 1.14; }
[data-light="11"] { --terrain-hue: 43deg; --terrain-saturation: 1.19; --terrain-brightness: .94; }
[data-light="12"] { --terrain-hue: -32deg; --terrain-saturation: .77; --terrain-brightness: 1.12; }
[data-light="13"] { --terrain-hue: 13deg; --terrain-saturation: 1.25; --terrain-brightness: .87; }
[data-light="14"] { --terrain-hue: -57deg; --terrain-saturation: 1.11; --terrain-brightness: 1.02; }
.world-land[data-terrain]::before, .island-stop[data-terrain]::before {
    content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
    background: var(--terrain-art) center / 100% 100% no-repeat;
    filter: hue-rotate(var(--terrain-hue, 0deg)) saturate(var(--terrain-saturation, 1)) brightness(var(--terrain-brightness, 1));
}
.wheel-scenery[data-terrain]::before { background-position: center 55%; background-size: cover; }
[data-mirrored="true"]::before { transform: scaleX(-1); }
.game-shell[data-screen="village"] { position: relative; grid-template-rows: minmax(0, 1fr); }
.game-shell[data-screen="village"] .topbar {
    position: absolute; z-index: 4; inset: 0 0 auto;
}
.game-shell[data-screen="village"] .game-nav { position: absolute; z-index: 4; inset: auto 0 0; }
.village { position: relative; padding: 0; overflow: hidden; }
.island {
    position: absolute; inset: 0; overflow: hidden; isolation: isolate;
    background: linear-gradient(0deg, #122c42da, transparent 34%), #2c6981 var(--map-art, var(--island-image)) center / 100% 100% no-repeat;
}
.island[data-terrain], .flight-scene[data-terrain] { isolation: isolate; background: #27536a; }
.island[data-terrain]::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(0deg, #122c42de, transparent 34%);
}
.island-content {
    position: absolute; z-index: 3; inset: auto 13px 74px; padding: 10px 12px;
    border: 1px solid var(--brass-line); border-radius: 16px; background: var(--deep-panel);
    box-shadow: 0 5px 16px #0b172781, inset 0 1px #ebc38a2e;
}
.island-region { font-size: .75rem; font-weight: 850; color: #f5c982; margin-bottom: 4px; }
.village-map { position: absolute; z-index: 2; inset: 0; }
.village-actions { display: flex; gap: 7px; margin-top: 7px; }
.village-actions button {
    display: flex; align-items: center; justify-content: center; gap: 4px; color: #ffe8ab;
    background: #21505c; border: 1px solid #a8c5a98e; border-radius: 8px; min-height: 33px; font-size: .75rem; font-weight: 850;
}
.village-actions button { flex: 1; }
.village-actions #village-defense { color: #b4ebfa; }
.village-actions #village-defense[data-protected="true"] { color: #b5f9d7; border-color: #95d7b7; }
[data-plot="dock"] { --x: var(--dock-x, 21%); --y: var(--dock-y, 40%); }
[data-plot="beacon"] { --x: var(--beacon-x, 49.5%); --y: var(--beacon-y, 29%); }
[data-plot="workshop"] { --x: var(--workshop-x, 77%); --y: var(--workshop-y, 42%); }
[data-plot="mill"] { --x: var(--mill-x, 28%); --y: var(--mill-y, 55%); }
[data-plot="market"] { --x: var(--market-x, 68%); --y: var(--market-y, 60%); }
.map-pin {
    position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -68%);
    min-width: 46px; height: 47px; display: grid; place-items: center; padding: 0; border: 1px solid #ffe4a2; border-radius: 16px;
    background: #173d48e6; box-shadow: inset 0 1px #e5ffdf40, 0 3px 7px #163234a6;
}
.map-pin svg { width: 23px; height: 23px; }
.map-pin .miniature { width: 85px; filter: drop-shadow(0 3px 3px #102b37); }
.map-pin[data-level="1"] .miniature, .map-pin[data-level="2"] .miniature { width: 58px; }
.map-pin[data-level="3"] .miniature, .map-pin[data-level="4"] .miniature { width: 72px; }
.map-pin:not([data-level="0"]) { height: auto; border-color: transparent; box-shadow: none; background: transparent; }
.map-pin .plot-level {
    position: absolute; bottom: 1px; right: -4px; min-width: 20px; height: 20px; padding: 2px; border: 1px solid #ffe5a4;
    border-radius: 50%; color: #3a342c; background: #ffe298; font-size: .63rem; font-weight: 900;
}
.plot-name {
    position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 5px;
    color: #fff3c8; background: #153b4cde; border-radius: 5px; font-size: .66rem; line-height: 1.15;
}
.map-pin[data-level="0"] { color: #4d361f; border-color: #ffde9b; background: linear-gradient(#ffe3a2, #ebaa58); }
.map-pin[data-level="5"] .plot-level { box-shadow: 0 0 9px #ffcd71; }
.map-pin[data-damaged="true"] .plot-level { color: #fff0de; background: #963f47; border-color: #ffd19f; }
.island-flight { position: absolute; inset: 0; z-index: 6; isolation: isolate; overflow: hidden; background: #497ca4; }
.flight-scene { position: absolute; inset: 0; background: #427b9e var(--map-art) center / 100% 100% no-repeat; }
.flight-departure { animation: depart-scene 2450ms ease-in-out both; }
.flight-destination { animation: arrive-scene 2450ms ease-in-out both; }
@keyframes depart-scene {
    from { transform: scale(1); opacity: 1; }
    60%, to { transform: translateY(10%) scale(1.16); opacity: 0; }
}
@keyframes arrive-scene {
    0%, 33% { transform: translateY(-9%) scale(1.2); opacity: 0; }
    74%, to { transform: none; opacity: 1; }
}
.flight-clouds {
    position: absolute; inset: -28%; pointer-events: none;
    background: radial-gradient(ellipse at 11% 55%, #f4f3ffdd, transparent 29%), radial-gradient(ellipse at 92% 41%, #fff4dbec, transparent 32%),
        radial-gradient(ellipse at 47% 18%, #e2efffe6, transparent 26%);
    animation: pass-clouds 2450ms ease-in-out both;
}
@keyframes pass-clouds {
    0% { opacity: 0; transform: translateY(-28%); }
    42% { opacity: 1; }
    81%, to { opacity: 0; transform: translateY(34%); }
}
.journey-craft { position: absolute; width: min(48vw, 175px); left: 55%; top: 36%; transform: translate(-50%, -50%); animation: balloon-ascent 2450ms ease-in-out both; }
.journey-balloon { position: relative; width: 100%; }
.journey-pennant {
    position: absolute; top: 66%; right: 7%; width: 26%; height: 14%;
    background: linear-gradient(145deg, #baffed 14%, #5bcbdf 35%, #516cc9 70%, #d9afff 90%);
    clip-path: polygon(0 0, 100% 35%, 73% 60%, 94% 100%, 0 75%);
    transform-origin: left center; animation: pennant-flutter .4s ease-in-out infinite alternate;
}
.journey-pennant[data-pennant="jade"] {
    background: linear-gradient(145deg, #f8db84 14%, #90e19f 33%, #2ea08d 66%, #ffdfa1 91%);
}
@keyframes pennant-flutter { to { transform: skewY(-10deg) scaleX(.84); } }
.journey-wake {
    position: absolute; width: 102%; height: 36%; right: 61%; top: 54%; transform: rotate(-16deg);
    background: radial-gradient(circle at 80% 44%, #fff7bf 2%, transparent 6%),
        radial-gradient(circle at 56% 59%, #fffce0 2%, transparent 5%),
        radial-gradient(circle at 33% 34%, #ffedbd 2%, transparent 4.5%),
        radial-gradient(ellipse at 80% 50%, #ffebbaad, transparent 66%);
}
@keyframes balloon-ascent {
    0% { left: -13%; top: 73%; transform: translate(-50%, -50%) scale(.67) rotate(-12deg); opacity: .85; }
    44% { left: 46%; top: 48%; transform: translate(-50%, -50%) scale(1.12) rotate(-5deg); opacity: 1; }
    75% { left: 69%; top: 26%; transform: translate(-50%, -50%) scale(.84) rotate(7deg); opacity: 1; }
    100% { left: 94%; top: 12%; transform: translate(-50%, -50%) scale(.5) rotate(11deg); opacity: 0; }
}
.flight-caption {
    position: absolute; inset: auto 12% 12%; display: grid; justify-items: center; gap: 4px; padding: 10px 8px;
    color: #eee0c1; background: #142f4be8; border: 1px solid #fbd593; border-radius: 15px; box-shadow: 0 7px 14px #193456ab;
    font-size: .85rem; animation: flight-caption 2450ms ease both;
}
.flight-caption strong { color: #ffe1a5; font: 850 clamp(1.4rem, 6vw, 1.94rem)/1.13 Georgia, serif; text-align: center; }
@keyframes flight-caption { 0%, 100% { opacity: 0; } 17%, 88% { opacity: 1; } }
.island h2 { color: #fff1c4; font: 800 clamp(1.6rem, 7vw, 2.28rem)/1 var(--display-face); text-shadow: 0 2px #132339; letter-spacing: -.03em; }
.island-level { margin-top: 10px; padding: 7px 9px; border: 1px solid #b4c9d650; border-radius: 9px; background: #101f32; }
.level-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: .875rem; }
#world-dialog {
    width: min(520px, 100%); height: 100vh; height: 100dvh; max-width: none; max-height: none;
    padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #18385b;
}
#world-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.route-header {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; padding: 8px 10px;
    background: var(--deep-panel); border-bottom: 1px solid var(--brass-line);
}
.route-header img { width: 44px; height: 44px; object-fit: cover; }
.route-header h2 { margin: 0; font-size: 1.48rem; line-height: 1.1; }
#world-dialog .route-header p { margin-top: 3px; color: #cfe3e5; font-size: .77rem; }
#world-dialog[data-fog] .route-header {
    border-bottom-color: #b2d3e1;
    background: radial-gradient(ellipse at 5% -24%, #fff9f0 0 21%, transparent 47%),
        radial-gradient(ellipse at 92% 105%, #edfbff 0 22%, transparent 57%),
        linear-gradient(110deg, #afdaee, #d6e9f6 72%);
}
#world-dialog[data-fog] .route-header h2 { color: #193351; }
#world-dialog[data-fog] .route-header p { color: #2c4766; }
.route-scroll {
    overflow-y: auto; overscroll-behavior: contain;
    background: linear-gradient(180deg, #152942cf, #283d56cc 60%, #292b49bd), url("skywheel-dusk.webp") center / cover;
}
.route-fog {
    position: relative; isolation: isolate; min-height: 142px; display: grid; place-items: center; overflow: hidden;
    background: linear-gradient(#d6e9f6 0%, #b0d5ef 45%, #83adcc45 78%, transparent);
}
.route-fog::before, .route-fog::after {
    content: ""; position: absolute; z-index: -1; inset: -41px 27% 15px -8%;
    background: radial-gradient(ellipse at 35% 41%, #fff9ee 0 22%, transparent 24%),
        radial-gradient(ellipse at 61% 46%, #edf8fb 0 26%, transparent 28%),
        radial-gradient(ellipse at 24% 68%, #e0eff9 0 24%, transparent 26%),
        radial-gradient(ellipse at 66% 67%, #d5e9fa 0 30%, transparent 33%);
    filter: drop-shadow(0 9px 7px #9fc8ec7d);
}
.route-fog::after {
    inset: -27px -11% 1px 31%;
    transform: scaleX(-1);
    opacity: .93;
}
.route-fog span {
    padding: 6px 12px; border: 1px solid #c2d6e4; border-radius: 20px;
    background: #173953; color: #edf8ff; font-size: .77rem; font-weight: 800;
}
.island-selector { position: relative; list-style: none; padding: 15px 13px 26px; margin: 0; isolation: isolate; }
.island-selector::before {
    content: ""; position: absolute; z-index: -1; inset: 49px auto 55px 50%; border-left: 2px dashed #e1bb7e;
    box-shadow: 0 0 9px #ffd09176;
}
.route-leg { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 47px minmax(0, 1fr); align-items: center; min-height: 116px; padding-block: 6px; content-visibility: auto; contain-intrinsic-height: auto 104px; }
.route-leg::after { content: ""; position: absolute; z-index: -1; top: 50%; left: calc(50% - 24px); width: 24px; border-top: 2px dashed #cbb17f; }
.route-leg:nth-child(even)::after { left: 50%; }
.route-knot {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 21px; height: 21px;
    display: grid; place-items: center; border-radius: 50%; border: 1px solid #d6bd8b; background: #213e5b; color: #d9f7ca; font-size: .78rem;
}
.route-leg[data-route-state="here"] .route-knot { width: 30px; height: 30px; border-color: #fff1a6; background: #456e75; box-shadow: 0 0 15px #ffe399a1; }
.route-knot .route-balloon { width: 43px; transform: translateY(-4px); }
.route-leg[data-route-state="locked"] .route-knot { background: #243852; border-color: #a9a5a4; }
.island-stop {
    position: relative; grid-column: 1; min-width: 0; min-height: 103px; display: grid; align-content: end; justify-items: start; gap: 3px; padding: 7px;
    text-align: left; border: 1px solid #b5c3b4; border-radius: 13px;
    background: linear-gradient(transparent 2%, #14283cf0 91%), #356171 var(--island-image) center 45% / cover;
    box-shadow: 0 4px 9px #0b243db8;
}
.island-stop[data-terrain] { isolation: isolate; overflow: hidden; background: #356171; }
.island-stop[data-terrain]::before { background: linear-gradient(transparent 8%, #14283cf5 94%), var(--terrain-art) center 44% / cover; }
.route-leg:nth-child(even) .island-stop { grid-column: 3; }
.island-stop[aria-current] { border-color: #ffe4a2; box-shadow: 0 0 0 2px #eec581, 0 5px 9px #162138; }
.route-leg[data-route-state="locked"] .island-stop { color: #e5e5e0; filter: saturate(.62); }
.island-complete-mark {
    position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
    display: grid; place-items: center; border: 1px solid #b8f2c1; border-radius: 50%;
    background: #1c654c; color: #eeffdd; font-size: 1rem; font-weight: 900; box-shadow: 0 2px 5px #112c3f91;
}
.island-stop strong { font: 800 clamp(.88rem, 4vw, 1.16rem)/1.06 Georgia, serif; }
.island-stop .route-level { color: #ffda9a; background: #15334ee0; border: 1px solid #d6ba86a3; border-radius: 6px; padding: 2px 4px; font-size: .66rem; font-weight: 900; }
.island-stop .route-status { color: #d3e8e4; font-size: .72rem; }
.island-stop[aria-current] .route-status { color: #ffebae; font-weight: 900; }
.route-footer { display: grid; gap: 4px; padding: 9px 12px; border-top: 1px solid var(--brass-line); background: var(--deep-panel); }
#island-journey { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; }
#island-journey strong { color: #ffe1a0; font: 800 1.02rem/1.1 Georgia, serif; }
#island-journey span, #world-dialog .route-footer p { color: #d4e3df; margin: 0; font-size: .75rem; }
.section-heading { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #12404aed; }
.section-heading h2 { font: 800 1.4rem/1.1 Georgia, serif; }
.section-heading p { color: #cfe7de; font-size: .75rem; margin-top: 3px; }
.heading-icon, .building-icon, .log-icon {
    display: inline-grid; flex: none; place-items: center; border: 1px solid #f0d39760; border-radius: 8px;
    width: 33px; height: 33px; background: #22555b; font-size: 16px;
}
.miniature { display: block; width: 100px; aspect-ratio: 1; flex: none; background: url("building-art.webp") var(--mini-x, 0%) var(--mini-y, 0%) / 300% 200% no-repeat; filter: drop-shadow(0 5px 5px #243c405d); }
.miniature-workshop { --mini-x: 50%; }
.miniature-beacon { --mini-x: 100%; }
.miniature-mill { --mini-y: 100%; }
.miniature-market { --mini-x: 50%; --mini-y: 100%; }
.miniature-airship { --mini-x: 100%; --mini-y: 100%; }
.stage-pips { display: flex; gap: 4px; margin-block: 5px; }
.stage-pips span { width: 13px; height: 6px; border: 1px solid #9eac95; border-radius: 6px; background: #0c2a36; }
.stage-pips span.built { border-color: #ffe6a8; background: linear-gradient(#ffe2a1, #e4ac5b); }
.folio-hero {
    position: relative; isolation: isolate; display: flex; align-items: center; min-height: 142px;
    padding: 15px 42% 15px 14px; overflow: hidden; border: 1px solid #e6c690;
    border-radius: 16px; box-shadow: 0 5px 14px #1a3a4c7a;
}
.folio-hero h2 { color: #fff0c6; font: 800 clamp(1.65rem, 6.85vw, 2.25rem)/1.02 Georgia, serif; text-shadow: 0 2px 4px #0c2437a8; }
.folio-hero p { color: #dceee7; font-size: .83rem; margin-top: 7px; line-height: 1.2; }
.folio-copy { position: relative; z-index: 1; }
.folio-chip {
    display: inline-flex; align-items: center; gap: 5px; width: max-content; max-width: 100%;
    padding: 4px 7px; border: 1px solid #e6c69073; border-radius: 6px; background: #142c40dd;
    color: #ffe0a5; font-size: .74rem; font-weight: 700; line-height: 1.15;
}
.log-hero { min-height: 120px; background: linear-gradient(90deg, #14213be8, #25325172), url("starfall.webp") center 44% / cover; }
.log-list {
    position: relative; display: grid; gap: 9px; padding: 0; margin-top: 13px; list-style: none;
}
.log-list::before { content: ""; position: absolute; z-index: 0; left: 18px; inset-block: 21px; width: 2px; background: #eaca8fab; }
.log-list li { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; }
.log-list li > div {
    padding: 10px 11px; border: 1px solid #a1c7c56b; border-radius: 12px;
    background: linear-gradient(120deg, #193e52f5, #142e42f7);
    box-shadow: inset 0 1px #e9fcfd12, 0 3px 8px #142e4352;
}
.log-list li:first-child > div { border-color: #dfbd85a6; }
.log-list .log-icon { height: 36px; border-radius: 50%; background: #17394e; border-color: #edc98d9c; }
.log-list p { color: var(--muted); font-size: .82rem; margin-top: 4px; line-height: 1.32; }

.voyage-hero {
    background: linear-gradient(102deg, #12334cf5 19%, #25536390 65%, #ecd0a132), url("skywheel.webp") center 48% / cover;
}
.voyage-hero .miniature {
    position: absolute; width: clamp(112px, 42vw, 202px); right: 0; top: 50%;
    transform: translateY(-50%) rotate(-5deg); filter: drop-shadow(0 9px 10px #243c4088);
}
.voyage-hero .folio-chip { margin-top: 10px; }
.expedition-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
    min-height: 85px; margin-top: 10px; padding: 12px;
    border: 1px solid #e5ca91; border-radius: 12px;
    background: linear-gradient(95deg, #192c4af7 12%, #243b63b9 85%), url("map-frost.webp") center 26% / cover;
}
.expedition-card h3 { color: #fff0c6; font: 800 clamp(1.02rem, 4.3vw, 1.22rem)/1.08 Georgia, serif; }
.expedition-card p { margin-top: 4px; color: #d2e9f1; font-size: .77rem; }
.expedition-card[data-expedition="jade"] {
    background: linear-gradient(95deg, #183c40f7 12%, #225068a1 85%), url("map-jade.webp") center 32% / cover;
}
.expedition-dialog { background: linear-gradient(#1d3a58, #162e44); }
.expedition-scene {
    position: relative; display: flex; justify-content: center; align-items: center; height: 132px; overflow: hidden;
    border: 1px solid #a8cfdaab; border-radius: 10px;
    background: linear-gradient(#1b335627, #223c526e), url("map-frost.webp") center 26% / cover;
}
.expedition-scene .miniature { width: 145px; transform: rotate(-9deg); }
.expedition-dialog[data-expedition="jade"] .expedition-scene {
    background: linear-gradient(#163a4e26, #194b4589), url("map-jade.webp") center 33% / cover;
}
#expedition-body h3 { margin-top: 13px; color: #fff0c4; font: 800 1.22rem/1.12 Georgia, serif; }
#expedition-body > .reward-list { margin-top: 10px; }
.expedition-option {
    width: 100%; display: grid; gap: 5px; padding: 10px; margin-top: 9px; text-align: left;
    border: 1px solid #a7cfcb8f; border-radius: 9px; background: #264e62; color: #e3f2ee; font-size: .83rem;
}
.expedition-option strong { color: #fff0c6; font-size: .95rem; }
.expedition-option:disabled { opacity: .58; }
.expedition-cost { display: flex; align-items: center; gap: 5px; font-size: .75rem; color: #ffdca0; }
.active-voyage { display: grid; gap: 7px; padding: 10px; margin-block: 8px; background: linear-gradient(110deg, #27655f, #184c53); border: 1px solid #b7efcb; border-radius: 10px; }
.voyage-running { display: flex; justify-content: space-between; gap: 5px; align-items: baseline; }
.voyage-running h3 { color: #fff0c0; font-size: .94rem; }
.voyage-running span { color: #d9f9e2; font-size: .76rem; }
.active-voyage progress { width: 100%; height: 7px; accent-color: #96f2cf; }
.active-voyage button { justify-self: start; }
.voyage-routes, .order-list { display: grid; gap: 9px; margin-top: 11px; }
.voyage-card, .order-card {
    min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 9px; align-items: start;
    padding: 10px; border: 1px solid #b5cfbd79; border-radius: 12px;
    background: linear-gradient(115deg, #22526b, #15384b 56%); box-shadow: 0 3px 8px #19374b67;
}
.voyage-card[data-route="salvage"] { background: linear-gradient(115deg, #31596a, #17364f 56%); }
.voyage-card[data-route="courier"] { background: linear-gradient(115deg, #286259, #173e49 56%); }
.voyage-card[data-route="survey"], .voyage-card[data-route="arsenal"] { background: linear-gradient(115deg, #485178, #253652 56%); }
.voyage-route-icon, .order-emblem {
    display: grid; place-items: center; width: 37px; height: 39px;
    border: 1px solid #e5c69475; border-radius: 10px; background: #142f45d6; color: #ffda98;
}
.voyage-route-icon svg { width: 23px; height: 23px; }
.voyage-card h3 { color: #fff1d4; font-size: .95rem; }
.voyage-card p { color: #d3e5d8; font-size: .8rem; margin-block: 3px 5px; }
.reward-list { display: flex; flex-wrap: wrap; gap: 4px; }
.reward-list > span {
    display: inline-flex; align-items: center; gap: 3px; padding: 3px 5px;
    border: 1px solid #a6cac33d; border-radius: 5px; background: #0b2d3c9c; color: #bdeedb; font-size: .72rem; font-weight: 800;
}
.reward-list > [data-reward="coins"] { color: #ffe0a0; }
.reward-list > [data-reward="parts"] { color: #bce9ff; }
.reward-list > [data-reward="charts"], .reward-list > [data-reward="bombs"] { color: #edd6ff; }
.voyage-footer, .order-footer {
    display: flex; grid-column: 1 / -1; justify-content: space-between; gap: 7px; align-items: center;
    border-top: 1px solid #c5dacf2c; padding-top: 7px; color: #e3e9dd; font-size: .8rem;
}
.voyage-button { min-height: 40px; min-width: 70px; padding: 5px 9px; border: 1px solid #ebc08b; border-radius: 8px; color: #3f3323; background: linear-gradient(#ffe4ab, #edb361); font-size: .85rem; font-weight: 900; }
.voyage-button:disabled { color: #ccdcd1; border-color: #87b0a6; background: #254d53; }

.orders-hero {
    background: radial-gradient(ellipse at 86% 26%, #e5ab73, #956951 39%, #173f50 77%);
}
.orders-hero img { position: absolute; right: 4px; bottom: -12px; width: min(42%, 165px); height: auto; filter: drop-shadow(0 3px 5px #27463283); }
.orders-hero .folio-chip { margin-bottom: 6px; }
.order-card[data-order-state="ready"] { border-color: #f9cf86; box-shadow: 0 0 12px #ffe08952; }
.order-status { color: #b9d3d6; font-size: .74rem; font-weight: 800; text-align: right; }
.order-card[data-order-state="claimed"] .order-status { color: #a9edd0; }
.order-emblem svg { width: 23px; height: 23px; }
.order-content { min-width: 0; }
.order-content h3 { font-size: .92rem; color: #fff2d5; }
.order-content p { color: #c1dad2; font-size: .75rem; margin-top: 3px; }
.order-content progress { display: block; width: 100%; height: 6px; margin: 4px 0; border: 0; border-radius: 6px; overflow: hidden; }
.order-content progress::-webkit-progress-bar { background: #0d2c36; }
.order-content progress::-webkit-progress-value { background: linear-gradient(90deg, #51bfaa, #b1f4cc); }
.order-card button, .rival-return {
    min-height: 38px; padding: 5px 8px; border: 1px solid #e0ab67; border-radius: 8px;
    background: linear-gradient(#ffebaf, #e8ad60); color: #473021; font-size: .77rem; font-weight: 900;
}

.game-dialog {
    width: min(460px, calc(100% - 28px)); max-height: calc(100% - 24px); overflow: auto;
    padding: 17px; color: var(--text); border: 1px solid #dbaf6a; border-radius: 18px; background: #16434aeF;
    box-shadow: 0 9px 44px #051b29b0;
}
.game-dialog::backdrop { background: #072733b0; }
.dialog-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.game-dialog h2 { font: 800 1.65rem Georgia, serif; color: #ffda90; }
.game-dialog p { font-size: .9rem; line-height: 1.35; color: #d7ebe4; margin-top: 7px; }
.audio-dialog { background: radial-gradient(ellipse at 89% 0%, #24616a 0%, #173848 62%); }
.audio-toggle, .audio-level {
    width: 100%; padding: 10px 11px; border: 1px solid #b7d9cd51; border-radius: 10px;
    color: #fff5da; background: #102c3deb;
}
.audio-toggle { display: flex; min-height: 44px; align-items: center; justify-content: space-between; font-weight: 800; }
.audio-toggle strong { color: #b3edd3; }
.audio-toggle[aria-checked="false"] strong { color: #f0baaa; }
.audio-level { margin-top: 9px; padding-bottom: 5px; }
.audio-level div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.audio-level label { font-weight: 800; }
.audio-level output { color: #ffdd9e; font-weight: 850; font-variant-numeric: tabular-nums; }
.audio-level input { display: block; width: 100%; min-height: 38px; margin: 0; accent-color: #ffcb77; }
#preview-bomb { display: flex; align-items: center; justify-content: center; min-height: 44px; gap: 6px; margin-top: 12px; }
.wallet-balances { display: grid; gap: 6px; margin: 0; }
.wallet-balances > div {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px;
    padding: 8px 10px; border: 1px solid #c0d8bf54; border-radius: 9px;
    background: #112f41; color: #f7eac8;
}
.wallet-balances dt { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 750; }
.wallet-balances .token { width: 27px; }
.wallet-balances dd { margin: 0; text-align: right; font-weight: 850; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-trade { margin-top: 15px; }
.wallet-trade h3 { color: #ffda90; font: 800 1.17rem Georgia, serif; }
.trade-row { margin-top: 7px; padding: 8px; border: 1px solid #a8cbc063; border-radius: 10px; background: #123348; }
.trade-row h4 { display: flex; align-items: center; gap: 5px; margin: 0 0 6px; color: #f4eccf; font-size: .82rem; }
.trade-row h4 svg { color: #f9cf87; }
.trade-options { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; }
.trade-options button {
    min-height: 46px; display: grid; gap: 3px; align-content: center; padding: 4px;
    border: 1px solid #a4c8bd8a; border-radius: 8px; background: #225161; color: #f1f8e6;
    font-size: .77rem; line-height: 1.1;
}
.trade-options button span { color: #c8ebd5; font-size: .71rem; overflow-wrap: anywhere; }
.trade-options [data-buy-spins] { background: #604d40; border-color: #eac385b5; }
.trade-options [data-buy-spins] span { color: #ffdfa0; }
.trade-options button:active { filter: brightness(1.2); }
.trade-options button:disabled { opacity: .57; filter: saturate(.45); }
#trade-status { color: #c8f5d7; }
#trade-status:empty { display: none; }
.symbol-guide { margin-top: 8px; padding: 0; list-style: none; }
.symbol-guide li { display: flex; align-items: center; gap: 7px; padding: 5px 0; font-size: .875rem; }
#rival-event {
    width: min(520px, 100%); height: 100vh; height: 100dvh; max-width: none; max-height: none;
    padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #1a5166;
}
#rival-event {
    --mission-accent: #ffe4a2;
    --mission-trim: #ddb87799;
    --mission-glow: #2b7270;
}
#rival-event[data-mission="attack"] {
    --mission-accent: #ffd7b4;
    --mission-trim: #e2a081a6;
    --mission-glow: #884b4e;
}
.rival-bottom {
    position: absolute; z-index: 2; inset-inline: 11px; padding: 10px 11px;
    border: 1px solid #e5c38a91; border-radius: 16px; color: #e6eee1;
    background: radial-gradient(ellipse at 0 0, #2e6874, transparent 75%), linear-gradient(135deg, #173d53f9, #13283ff5);
    box-shadow: inset 0 1px #fff3d425, 0 5px 14px #0c213bae;
}
.rival-bottom { bottom: 11px; }
.rival-top {
    position: absolute; z-index: 2; top: 11px; inset-inline: 11px;
    display: grid; gap: 8px; padding: 10px;
    overflow: hidden; border: 1px solid var(--mission-trim); border-radius: 17px;
    background: radial-gradient(ellipse at 5% 0, var(--mission-glow), transparent 76%), linear-gradient(150deg, #1d3b50, #10243a);
    box-shadow: inset 0 0 0 2px #ffffff10, 0 6px 16px #09162eb0;
}
.rival-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.rival-emblem {
    display: grid; place-items: center; width: clamp(47px, 12vw, 56px); aspect-ratio: 1;
    border: 1px solid var(--mission-trim); border-radius: 13px; transform: rotate(-5deg);
    background: radial-gradient(ellipse at 40% 25%, var(--mission-glow), #0f273b);
    box-shadow: inset 0 0 0 2px #ffffff12, 0 3px 6px #0a182575;
}
.rival-emblem .token { width: 84%; transform: rotate(5deg); filter: drop-shadow(0 4px 3px #071b32b3); }
.rival-mission { display: grid; gap: 5px; }
.rival-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; min-width: 0; }
.rival-identity .rival-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rival-village-type { color: #ccdee6; font-size: .64rem; font-weight: 700; }
.rival-header h2 { color: #fff1c9; font-size: clamp(1.28rem, 5.85vw, 1.85rem); line-height: 1.06; text-shadow: 0 2px #111d30; }
.rival-name { color: #cfdfdf; font-size: .75rem; overflow-wrap: anywhere; }
.rival-identity .rival-name { color: #f2f8f5; font-weight: 800; }
.rival-status { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.rival-haul {
    display: flex; align-items: center; gap: 4px; padding: 5px 7px; color: var(--mission-accent); background: #0b2236bd;
    border: 1px solid var(--mission-trim); border-radius: 8px; font-variant-numeric: tabular-nums;
}
.rival-haul strong, .rival-multiplier strong { line-height: 1; font-size: .84rem; }
.rival-haul span, .rival-multiplier { font-size: .66rem; white-space: nowrap; font-weight: 750; }
.rival-multiplier { display: inline-flex; align-items: center; gap: 4px; color: #fff0ca; padding: 6px; }
.rival-brief {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px;
    border-top: 1px solid #ffffff24; padding-top: 7px; color: var(--mission-accent);
}
.rival-brief svg, .rival-haul svg { width: 15px; height: 15px; }
#rival-event .rival-instructions { margin: 0; color: #e3eef3; font-size: .74rem; line-height: 1.3; }
.rival-map {
    position: absolute; inset: 0; overflow: hidden; isolation: isolate;
    background: linear-gradient(0deg, #123b4780, transparent 49%), #427676 var(--map-art) center / 100% 100% no-repeat;
}
.rival-pin {
    position: absolute; top: var(--y); left: var(--x); transform: translate(-50%, -56%); width: clamp(80px, 25vw, 110px);
    display: grid; place-items: center; gap: 3px; padding: 4px 4px 6px; border: 1px solid #ffe1a48f;
    color: #fff4d3; background: linear-gradient(#183f51b8 16%, #102c45 75%);
    border-radius: 14px; box-shadow: inset 0 1px #fff4d431, 0 3px #123643a0, 0 4px 14px #1017286d;
    font-size: clamp(.62rem, 2.7vw, .74rem); line-height: 1.05;
}
.rival-pin:enabled:hover { filter: brightness(1.16); }
.rival-pin[data-hinted="true"]:enabled { border-color: #a5f2bf; box-shadow: 0 0 0 3px #a5f2bf48, 0 0 15px #88e8b681, 0 4px 14px #1017286d; }
.rival-pin[data-hinted="true"] small { color: #caffd6; font-weight: 850; }
.rival-pin[data-intel="clear"] { border-color: #adf5c5; box-shadow: 0 0 0 2px #adf5c550, 0 3px 12px #0c2335; }
.rival-pin[data-intel="shielded"] { border-color: #ffd3a8; box-shadow: 0 0 0 2px #ffd3a850, 0 3px 12px #0c2335; }
.rival-pin[data-intel] small { color: #fff0bc; font-weight: 850; }
.rival-pin[data-picked="true"] { color: #fff5ce; background: linear-gradient(#94663d, #573b42); border-color: #ffe49b; }
.rival-pin[data-picked="true"] .rival-pin-art { filter: saturate(.7) drop-shadow(0 3px 3px #20303a); }
.rival-pin:disabled:not([data-picked="true"]) { opacity: .63; }
.rival-pin-art { width: clamp(44px, 12.5vw, 61px); }
.rival-decoration { position: absolute; top: var(--y); left: var(--x); width: clamp(45px, 13vw, 65px); transform: translate(-50%, -68%); }
.rival-pin-payout { color: #ffe6a9; font-weight: 900; }
.rival-pin small { color: #e9e2cd; font-size: .65rem; }
.rival-supply { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; color: #fff0c0; font-size: .81rem; }
.rival-supply > span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 6px; background: #102a3b; }
.rival-supply > span > span { color: #c4dadd; }
.rival-actions { display: grid; grid-template-columns: 1.45fr 1fr; gap: 6px; }
.rival-actions .rival-return { margin-top: 7px; }
.rival-actions .secondary { color: #ffebd1; background: #285566; border-color: #b5c9bc; }
.rival-result-overlay {
    position: absolute; z-index: 2; inset: 0; display: flex; align-items: safe center; justify-content: center;
    padding: 16px; overflow-y: auto; background: radial-gradient(ellipse at center, #234e6580, #081d34d1 83%);
}
.rival-result {
    isolation: isolate; width: min(100%, 385px); padding: 0 15px 17px; display: grid; justify-items: center; gap: 5px;
    text-align: center; border: 1px solid #fed693; border-radius: 23px; overflow: hidden;
    background: radial-gradient(ellipse at 50% 56%, #245969, #132d44 71%);
    box-shadow: inset 0 0 0 3px #fce0a734, 0 12px 35px #08182dd1;
}
.rival-result-art {
    width: calc(100% + 30px); height: clamp(111px, 36vw, 154px);
    background: linear-gradient(0deg, #173b53, #173b5300 47%), url("rival-return-art.webp") 70% 26% / cover no-repeat;
}
.rival-result[data-won="true"] { animation: reveal-rival-result .32s ease-out both; }
@keyframes reveal-rival-result {
    from { opacity: .3; transform: translateY(9px) scale(.94); }
    to { opacity: 1; transform: none; }
}
.rival-result-emblem {
    position: relative; display: grid; place-items: center; width: min(100%, 192px);
    margin-top: -35px; background: radial-gradient(ellipse, #ffdd8b66, transparent 69%);
}
.rival-result-emblem .token { width: clamp(66px, 22vw, 112px); filter: drop-shadow(0 6px 5px #173345bd); }
.rival-result h2 { color: #ffe2a3; font-size: clamp(1.4rem, 6.3vw, 1.85rem); }
.rival-result-prize { display: grid; gap: 4px; max-width: 100%; padding: 6px 0 10px; }
.rival-result-prize strong {
    color: #fff2b6; font-size: clamp(2.15rem, 12vw, 4rem); line-height: 1;
    font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-shadow: 0 3px #876038, 0 0 19px #fbd66866;
}
.rival-result-prize span { color: #f7d9a7; font-size: .92rem; font-weight: 800; }
.game-dialog .rival-triple, .rival-triple {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; padding: 3px 7px;
    border: 1px solid #e9c28c9c; border-radius: 8px; color: #ffe3ae; background: #493a31;
    font-size: .72rem; font-weight: 800;
}
.rival-result .rival-triple { margin: 0 0 5px; }
.rival-result-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.rival-result-actions .rival-return { min-height: 44px; margin: 0; }
.rival-result-actions .secondary { color: #ffebd1; background: #285566; border-color: #b5c9bc; }
.rival-return { display: block; width: 100%; margin-top: 12px; }
.rival-return:disabled { color: #c6d3c6; background: #275366; border-color: #9bb8a1; }
.bomb-hero { display: grid; place-items: center; background: radial-gradient(#5d5a85, #173c4c 72%); border-radius: 12px; }
.bomb-hero .token { width: 110px; }
.strike-flight { position: absolute; z-index: 3; pointer-events: none; left: var(--strike-x); top: var(--strike-y); }
.strike-flight > span { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.strike-airship { width: 125px; animation: fly-strike 1450ms ease-in-out both; }
@keyframes fly-strike {
    0% { transform: translate(calc(-50% - 92vw), -107px) rotate(-7deg); }
    49% { transform: translate(-50%, -117px) rotate(0); }
    100% { transform: translate(calc(-50% + 92vw), -138px) rotate(-5deg); }
}
.strike-flight .token { width: 29px; animation: drop-bomb 1450ms cubic-bezier(.38,.04,.9,.63) both; }
@keyframes drop-bomb {
    0%, 38% { opacity: 0; transform: translate(-90%, -100px) rotate(-10deg); }
    39% { opacity: 1; transform: translate(-90%, -100px) rotate(-10deg); }
    60% { opacity: 1; transform: translate(-50%, -50%) rotate(20deg); }
    61%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(20deg); }
}
.strike-impact {
    width: 86px; height: 86px; border-radius: 50%;
    background: radial-gradient(circle, #fff7bb 1%, #ffc16f 30%, #ed923250 58%, transparent 73%);
    animation: impact 1450ms ease-out both;
}
.strike-ring {
    width: 75px; aspect-ratio: 1; border: 3px solid #ffe0a0; border-radius: 50%;
    box-shadow: 0 0 12px #ffd183; animation: impact-ring 1450ms ease-out both;
}
.shield-impact .strike-ring { border-color: #b8faff; box-shadow: 0 0 12px #77d7ff; }
.shield-impact .strike-sparks i { background: #baf7ff; }
.shield-impact .strike-impact {
    background: radial-gradient(circle, #effdff 4%, #7ddcf8 33%, #5892f188 55%, transparent 73%);
}
@keyframes impact {
    0%, 58% { transform: translate(-50%, -50%) scale(.12); opacity: 0; }
    65% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}
@keyframes impact-ring {
    0%, 58% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
    62% { opacity: 1; }
    96%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.65); }
}
.building-detail .help-button { position: absolute; right: 11px; top: 10px; z-index: 1; }
.building-detail-art { position: relative; display: grid; place-items: center; margin-bottom: 8px; border: 1px solid #acd2af88; border-radius: 14px; background: radial-gradient(ellipse, #4d8e87, #1c4c57 78%); }
.upgrade-burst { position: absolute; top: 52%; left: 50%; pointer-events: none; }
.upgrade-burst i, .strike-sparks i {
    position: absolute; width: 10px; height: 10px; background: #ffe9a5;
    clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%);
    animation: radial-spark 580ms ease-out both;
}
.strike-sparks i { animation-delay: 850ms; }
.upgrade-burst i:nth-child(3n) { background: #c9fff0; }
@keyframes radial-spark {
    from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) scale(.5); }
    24% { opacity: 1; }
    to { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) scale(1.25); }
}
.upgrade-glow .miniature { animation: upgrade-pop 610ms ease-out; }
@keyframes upgrade-pop {
    38% { transform: translateY(-7%) scale(1.1); filter: drop-shadow(0 0 9px #ffeaae); }
    72% { transform: scale(.98); }
}
.building-detail-art .miniature { width: min(46vw, 162px); }
.building-detail-level { font-weight: 850; }
.building-detail .stage-pips > span { width: 18px; height: 7px; }
.building-detail-wallet { display: flex; gap: 5px; align-items: center; margin-top: 9px; font-size: .89rem; }
.building-detail .resource-shortfall { color: var(--rose); }
.toast {
    position: fixed; z-index: 5; left: 50%; bottom: 67px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 25px);
    padding: 9px 12px; text-align: center; border: 1px solid #d6c981; border-radius: 9px; background: #174a52; color: #fff9df; pointer-events: none;
}
.toast:empty { display: none; }

@media (max-height: 720px) {
    .skywheel { gap: 8px; }
    .wheel-heading h1 { font-size: clamp(1.65rem, 7.2vw, 2.15rem); }
    .launch { min-height: 56px; }
    .auto-button { min-height: 51px; }
    .launch > [data-icon] { width: 36px; }
}
@media (max-height: 620px) {
    .topbar { padding-bottom: 5px; }
    .skywheel { gap: 7px; padding-top: 6px; }
    .wheel-heading-copy { display: flex; align-items: center; gap: 8px; }
    .wheel-heading h1 { font-size: clamp(1.33rem, 6.8vw, 1.8rem); }
    .wheel-location { margin-top: 0; font-size: .69rem; }
    .encounter-key { display: none; }
    .reel-window { --cell: clamp(44px, 8svh, 54px); }
    .machine { gap: 4px; padding-block: 6px; }
    .spin-result { min-height: 43px; padding: 4px 6px; }
    .spin-result > span { font-size: .72rem; }
    .spin-result:has(.storm-discovery:not([hidden])) {
        grid-template-columns: minmax(0, auto) auto; justify-content: center; column-gap: 5px;
    }
    .spin-result .result-heading { grid-column: 1 / -1; }
    .launch { min-height: 52px; }
}
@media (max-height: 520px) {
    .skywheel { padding-bottom: 9px; }
    .reel-window { --cell: clamp(34px, 8.5svh, 44px); }
    .treasure-trail { padding-block: 5px; }
}
@media (orientation: portrait) and (max-height: 520px) {
    .skywheel {
        display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto; align-items: center;
    }
    .skywheel .wheel-heading, .skywheel .machine { grid-column: 1 / -1; }
    .skywheel .machine { max-height: 100%; }
    .skywheel .spin-actions { gap: 5px; }
    .skywheel .auto-button { min-width: 45px; }
    .skywheel .treasure-trail { padding: 6px; }
    .skywheel .trail-chest { display: none; }
    .skywheel .trail-label { display: grid; justify-content: start; }
    .skywheel .trail-label strong { font-size: .68rem; }
    .skywheel .trail-label span { font-size: .62rem; }
    .skywheel .launch { font-size: 1.13rem; }
    .skywheel .launch > [data-icon] { display: none; }
    .skywheel .launch > [data-icon] + span { margin: 0; }
}
@media (orientation: landscape) {
    .game-shell { width: 100%; }
    .game-shell[data-screen="village"] { grid-template-rows: auto minmax(0, 1fr) auto; }
    .game-shell[data-screen="village"] :is(.topbar, .game-nav) { position: relative; inset: auto; }
    .village .island {
        --village-sidebar: clamp(185px, 31vw, 308px);
        background-position: left center; background-size: calc(100% - var(--village-sidebar) - 8px) 100%;
    }
    .village .island[data-terrain]::before, .village-map { inset-inline-end: calc(var(--village-sidebar) + 8px); }
    .village .island-content {
        display: grid; align-content: center; inset: 8px 8px 8px auto; width: var(--village-sidebar);
        overflow: auto;
    }
    .village .island h2 { font-size: clamp(1.35rem, 3.4vw, 2.17rem); }
    .village .level-label { font-size: .75rem; }
    .village .village-actions button { padding-inline: 3px; }
    #rival-event { width: 100%; }
    #rival-event[open]:has(.rival-bottom) {
        display: grid; grid-template-columns: minmax(0, 1fr) clamp(215px, 34vw, 330px);
        grid-template-rows: auto minmax(0, 1fr) auto;
        background: radial-gradient(ellipse at 100% 45%, var(--mission-glow), transparent 73%), var(--deep-panel);
    }
    #rival-event:has(.rival-bottom) .rival-map { position: relative; grid-area: 1 / 1 / 4 / 2; }
    #rival-event :is(.rival-top, .rival-bottom) {
        position: relative; inset: auto; grid-column: 2; margin-inline: 8px; padding: 8px;
    }
    #rival-event .rival-top { grid-row: 1; margin-top: 8px; }
    #rival-event .rival-bottom { grid-row: 3; margin-bottom: 8px; }
    #rival-event .rival-header { gap: 7px; }
    #rival-event .rival-emblem { width: 44px; }
    #rival-event .rival-header h2 { font-size: clamp(1.1rem, 2.7vw, 1.5rem); }
    #rival-event .rival-pin { width: clamp(78px, 13vw, 102px); }
    #rival-event .rival-pin-art { width: clamp(40px, 7vw, 52px); }
}
@media (orientation: landscape) and (max-height: 550px) {
    .game-shell .topbar {
        display: grid; align-items: center; gap: 8px; grid-template-columns: auto minmax(0, 1fr);
    }
    .game-shell .masthead { margin: 0; gap: 4px; }
    .game-shell .brand img { width: 25px; }
    .game-shell .brand > span { display: none; }
    .game-shell .masthead-actions .help-button { width: clamp(22px, 5vw, 26px); }
    .game-shell .masthead-actions .help-button > [data-icon] { width: 23px; }
    .wheel-heading h1 { font-size: 1.55rem; }
    .wheel-heading { grid-column: 2; grid-row: 1; flex-wrap: wrap; gap: 5px; padding: 0; }
    .wheel-heading-copy { display: grid; gap: 4px; }
    .skywheel {
        display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr); align-items: start;
        column-gap: clamp(10px, 2vw, 24px); justify-self: center; width: min(100%, 790px);
    }
    .skywheel .machine { grid-column: 1; grid-row: 1 / 4; align-self: start; max-height: 100%; }
    .skywheel .spin-actions { grid-column: 2; grid-row: 2; }
    .skywheel .treasure-trail { grid-column: 2; grid-row: 3; }
    .reel-window { --cell: clamp(32px, 9.25svh, 50px); }
    .spin-actions { gap: 5px; }
    .spin-actions .auto-button { min-width: 43px; }
    .launch > [data-icon] { display: none; }
    .launch > [data-icon] + span { margin: 0; }
    .launch { font-size: 1.18rem; padding-inline: 4px; }
    .trail-chest { width: 26px; }
    .trail-label { align-items: baseline; }
    .trail-label strong { font-size: .72rem; }
    .trail-label span { font-size: .64rem; }
    .village .island {
        background-size: 100% 100%, calc(100% - var(--village-sidebar) - 8px) 162%;
        background-position: left center, left 26%;
    }
    .village .island[data-terrain]::before { background-size: 100% 162%; background-position: center 26%; }
    .village .map-pin { top: calc(var(--y) * 1.62 - 16%); }
    .village .map-pin .miniature { width: clamp(48px, 13vh, 69px); }
    .village .new-region .map-pin .miniature { width: clamp(36px, 11vh, 57px); }
    .village .new-region .plot-name { pointer-events: none; }
    #rival-event:has(.rival-bottom) .rival-map {
        background-size: 100% 100%, 100% 127%; background-position: center, center 20%;
    }
    #rival-event:has(.rival-bottom) .rival-map[data-terrain]::before {
        background-size: 100% 127%; background-position: center 20%;
    }
    #rival-event .rival-map :is(.rival-pin, .rival-decoration) { top: calc(var(--y) * 1.27 - 5.4%); }
}
@media (orientation: landscape) and (min-width: 760px) and (max-height: 550px) {
    .game-shell .brand > span { display: inline; }
    .game-shell .masthead { gap: 9px; }
}
@media (orientation: landscape) and (max-width: 700px) {
    #rival-event .rival-pin-art { width: clamp(32px, 6vw, 42px); }
    #rival-event .rival-top { gap: 6px; }
    #rival-event .rival-identity { column-gap: 6px; }
}
@media (max-width: 390px), (orientation: landscape) and (max-height: 550px) {
    .wallet-item {
        grid-template-columns: auto auto; grid-template-rows: auto auto; align-content: center;
        justify-content: center; column-gap: 4px; row-gap: 2px; padding-inline: 3px; text-align: center;
    }
    .wallet-reading { display: contents; }
    .wallet-reading strong { grid-column: 1 / -1; grid-row: 1; }
    .wallet-item > .token { grid-column: 1; grid-row: 2; width: 14px; }
    .wallet-label { grid-column: 2; grid-row: 2; }
}
@media (max-width: 345px) {
    .topbar, .screen { padding-inline: 9px; }
    .machine { padding-inline: 6px; }
    .protection svg { width: 17px; }
    .game-nav button { font-size: .68rem; }
    .wallet { gap: 4px; }
    .wheel-heading { gap: 6px; }
    .encounter-key { gap: 3px; }
    .launch > [data-icon] { width: 34px; }
}
@media (pointer: coarse) {
    .game-shell, .game-dialog, .signin { touch-action: pan-x pan-y; }
}
@media (prefers-reduced-motion: reduce) {
    .track span { transition: none; }
    .machine-win .reel-match .token, .machine-win .spin-result { animation: none; }
    .rival-result[data-won="true"] { animation: none; }
    .machine[data-win="triple"] .reel-window::before, .machine[data-win="triple"] .reel-window::after,
    .machine[data-win="triple"] .triple-badge, .rival-top .rival-triple { animation: none; }
    .reel-moving::after { display: none; }
    .flight-departure { display: none; }
    .flight-destination, .flight-clouds, .journey-craft, .journey-pennant, .flight-caption { animation: none; }
}
