@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
:root {
  --cyan: #7ff0ff; --gold: #ffd65a; --pink: #ff7ac8; --red: #ff4a6a; --green: #7dff9a; --text: #eaf8ff; --muted: #8fb4c8;
  --panel: rgba(8, 26, 42, 0.9); --panel2: rgba(14, 40, 62, 0.92); --line: rgba(127, 240, 255, 0.28);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #06121c; }
body { position: fixed; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; font-family: 'Fredoka', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
#c { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
#boot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 40%, #12465a, #06121c 70%); z-index: 50; transition: opacity .4s; }
#boot .boot-title { font-size: 44px; font-weight: 700; letter-spacing: 4px; color: #bff8ff; text-shadow: 0 0 18px #3fd8ff, 0 0 40px #1a8aff; }
#boot .boot-bar { width: 160px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); margin-top: 18px; overflow: hidden; }
#boot .boot-bar i { display: block; width: 30%; height: 100%; background: #7ff0ff; border-radius: 3px; animation: bootbar 1s ease-in-out infinite alternate; }
@keyframes bootbar { from { transform: translateX(-20%); } to { transform: translateX(260%); } }

button { font-family: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; pointer-events: auto; padding: calc(10px + var(--sat)) calc(12px + var(--sar)) calc(10px + var(--sab)) calc(12px + var(--sal)); }
.screen.fade-in { animation: fadein .22s ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.dim { background: radial-gradient(ellipse at 50% 45%, rgba(4, 16, 28, 0.55), rgba(2, 8, 16, 0.86)); }
.dim.solid { background: radial-gradient(ellipse at 50% 45%, rgba(6, 22, 36, 0.94), rgba(2, 8, 16, 0.97)); }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 14px; font-size: 18px; font-weight: 600; letter-spacing: .3px;
  background: linear-gradient(180deg, rgba(40, 90, 120, .95), rgba(20, 52, 78, .95)); border: 2px solid var(--line); box-shadow: 0 3px 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.15); color: var(--text); transition: transform .08s, filter .1s; }
.btn:active { transform: translateY(2px) scale(.98); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.primary { background: linear-gradient(180deg, #8ff6ff, #2bb8e8 55%, #1a86c8); color: #052235; border-color: #c8fbff; text-shadow: 0 1px 0 rgba(255,255,255,.5); box-shadow: 0 4px 0 #0c4a72, 0 0 24px rgba(95, 230, 255, .45); }
.btn.gold { background: linear-gradient(180deg, #fff0a8, #ffc83a 55%, #e89a1a); color: #3a2200; border-color: #fff6c8; box-shadow: 0 4px 0 #8a5208, 0 0 20px rgba(255, 210, 80, .4); }
.btn.danger { background: linear-gradient(180deg, #ff8a9a, #e8405a); color: #2a0008; border-color: #ffc8d0; box-shadow: 0 4px 0 #7a1020; }
.btn.big { font-size: 26px; min-height: 62px; padding: 12px 44px; border-radius: 18px; letter-spacing: 1.5px; }
.btn.small { font-size: 15px; min-height: 38px; padding: 6px 14px; border-radius: 11px; }
.btn[disabled], .btn.disabled { filter: grayscale(.8) brightness(.7); }
.btn img { width: 24px; height: 24px; }
.focus { outline: 3px solid #fff !important; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(127,240,255,.5), 0 0 26px rgba(127,240,255,.6) !important; }
.iconbtn { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: rgba(10, 32, 50, .8); border: 2px solid var(--line); font-size: 22px; font-weight: 700; }
.iconbtn:active { transform: scale(.94); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 99px; background: rgba(6, 20, 34, .78); border: 1.5px solid rgba(255, 214, 90, .45); font-weight: 600; font-size: 17px; color: #ffe9a8; }
.pill img { width: 22px; height: 22px; }
.pearl-ic { width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- title ---------- */
.title { justify-content: space-between; }
.title .topbar { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.title .center { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: -2vh; }
.logo { font-size: clamp(48px, 13vw, 96px); font-weight: 700; letter-spacing: clamp(3px, 1.2vw, 10px); color: #dffcff; line-height: 1;
  text-shadow: 0 0 10px #7ff0ff, 0 0 30px #2bb8ff, 0 0 60px #1a6aff, 0 4px 0 #0a3a5a; animation: logoglow 3s ease-in-out infinite; }
@keyframes logoglow { 50% { text-shadow: 0 0 14px #9ff8ff, 0 0 40px #4ac8ff, 0 0 80px #2a7aff, 0 4px 0 #0a3a5a; } }
.tagline { font-size: clamp(15px, 4vw, 20px); color: #a8e8f8; letter-spacing: .5px; text-align: center; }
.hero-show { width: clamp(110px, 30vw, 170px); height: clamp(110px, 30vw, 170px); margin: 6px 0 4px; position: relative; animation: bob 3s ease-in-out infinite; }
.hero-show img { width: 100%; height: 100%; filter: drop-shadow(0 0 16px rgba(127, 240, 255, .6)); }
@keyframes bob { 50% { transform: translateY(-8px); } }
.title .bottom .btn.primary.big { animation: divepulse 2.2s ease-in-out infinite; }
@keyframes divepulse { 0%, 100% { box-shadow: 0 4px 0 #0c4a72, 0 0 24px rgba(95, 230, 255, .45); } 50% { box-shadow: 0 4px 0 #0c4a72, 0 0 40px rgba(140, 245, 255, .85); transform: scale(1.03); } }
.title .bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 460px; }
.menu-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.menu-row .btn { flex-direction: column; gap: 2px; font-size: 13px; padding: 6px 4px; min-height: 64px; border-radius: 14px; position: relative; }
.menu-row .btn img { width: 30px; height: 30px; }
.badge-dot { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; box-shadow: 0 0 10px rgba(255, 74, 106, .7); }
.daily-strip { font-size: 14px; color: var(--muted); text-align: center; }
.daily-strip b { color: var(--gold); }
@media (orientation: landscape) and (max-height: 520px) {
  .title { flex-direction: row; flex-wrap: wrap; align-content: center; justify-content: center; }
  .title .topbar { position: absolute; top: calc(8px + var(--sat)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); width: auto; }
  .title .center { margin: 0 3vw 0 0; }
  .hero-show { width: 90px; height: 90px; }
  .logo { font-size: clamp(40px, 9vh + 2vw, 72px); }
  .title .bottom { max-width: 360px; }
}

/* ---------- panels / headers ---------- */
.head { width: 100%; max-width: 820px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.head .ttl { flex: 1; font-size: 24px; font-weight: 700; text-align: center; color: #dffcff; text-shadow: 0 0 12px rgba(127, 240, 255, .55); }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 8px 32px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06); }
.content { width: 100%; max-width: 820px; flex: 1; min-height: 0; }

/* ---------- select ---------- */
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; padding: 4px; }
.char { position: relative; aspect-ratio: 1 / 1.12; border-radius: 14px; background: linear-gradient(180deg, rgba(30, 70, 100, .85), rgba(12, 34, 54, .9)); border: 2px solid rgba(127, 240, 255, .2); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; }
.char img { width: 78%; height: auto; }
.char .nm { font-size: 13px; font-weight: 600; margin-top: -2px; }
.char.sel { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(127,240,255,.5), 0 0 18px rgba(127,240,255,.5); background: linear-gradient(180deg, rgba(50, 120, 150, .9), rgba(16, 50, 74, .95)); }
.char.locked img { filter: brightness(0) opacity(.55); }
.char.locked .nm { color: var(--muted); }
.char .lock { position: absolute; bottom: 3px; left: 3px; right: 3px; font-size: 10px; line-height: 1.1; color: #ffd8a0; text-align: center; }
.char .mast { position: absolute; top: 4px; left: 6px; font-size: 11px; font-weight: 700; color: #ffe08a; text-shadow: 0 1px 2px #000; }
.char .cost { position: absolute; top: 4px; right: 4px; font-size: 11px; color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 2px; }
.char .cost img { width: 12px; height: 12px; }
.info { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin: 8px 0; }
.info .por { width: 64px; height: 64px; flex: none; }
.info .t1 { font-size: 20px; font-weight: 700; }
.info .t1 span { font-size: 15px; font-weight: 400; color: var(--muted); }
.info .t2 { font-size: 14px; color: #bfe8f4; display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.info .t2 span { flex: 1; min-width: 0; }
.info .t2 img { width: 24px; height: 24px; }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stage { border-radius: 14px; padding: 10px 12px; text-align: left; border: 2px solid rgba(127, 240, 255, .2); min-height: 74px; position: relative; overflow: hidden; }
.stage .sn { font-size: 16px; font-weight: 700; }
.stage .ss { font-size: 12px; color: rgba(234, 248, 255, .75); margin-top: 2px; }
.stage .sb { font-size: 12px; color: var(--gold); margin-top: 4px; }
.stage.sel { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(127,240,255,.5), 0 0 18px rgba(127,240,255,.45); }
.stage.locked { filter: grayscale(.7) brightness(.6); }
.sec { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; margin: 10px 2px 6px; }
.pressure { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0 4px; font-size: 15px; }
.pressure .pv { min-width: 120px; text-align: center; font-weight: 600; }
.footer { width: 100%; max-width: 820px; display: flex; justify-content: center; gap: 10px; padding-top: 8px; }

/* ---------- shop ---------- */
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 4px; }
.up { position: relative; border-radius: 14px; padding: 8px 8px 8px 8px; text-align: left; background: linear-gradient(180deg, rgba(30, 66, 94, .9), rgba(12, 32, 50, .92)); border: 2px solid rgba(127, 240, 255, .2); display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto auto; column-gap: 8px; }
.up img { width: 40px; height: 40px; grid-row: 1 / 3; }
.up .un { font-size: 15px; font-weight: 700; }
.up .ud { font-size: 12px; color: #bfe0ee; line-height: 1.15; }
.up .pips { grid-column: 1 / 3; display: flex; gap: 3px; margin-top: 6px; }
.up .pips i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); }
.up .pips i.on { background: linear-gradient(90deg, #7ff0ff, #3ac8ff); box-shadow: 0 0 6px rgba(127,240,255,.6); }
.up .price { grid-column: 1 / 3; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--gold); display: flex; align-items: center; gap: 4px; }
.up .price img { width: 16px; height: 16px; grid-row: auto; vertical-align: -3px; }
.up.max .price { color: var(--green); }
.up.poor .price { color: #b08a6a; }
.up.flash { animation: buyflash .5s ease-out; }
@keyframes buyflash { 0% { box-shadow: 0 0 0 0 rgba(255, 230, 120, .9); } 100% { box-shadow: 0 0 0 16px rgba(255, 230, 120, 0); } }

/* ---------- logbook ---------- */
.tabs { display: flex; gap: 6px; width: 100%; max-width: 820px; margin-bottom: 8px; }
.tabs .btn { flex: 1; font-size: 15px; min-height: 40px; padding: 4px 6px; }
.tabs .btn.on { background: linear-gradient(180deg, #8ff6ff, #2bb8e8); color: #052235; }
.list { display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(14, 40, 60, .85); border: 1.5px solid rgba(127, 240, 255, .14); }
.row .ri { width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.row .ri img { width: 34px; height: 34px; }
.row .rt { flex: 1; min-width: 0; }
.row .rn { font-weight: 600; font-size: 15px; }
.row .rd { font-size: 12.5px; color: #a8cfe0; }
.row .rr { font-size: 13px; color: var(--gold); font-weight: 600; white-space: nowrap; }
.row .rr img, .btn .pearl-ic { width: 15px; height: 15px; }
.row.done { border-color: rgba(125, 255, 154, .35); background: rgba(20, 60, 50, .8); }
.row.locked { opacity: .55; }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); margin-top: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #7ff0ff, #3ac8ff); border-radius: 3px; }
.codex { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat { padding: 8px 12px; border-radius: 12px; background: rgba(14, 40, 60, .85); }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 700; }

/* ---------- settings ---------- */
.set { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.set .line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; }
.set input[type=range] { width: 52%; accent-color: #7ff0ff; height: 28px; touch-action: pan-x; }
.toggle { min-width: 84px; }
.toggle.on { background: linear-gradient(180deg, #8ff6ff, #2bb8e8); color: #052235; }
.credits { font-size: 12px; color: var(--muted); line-height: 1.4; text-align: center; margin-top: 6px; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }
.xpbar { position: absolute; left: calc(6px + var(--sal)); right: calc(6px + var(--sar)); top: calc(5px + var(--sat)); height: 14px; border-radius: 8px; background: rgba(4, 16, 28, .75); border: 1.5px solid rgba(127, 240, 255, .35); overflow: hidden; }
.xpbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; background: linear-gradient(90deg, #3ac8ff, #7ff0ff 70%, #dffcff); box-shadow: 0 0 10px rgba(127,240,255,.8); transition: transform .12s linear; }
.xpbar span { position: absolute; right: 8px; top: -1px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.hudrow { position: absolute; top: calc(24px + var(--sat)); left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); display: flex; justify-content: space-between; align-items: flex-start; }
.hud-l { display: flex; flex-direction: column; gap: 3px; max-width: 40%; }
.slots { display: flex; gap: 2px; flex-wrap: wrap; }
.slots img { width: 22px; height: 22px; border-radius: 6px; background: rgba(4, 16, 28, .6); }
.slots .sl { position: relative; }
.slots .sl b { position: absolute; right: -1px; bottom: -3px; font-size: 9px; font-weight: 700; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.hud-c { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; top: 0; }
.timer { font-size: 26px; font-weight: 700; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 12px rgba(127,240,255,.5); line-height: 1; }
.timer.boss { color: #ffb0b8; }
.kills { font-size: 14px; color: #d8f0f8; text-shadow: 0 1px 2px #000; margin-top: 2px; }
.hud-r { display: flex; align-items: center; gap: 6px; pointer-events: auto; }
.hud-r .pill { font-size: 15px; padding: 3px 10px 3px 6px; }
.pausebtn { width: 42px; height: 42px; border-radius: 12px; background: rgba(6, 20, 34, .75); border: 2px solid rgba(127, 240, 255, .35); display: flex; align-items: center; justify-content: center; gap: 4px; }
.pausebtn i { width: 5px; height: 16px; border-radius: 2px; background: #dffcff; display: block; }
.bossbar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(76px + var(--sat)); width: min(76%, 460px); text-align: center; transition: opacity .3s; }
.bossbar .bn { font-size: 15px; font-weight: 700; color: #ffc0c8; text-shadow: 0 0 8px rgba(255, 60, 90, .8), 0 1px 2px #000; margin-bottom: 2px; }
.bossbar .bb { height: 11px; border-radius: 6px; background: rgba(30, 4, 12, .8); border: 1.5px solid rgba(255, 120, 140, .6); overflow: hidden; }
.bossbar .bb i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; background: linear-gradient(90deg, #ff3a5a, #ff8a9a); transition: transform .15s; }
.hint { position: absolute; left: 50%; bottom: calc(16% + var(--sab)); transform: translateX(-50%); padding: 10px 18px; border-radius: 14px; background: rgba(4, 18, 30, .78); border: 1.5px solid rgba(127,240,255,.35); font-size: 17px; text-align: center; max-width: 86%; transition: opacity .4s; white-space: pre-line; }
.banner { position: absolute; left: 0; right: 0; top: 32%; text-align: center; pointer-events: none; padding: 0 14px; }
.banner .b1 { line-height: 1.08; font-size: clamp(24px, 7vw, 52px); font-weight: 700; color: #fff; text-shadow: 0 0 16px rgba(255, 60, 90, .9), 0 3px 0 rgba(0,0,0,.5); animation: bannerin 2.4s ease-out forwards; }
.banner .b1.good { text-shadow: 0 0 16px rgba(127, 240, 255, .9), 0 3px 0 rgba(0,0,0,.5); }
.banner .b2 { font-size: clamp(15px, 4vw, 22px); color: #ffd0d8; animation: bannerin 2.4s ease-out forwards; }
@keyframes bannerin { 0% { opacity: 0; transform: scale(1.6); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- level up ---------- */
.lu { justify-content: safe center; gap: 10px; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.lu-title { font-size: clamp(30px, 8vw, 44px); font-weight: 700; color: #fff; text-shadow: 0 0 14px #7ff0ff, 0 0 30px #2bb8ff, 0 3px 0 #0a3a5a; text-align: center; line-height: 1; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.lu-sub { font-size: 15px; color: #a8e8f8; text-align: center; margin-top: 4px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cards { display: flex; flex-direction: column; gap: 9px; width: 100%; max-width: 480px; }
.card { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 14px 10px 10px; border-radius: 16px; min-height: 84px; position: relative;
  background: linear-gradient(180deg, rgba(36, 80, 110, .96), rgba(14, 38, 58, .97)); border: 2px solid rgba(127, 240, 255, .32); box-shadow: 0 5px 0 rgba(0,0,0,.35), 0 0 20px rgba(0,0,0,.3);
  animation: cardin .32s cubic-bezier(.2, 1.3, .4, 1) backwards; }
.card:nth-child(2) { animation-delay: .05s; } .card:nth-child(3) { animation-delay: .1s; } .card:nth-child(4) { animation-delay: .15s; }
@keyframes cardin { from { transform: translateY(30px) scale(.9); opacity: 0; } }
.card:active { transform: scale(.98); }
.card .ic { width: 58px; height: 58px; flex: none; border-radius: 14px; background: radial-gradient(circle, rgba(127,240,255,.18), rgba(0,0,0,0) 70%); display: flex; align-items: center; justify-content: center; }
.card .ic img { width: 58px; height: 58px; }
.card .nm { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .ds { font-size: 14.5px; color: #cfeaf4; margin-top: 2px; line-height: 1.2; }
.card .ev { font-size: 12px; color: #ffe08a; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.card .ev img { width: 18px; height: 18px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 7px; background: #ff7ac8; color: #2a0018; letter-spacing: .5px; }
.tag.lv { background: rgba(127, 240, 255, .2); color: var(--cyan); }
.tag.evo { background: #ffd65a; color: #3a2200; }
.card.weapon { border-color: rgba(127, 240, 255, .4); }
.card.passive { border-color: rgba(255, 214, 90, .35); background: linear-gradient(180deg, rgba(60, 64, 96, .96), rgba(24, 28, 54, .97)); }
.card.banishing { border-color: var(--red); box-shadow: 0 0 18px rgba(255,74,106,.6); }
.lu-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lu-tools .btn { font-size: 14px; min-height: 40px; padding: 6px 12px; }
.lu-tools .btn.on { background: linear-gradient(180deg, #ff8a9a, #e8405a); color: #2a0008; }
@media (orientation: landscape) and (max-height: 560px) {
  .cards { flex-direction: row; max-width: 980px; align-items: stretch; }
  .card { flex: 1; flex-direction: column; text-align: center; min-height: 0; padding: 10px 8px; gap: 4px; }
  .card .nm { justify-content: center; font-size: 16px; }
  .card .ds { font-size: 13px; }
  .card .ev { justify-content: center; }
  .lu { gap: 6px; }
}

/* ---------- chest ---------- */
.chestbox { width: 150px; height: 130px; position: relative; display: flex; align-items: center; justify-content: center; }
.chestbox img { width: 130px; height: auto; position: relative; z-index: 2; }
.chestbox .rays { pointer-events: none; position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; margin: -160px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 230, 140, .5) 0deg 8deg, rgba(255,230,140,0) 8deg 24deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); animation: spin 6s linear infinite; opacity: 0; transition: opacity .4s; }
.chestbox.open .rays { opacity: 1; }
.chestbox.shake img { animation: shake .12s linear infinite; }
@keyframes shake { 0% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-2px); } 100% { transform: rotate(-4deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.chest-items { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 420px; min-height: 40px; flex-shrink: 0; }
.lu > * { flex-shrink: 0; }
@media (max-height: 420px) { .chest-collect { position: fixed; right: calc(14px + var(--sar)); bottom: calc(10px + var(--sab)); z-index: 5; min-height: 0 !important; } .chestbox { width: 110px; height: 90px; } .chestbox img { width: 90px; } .chestbox .rays { width: 220px; height: 220px; margin: -110px; } .evo-big img { width: 64px; height: 64px; } }
.chest-items .row { animation: cardin .35s cubic-bezier(.2,1.3,.4,1) backwards; }
.evo-big { text-align: center; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.evo-big img { width: 96px; height: 96px; filter: drop-shadow(0 0 18px rgba(255, 214, 90, .9)); }
.evo-big .en { font-size: 24px; font-weight: 700; color: #ffe08a; text-shadow: 0 0 12px rgba(255, 200, 60, .8); }
.evo-big .ed { font-size: 14px; color: #f0e0c0; }

/* ---------- results ---------- */
.res-title { font-size: clamp(30px, 8vw, 46px); font-weight: 700; text-align: center; line-height: 1.05; }
.res-title.win { color: #fff2b0; text-shadow: 0 0 18px rgba(255, 210, 80, .9), 0 3px 0 rgba(60, 30, 0, .6); }
.res-title.lose { color: #ffd0d8; text-shadow: 0 0 16px rgba(255, 60, 90, .7), 0 3px 0 rgba(0,0,0,.5); }
.res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; margin: 10px 0; }
.res-grid .stat { text-align: center; padding: 8px 4px; }
.res-grid .v { font-size: 22px; }
.dmg { display: flex; flex-direction: column; gap: 4px; }
.dmg .dr { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.dmg .dr img { width: 26px; height: 26px; }
.dmg .db { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #7ff0ff, #3a8aff); }
.newbest { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 8px; background: #ffd65a; color: #3a2200; font-weight: 700; font-size: 13px; animation: pop .5s cubic-bezier(.2,1.6,.4,1) .3s backwards; }

/* ---------- dialogs / toasts ---------- */
.dialog { margin: auto; padding: 20px 18px; max-width: 420px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 12px; animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
.dialog .dt { font-size: 24px; font-weight: 700; }
.dialog .dd { font-size: 15px; color: #c8e4f0; line-height: 1.35; }
.dialog .dbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#toasts { position: absolute; top: calc(66px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; width: min(92%, 420px); z-index: 30; pointer-events: none; }
.toast { padding: 8px 14px; border-radius: 14px; background: rgba(10, 34, 52, .95); border: 2px solid rgba(255, 214, 90, .6); box-shadow: 0 6px 20px rgba(0,0,0,.4), 0 0 18px rgba(255, 214, 90, .3); font-size: 14.5px; display: flex; align-items: center; gap: 8px; animation: toastin 3.6s ease-out forwards; }
.toast b { color: var(--gold); }
#toasts.ingame { top: calc(114px + var(--sat)); }
@media (max-height: 520px) { #toasts.ingame { top: auto; bottom: calc(8px + var(--sab)); flex-direction: column-reverse; } }
.toast.small { font-size: 12.5px; padding: 5px 10px; border-width: 1.5px; gap: 6px; }
.toast.small img { width: 22px; height: 22px; }
.toast img { width: 28px; height: 28px; }
@keyframes toastin { 0% { opacity: 0; transform: translateY(-20px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.rotate-note { font-size: 12px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
