/* VOYAGE — UI (docs/voyage-gdd.md). Sunny holiday: turquoise sea, sand, coral and gold. Flat buttons (no shadows), no
   emoji. Root class .vy is unique to this game (game-root-class rule). Portrait-first. */
#vyStage { position: fixed; inset: 0; z-index: 60; background: #0d6e86; }
#vyStage[hidden] { display: none; }
body.vy-on { overflow: hidden; }
body.vy-on header.topbar, body.vy-on .site-foot { display: none !important; }

.vy {
  --ink: #2b1d0e; --ink2: #6b5236; --sand: #fff4dc; --sand2: #f7e3b8; --sea: #0f8fae; --sea2: #0a5f7a; --coral: #ff6b5b; --gold: #ffc23d; --gold2: #ffdf7e; --goldD: #c98a0c;
  --mint: #33c48d; --violet: #8a63d2; --line: rgba(43, 29, 14, .12);
  position: absolute; inset: 0; overflow: hidden; color: var(--ink); font: 600 14px/1.3 Fredoka, Inter, system-ui, sans-serif;
  display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
:where(.vy) button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
:where(.vy) header:not(.vy-hud) { z-index: auto; }
.vy h2, .vy h3, .vy b { font-family: "Lilita One", Fredoka, sans-serif; font-weight: 400; letter-spacing: .01em; }
.vy-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vy-pic { width: 26px; height: 26px; object-fit: contain; flex: none; pointer-events: none; }
.vy-bg { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 110, 140, .7), rgba(8, 110, 140, 0) 22%), url(assets/voyage/ui/bg.webp) center / cover, linear-gradient(180deg, #38c6dc, #0b7d99 60%, #075a72); }
.vy-loading { align-items: center; justify-content: center; gap: 6px; color: #fff; }
.vy-loading b { position: relative; font: 400 44px/1 "Lilita One"; letter-spacing: .04em; } .vy-loading small { position: relative; font-size: 15px; opacity: .85; }

/* ---------------- HUD ---------------- */
.vy-hud { position: relative; z-index: 5; display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top) + 8px) 10px 6px; }
.vy-pill { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px 0 4px; border-radius: 17px; background: rgba(255, 248, 230, .94); color: var(--ink); }
.vy-pill b { font-size: 17px; line-height: 1; } .vy-pill .vy-pic { width: 28px; height: 28px; }
.vy-coins.bump { animation: vyBump .45s; } @keyframes vyBump { 40% { transform: scale(1.12); } }
.vy-jar em { font: 700 11px/1 Fredoka; font-style: normal; padding: 3px 6px; border-radius: 8px; background: var(--mint); color: #fff; }
.vy-jar.empty em { display: none; } .vy-jar.full { background: #fff3c4; } .vy-jar.full em { background: var(--coral); }
.vy-sp { flex: 1; }
.vy-x { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 248, 230, .94); color: var(--ink2); flex: none; }

/* ---------------- main: destination name, board, controls ---------------- */
.vy-main { position: relative; z-index: 2; flex: 1; min-height: 0; min-width: 0; width: 100%; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 6px; padding: 0 6px; }
.vy-dest { text-align: center; color: #fff; line-height: 1.05; }
.vy-dest small { display: block; font-size: 12px; opacity: .9; letter-spacing: .06em; text-transform: uppercase; } .vy-dest b { font-size: 24px; }
.vy-board { --side: 360px; --c: calc(var(--side) / 7); position: relative; width: var(--side); height: var(--side); flex: none; }
.vy-tile { position: absolute; left: calc(var(--x) * var(--c)); top: calc(var(--y) * var(--c)); width: var(--c); height: var(--c); padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  border-radius: 10px; background: var(--sand); border: 2px solid rgba(255, 255, 255, .9); box-sizing: border-box; color: var(--ink); transition: transform .2s; }
.vy-tile .vy-pic { width: 62%; height: 52%; } .vy-tile .vy-ic { width: 44%; height: 44%; }
.vy-tile span { font: 700 calc(var(--c) * .19)/1 Fredoka; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.vy-tile.t-coin span { font-family: "Lilita One"; font-weight: 400; font-size: calc(var(--c) * .22); color: #8a5a00; }
.vy-tile.t-coin3 { background: #ffe9a8; }
.vy-tile.t-harbour { background: var(--sea); color: #fff; } .vy-tile.t-surprise { background: #efe2ff; color: #5b3aa6; } .vy-tile.t-raid { background: #ffe0d8; color: #b0392a; }
.vy-tile.t-smash { background: #ffe7c7; color: #a3530b; } .vy-tile.t-corner { background: #d6f5ec; color: #146b53; } .vy-tile.t-trap { background: #f1e6d6; color: #8b6a45; }
.vy-tile.t-post { background: #dcefff; color: #1f5f9a; } .vy-tile.t-event { background: #ffe1ef; color: #b02d6e; } .vy-tile.t-nap { background: #e9f6ff; color: #4d7a99; }
.vy-tile.hit { animation: vyHit .6s; } @keyframes vyHit { 30% { transform: scale(1.14); background: #fff; } }
.vy-center { position: absolute; left: var(--c); top: var(--c); width: calc(var(--c) * 5); height: calc(var(--c) * 5); border-radius: 14px; overflow: hidden; background: #0d7f9c; cursor: pointer; }
.vy-center canvas { width: 100%; height: 100%; display: block; }
.vy-car { position: absolute; z-index: 4; width: calc(var(--c) * 1.05); transform: translate(-50%, -62%); pointer-events: none; transition: left .14s ease-out, top .14s ease-out; }
.vy-car.flip { transform: translate(-50%, -62%) scaleX(-1); }
.vy-car.hop { animation: vyHop .15s ease-out; } @keyframes vyHop { 50% { margin-top: -12px; } }
.vy-car.flip.hop { animation-name: vyHop; }
.vy-fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.vy-float { position: absolute; transform: translate(-50%, -50%); font: 400 20px/1 "Lilita One"; color: #fff; -webkit-text-stroke: 1px rgba(80, 40, 0, .55); animation: vyFloat 1.4s ease-out forwards; white-space: nowrap; }
.vy-float.big { font-size: 28px; color: var(--gold2); } .vy-float.bad { color: #ffb4a8; } .vy-float.lap { color: #bff3ff; } .vy-float.tag { font: 700 13px/1 Fredoka; -webkit-text-stroke: 0; padding: 4px 8px; border-radius: 10px; background: rgba(255, 255, 255, .92); color: var(--violet); margin-top: 22px; }
@keyframes vyFloat { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -220%) scale(1); } }
.vy-flycoin { position: absolute; left: 0; top: 0; width: 26px; height: 26px; z-index: 40; pointer-events: none; }
.vy-dice { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 14px; background: rgba(5, 40, 55, .25); }
.vy-die { width: 56px; height: 56px; border-radius: 13px; background: #fff; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 9px; box-sizing: border-box; transition: transform .1s; }
.vy-dice.rock .vy-die:first-child { transform: rotate(-14deg) translateY(-6px); } .vy-dice.rock .vy-die:last-child { transform: rotate(12deg) translateY(4px); }
.vy-dice.set .vy-die { animation: vySet .3s; } @keyframes vySet { 50% { transform: scale(1.18); } }
.vy-die b { width: 10px; height: 10px; border-radius: 50%; background: #d8352a; place-self: center; }
.vy-die[data-v="1"] b { grid-area: 2 / 2; }
.vy-die[data-v="2"] b:nth-child(1) { grid-area: 1 / 1; } .vy-die[data-v="2"] b:nth-child(2) { grid-area: 3 / 3; }
.vy-die[data-v="3"] b:nth-child(1) { grid-area: 1 / 1; } .vy-die[data-v="3"] b:nth-child(2) { grid-area: 2 / 2; } .vy-die[data-v="3"] b:nth-child(3) { grid-area: 3 / 3; }
.vy-die[data-v="4"] b:nth-child(1) { grid-area: 1 / 1; } .vy-die[data-v="4"] b:nth-child(2) { grid-area: 1 / 3; } .vy-die[data-v="4"] b:nth-child(3) { grid-area: 3 / 1; } .vy-die[data-v="4"] b:nth-child(4) { grid-area: 3 / 3; }
.vy-die[data-v="5"] b:nth-child(1) { grid-area: 1 / 1; } .vy-die[data-v="5"] b:nth-child(2) { grid-area: 1 / 3; } .vy-die[data-v="5"] b:nth-child(3) { grid-area: 2 / 2; } .vy-die[data-v="5"] b:nth-child(4) { grid-area: 3 / 1; } .vy-die[data-v="5"] b:nth-child(5) { grid-area: 3 / 3; }
.vy-die[data-v="6"] b:nth-child(1) { grid-area: 1 / 1; } .vy-die[data-v="6"] b:nth-child(2) { grid-area: 2 / 1; } .vy-die[data-v="6"] b:nth-child(3) { grid-area: 3 / 1; } .vy-die[data-v="6"] b:nth-child(4) { grid-area: 1 / 3; } .vy-die[data-v="6"] b:nth-child(5) { grid-area: 2 / 3; } .vy-die[data-v="6"] b:nth-child(6) { grid-area: 3 / 3; }
.vy-spark { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #fff6c9; pointer-events: none; animation: vySpark .9s ease-out forwards; }
@keyframes vySpark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

.vy-ctrl { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 460px; padding-bottom: 4px; }
.vy-mult, .vy-buildbtn { width: 70px; height: 62px; border-radius: 18px; background: rgba(255, 248, 230, .94); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.vy-mult small, .vy-buildbtn small { font-size: 12px; color: var(--ink2); } .vy-mult b, .vy-buildbtn b { font-size: 22px; }
.vy-mult.hot { background: var(--violet); color: #fff; } .vy-mult.hot small { color: #e8dcff; } .vy-mult:disabled { opacity: .55; }
.vy-buildbtn.ready { background: var(--mint); color: #fff; } .vy-buildbtn.ready small { color: #e2fff2; }
.vy-roll { position: relative; flex: 1; max-width: 220px; height: 84px; border-radius: 26px; background: linear-gradient(180deg, var(--gold2), var(--gold) 55%, #f3a90f); color: #5a3500; display: grid; place-content: center; text-align: center; transition: transform .12s; }
.vy-roll::after { content: ""; position: absolute; inset: 0 0 auto; height: 6px; border-radius: 26px 26px 0 0; background: rgba(255, 255, 255, .35); }
.vy-roll-t { font: 400 30px/1 "Lilita One"; letter-spacing: .04em; } .vy-roll-d { display: flex; align-items: center; justify-content: center; gap: 4px; } .vy-roll-d b { font-size: 18px; }
.vy-roll small { font-size: 11px; color: #7a4d00; } .vy-roll.down { transform: scale(.95); } .vy-roll.empty { filter: saturate(.4); }

/* ---------------- bottom nav ---------------- */
.vy-nav { position: relative; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px 10px calc(env(safe-area-inset-bottom) + 8px); }
.vy-nav button { position: relative; height: 54px; border-radius: 16px; background: rgba(255, 248, 230, .94); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--sea2); }
.vy-nav span { font-size: 12px; color: var(--ink); }
.vy-dot { position: absolute; top: 6px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }

/* ---------------- overlays (raid, smash, packs, celebrations) ---------------- */
.vy-layer { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.vy-layer > * { pointer-events: auto; }
.vy-over { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(4, 38, 52, .66); opacity: 0; transition: opacity .2s; }
.vy-over.on { opacity: 1; }
.vy-over-card { position: relative; width: min(420px, 100%); max-height: 100%; overflow: auto; padding: 18px 16px 16px; border-radius: 24px; background: var(--sand); text-align: center; transform: translateY(14px) scale(.97); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.vy-over.on .vy-over-card { transform: none; }
.vy-over-card h2 { margin: 0 0 4px; font-size: 26px; color: var(--sea2); } .vy-over-card p { margin: 0 0 12px; color: var(--ink2); }
.vy-pose { display: block; height: 130px; margin: -6px auto 4px; object-fit: contain; }
.vy-cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 12px; }
.vy-case { position: relative; aspect-ratio: 1; border-radius: 16px; background: #fff; display: grid; place-items: center; transition: transform .15s; }
.vy-case .vy-pic { width: 72%; height: 72%; } .vy-case.picked { background: #ffe9a8; transform: scale(.95); }
.vy-case b { position: absolute; bottom: 6px; left: 0; right: 0; font-size: 16px; color: #8a5a00; }
.vy-case.open { opacity: .5; } .vy-case.won { background: var(--gold2); animation: vyBump .45s; }
.vy-raid-total { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 12px; font-size: 26px; color: #8a5a00; } .vy-raid-total .vy-pic { width: 34px; height: 34px; } .vy-raid-total span { font-size: 15px; color: var(--sea2); margin-right: 8px; }
.vy-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 150px; height: 48px; padding: 0 20px; border-radius: 16px; background: var(--mint); color: #fff; font: 700 17px/1 Fredoka; }
.vy-btn.sm { min-width: 0; height: 38px; padding: 0 12px; font-size: 14px; border-radius: 12px; } .vy-btn.sm .vy-pic { width: 20px; height: 20px; }
.vy-btn.off { background: #d9ceb8; color: #7a6a52; }
.vy-target { position: relative; width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.vy-target canvas { width: 100%; height: 100%; display: block; }
.vy-target.shake { animation: vyShake .5s; } @keyframes vyShake { 20% { transform: translate(6px, -3px); } 40% { transform: translate(-7px, 4px); } 60% { transform: translate(4px, 2px); } 80% { transform: translate(-3px, -2px); } }
.vy-spots { position: absolute; inset: 0; pointer-events: none; }
.vy-spot { position: absolute; width: 46px; height: 46px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(255, 255, 255, .88); display: grid; place-items: center; pointer-events: auto; animation: vyPulse 1.2s ease-in-out infinite; }
.vy-spot .vy-pic { width: 30px; height: 30px; } .vy-spot.swing .vy-pic { animation: vySwing .35s; }
@keyframes vyPulse { 50% { transform: translate(-50%, -50%) scale(1.12); } } @keyframes vySwing { 40% { transform: rotate(-60deg); } }
.vy-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.vy-card { width: 84px; aspect-ratio: 3 / 4; perspective: 600px; }
.vy-card-in { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.vy-card.flip .vy-card-in { transform: rotateY(180deg); }
.vy-card-back, .vy-card-face { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 4px solid #fff; box-sizing: border-box; }
.vy-card-back { background: repeating-linear-gradient(45deg, #0f8fae 0 8px, #2fb0cb 8px 16px); display: grid; place-items: center; }
.vy-card-face { transform: rotateY(180deg); background-size: 300%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; }
.vy-card.s4 .vy-card-face { border-color: #c9a2ff; } .vy-card.s5 .vy-card-face { border-color: var(--gold); }
.vy-card.miss .vy-card-back { background: #e8dcc4; color: #b8a682; }
.vy-stars { display: flex; gap: 0; color: var(--gold); } .vy-stars .vy-ic { width: 12px; height: 12px; fill: currentColor; stroke: rgba(80, 40, 0, .6); stroke-width: 1.4; }
.vy-new { position: absolute; top: -6px; right: -6px; padding: 2px 6px; border-radius: 8px; background: var(--coral); color: #fff; font: 700 11px/1.3 Fredoka; font-style: normal; }
.vy-setdone { font-weight: 700; color: var(--mint) !important; }

/* ---------------- sheets ---------------- */
.vy-sheet { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 38, 52, .5); opacity: 0; transition: opacity .2s; }
.vy-sheet.on { opacity: 1; }
.vy-sheet-in { width: min(560px, 100%); max-height: 86%; display: flex; flex-direction: column; border-radius: 24px 24px 0 0; background: var(--sand); transform: translateY(30px); transition: transform .25s cubic-bezier(.3, 1.2, .5, 1); padding-bottom: env(safe-area-inset-bottom); }
.vy-sheet.on .vy-sheet-in { transform: none; }
.vy-sheet header { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 18px; }
.vy-sheet h2 { margin: 0; font-size: 24px; color: var(--sea2); } .vy-sheet h3 { margin: 14px 0 6px; font-size: 18px; color: var(--sea2); }
.vy-sheet .vy-x { background: #efe3c8; }
.vy-sheet-b { overflow: auto; padding: 0 14px 16px; }
.vy-sub { margin: 0 0 10px; color: var(--ink2); display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.vy-have { display: flex; align-items: center; gap: 3px; padding: 4px 10px 4px 4px; border-radius: 12px; background: #fff; color: var(--ink); } .vy-have b { font-size: 17px; } .vy-sub .vy-pic { width: 20px; height: 20px; }
.vy-note { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #fff; color: var(--coral); }
.vy-fine { margin: 12px 0 0; font-size: 11px; color: #8d7b5e; line-height: 1.4; }
.vy-lm { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 8px; border-radius: 16px; background: #fff; }
.vy-lm-th { width: 64px; height: 64px; border-radius: 12px; flex: none; background-repeat: no-repeat; background-color: #cfe9ef; }
.vy-lm-t { flex: 1; min-width: 0; display: grid; gap: 4px; } .vy-lm-t b { font-size: 17px; } .vy-lm-t small { display: flex; align-items: center; gap: 2px; color: var(--ink2); font-size: 12px; } .vy-lm-t small .vy-pic { width: 16px; height: 16px; }
.vy-pips { display: flex; gap: 4px; } .vy-pips i { width: 22px; height: 6px; border-radius: 3px; background: #e8dcc4; } .vy-pips i.on { background: var(--mint); }
.vy-lm.fin { background: #eafaf2; } .vy-done { display: flex; align-items: center; gap: 4px; color: var(--mint); font-weight: 700; }
.vy-styles { display: flex; gap: 6px; } .vy-style { display: grid; gap: 2px; justify-items: center; font-size: 11px; } .vy-style i { width: 52px; height: 52px; border-radius: 10px; background-repeat: no-repeat; border: 3px solid var(--gold); }
.vy-style:disabled { opacity: .5; }
.vy-sets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vy-set { display: grid; gap: 2px; padding: 6px; border-radius: 14px; background: #fff; text-align: center; } .vy-set i { aspect-ratio: 1; border-radius: 10px; background-size: cover; background-position: center; }
.vy-set b { font-size: 13px; line-height: 1.1; } .vy-set small { font-size: 11px; color: var(--ink2); } .vy-set.full { background: #fff3c4; }
.vy-vault { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: #fff; } .vy-vault small { flex: 1; color: var(--ink2); }
.vy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; justify-items: center; } .vy-grid .vy-card { width: 100%; max-width: 120px; }
.vy-login, .vy-q { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 14px; background: #fff; } .vy-login > div, .vy-q > div { flex: 1; display: grid; gap: 3px; }
.vy-login small, .vy-q small { color: var(--ink2); font-size: 12px; } .vy-got, .vy-q.got { opacity: .6; }
.vy-bar { height: 8px; border-radius: 4px; background: #efe3c8; overflow: hidden; } .vy-bar i { display: block; height: 100%; background: var(--mint); }
.vy-skus { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.vy-sku { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border-radius: 16px; background: #fff; } .vy-sku .vy-pic { width: 46px; height: 46px; }
.vy-sku b { font-size: 22px; } .vy-sku small { color: var(--ink2); font-size: 12px; text-align: center; } .vy-sku span { margin-top: 4px; padding: 6px 14px; border-radius: 10px; background: var(--mint); color: #fff; font-weight: 700; }
.vy-sku.starter { grid-column: 1 / -1; background: #fff3c4; } .vy-tag { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 8px; background: var(--coral); color: #fff; font: 700 11px/1.4 Fredoka; font-style: normal; }

/* ---------------- toasts ---------------- */
.vy-toasts { position: absolute; z-index: 50; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 52px); display: grid; justify-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.vy-toast { max-width: 420px; padding: 9px 14px; border-radius: 14px; background: rgba(255, 252, 242, .97); color: var(--ink); font-weight: 600; text-align: center; animation: vyIn .25s; }
.vy-toast.bad { color: #b0392a; } .vy-toast.out { opacity: 0; transition: opacity .3s; }
@keyframes vyIn { from { opacity: 0; transform: translateY(-8px); } }

@media (min-width: 900px) { .vy-main { gap: 12px; } .vy-nav { width: min(560px, 100%); margin: 0 auto; } .vy-hud { width: min(960px, 100%); margin: 0 auto; box-sizing: border-box; } }
@media (prefers-reduced-motion: reduce) { .vy * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
