:root {
  --bg1: #1b0f2e; --bg2: #2e1554; --panel: #2a1745; --panel2: #3a2160;
  --orange: #ff8a1f; --orange2: #ffb11f; --purple: #8b5cf6; --purple2: #b48cff;
  --gold: #ffd23f; --evt: #ff9f2e; --exp: #4cb8ff; --text: #fff4e6; --muted: #c9b8e8;
  --card: #fff8ec; --ink: #2a1740; --danger: #ff4d6d; --good: #4fcf78;
  --r: 14px;
  --font: "Hiragino Maru Gothic ProN", "Rounded Mplus 1c", "M PLUS Rounded 1c", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg1); color: var(--text); font-family: var(--font); overscroll-behavior: none; }
body { background: radial-gradient(ellipse at 50% -10%, #4a2380 0%, var(--bg2) 35%, var(--bg1) 75%); background-attachment: fixed; }
button { font-family: inherit; cursor: pointer; border: none; }
#app { position: relative; max-width: 480px; height: 100dvh; margin: 0 auto; overflow: hidden; user-select: none; -webkit-user-select: none; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* ---------- buttons ---------- */
.btn { display: inline-block; text-decoration: none; text-align: center; border-radius: 999px; font-weight: 800; color: var(--text); padding: 10px 18px; font-size: 15px; transition: transform .08s; }
.btn:active { transform: scale(.95); }
.btn-big { font-size: 22px; padding: 14px 44px; letter-spacing: .05em; }
.btn-orange { background: linear-gradient(180deg, #ffb347, var(--orange)); color: #3a1600; box-shadow: 0 5px 0 #b3530a, 0 0 24px rgba(255,138,31,.45); }
.btn-ghost { background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.25); }
.btn-x { background: #000; border: 2px solid #555; }
.btn-small { font-size: 13px; padding: 7px 12px; }
.btn small { font-size: 11px; opacity: .8; font-weight: 600; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.12); color: var(--text); font-size: 16px; font-weight: 900; flex: none; }

/* ---------- title ---------- */
#screen-title { padding-top: env(safe-area-inset-top); align-items: center; justify-content: center; text-align: center; }
.title-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.moon { position: absolute; top: 2%; right: 4%; width: 54px; height: 54px; opacity: .85; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff8d6, #ffd76a); box-shadow: 0 0 40px #ffd76a88; }
.bat { position: absolute; font-size: 22px; animation: fly 6s ease-in-out infinite; }
.b1 { top: 12%; left: 8%; } .b2 { top: 22%; left: 70%; animation-delay: -2s; font-size: 16px; } .b3 { top: 3%; left: 14%; animation-delay: -4s; font-size: 14px; }
@keyframes fly { 0%,100% { transform: translate(0,0) } 50% { transform: translate(20px,-12px) } }
.title-wrap { position: relative; padding: 16px 20px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.title { margin: 0; line-height: 1; display: flex; flex-direction: column; align-items: center; }
.t-syfu { font-size: 26px; color: var(--gold); letter-spacing: .1em; }
.t-hw { font-size: 40px; color: var(--orange); text-shadow: 0 3px 0 #7a2c00, 0 0 18px #ff8a1f88; }
.t-main { font-size: 30px; color: #fff; text-shadow: 0 3px 0 #4b2a7a; }
.title-hero { width: 150px; height: 150px; animation: bob 2.4s ease-in-out infinite; }
.title-hero svg, .title-hero img { width: 100%; height: 100%; object-fit: contain; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.title-lead { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.5; }
.best-box { background: rgba(0,0,0,.25); padding: 6px 16px; border-radius: 999px; font-size: 14px; }
.best-box b { color: var(--evt); font-size: 18px; }
.title-sub { display: flex; gap: 10px; }
.disclaimer { font-size: 10.5px; color: #a995c9; line-height: 1.5; margin: 6px 0 0; }
#title-logo img { max-width: 160px; max-height: 50px; }

/* ---------- HUD ---------- */
.hud { padding: calc(8px + env(safe-area-inset-top)) 10px 4px; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,0)); }
.hud-row1 { display: flex; align-items: center; gap: 6px; }
.timer { flex: 1; position: relative; height: 30px; display: flex; align-items: center; }
.timer-bar { position: absolute; inset: 4px 0; background: rgba(0,0,0,.4); border-radius: 999px; overflow: hidden; border: 2px solid rgba(255,255,255,.2); }
.timer-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--orange), var(--orange2)); transform-origin: left; transition: background .3s; }
.timer.low .timer-bar i { background: linear-gradient(90deg, var(--danger), #ff7a8a); }
.timer.low #timer-text { animation: pulse .5s infinite alternate; }
#timer-text { position: relative; width: 100%; text-align: center; font-weight: 900; font-size: 17px; text-shadow: 0 2px 2px #000; font-variant-numeric: tabular-nums; }
@keyframes pulse { to { transform: scale(1.12) } }
.hud-row2 { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 6px; margin-top: 6px; }
.stat { background: rgba(0,0,0,.3); border-radius: 10px; padding: 4px 8px; display: flex; flex-direction: column; min-width: 0; }
.stat small { font-size: 10px; color: var(--muted); font-weight: 700; display: flex; gap: 4px; align-items: baseline; }
.stat small em { font-style: normal; font-size: 8.5px; opacity: .8; }
.stat b { font-size: 19px; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.stat-gold b { color: var(--gold); }
.stat-evt b { color: var(--evt); }
.stat-lv small b { font-size: 15px; color: #fff; }
.expbar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 4px; }
.expbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4cb8ff, #8be0ff); transition: width .25s; }
.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.18) } }

/* ---------- stage ---------- */
.stage { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 64px; }
.hero { width: 64px; height: 64px; flex: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.hero svg, .hero img { width: 100%; height: 100%; object-fit: contain; }
.hero.happy { animation: hop .4s; }
@keyframes hop { 40% { transform: translateY(-10px) rotate(-4deg) } }
.hero.sad { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-5px) } 40%,80% { transform: translateX(5px) } }
.stage-info { flex: 1; min-width: 0; }
.stage-name { font-weight: 900; font-size: 14px; }
.bonus-line { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.bonus-line b { color: var(--evt); } .bonus-line b.x { color: var(--exp); }
.curse-line { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.curse-chip { background: #5a1f7a; border: 1px solid #b46bff; font-size: 10.5px; padding: 1px 7px; border-radius: 99px; animation: glow 1s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 8px #b46bff } }

/* ---------- offers ---------- */
.offers { flex: 1; display: flex; flex-direction: column; gap: 7px; padding: 4px 10px; min-height: 0; position: relative; }
.card { position: relative; flex: 1; max-height: 128px; min-height: 92px; display: flex; align-items: stretch; text-align: left; background: var(--card); color: var(--ink); border-radius: var(--r); padding: 0; overflow: hidden; box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s; animation: cardIn .22s ease-out backwards; }
.card:nth-child(2) { animation-delay: .04s } .card:nth-child(3) { animation-delay: .08s }
@keyframes cardIn { from { transform: translateY(14px) scale(.96); opacity: 0 } }
.card:active { transform: scale(.97); }
.card.cant { filter: grayscale(.85) brightness(.7); }
.card.cant .card-price::after { content: 'GOLD不足'; display: block; font-size: 10px; color: var(--danger); font-weight: 900; }
.card-band { width: 22px; flex: none; background: var(--c); color: #fff; writing-mode: vertical-rl; font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; letter-spacing: .1em; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.card-icon { width: 52px; flex: none; display: flex; align-items: center; justify-content: center; }
.card-icon .emoji { font-size: 36px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.card-icon img { width: 46px; height: 46px; object-fit: contain; }
.card-main { flex: 1; min-width: 0; padding: 6px 2px 6px 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.card-name { font-weight: 900; font-size: 14.5px; line-height: 1.2; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 9.5px; padding: 1px 6px; border-radius: 99px; background: var(--good); color: #fff; font-weight: 800; }
.tag.high { background: #ff5c8a; }
.card-rows { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12.5px; font-weight: 800; }
.card-rows .k-EVT { color: #d35f00; } .card-rows .k-EXP { color: #1a7dc4; } .card-rows .k-GOLD { color: #8a6400; } .card-rows .k-🐟 { color: #7a4a00; }
.card-sub { font-size: 11px; color: #6b5a80; display: flex; flex-wrap: wrap; gap: 2px 8px; line-height: 1.3; }
.stars { color: #ff9f2e; letter-spacing: -1px; }
.risk { color: #a23ad6; font-weight: 800; }
.clue { color: #2d6f9e; font-weight: 800; }
.reveal { font-size: 11.5px; font-weight: 900; color: #2b6a3f; }
.reveal.bad { color: var(--danger); }
.reveal.good { color: #d35f00; }
.ev-line { font-size: 11px; font-weight: 900; color: #fff; background: #7b3fe4; border-radius: 6px; padding: 0 6px; align-self: flex-start; }
.card-price { width: 78px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(180deg, #ffe9c7, #ffd89a); font-weight: 900; font-size: 20px; color: #5a2d00; font-variant-numeric: tabular-nums; border-left: 2px dashed #e6b26a; }
.card-price small { font-size: 11px; }
.card-price .pay { font-size: 10px; background: var(--orange); color: #fff; border-radius: 99px; padding: 1px 8px; margin-top: 3px; }
.card.hiddeninfo { background: #e9defa; }
.card.job .card-price { background: #e6e6f0; color: #444; }
.card.paid { animation: paid .32s forwards; pointer-events: none; }
@keyframes paid { 30% { transform: scale(1.04) } 100% { transform: scale(.9) translateY(-10px); opacity: 0 } }
.stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-12deg); border: 4px solid var(--danger); color: var(--danger); font-weight: 900; font-size: 20px; padding: 2px 10px; border-radius: 8px; background: rgba(255,255,255,.85); animation: stamp .25s ease-out; }
@keyframes stamp { from { transform: translate(-50%,-50%) rotate(-12deg) scale(2); opacity: 0 } }

.offers.veiled .card { visibility: hidden; }

/* ---------- actions & tray ---------- */
.actions { display: flex; gap: 8px; padding: 6px 10px 4px; justify-content: center; }
.actions .btn { flex: 1; }
.actions .btn.alert { background: var(--orange); color: #3a1600; border-color: #ffd29a; animation: pulse .6s infinite alternate; }
.tray { padding: 4px 10px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(0,0,0,.45), rgba(0,0,0,.1)); }
.ups { display: flex; gap: 4px; flex-wrap: wrap; min-height: 22px; }
.up-chip { font-size: 11px; background: rgba(255,255,255,.12); border-radius: 99px; padding: 2px 7px; white-space: nowrap; }
.up-chip .st { color: var(--gold); letter-spacing: -1px; }
.up-chip.empty { opacity: .45; }
.tray-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.cats { flex: 1; display: flex; gap: 6px; }
.cat-slot { flex: 1; height: 50px; border-radius: 12px; background: rgba(255,255,255,.08); border: 2px dashed rgba(255,255,255,.2); display: flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 10.5px; color: var(--muted); text-align: left; min-width: 0; }
.cat-slot.filled { border-style: solid; background: rgba(255,255,255,.14); color: var(--text); }
.cat-slot.filled.r-rare { border-color: #4cb8ff; } .cat-slot.filled.r-halloween { border-color: var(--orange); box-shadow: 0 0 10px #ff8a1f88; } .cat-slot.filled.r-uncommon { border-color: var(--good); }
.cat-slot .mini { width: 40px; height: 40px; flex: none; }
.cat-slot .mini svg, .cat-slot .mini img { width: 100%; height: 100%; }
.cat-slot .ct { line-height: 1.25; min-width: 0; overflow: hidden; }
.cat-slot .ct b { display: block; font-size: 11px; white-space: nowrap; }
.taiyaki { width: 64px; text-align: center; font-size: 11px; color: var(--muted); }
.taiyaki .fish { font-size: 20px; letter-spacing: -4px; }
.taiyaki .fish .off { opacity: .2; filter: grayscale(1); }

/* ---------- FX ---------- */
.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.float { position: absolute; font-weight: 900; font-size: 20px; text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 6px rgba(0,0,0,.4); animation: floatUp 1.1s ease-out forwards; white-space: nowrap; transform: translateX(-50%); }
.float.evt { color: var(--evt); font-size: 24px; } .float.exp { color: #8be0ff; } .float.gold { color: var(--gold); } .float.bad { color: #ff8fa3; } .float.big { font-size: 30px; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8) } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1) } 100% { opacity: 0; transform: translate(-50%, -60px) } }
.flash-curse { position: absolute; inset: 0; background: radial-gradient(circle, rgba(157,77,255,.0) 30%, rgba(90,20,140,.7)); animation: flash .7s forwards; }
.flash-gold { position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,210,63,.0) 30%, rgba(255,180,40,.55)); animation: flash .7s forwards; }
@keyframes flash { from { opacity: 1 } to { opacity: 0 } }
.coin { position: absolute; font-size: 18px; animation: coin .8s ease-in forwards; }
@keyframes coin { to { transform: translate(var(--dx), var(--dy)) scale(.5); opacity: 0 } }

/* ---------- toast ---------- */
.toast-layer { position: absolute; left: 0; right: 0; top: 96px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 20; }
.toast { background: rgba(30,12,52,.94); border: 2px solid var(--purple2); padding: 7px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 800; max-width: 92%; text-align: center; animation: toastIn .25s ease-out, toastOut .3s ease-in 1.9s forwards; }
.toast.curse { border-color: #c86bff; background: rgba(70,15,100,.95); }
.toast.good { border-color: var(--gold); }
.toast.evolve { border-color: var(--orange); font-size: 16px; }
@keyframes toastIn { from { transform: translateY(-10px) scale(.9); opacity: 0 } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) } }

/* ---------- modal ---------- */
.modal-back { position: absolute; inset: 0; background: rgba(10,4,20,.78); display: none; align-items: center; justify-content: center; z-index: 30; padding: 14px; backdrop-filter: blur(3px); }
.modal-back.show { display: flex; }
.modal { width: 100%; max-height: 100%; overflow-y: auto; background: linear-gradient(180deg, #3d2266, #241240); border: 3px solid var(--purple2); border-radius: 20px; padding: 16px; text-align: center; animation: pop .25s ease-out; box-shadow: 0 0 40px rgba(139,92,246,.5); }
@keyframes pop { from { transform: scale(.85); opacity: 0 } }
.modal h2 { margin: 0 0 4px; font-size: 26px; color: var(--gold); text-shadow: 0 3px 0 #7a4a00; }
.modal h3 { margin: 4px 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; }
.modal .paused-note { font-size: 11px; color: var(--muted); margin-top: 8px; }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.choice { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--card); color: var(--ink); border-radius: 14px; padding: 10px 12px; box-shadow: 0 4px 0 rgba(0,0,0,.35); animation: cardIn .25s backwards; }
.choice:nth-child(2) { animation-delay: .06s } .choice:nth-child(3) { animation-delay: .12s }
.choice:active { transform: scale(.97); }
.choice .ci { font-size: 34px; width: 44px; text-align: center; flex: none; }
.choice .cn { font-weight: 900; font-size: 16px; }
.choice .cs { color: #ff9f2e; font-size: 15px; letter-spacing: -1px; }
.choice .cs .nx { color: #ff5c00; text-shadow: 0 0 6px #ffb347; }
.choice .ct { font-size: 12.5px; color: #4a3a60; font-weight: 700; margin-top: 2px; }
.choice .cc { font-size: 10.5px; color: #8a7aa0; }
.choice.taiyaki-c { background: #fff0d6; border: 2px solid var(--orange); }
.lv-hero { width: 90px; height: 90px; margin: 0 auto; }
.lv-hero svg, .lv-hero img { width: 100%; height: 100%; }
.evolve-banner { background: linear-gradient(90deg, #ff8a1f, #ffd23f); color: #3a1600; font-weight: 900; border-radius: 10px; padding: 4px; margin: 6px 0; animation: pulse .5s infinite alternate; }

/* breed */
.breed-stage { position: relative; height: 170px; display: flex; align-items: center; justify-content: center; }
.breed-fish { font-size: 46px; position: absolute; animation: fishL 1.1s ease-in forwards; }
.breed-fish.r { animation-name: fishR; }
@keyframes fishL { from { transform: translateX(-90px) } 80% { transform: translateX(-6px) rotate(20deg) } to { transform: translateX(0) scale(0); opacity: 0 } }
@keyframes fishR { from { transform: translateX(90px) scaleX(-1) } 80% { transform: translateX(6px) scaleX(-1) rotate(-20deg) } to { transform: translateX(0) scaleX(-1) scale(0); opacity: 0 } }
.breed-burst { position: absolute; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, var(--rc) 40%, transparent 70%); opacity: 0; animation: burst .9s ease-out 1s forwards; }
@keyframes burst { 0% { opacity: 0; transform: scale(.2) } 30% { opacity: 1 } 100% { opacity: .35; transform: scale(1.3) } }
.breed-cat { width: 130px; height: 130px; opacity: 0; animation: catIn .5s ease-out 1.2s forwards; position: relative; }
.breed-cat svg, .breed-cat img { width: 100%; height: 100%; }
@keyframes catIn { from { opacity: 0; transform: scale(.3) rotate(-20deg) } to { opacity: 1; transform: none } }
.breed-info { opacity: 0; animation: fadeIn .3s 1.5s forwards; }
@keyframes fadeIn { to { opacity: 1 } }
.rarity { display: inline-block; padding: 2px 12px; border-radius: 99px; font-weight: 900; color: #fff; margin: 4px 0; }
.r-common .rarity, .rarity.common { background: #a0896a; } .rarity.uncommon { background: var(--good); } .rarity.rare { background: #4cb8ff; } .rarity.halloween { background: linear-gradient(90deg, #ff8a1f, #9d4dff); }
.breed-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.breed-btns .btn { width: 100%; }
.note { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }

/* sell modal & help */
.sell-cat { width: 100px; height: 100px; margin: 0 auto; }
.help { text-align: left; font-size: 13px; line-height: 1.6; }
.help h4 { margin: 10px 0 2px; color: var(--orange2); font-size: 14px; }
.help p, .help ul { margin: 0; }
.help ul { padding-left: 1.2em; }
.help .cats-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 4px; }
.help .cats-table td, .help .cats-table th { border-bottom: 1px solid rgba(255,255,255,.15); padding: 3px 2px; }
.tomo-wrap { width: 120px; height: 120px; margin: 0 auto; animation: tomo 1s ease-out; }
.tomo-wrap svg, .tomo-wrap img { width: 100%; height: 100%; }
@keyframes tomo { from { transform: translateY(-120px) scale(.3) rotate(-30deg); opacity: 0 } }

/* ---------- result ---------- */
#screen-result { overflow-y: auto; }
.result-wrap { padding: 18px 16px 30px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.result-head { font-size: 34px; font-weight: 900; color: var(--orange); text-shadow: 0 3px 0 #7a2c00; animation: pop .4s; }
.result-hero { width: 120px; height: 120px; }
.result-hero svg, .result-hero img { width: 100%; height: 100%; }
.result-score small { display: block; color: var(--muted); font-size: 12px; }
.result-score b { font-size: 46px; color: var(--evt); text-shadow: 0 3px 0 #7a3a00; font-variant-numeric: tabular-nums; }
.result-best { font-size: 14px; }
.result-best .new { background: linear-gradient(90deg, #ff8a1f, #ffd23f); color: #3a1600; font-weight: 900; padding: 2px 10px; border-radius: 99px; animation: pulse .5s infinite alternate; display: inline-block; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.result-grid div { background: rgba(0,0,0,.28); border-radius: 10px; padding: 6px 4px; font-size: 11px; color: var(--muted); }
.result-grid b { display: block; font-size: 17px; color: var(--text); }
.result-builds { width: 100%; background: rgba(0,0,0,.22); border-radius: 12px; padding: 8px; font-size: 12px; text-align: left; line-height: 1.7; }
.result-builds .catsrow { display: flex; gap: 6px; margin-top: 4px; }
.result-builds .catsrow .mini { width: 44px; height: 44px; }
.result-builds .catsrow svg, .result-builds .catsrow img { width: 100%; height: 100%; }
.result-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 6px; width: 100%; }
.result-btns .btn { min-width: 220px; }

@media (min-height: 760px) {
  .card { min-height: 104px; max-height: 150px; }
  .card-name { font-size: 15.5px; } .card-rows { font-size: 13.5px; }
  .hero { width: 76px; height: 76px; }
}
@media (max-height: 640px) {
  .card { min-height: 84px; }
  .card-icon { width: 44px; } .card-icon .emoji { font-size: 30px; }
  .stage { min-height: 52px; } .hero { width: 52px; height: 52px; }
}
.offers.noanim .card { animation: none; }

/* ---------- 公式画像 ---------- */
.hero-img { width: 100%; height: 100%; object-fit: contain; }
.title-hero { width: 190px; height: 210px; }
.title-hero img { filter: drop-shadow(0 0 22px rgba(255,138,31,.55)); }
.lv-hero { width: 120px; height: 140px; }
.result-hero { width: 140px; height: 160px; }
.evt-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; border-radius: 50%; }
#evt-ic:empty { display: none; }
.up-img { height: 13px; width: auto; vertical-align: -2px; border-radius: 2px; }
.choice .ci .up-img { height: 26px; border-radius: 3px; }
.choice .ci .ci-img { width: 42px; height: 42px; object-fit: contain; }
.taiyaki .fish { display: flex; justify-content: center; gap: 0; }
.taiyaki .tk { width: 28px; height: 28px; object-fit: contain; }
.taiyaki .tk.off { opacity: .2; filter: grayscale(1); }
.tk-s { width: 20px; height: 20px; vertical-align: -5px; object-fit: contain; }
.cat-slot .mini img, .result-builds .catsrow img, .sell-cat img, .breed-cat img { object-fit: contain; }
.breed-fish img { width: 60px; height: 60px; object-fit: contain; }
.breed-pod { position: absolute; width: 100px; height: 120px; opacity: 0; animation: podIn 1.6s ease-out .75s forwards; }
.breed-pod img { width: 100%; height: 100%; object-fit: contain; }
@keyframes podIn { 0% { opacity: 0; transform: scale(.3) } 15% { opacity: 1; transform: scale(1.05) } 25%,45%,65% { transform: rotate(-9deg) } 35%,55%,75% { transform: rotate(9deg) } 85% { opacity: 1; transform: scale(1.15) } 100% { opacity: 0; transform: scale(1.6) } }
.breed-burst { animation-delay: 2.0s !important; }
.breed-cat { animation-delay: 2.15s !important; }
.breed-info { animation-delay: 2.4s !important; }
.tomo-wrap img { border-radius: 50%; }

/* ---------- 主人公＋ついてくる猫（行列） ---------- */
.stage { align-items: flex-end; gap: 6px; }
.parade { display: flex; align-items: flex-end; flex: none; min-width: 64px; }
.parade .hero { position: relative; z-index: 3; }
.follower { position: relative; width: 38px; height: 44px; margin-right: -8px; animation: follow 0.9s ease-in-out infinite; filter: drop-shadow(0 3px 3px rgba(0,0,0,.4)); }
.follower img, .follower svg { width: 100%; height: 100%; object-fit: contain; }
.follower.special { width: 44px; height: 50px; z-index: 2; }
.follower.special::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: radial-gradient(circle, rgba(255,138,31,.45), transparent 65%); z-index: -1; animation: glow 1s infinite alternate; }
@keyframes follow { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-4px) } }
.tomo-badge { position: absolute; right: -2px; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: #ff8a1f; color: #fff; font-size: 10px; font-weight: 900; display: flex; align-items: center; justify-content: center; border: 1.5px solid #fff; }
.stage-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evo-badge { font-size: 12px; font-weight: 900; padding: 1px 9px; border-radius: 99px; letter-spacing: .06em; }
.evo-pod { background: #8f86a3; color: #fff; } .evo-mini { background: var(--good); color: #fff; } .evo-prime { background: linear-gradient(90deg, #ffd23f, #ff8a1f); color: #3a1600; }
.next-evo { font-size: 11px; color: var(--muted); font-weight: 700; }
.bonus-line { font-size: 10.5px; line-height: 1.35; }
.guard-line { font-size: 10.5px; color: #8f86a3; margin-top: 1px; }
.guard-line .on { color: #ffd23f; font-weight: 800; } .guard-line .on.tomo { color: var(--orange2); }

/* ---------- 進化演出 ---------- */
.modal-back.dark { background: rgba(0,0,0,.93); }
.evo-title { font-size: 28px; font-weight: 900; color: #8ff0b0; text-shadow: 0 3px 0 #1d5a33, 0 0 18px rgba(79,207,120,.7); animation: pop .4s; letter-spacing: .02em; }
.evo-title.gold { color: #ffe27a; text-shadow: 0 3px 0 #7a4a00, 0 0 22px rgba(255,210,63,.85); }
.evo-stage { position: relative; height: 190px; margin: 6px 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.evo-stage img, .evo-stage svg { width: 100%; height: 100%; object-fit: contain; }
.pod-glow { position: absolute; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(143,240,176,.8), transparent 65%); animation: podGlow 1.2s ease-in forwards; }
@keyframes podGlow { from { opacity: 0; transform: scale(.5) } to { opacity: 1; transform: scale(1.2) } }
.pod-half { position: absolute; width: 120px; height: 150px; }
.pod-half.top { clip-path: polygon(0 0, 100% 0, 100% 52%, 70% 48%, 50% 56%, 30% 47%, 0 53%); animation: wobble .25s 3, crackTop .7s ease-in 1s forwards; }
.pod-half.bottom { clip-path: polygon(0 53%, 30% 47%, 50% 56%, 70% 48%, 100% 52%, 100% 100%, 0 100%); animation: wobble .25s 3, crackBottom .7s ease-in 1s forwards; }
@keyframes wobble { 25% { transform: rotate(-6deg) } 75% { transform: rotate(6deg) } }
@keyframes crackTop { to { transform: translate(-30px, -90px) rotate(-35deg); opacity: 0 } }
@keyframes crackBottom { to { transform: translate(20px, 70px) rotate(15deg); opacity: 0 } }
.evo-flash { position: absolute; inset: 0; background: radial-gradient(circle, #fff 0%, rgba(255,255,255,.6) 30%, transparent 70%); opacity: 0; animation: evoFlash .7s ease-out 1s forwards; }
.evo-flash.gold { background: radial-gradient(circle, #fff 0%, #ffe27a 30%, transparent 70%); animation-delay: 1.1s; }
@keyframes evoFlash { 0% { opacity: 0 } 30% { opacity: 1 } 100% { opacity: 0 } }
.evo-new { position: absolute; width: 140px; height: 170px; opacity: 0; animation: catIn .5s ease-out 1.25s forwards; }
.evo-old { position: absolute; width: 130px; height: 160px; animation: goldUp 1.3s ease-in forwards; }
@keyframes goldUp { 0% { filter: none } 70% { filter: brightness(1.6) sepia(1) saturate(4) hue-rotate(-10deg) drop-shadow(0 0 18px #ffd23f); opacity: 1 } 100% { filter: brightness(3) drop-shadow(0 0 30px #ffd23f); opacity: 0 } }
.gold-aura { position: absolute; width: 200px; height: 200px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, rgba(255,210,63,.6), transparent, rgba(255,177,31,.6), transparent); animation: spin 2s linear infinite, fadeIn .6s forwards; opacity: 0; }
@keyframes spin { to { transform: rotate(360deg) } }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 7px; height: 12px; border-radius: 2px; opacity: 0; animation-name: fall; animation-timing-function: linear; animation-fill-mode: forwards; animation-iteration-count: 2; }
@keyframes fall { 0% { opacity: 1; top: -12px } 100% { opacity: .8; top: 105%; margin-left: 30px } }
.evo-info { opacity: 0; animation: fadeIn .3s 1.6s forwards; }
.evo-sub { font-size: 14px; margin-bottom: 6px; }
.perks { list-style: none; padding: 0; margin: 0 0 10px; text-align: left; display: inline-block; font-size: 13px; font-weight: 700; line-height: 1.7; }
.perks li::before { content: '✨ '; }

/* ---------- 友ちゃん降臨 ---------- */
.tomo-scene { position: relative; }
.tomo-q { font-size: 44px; font-weight: 900; color: #ff4d6d; animation: shakeQ .5s 2; }
@keyframes shakeQ { 20%,60% { transform: translateX(-6px) rotate(-6deg) } 40%,80% { transform: translateX(6px) rotate(6deg) } }
.tomo-title { font-size: 30px; font-weight: 900; color: #ffb11f; text-shadow: 0 3px 0 #7a2c00, 0 0 24px rgba(255,138,31,.9); opacity: 0; animation: popIn .4s .5s forwards; }
@keyframes popIn { from { opacity: 0; transform: scale(2) } to { opacity: 1; transform: none } }
.tomo-scene .tomo-wrap { width: 150px; height: 150px; margin: 6px auto; opacity: 0; animation: tomoIn .7s ease-out .9s forwards; }
@keyframes tomoIn { from { opacity: 0; transform: translateY(-80px) scale(.4) rotate(-20deg) } to { opacity: 1; transform: none } }
.bubble { position: relative; display: inline-block; background: #fff; color: #2a1740; font-weight: 900; font-size: 14.5px; padding: 8px 14px; border-radius: 14px; opacity: 0; animation: fadeIn .3s 1.6s forwards; }
.bubble::before { content: ''; position: absolute; left: 50%; top: -9px; margin-left: -9px; border: 9px solid transparent; border-top: 0; border-bottom-color: #fff; }
.tomo-gift { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0; font-size: 14px; opacity: 0; animation: popIn .4s 2.3s forwards; }
.wt-img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 0 12px #fff); }
.tomo-next, .tomo-scene .breed-btns { opacity: 0; animation: fadeIn .3s 2.9s forwards; }
.tomo-scene .breed-btns { animation-delay: 0s; opacity: 1; }
.breed-stage.special { height: 190px; overflow: hidden; }
.breed-fish.solo { animation-name: fishDrop; }
@keyframes fishDrop { from { transform: translateY(-90px) } 80% { transform: translateY(-4px) rotate(10deg) } to { transform: scale(0); opacity: 0 } }

/* ---------- 結果：友ちゃん特別演出 ---------- */
.special-card { width: 100%; border-radius: 16px; padding: 10px; background: linear-gradient(135deg, #ff8a1f, #7b3fe4); border: 3px solid #ffe27a; box-shadow: 0 0 26px rgba(255,177,31,.7); animation: pop .5s; }
.sc-title { font-weight: 900; font-size: 17px; color: #fff; text-shadow: 0 2px 0 #5a1f00; }
.sc-row { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 6px 0; }
.sc-row img, .sc-row svg { width: 100%; height: 100%; object-fit: contain; }
.sc-tomo { width: 74px; height: 74px; } .sc-tomo img { border-radius: 50%; }
.sc-wt { width: 48px; height: 48px; } .sc-cat { width: 80px; height: 96px; }
.sc-plus { font-weight: 900; font-size: 20px; color: #fff; }
.sc-sub { font-size: 12.5px; font-weight: 800; color: #fff; }
.tomo-result .result-head { color: #ffe27a; }
.missing { font-size: 10.5px; color: #ff8fa3; margin: 4px 0 0; text-align: left; }
.missing:empty { display: none; }

/* =============== 配達版レイアウト =============== */
#screen-game { display: none; }
#screen-game.active { display: flex; }
.lanterns { display: flex; gap: 1px; font-size: 18px; flex: none; }
.lanterns .off { filter: grayscale(1) brightness(.5); opacity: .5; }
.hud-row1 .timer #timer-text { font-size: 13px; }
.stat-lv small { align-items: center; }
.stat-lv .evo-badge { font-size: 9.5px; padding: 0 6px; }
.hud-row3 { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; font-size: 10.5px; color: var(--muted); min-height: 18px; }
.hud-row3 .r3 { background: rgba(0,0,0,.28); border-radius: 99px; padding: 1px 7px; }
.hud-row3 .r3.on { color: #ffd23f; font-weight: 800; } .hud-row3 .r3.on.tomo { color: var(--orange2); }
.hud-row3 .curse-chip { font-size: 10.5px; }
.field { position: relative; flex: 1; min-height: 0; touch-action: none; overflow: hidden; }
.field canvas { position: absolute; left: 0; top: 0; display: block; touch-action: none; }
.combo { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font-weight: 900; font-size: 16px; color: #ffd23f; text-shadow: 0 2px 0 #7a4a00, 0 0 10px rgba(255,177,31,.7); pointer-events: none; }
.field-hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 800; color: #fff; opacity: .8; pointer-events: none; animation: pulse .8s infinite alternate; }
.field-hint.hide { display: none; }
.tray { display: flex; flex-direction: column; gap: 5px; }
.bag { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bag-label { font-size: 16px; }
.bag .slot { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.08); border: 2px dashed rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.bag .slot.full { border-style: solid; border-color: #ffd23f; background: rgba(255,210,63,.15); }
.tk-count { margin-left: auto; font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 2px; }
.cat-chip { padding: 0 3px; } .cat-chip img { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; }
.toast-layer { top: 120px; }

/* =============== v0.4 =============== */
.life-box { position: absolute; left: 6px; top: 6px; background: rgba(20,8,36,.82); border: 2px solid #ff8a1f; border-radius: 14px; padding: 3px 8px 4px; display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 3; }
.life-box .lbl { font-size: 10px; font-weight: 900; color: #ffb11f; letter-spacing: .1em; }
.life-box .lanterns { font-size: 24px; line-height: 1; display: flex; gap: 2px; }
.life-box .lanterns .off { filter: grayscale(1) brightness(.4); opacity: .45; transform: scale(.85); }
.field.danger .life-box { animation: dangerPulse .6s infinite alternate; }
.field.danger::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 40px rgba(255,40,80,.7); animation: dangerPulse .6s infinite alternate; z-index: 2; }
@keyframes dangerPulse { from { opacity: .45 } to { opacity: 1 } }
.field.shake { animation: fshake .4s; }
@keyframes fshake { 20%,60% { transform: translateX(-7px) } 40%,80% { transform: translateX(7px) } }
.tk-box { position: absolute; right: 6px; top: 6px; background: rgba(20,8,36,.82); border: 2px solid #ffd23f; border-radius: 14px; padding: 3px 8px; display: flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; pointer-events: none; z-index: 3; }
.tk-box .tk { width: 24px; height: 24px; object-fit: contain; }
.tk-box .tk.off { opacity: .25; filter: grayscale(1); }
.tk-box b { color: #ffd23f; font-size: 13px; }
.big-msg { position: absolute; left: 50%; top: 42%; transform: translate(-50%,-50%) scale(.6); opacity: 0; pointer-events: none; z-index: 6; text-align: center; font-weight: 900; font-size: 30px; line-height: 1.15; color: #fff; text-shadow: 0 3px 0 #000, 0 0 16px rgba(0,0,0,.6); transition: transform .15s, opacity .15s; white-space: nowrap; }
.big-msg small { display: block; font-size: 15px; }
.big-msg.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.big-msg.bad { color: #ff5c7a; } .big-msg.heal { color: #8ff0b0; } .big-msg.tk { color: #ffd23f; }
.combo { top: 52px; }
.shop-panel { position: absolute; left: 6px; right: 6px; bottom: 6px; background: rgba(28,12,50,.95); border: 2px solid #ffd23f; border-radius: 14px; padding: 6px 8px; display: none; z-index: 5; box-shadow: 0 -4px 20px rgba(0,0,0,.5); }
.shop-panel.show { display: block; animation: cardIn .15s ease-out; }
.sp-head { font-weight: 900; font-size: 13px; margin-bottom: 4px; } .sp-head small { color: var(--muted); font-weight: 700; margin-left: 6px; }
.sp-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-top: 1px solid rgba(255,255,255,.08); }
.sp-ic { font-size: 22px; width: 28px; text-align: center; flex: none; } .sp-img { width: 28px; height: 28px; object-fit: contain; }
.sp-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 800; line-height: 1.2; } .sp-name small { display: block; font-size: 9.5px; color: var(--muted); font-weight: 700; }
.sp-btn { flex: none; background: linear-gradient(180deg, #ffb347, #ff8a1f); color: #3a1600; font-weight: 900; font-size: 13px; border-radius: 10px; padding: 8px 10px; box-shadow: 0 3px 0 #b3530a; }
.sp-btn.sm { font-size: 11px; padding: 8px 7px; background: #ffe2b0; box-shadow: 0 3px 0 #b88a3a; }
.sp-btn.gold { background: linear-gradient(180deg, #fff1a8, #ffd23f); box-shadow: 0 3px 0 #b07a00; }
.sp-btn:active { transform: translateY(2px); box-shadow: none; }
.sp-btn:disabled { filter: grayscale(1) brightness(.6); box-shadow: none; }
.sp-row.inv { background: rgba(255,210,63,.07); border-radius: 8px; padding: 3px 4px; }
.bag .slot { font-family: inherit; color: inherit; padding: 0; }
.bag button.slot { cursor: pointer; } .bag button.slot:active { transform: scale(.9); }
.bag .slot.t2 { border-color: #c86bff; background: rgba(200,107,255,.18); } .bag .slot.t3 { border-color: #fff1a8; background: rgba(255,241,168,.25); box-shadow: 0 0 8px #ffd23f; }
.bag-hint { font-size: 10px; color: var(--muted); margin-left: 4px; }

.stars-on { color: #ffd23f; } .stars-off { color: rgba(255,255,255,.2); }

/* グレードの飾り：★2＝金の縁、★3＝輝き */
.gi { display: inline-flex; align-items: center; justify-content: center; position: relative; line-height: 1; border-radius: 50%; }
.gi.t2 { box-shadow: 0 0 0 2px #ffd23f; padding: 1px; }
.gi.t3 { box-shadow: 0 0 0 2px #fff1a8, 0 0 10px 3px rgba(255,210,63,.9); padding: 1px; animation: giGlow 1s infinite alternate; }
.gi.t3::after { content: '✨'; position: absolute; right: -8px; top: -8px; font-size: .55em; animation: twinkle .8s infinite alternate; }
@keyframes giGlow { to { box-shadow: 0 0 0 2px #fff1a8, 0 0 16px 5px rgba(255,210,63,1); } }
@keyframes twinkle { from { opacity: .3; transform: scale(.8) } to { opacity: 1; transform: scale(1.1) } }
.bag .slot.t2, .bag .slot.t3 { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); box-shadow: none; }

/* =============== v0.4.2 スマホ操作 =============== */
#screen-game { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.joy { position: fixed; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%; border: 3px solid rgba(255,255,255,.45); background: rgba(255,255,255,.06); pointer-events: none; z-index: 40; display: none; }
.joy.show { display: block; }
.joy i { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.5); transform: translate(-50%,-50%); }
.tray .shop-panel { position: static; display: none; margin: 0 0 4px; padding: 5px 6px; border-radius: 12px; animation: none; box-shadow: none; }
.tray .shop-panel.show { display: block; }
.sp-head { font-size: 12px; margin-bottom: 4px; }
.sp-chips { display: flex; gap: 5px; }
.chip { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip-buy { display: flex; align-items: center; justify-content: center; gap: 4px; background: linear-gradient(180deg, #ffb347, #ff8a1f); color: #3a1600; border-radius: 10px; padding: 6px 4px; box-shadow: 0 3px 0 #b3530a; font-size: 18px; min-height: 44px; }
.chip-buy span { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.chip-buy b { font-size: 14px; } .chip-buy small { font-size: 10px; font-weight: 700; opacity: .8; }
.chip-buy.wide { flex: 1; } .chip-buy .sp-img { width: 32px; height: 32px; object-fit: contain; }
.chip-fill { background: #ffe2b0; color: #5a2d00; border-radius: 8px; font-size: 11px; font-weight: 900; padding: 5px 2px; box-shadow: 0 2px 0 #b88a3a; }
.chip-inv { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(180deg, #fff1a8, #ffd23f); color: #4a2c00; border-radius: 10px; padding: 4px; box-shadow: 0 3px 0 #b07a00; line-height: 1.1; min-width: 0; }
.chip-inv span { font-size: 11px; font-weight: 900; } .chip-inv b { font-size: 14px; } .chip-inv small { font-size: 9px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chip-buy:disabled, .chip-fill:disabled, .chip-inv:disabled { filter: grayscale(1) brightness(.6); box-shadow: none; }
.chip-buy:active, .chip-fill:active, .chip-inv:active { transform: translateY(2px); box-shadow: none; }
.ups.hide { display: none; }

/* 下の欄は高さ固定（購入パネルが出ても町の画面の大きさが変わらない） */
.tray { flex: none; height: calc(152px + env(safe-area-inset-bottom)); justify-content: flex-start; }
.tray .bag { order: 2; } .tray .shop-panel { order: 1; } .tray .ups { order: 3; }
.tray:not(:has(.shop-panel.show))::before { content: 'お店の入口に立つと、ここに購入ボタンが出ます'; order: 1; font-size: 10.5px; color: var(--muted); text-align: center; padding: 6px 0 2px; }
@media (max-height: 720px) {
  .life-box { padding: 1px 6px 2px; border-radius: 10px; }
  .life-box .lbl { font-size: 8.5px; }
  .life-box .lanterns { font-size: 17px; }
  .tk-box { padding: 1px 6px; font-size: 10px; }
  .tk-box .tk { width: 18px; height: 18px; }
  .hud-row3 { margin-top: 3px; }
  .stat b { font-size: 16px; }
  .tray { height: calc(140px + env(safe-area-inset-bottom)); }
  .chip-buy { min-height: 40px; padding: 4px; }
}

/* =============== v0.4.3 購入ボタンを上に・ライフ/たい焼きをHUDへ =============== */
.hud { position: relative; }
.life-mini { flex: none; display: flex; flex-direction: column; align-items: center; background: rgba(20,8,36,.85); border: 2px solid #ff8a1f; border-radius: 12px; padding: 0 6px 1px; line-height: 1; }
.life-mini .lbl { font-size: 8.5px; font-weight: 900; color: #ffb11f; letter-spacing: .1em; }
.life-mini .lanterns { font-size: 19px; display: flex; gap: 1px; }
.life-mini .lanterns .off { filter: grayscale(1) brightness(.4); opacity: .45; transform: scale(.85); }
#screen-game.danger .life-mini { animation: dangerPulse .6s infinite alternate; border-color: #ff4d6d; box-shadow: 0 0 12px #ff4d6d; }
.hud-row3 { gap: 3px; }
.hud-row3 .r3 { padding: 1px 6px; }
.tk-chip { display: inline-flex; align-items: center; gap: 1px; border: 1.5px solid #ffd23f; color: #fff; font-weight: 800; }
.tk-chip .tk { width: 16px; height: 16px; object-fit: contain; } .tk-chip .tk.off { opacity: .25; filter: grayscale(1); }
.tk-chip b { color: #ffd23f; margin-left: 2px; }
/* 購入ボタン：HUD（GOLD等）の上にかぶせる。町の画面の大きさは変えない */
.hud .shop-panel, .tray .shop-panel { position: absolute; left: 6px; right: 6px; top: calc(44px + env(safe-area-inset-top)); bottom: auto; margin: 0; display: none; z-index: 12; padding: 5px 6px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.6); background: rgba(28,12,50,.97); animation: none; }
.hud .shop-panel.show { display: block; animation: spDrop .12s ease-out; }
@keyframes spDrop { from { transform: translateY(-8px); opacity: 0 } }
.hud .sp-head { margin-bottom: 3px; }
.hud .chip-buy { min-height: 40px; padding: 4px; }
.hud .chip-fill { padding: 4px 2px; }
/* 下の欄はカバンと強化だけ（薄く） */
.tray { height: auto; min-height: 0; }
.tray:not(:has(.shop-panel.show))::before { content: none; }
.ups.hide { display: flex; }

/* =============== v0.4.4 購入窓をお店のそばに（吹き出し型） =============== */
.field .shop-panel { position: absolute; right: auto; bottom: auto; display: none; z-index: 8; padding: 5px 6px; border-radius: 12px; border: 2px solid #ffd23f; background: rgba(28,12,50,.96); box-shadow: 0 6px 18px rgba(0,0,0,.55); animation: none; }
.field .shop-panel.show { display: block; animation: spPop .12s ease-out; }
@keyframes spPop { from { transform: scale(.9); opacity: 0 } }
.field .shop-panel::after { content: ''; position: absolute; left: var(--tail, 50%); bottom: -9px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: #ffd23f; }
.field .shop-panel.below::after { bottom: auto; top: -9px; border-top: 0; border-bottom: 8px solid #ffd23f; }
.field .sp-head { font-size: 11px; margin-bottom: 3px; }
.field .chip-buy { min-height: 38px; padding: 3px 4px; }
.field .chip-buy b { font-size: 13px; }
.field .chip-fill { padding: 3px 2px; font-size: 10.5px; }
.field .chip-inv b { font-size: 13px; }
.up-img { height: 16px; width: auto; vertical-align: -3px; }
.choice .ci .up-img { height: 38px; width: 38px; object-fit: contain; }
.help .up-img { height: 18px; }

/* =============== v0.5 タイトル画像・ランキング =============== */
#screen-title { justify-content: center; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); overflow-y: auto; }
.title-bg { position: absolute; inset: 0; background: url(../assets/official/title_bg.webp) center/cover; filter: blur(18px) brightness(.55); transform: scale(1.2); pointer-events: none; }
.title-art { position: relative; width: 100%; max-width: 480px; margin: 0 auto; flex: none; }
.title-art img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.hit { position: absolute; background: transparent; border-radius: 999px; padding: 0; }
.hit:active { background: rgba(255,255,255,.18); }
.hit:focus-visible { outline: 3px solid #fff; }
.hit-start { left: 24.4%; top: 73.0%; width: 51.2%; height: 10.4%; animation: startGlow 1.2s ease-in-out infinite alternate; }
@keyframes startGlow { from { box-shadow: 0 0 0 0 rgba(255,177,31,0) } to { box-shadow: 0 0 22px 4px rgba(255,177,31,.55) } }
.hit-howto { left: 21.0%; top: 85.3%; width: 17.4%; height: 5.6%; }
.hit-rank { left: 40.4%; top: 85.3%; width: 19.6%; height: 5.6%; }
.hit-mute { left: 61.9%; top: 85.3%; width: 16.9%; height: 5.6%; }
.mute-badge { position: absolute; right: -4px; top: -8px; background: #ff4d6d; color: #fff; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 99px; display: none; }
.mute-badge.show { display: block; }
.title-foot { position: relative; padding: 8px 14px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rank-tabs { display: flex; gap: 6px; justify-content: center; margin: 6px 0 8px; }
.rank-tabs button { padding: 6px 18px; border-radius: 99px; background: rgba(255,255,255,.1); color: var(--text); font-weight: 900; border: 2px solid rgba(255,255,255,.2); }
.rank-tabs button.on { background: var(--orange); color: #3a1600; border-color: #ffd29a; }
.rank-list { list-style: none; padding: 0; margin: 0; text-align: left; max-height: 52vh; overflow-y: auto; }
.rank-list li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; background: rgba(0,0,0,.22); margin-bottom: 4px; }
.rank-list li.top1 { background: linear-gradient(90deg, rgba(255,210,63,.35), rgba(0,0,0,.2)); }
.rank-list li.top2 { background: linear-gradient(90deg, rgba(220,220,235,.25), rgba(0,0,0,.2)); }
.rank-list li.top3 { background: linear-gradient(90deg, rgba(205,127,50,.3), rgba(0,0,0,.2)); }
.rank-list li.mine { outline: 2px solid #8ff0b0; }
.rank-list .rk { width: 28px; text-align: center; font-weight: 900; font-size: 15px; }
.rank-list .nm { flex: 1; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .sc { font-weight: 900; color: var(--evt); font-variant-numeric: tabular-nums; } .rank-list .sc small { font-size: 9px; margin-left: 2px; color: var(--muted); }
.rank-list .cl { width: 38px; text-align: right; font-size: 12px; color: var(--muted); }
.rank-entry { width: 100%; background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px; }
.re-row { display: flex; gap: 6px; }
.re-row input { flex: 1; min-width: 0; border-radius: 10px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: var(--text); padding: 8px 10px; font-size: 16px; font-family: inherit; }
.re-row .btn { flex: none; font-size: 13px; padding: 8px 12px; }
.re-row .btn:disabled { filter: grayscale(1) brightness(.7); }
.re-msg { font-size: 12.5px; font-weight: 800; color: #8ff0b0; margin-top: 5px; min-height: 1em; }
