/* Bolludalur — pastel pixel UI. One deliberate light, pastel world (no dark theme). */
:root {
  color-scheme: light;
  --ink: #4a3560; --ink-2: #7b6793; --milk: #fffaf8; --lav: #efe5fb; --lav-2: #dccdf1;
  --pink: #ff9ec4; --pink-d: #ef77a6; --mint: #a8e6cd; --butter: #ffe08a; --sky: #b6d8ff; --bg: #e6d8f2;
  --display: 'Jersey 10', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'DotGothic16', ui-monospace, monospace;
  --b3: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
  --b4: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); overflow: hidden; overscroll-behavior: none; }
body { font-synthesis: none; font-family: var(--body); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: none; }
#app { position: relative; width: 100%; height: 100%; overflow: hidden; background: #b8dca8; }
#world { position: absolute; left: 0; top: 0; image-rendering: pixelated; cursor: pointer; }
canvas { image-rendering: pixelated; }
h1, h2, h3, p { margin: 0; }

/* ---------- building blocks */
.frame { background: var(--milk); box-shadow: var(--b4), inset 0 4px 0 0 #fff, inset 0 -5px 0 0 var(--lav-2); }
.btn {
  font: 400 23px/1 var(--display); color: var(--ink); background: var(--pink); border: 0; margin: 3px;
  padding: 11px 16px 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--b3), inset 0 -4px 0 0 rgba(74, 53, 96, .18), inset 0 3px 0 0 rgba(255, 255, 255, .5);
  transition: transform .08s, filter .15s; touch-action: manipulation;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: var(--b3), inset 0 -1px 0 0 rgba(74, 53, 96, .18), inset 0 3px 0 0 rgba(0, 0, 0, .05); }
.btn:focus-visible { outline: 3px dashed var(--ink); outline-offset: 6px; }
.btn.alt { background: var(--lav); } .btn.mint { background: var(--mint); } .btn.gold { background: var(--butter); }
.btn.big { font-size: 29px; padding: 14px 24px 16px; }
.btn.sq { width: 46px; height: 46px; padding: 0; font-size: 22px; }
.btn.sq svg { width: 22px; height: 22px; }
.btn.off { background: #e4dcec; color: #a898bb; position: relative; }
.btn.off::after { content: ''; position: absolute; left: 8px; right: 8px; top: 50%; height: 3px; background: var(--ink); transform: rotate(-45deg); }
.btn:disabled { background: #ece6f2; color: #a697b8; cursor: default; filter: none; transform: none; }
.pill { font: 400 26px/1 var(--display); background: var(--milk); padding: 8px 12px 9px; margin: 3px; box-shadow: var(--b3), inset 0 -3px 0 0 var(--lav-2); display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.pill.small { font-size: 22px; padding: 6px 10px 7px; }
.ico { display: inline-block; width: 22px; height: 22px; background: center / contain no-repeat; image-rendering: pixelated; flex: none; }
.ico.coin { background-image: var(--i-coin); }
.ico.star { background-image: var(--i-star); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 400 18px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; padding: 6px 9px 7px; background: var(--c, var(--lav)); box-shadow: var(--b3); margin: 3px; }
.stars { display: inline-flex; gap: 1px; }
.star { display: inline-block; width: 13px; height: 13px; background: var(--i-star) center / contain no-repeat; image-rendering: pixelated; }
.hearts { display: inline-flex; gap: 2px; }
.hearts .h { display: inline-block; width: 13px; height: 12px; background: var(--i-heart) center / contain no-repeat; image-rendering: pixelated; }
.hearts .h.off { background-image: var(--i-heart-off); }

/* ---------- HUD */
#hud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 0; pointer-events: none; }
#hud > * { pointer-events: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hud-r { justify-content: flex-end; }
.lucky { background: #fff4c4; animation: glow 1.4s ease-in-out infinite alternate; }
.book-btn img { width: 30px; height: auto; image-rendering: pixelated; margin: -6px 0 -4px; }
.book-btn b { font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .6); padding: 3px 6px; }
@keyframes glow { to { background: #fffbe8; } }

#hint { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); font: 17px/1.35 var(--body); background: rgba(255, 250, 248, .94); padding: 9px 14px 10px; box-shadow: var(--b3); width: max-content; max-width: calc(100% - 40px); text-align: center; pointer-events: none; transition: opacity .4s; }
#hint.off { opacity: 0; } #hint.dim { opacity: .55; }
#toasts { position: absolute; top: calc(80px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { font: 400 22px/1.2 var(--display); background: var(--milk); padding: 9px 14px 10px; box-shadow: var(--b3); text-align: center; animation: toast 2.8s forwards; }
@keyframes toast { 0% { transform: translateY(-10px) scale(.9); opacity: 0; } 8% { transform: none; opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
#bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubble { position: absolute; transform: translate(-50%, -100%); font: 400 20px/1 var(--display); background: #fff; padding: 6px 9px 7px; box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink); white-space: nowrap; animation: pop .25s; }
@keyframes pop { from { transform: translate(-50%, -80%) scale(.6); opacity: 0; } }

/* ---------- dialog */
#dlgCatch { position: absolute; inset: 0; }
#dialog { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(720px, calc(100% - 40px)); display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px 20px; min-height: 118px; cursor: pointer; animation: rise .22s ease-out; }
@keyframes rise { from { transform: translate(-50%, 14px); opacity: 0; } }
#dialog .who { position: absolute; top: -18px; left: 18px; font: 400 21px/1 var(--display); background: var(--pink); padding: 6px 10px 7px; box-shadow: var(--b3); }
#dlgFace { flex: none; width: 72px; height: 68px; background: var(--lav); box-shadow: inset 0 0 0 3px var(--lav-2); }
.dlg-main { flex: 1; min-width: 0; }
#dlgText { font: 21px/1.5 var(--body); min-height: 2.9em; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.choices:empty { display: none; }
#dialog .more { position: absolute; right: 18px; bottom: 12px; width: 14px; height: 12px; background: var(--i-more) center / contain no-repeat; image-rendering: pixelated; animation: nudge .8s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---------- reveal */
#reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; cursor: pointer; touch-action: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .9) 0, rgba(255, 255, 255, 0) 42%), radial-gradient(#f0dcef 2px, transparent 2.6px) 0 0 / 24px 24px, linear-gradient(#f9e9f4, #e3d4f4);
  animation: fadein .25s; }
#reveal[data-tier="3"] { background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .9) 0, rgba(255, 255, 255, 0) 42%), radial-gradient(#e2d8fb 2px, transparent 2.6px) 0 0 / 24px 24px, linear-gradient(#efe6ff, #d9cbf6); }
#reveal[data-tier="4"] { background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 45%), radial-gradient(#ffe7a6 2px, transparent 2.6px) 0 0 / 24px 24px, linear-gradient(#fff5d6, #ffdca8); }
@keyframes fadein { from { opacity: 0; } }
.r-top { font: 400 29px/1.2 var(--display); min-height: 1.2em; text-align: center; animation: bob 1s ease-in-out infinite; }
.r-top.soft { animation: none; font-size: 22px; color: var(--ink-2); }
@keyframes bob { 50% { transform: translateY(-4px); } }
#rCv { display: block; max-width: 100%; outline: none; }
.r-taps { display: flex; gap: 14px; }
.r-taps i { width: 30px; height: 27px; background: var(--i-heart-off) center / contain no-repeat; image-rendering: pixelated; transition: transform .15s; }
.r-taps i.on { background-image: var(--i-heart); transform: scale(1.2); }
.r-info { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s; pointer-events: none; min-height: 190px; }
.r-info.in { opacity: 1; transform: none; pointer-events: auto; }
.r-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip.new { background: #fff; color: var(--pink-d); animation: wiggle 1s ease-in-out infinite; }
@keyframes wiggle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
#rName { font: 400 clamp(40px, 8.5vw, 64px)/1 var(--display); text-wrap: balance; text-shadow: 3px 3px 0 #fff; }
#rLine { font: 18px/1.4 var(--body); max-width: 34ch; }
.r-coins { display: inline-flex; align-items: center; gap: 6px; font: 400 23px/1 var(--display); }

/* ---------- sheets (book + shop) */
.overlay { z-index: 6; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: rgba(74, 53, 96, .38); animation: fadein .2s; }
.sheet { width: min(920px, calc(100% - 8px)); max-height: 100%; display: flex; flex-direction: column; min-height: 0; }
.sheet-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px 12px; }
.sh-t { flex: 1; min-width: 0; }
.sheet-head h2 { font: 400 39px/1 var(--display); }
.sheet-head .sub { font: 16px/1.3 var(--body); color: var(--ink-2); margin-top: 6px; }
.strip { display: grid; grid-template-columns: repeat(27, 1fr); gap: 3px; margin: 0 18px 10px; }
.strip i { height: 10px; background: var(--lav); }
.sheet-body { overflow: auto; padding: 6px 18px 22px; touch-action: pan-y; overscroll-behavior: contain; }
.bset + .bset { margin-top: 18px; }
.bset h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bset .cnt { font: 400 20px/1 var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 14px; }
.card { font-family: var(--display); color: var(--ink); background: #fff; border: 0; margin: 3px; padding: 8px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--b3), inset 0 -4px 0 0 var(--lav); cursor: pointer; }
.card:hover img { animation: squishy .5s; }
.card:focus-visible { outline: 3px dashed var(--ink); outline-offset: 5px; }
.card .no { align-self: flex-start; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card img { width: 100px; height: 84px; image-rendering: pixelated; }
.card .nm { font-size: 19px; text-align: center; line-height: .95; min-height: 2em; display: flex; align-items: center; justify-content: center; overflow-wrap: anywhere; hyphens: manual; max-width: 100%; }
.card.lock { background: var(--lav); cursor: default; box-shadow: var(--b3), inset 0 -4px 0 0 var(--lav-2); }
.card.lock .nm { color: var(--ink-2); }
.card.buddy { background: #fff4f9; }
@keyframes squishy { 30% { transform: scale(1.18, .82); } 60% { transform: scale(.94, 1.06); } }

.detail { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 24px; align-items: center; padding-top: 6px; }
.d-stage { background: radial-gradient(circle at 50% 55%, #fff 0, color-mix(in srgb, var(--c) 55%, #fff) 70%); box-shadow: var(--b3); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 3px; }
#dCv { width: 100%; max-width: 336px; aspect-ratio: 112 / 96; cursor: pointer; touch-action: none; }
.d-hint { font: 15px/1 var(--body); color: var(--ink-2); }
.d-info { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.d-info .no { font: 400 20px/1 var(--display); color: var(--ink-2); }
.d-info h3 { font: 400 clamp(36px, 6.5vw, 54px)/1 var(--display); text-wrap: balance; }
.d-info .desc { font: 19px/1.5 var(--body); max-width: 36ch; }
.d-info dl { margin: 4px 0; display: grid; gap: 8px; }
.d-info dl div { display: flex; gap: 12px; align-items: center; }
.d-info dt { font: 400 20px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); min-width: 7.5em; }
.d-info dd { margin: 0; font: 18px/1 var(--body); }
.d-info .row { justify-content: flex-start; margin-top: 6px; }

#shopFace { width: 64px; height: 60px; background: var(--lav); flex: none; box-shadow: inset 0 0 0 3px var(--lav-2); }
.shop-sheet { width: min(860px, calc(100% - 8px)); }
.shop-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; padding: 6px 4px; }
.item { padding: 16px 14px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin: 4px; }
.item img { width: 138px; height: auto; image-rendering: pixelated; }
.item h3 { font: 400 27px/1.1 var(--display); }
.item p { font: 16px/1.4 var(--body); color: var(--ink-2); min-height: 2.8em; }
.odds { display: flex; width: 100%; height: 12px; gap: 2px; box-shadow: var(--b3); margin: 3px 0 6px; }
.odds i { display: block; }
.item .btn { width: 100%; }
.cn::before { content: ''; display: inline-block; width: 16px; height: 16px; background: var(--i-coin) center / contain no-repeat; vertical-align: -2px; margin-right: 4px; image-rendering: pixelated; }
.fine { font: 15px/1.4 var(--body); color: var(--ink-2); text-align: center; margin-top: 16px; }

/* ---------- title */
#title { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: radial-gradient(ellipse at 50% 45%, rgba(255, 248, 252, .82) 0, rgba(255, 248, 252, .5) 38%, rgba(230, 216, 242, .12) 75%), linear-gradient(rgba(255, 244, 250, .1), rgba(200, 180, 225, .35)); overflow: auto; }
.title-card { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(560px, 100%); }
.title-lang { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 16px; }
.logo { font: 400 clamp(76px, 17vw, 150px)/.86 var(--display); text-align: center; letter-spacing: .01em; display: flex; flex-direction: column; align-items: center;
  text-shadow: -5px 0 0 var(--ink), 5px 0 0 var(--ink), 0 -5px 0 var(--ink), 0 5px 0 var(--ink), -5px -5px 0 var(--ink), 5px -5px 0 var(--ink), -5px 5px 0 var(--ink), 5px 5px 0 var(--ink), 0 12px 0 var(--ink), 5px 12px 0 var(--ink), -5px 12px 0 var(--ink); }
.logo span:first-child { color: #fff; }
.logo span:last-child { color: var(--pink); margin-top: .02em; }
.bunrow { display: flex; gap: 6px; align-items: flex-end; justify-content: center; flex-wrap: wrap; min-height: 84px; }
.bunrow img { width: 100px; height: auto; image-rendering: pixelated; transform-origin: 50% 100%; animation: hop 1.8s ease-in-out infinite; }
@keyframes hop { 0%, 60%, 100% { transform: none; } 70% { transform: scale(1.14, .86); } 80% { transform: translateY(-12px) scale(.94, 1.06); } 90% { transform: scale(1.06, .94); } }
.tag { font: 18px/1.45 var(--body); max-width: 30em; background: var(--milk); padding: 10px 16px 11px; box-shadow: var(--b3); text-align: center; text-wrap: balance; }
.menu { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.menu.np { padding: 20px 22px 22px; width: min(460px, 100%); }
.menu label, .menu .lbl2 { font: 400 26px/1.2 var(--display); }
.menu p { font: 18px/1.45 var(--body); text-align: center; }
#nameIn { font: 400 31px/1 var(--display); color: var(--ink); background: #fff; border: 0; width: 100%; max-width: 320px; padding: 12px 14px; text-align: center; box-shadow: var(--b3), inset 0 3px 0 0 var(--lav); outline: none; user-select: text; -webkit-user-select: text; }
#nameIn:focus-visible { box-shadow: var(--b3), inset 0 0 0 3px var(--pink); }
.outfits { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.outfit { width: 70px; height: 84px; background: #fff; border: 0; margin: 3px; cursor: pointer; box-shadow: var(--b3); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.outfit img { width: 54px; height: auto; image-rendering: pixelated; }
.outfit.on { background: var(--butter); box-shadow: var(--b3), inset 0 0 0 3px #fff; }
.outfit:focus-visible { outline: 3px dashed var(--ink); outline-offset: 5px; }

/* ---------- small screens */
/* ---------- Beach update */
.badge { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; font: 400 17px/20px var(--display); color: #fff; background: #3fbf86; box-shadow: 0 0 0 2px var(--ink); }
#questBtn { position: relative; }
#mountBtn img { width: 30px; height: auto; image-rendering: pixelated; }
#mountBtn.on { background: var(--butter); box-shadow: var(--b3), inset 0 0 0 3px #fff; }
#mountBtn:not(.on) img { opacity: .55; filter: grayscale(.4); }
#settings { position: absolute; top: calc(72px + env(safe-area-inset-top, 0px)); right: 16px; width: min(280px, calc(100% - 32px)); padding: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 5; animation: rise2 .15s ease-out; }
@keyframes rise2 { from { transform: translateY(-6px); opacity: 0; } }
#settings h3 { font: 400 26px/1 var(--display); margin-bottom: 4px; }
.st-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 400 21px/1 var(--display); color: var(--ink); background: #fff; border: 0; padding: 10px 12px; cursor: pointer; box-shadow: var(--b3); margin: 3px; }
.st-row .st-v { background: var(--lav); padding: 4px 8px; }
.st-row:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }
#settings .btn { margin-top: 6px; }
#areaBanner { z-index: 1; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 400 clamp(40px, 8vw, 72px)/1 var(--display); color: #fff; pointer-events: none; opacity: 0; white-space: nowrap;
  text-shadow: -4px 0 0 var(--ink), 4px 0 0 var(--ink), 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px -4px 0 var(--ink), 4px -4px 0 var(--ink), -4px 4px 0 var(--ink), 4px 4px 0 var(--ink), 0 9px 0 var(--ink); }
#areaBanner.show { animation: banner 2.4s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -40%); } 12%, 70% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -56%); } }
#fade { position: absolute; inset: 0; background: #3a2b4d; opacity: 0; transition: opacity .22s; pointer-events: all; z-index: 20; }
#fade.on { opacity: 1; } #fade.slow { transition-duration: .7s; }
.q-sheet { width: min(720px, calc(100% - 8px)); }
.q-empty { font: 18px/1.5 var(--body); color: var(--ink-2); text-align: center; padding: 24px 0; }
.qcard { display: flex; gap: 14px; align-items: flex-start; background: #fff; box-shadow: var(--b3); margin: 3px 3px 16px; padding: 12px 14px; }
.qcard.ready { background: #effbf5; box-shadow: var(--b3), inset 0 0 0 3px #a8e6cd; }
.q-face { width: 54px; height: 51px; background: var(--lav); flex: none; box-shadow: inset 0 0 0 3px var(--lav-2); }
.q-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.q-info h3 { font: 400 26px/1 var(--display); }
.q-info p { font: 17px/1.4 var(--body); }
.q-bar { position: relative; height: 18px; background: var(--lav); box-shadow: 0 0 0 2px var(--ink); margin: 4px 2px; }
.q-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pink); }
.qcard.ready .q-bar i { background: #7fd8ae; }
.q-bar span { position: relative; display: block; text-align: center; font: 400 17px/18px var(--display); font-variant-numeric: tabular-nums; }
.q-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font: 400 18px/1.1 var(--display); color: var(--ink-2); }
.qcard.ready .q-from { color: #2f9a6a; }
.q-rw { display: flex; gap: 10px; align-items: center; }
.rw { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.rw .ico { width: 18px; height: 18px; } .rw img { height: 24px; image-rendering: pixelated; }
.q-done-h { font: 400 22px/1 var(--display); color: var(--ink-2); margin: 10px 0 8px; }
.q-done { display: flex; flex-wrap: wrap; gap: 8px; }
.q-chip { font: 400 18px/1 var(--display); background: #effbf5; padding: 6px 9px; box-shadow: 0 0 0 2px #a8e6cd; margin: 2px; }
#fish { z-index: 6; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(74, 53, 96, .38); animation: fadein .2s; touch-action: none; }
.f-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 18px 18px; cursor: pointer; max-width: 100%; }
.f-top { font: 400 29px/1.1 var(--display); text-align: center; min-height: 1.1em; }
.f-top.hot { color: #e2507f; animation: wiggle .3s infinite; } .f-top.warn { color: var(--ink-2); } .f-top.good { color: #2f9a6a; }
#fCv { display: block; max-width: 100%; box-shadow: var(--b3); }

/* ---------- "make it hers" update */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { font: 400 21px/1 var(--display); color: var(--ink); background: var(--lav); border: 0; padding: 8px 12px 9px; margin: 3px; cursor: pointer; box-shadow: var(--b3); }
.tabs button.on { background: var(--pink); }
.tabs button:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }
#bookTabs { margin: 0 18px 10px; }
.card.bff { background: linear-gradient(#fffbea, #fff3c4); box-shadow: var(--b3), inset 0 0 0 3px #ffd46b; }
.detail.bff .d-stage { box-shadow: var(--b3), inset 0 0 0 4px #ffd46b; }
.species { font: 400 19px/1 var(--display); color: var(--ink-2); margin-top: -6px; }
.name-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.name-row input { font: 400 24px/1 var(--display); color: var(--ink); background: #fff; border: 0; padding: 8px 10px; width: 12em; max-width: 100%; box-shadow: var(--b3); outline: none; user-select: text; -webkit-user-select: text; }
.btn.small { font-size: 19px; padding: 7px 11px 9px; }
.d-h { font: 400 20px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 6px 0 0; }
.care-row { justify-content: flex-start; }
.hat-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hat-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 0; padding: 6px 6px 7px; margin: 3px; cursor: pointer; box-shadow: var(--b3); font: 400 16px/1 var(--display); color: var(--ink); min-width: 64px; }
.hat-opt img { width: 44px; image-rendering: pixelated; }
.hat-opt.on { background: var(--butter); }
.hat-opt em, .d-item em, .w-opt em { font-style: normal; font-size: 16px; }
.stk-count { font: 400 22px/1 var(--display); color: var(--ink-2); margin-bottom: 12px; }
.stk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.stk { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: var(--lav); padding: 10px 8px; box-shadow: var(--b3); margin: 3px; }
.stk.on { background: #fff; }
.stk img { width: 84px; image-rendering: pixelated; }
.stk b { font: 400 21px/1 var(--display); }
.stk span { font: 14px/1.3 var(--body); color: var(--ink-2); }
.fab { position: absolute; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); font-size: 22px; }
.fab img { width: 28px; image-rendering: pixelated; margin: -6px 0; }
#decorBar { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(820px, calc(100% - 32px)); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; z-index: 4; }
.db-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-head h3 { font: 400 28px/1 var(--display); margin-right: auto; }
.db-help { font: 16px/1.3 var(--body); color: var(--ink-2); }
.db-list { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 8px; touch-action: pan-x; }
.d-none { font: 16px/1.4 var(--body); color: var(--ink-2); padding: 12px; }
.d-item { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px; background: #fff; border: 0; margin: 3px; padding: 6px 4px 8px; box-shadow: var(--b3); cursor: pointer; font: 400 17px/1 var(--display); color: var(--ink); text-align: center; }
.d-item img { width: 40px; image-rendering: pixelated; }
.d-item.on { background: var(--mint); }
.d-item:disabled { opacity: .5; cursor: default; }
.ward-sheet { width: min(640px, calc(100% - 8px)); }
.ward-body { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#wardPrev { width: min(492px, 100%); aspect-ratio: 82 / 30; background: radial-gradient(circle at 50% 70%, #fff, var(--lav)); box-shadow: var(--b3); }
.ward-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; width: 100%; }
.w-opt { display: flex; flex-direction: column; align-items: center; gap: 3px; background: #fff; border: 0; margin: 3px; padding: 6px 4px 8px; box-shadow: var(--b3); cursor: pointer; font: 400 17px/1 var(--display); color: var(--ink); text-align: center; }
.w-opt img { width: 54px; image-rendering: pixelated; }
.w-opt.on { background: var(--butter); }
.w-opt.sw-opt { min-height: 64px; justify-content: center; }
.sw { display: block; width: 36px; height: 36px; box-shadow: 0 0 0 3px var(--ink); }
.bake-inv { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 18px 8px; }
.inv { display: inline-flex; align-items: center; gap: 5px; background: #fff; padding: 5px 9px 6px 6px; box-shadow: var(--b3); margin: 3px; font: 400 20px/1 var(--display); }
.inv img { width: 26px; image-rendering: pixelated; }
.inv em { font-style: normal; color: var(--ink-2); font-size: 17px; }
#bakeFace { width: 64px; height: 60px; background: var(--lav); flex: none; box-shadow: inset 0 0 0 3px var(--lav-2); }
.bake-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; padding: 4px; }
.r-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; text-align: center; margin: 4px; }
.r-bun { width: 90px; image-rendering: pixelated; }
.r-card h3 { font: 400 24px/1 var(--display); }
.r-need { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font: 400 19px/1 var(--display); }
.r-need span { display: inline-flex; align-items: center; gap: 2px; }
.r-need img { width: 24px; image-rendering: pixelated; }
.r-need .miss { color: #d2507a; opacity: .75; }
.r-card .btn { width: 100%; }
#mini { z-index: 6; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(74, 53, 96, .38); animation: fadein .2s; touch-action: none; }
.m-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 16px 16px; max-width: 100%; max-height: 100%; overflow: auto; }
.m-head { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: space-between; }
.m-head h2 { font: 400 34px/1 var(--display); }
.m-intro { font: 17px/1.4 var(--body); color: var(--ink-2); text-align: center; max-width: 30ch; }
.m-stat { font: 400 24px/1 var(--display); min-height: 1em; }
.m-cv { display: block; max-width: 100%; box-shadow: var(--b3); touch-action: none; cursor: pointer; }
.btn.cheer { font-size: 32px; padding: 16px 30px 18px; }
.mem-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 88px)); gap: 10px; }
.mem-card { position: relative; aspect-ratio: 1; border: 0; padding: 0; margin: 3px; cursor: pointer; background: none; box-shadow: var(--b3); }
.mem-card span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: transform .25s; backface-visibility: hidden; }
.mem-back { background: repeating-linear-gradient(45deg, var(--pink) 0 8px, #ffb8d3 8px 16px); }
.mem-front { background: #fff; transform: rotateY(180deg); }
.mem-front img { width: 80%; image-rendering: pixelated; }
.mem-card.up .mem-back { transform: rotateY(180deg); }
.mem-card.up .mem-front { transform: rotateY(0); }
.mem-card.done .mem-front { background: #effbf5; }
.slots-h { font: 400 30px/1 var(--display); text-shadow: 2px 2px 0 #fff; }
.slots { display: flex; flex-direction: column; gap: 12px; width: min(420px, 100%); }
.slot { display: flex; align-items: stretch; background: var(--milk); box-shadow: var(--b3); margin: 3px; }
.slot.empty { background: rgba(255, 250, 248, .75); }
.slot-main { flex: 1; display: flex; align-items: center; gap: 14px; border: 0; background: none; padding: 10px 14px; cursor: pointer; text-align: left; color: var(--ink); }
.slot-main img { width: 48px; image-rendering: pixelated; }
.slot-plus { width: 48px; text-align: center; font: 400 44px/1 var(--display); color: var(--pink-d); }
.slot-t { display: flex; flex-direction: column; gap: 4px; }
.slot-t b { font: 400 30px/1 var(--display); }
.slot-t em { font: normal 16px/1 var(--body); color: var(--ink-2); }
.slot-del { border: 0; background: var(--lav); color: var(--ink-2); font: 400 28px/1 var(--display); width: 48px; cursor: pointer; }
.slot-del:hover { background: #ffd0e0; color: var(--ink); }
.slot-main:focus-visible, .slot-del:focus-visible { outline: 3px dashed var(--ink); outline-offset: -6px; }
/* ---------- towns + travel */
.tv-sheet { width: min(760px, calc(100% - 8px)); }
.tv-body { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#tvCv { width: min(600px, 100%); aspect-ratio: 200 / 128; image-rendering: pixelated; box-shadow: var(--b3); cursor: pointer; touch-action: none; }
.tv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; width: 100%; }
.tv-town { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; background: #fff; border: 0; margin: 3px; padding: 10px 12px; box-shadow: var(--b3); cursor: pointer; color: var(--ink); }
.tv-town b { font: 400 24px/1 var(--display); }
.tv-town span { font: 14px/1.3 var(--body); color: var(--ink-2); }
.tv-town:not(:disabled):hover { background: var(--mint); }
.tv-town.here { background: #ffe3ef; cursor: default; }
.tv-town.locked { background: var(--lav); opacity: .75; cursor: default; }
.tv-town:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }
@media (max-width: 620px) {
  .mem-grid { grid-template-columns: repeat(4, minmax(0, 72px)); gap: 6px; }
  .stk-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
  .stk img { width: 64px; }
  .fab { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 620px) {
  .book-btn .lbl { display: none; }
  #dialog { gap: 12px; padding: 16px 14px 18px; width: calc(100% - 32px); }
  #dlgFace { width: 54px; height: 51px; }
  #dlgText { font-size: 18px; }
  .detail { grid-template-columns: 1fr; }
  .d-info { align-items: center; text-align: center; }
  .d-info .row { justify-content: center; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
  .card img { width: 80px; height: 67px; }
  .sheet-head h2 { font-size: 31px; }
  .bunrow img { width: 64px; }
  .strip { gap: 2px; }
  .pill { font-size: 23px; }
}
@media (max-width: 440px) {
  #hud { padding-left: 12px; padding-right: 12px; gap: 4px; }
  #hud > * { gap: 4px; }
  .btn.sq { width: 40px; height: 40px; font-size: 20px; }
  .btn.sq svg { width: 19px; height: 19px; }
  .book-btn { padding: 8px 9px 10px; gap: 5px; }
  .book-btn img { width: 24px; }
  .pill { padding: 7px 9px 8px; }
  #mountBtn img { width: 26px; }
  .strip { grid-template-columns: repeat(18, 1fr); }
  #shopFace { display: none; }
  .sheet-head { flex-wrap: wrap; gap: 10px; padding: 14px 14px 10px; }
  .sheet-body { padding: 6px 12px 18px; }
  .strip { margin: 0 14px 10px; }
  .card .nm { font-size: 16px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card img { width: 100%; max-width: 80px; height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- paint studio */
.studio-sheet { width: min(760px, calc(100% - 8px)); }
.studio-body { display: flex; flex-direction: column; gap: 14px; }
.stu-main { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
#stuCv { width: min(392px, 100%); aspect-ratio: 112 / 96; box-shadow: var(--b3); margin: 3px; cursor: crosshair; touch-action: none; background: #fbf6ff; }
#stuCv.pop { animation: stuPop .5s ease-out; }
@keyframes stuPop { 30% { transform: scale(1.05) rotate(-1deg); } 60% { transform: scale(.98) rotate(1deg); } }
.stu-side { display: flex; flex-direction: column; gap: 12px; flex: 1 1 240px; max-width: 340px; }
.stu-pal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.sw-b { aspect-ratio: 1; border: 0; margin: 3px; box-shadow: var(--b3); cursor: pointer; min-height: 34px; }
.sw-b.on { outline: 4px solid var(--ink); outline-offset: 3px; transform: scale(1.08); }
.stu-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-b, .opt-b { font: 400 19px/1 var(--display); color: var(--ink); background: var(--lav); border: 0; margin: 3px; padding: 8px 10px 9px; box-shadow: var(--b3); cursor: pointer; }
.tool-b.on { background: var(--butter); }
.tool-b:disabled { opacity: .45; cursor: default; }
.stu-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-b { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: #fff; flex: 1 1 120px; }
.opt-b span { font: 13px/1 var(--body); color: var(--ink-2); }
.opt-b b { font-weight: 400; }
.stu-name { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stu-name input, #bkCode { font: 16px/1.3 var(--body); color: var(--ink); background: #fff; border: 0; box-shadow: var(--b3); margin: 3px; padding: 10px 12px; user-select: text; -webkit-user-select: text; touch-action: auto; }
.stu-name input { flex: 1 1 160px; min-width: 0; font-size: 18px; }
.stu-h { font: 400 26px/1 var(--display); }
.stu-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pg-card { background: #fff; box-shadow: var(--b3); margin: 3px; display: flex; flex-direction: column; }
.pg-card.on { background: #fff4c8; }
.pg-img { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 8px 6px 4px; cursor: pointer; color: var(--ink); font: 400 18px/1 var(--display); text-align: center; }
.pg-img img { width: 64px; image-rendering: pixelated; }
.pg-row { display: flex; }
.pg-f, .pg-x { border: 0; font: 400 16px/1 var(--display); padding: 7px 6px 8px; cursor: pointer; color: var(--ink); }
.pg-f { flex: 1; background: var(--lav); }
.pg-f.on { background: var(--mint); }
.pg-x { background: #ffe3ef; min-width: 34px; }

/* ---------- save backup */
.bk-sheet { width: min(560px, calc(100% - 8px)); }
.bk-body { display: flex; flex-direction: column; gap: 10px; }
#bkCode { width: calc(100% - 6px); resize: vertical; font-size: 13px; word-break: break-all; min-height: 96px; }
.bk-msg { font: 15px/1.35 var(--body); color: var(--ink-2); min-height: 1.3em; }
.bk-btns, .bk-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-slots .btn { flex: 1 1 100%; font-size: 21px; }
.restore-btn { align-self: center; margin-top: 4px; }
.st-hint { font: 14px/1.35 var(--body); color: var(--ink-2); background: #fff; padding: 8px 10px; }

/* ---------- balloon flight */
#fly { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #bfe0ff; }
#flyCv { width: 100%; height: 100%; image-rendering: pixelated; }
#flyText { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); font: 400 34px/1 var(--display); color: var(--ink); background: var(--milk); padding: 10px 18px 12px; box-shadow: var(--b3); }
@media (max-width: 560px) { .stu-side { max-width: none; } #flyText { font-size: 26px; } }
