@font-face { font-family: 'PS2P'; src: url(../fonts/pressstart2p.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; src: url(../fonts/rubik.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }
:root {
  --bg: #0d0a1f; --bg2: #151034; --panel: #1b1543; --panel2: #231b56; --line: #3a2f80;
  --cyan: #3ef0ff; --pink: #ff3ea5; --yellow: #ffe14d; --green: #4ade80; --red: #ff4d6d; --text: #f1edff; --muted: #a59ed1;
  --r-common: #9aa4b5; --r-uncommon: #4ade80; --r-rare: #38bdf8; --r-epic: #c084fc; --r-legendary: #fbbf24;
  --pix: 'PS2P', ui-monospace, monospace; --sans: 'Rubik', system-ui, -apple-system, Segoe UI, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #2a1d6e 0%, transparent 60%), radial-gradient(800px 500px at 100% 100%, #3a0f4f 0%, transparent 60%), var(--bg);
  color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.4; overflow-x: hidden;
}
body::after { /* CRT scanlines */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.13) 0 1px, transparent 1px 3px); mix-blend-mode: multiply;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
#app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; }
@media (min-width: 560px) { #app { border-left: 2px solid #241c55; border-right: 2px solid #241c55; box-shadow: 0 0 80px #000a; min-height: 100vh; } }
.view { display: none; }
.view.active { display: block; animation: viewIn .25s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 12px; font-weight: 800; letter-spacing: .3px;
  transition: transform .08s, filter .15s; user-select: none; white-space: nowrap; }
.btn:active { transform: translateY(2px) scale(.98); }
.btn-primary { background: linear-gradient(180deg, #ff5fb5, #e0247f); color: #fff; box-shadow: 0 4px 0 #8f0f4e, 0 0 24px #ff3ea555; text-shadow: 0 1px 0 #0005; }
.btn-primary:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.btn-ghost { background: #ffffff0d; border: 2px solid var(--line); color: var(--text); }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.full { width: calc(100% - 24px); margin: 6px 12px 20px; }
.input, .select { background: #0b0820; border: 2px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 14px; font: inherit; min-width: 0; }
.input:focus, .select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px #3ef0ff33; }
.select { padding: 8px 10px; font-size: 13px; }
.row { display: flex; } .gap { gap: 8px; } .grow { flex: 1; } .between { justify-content: space-between; } .center { align-items: center; } .wrap { flex-wrap: wrap; }
.mt { margin-top: 12px; } .muted { color: var(--muted); margin: 6px 0; font-size: 14px; }
.h-pixel { font-family: var(--pix); font-size: 15px; margin: 2px 0 12px; color: var(--yellow); text-shadow: 2px 2px 0 #b8287a, 0 0 12px #ffe14d55; letter-spacing: 1px; }
.h-sm { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--cyan); margin: 0 0 8px; }
.panel { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 2px solid var(--line); border-radius: 18px; padding: 14px; margin: 12px; box-shadow: inset 0 1px 0 #ffffff14, 0 6px 20px #0006; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #0b0820; border: 2px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 13px; display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; transition: border-color .15s, transform .08s; }
.chip:active { transform: scale(.96); }
.chip:hover { border-color: var(--cyan); }
.chip small { color: var(--muted); font-size: 10.5px; font-family: ui-monospace, monospace; }
.chip.hot { border-color: #ff8a3d; box-shadow: 0 0 14px #ff8a3d44; }
.chips.small .chip { padding: 5px 10px; font-size: 12px; }
.chip.on { background: var(--cyan); color: #0b0820; border-color: var(--cyan); font-weight: 800; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 2px 0; min-height: 1em; }
.demo-tag { display: inline-block; background: #ffe14d22; color: var(--yellow); border: 1px solid #ffe14d66; border-radius: 6px; padding: 1px 6px; font-size: 11.5px; font-weight: 600; }
.demo-banner { background: repeating-linear-gradient(45deg, #ffe14d18 0 10px, #ffe14d0a 10px 20px); border: 2px dashed #ffe14d77; color: var(--yellow); border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 600; }

/* ---------- title ---------- */
#view-title.active { display: flex; min-height: 100vh; min-height: 100dvh; }
.title-wrap { width: 100%; padding: 30px 18px calc(24px + var(--safe-b)); text-align: center; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; }
.demo-ribbon { position: absolute; top: 18px; right: -42px; transform: rotate(35deg); background: var(--yellow); color: #1a1000; font-family: var(--pix); font-size: 8px; padding: 6px 48px; box-shadow: 0 2px 10px #0008; }
.title-bars { position: absolute; inset: 40px 10px auto; height: 170px; opacity: .14;
  background: repeating-linear-gradient(90deg, #fff 0 3px, transparent 3px 6px, #fff 6px 7px, transparent 7px 12px, #fff 12px 16px, transparent 16px 19px, #fff 19px 20px, transparent 20px 26px);
  -webkit-mask: linear-gradient(180deg, #000, transparent); mask: linear-gradient(180deg, #000, transparent); }
.title-bars::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: var(--red); box-shadow: 0 0 16px 4px var(--red); animation: laser 2.4s ease-in-out infinite; opacity: 1; }
@keyframes laser { 0%, 100% { top: 5%; } 50% { top: 90%; } }
.logo { margin: 34px 0 6px; font-family: var(--pix); line-height: 1.15; position: relative; }
.logo span { display: block; }
.logo-1 { font-size: clamp(26px, 9vw, 40px); color: #fff; text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 #5b1fa8, 0 0 30px #3ef0ff66; letter-spacing: 2px; }
.logo-2 { font-size: clamp(22px, 7.6vw, 34px); color: var(--yellow); text-shadow: 3px 3px 0 #d43a00, 6px 6px 0 #5b1fa8, 0 0 30px #ffe14d55; margin-top: 8px; letter-spacing: 2px; }
.tagline { font-size: 18px; font-weight: 800; margin: 14px 0 0; color: var(--cyan); text-shadow: 0 0 12px #3ef0ff66; }
.sub-tagline { color: var(--muted); margin: 4px 0 18px; font-size: 14px; }
.title-mons { display: flex; justify-content: center; align-items: flex-end; height: 190px; margin: 12px 0 2px; position: relative; }
.title-mons .tm { width: 130px; height: 130px; margin: 0 -18px; filter: drop-shadow(0 8px 12px #0008); animation: floaty 3s ease-in-out infinite; }
.title-mons .tm:nth-child(2) { width: 180px; height: 180px; z-index: 2; animation-delay: -1s; }
.title-mons .tm:nth-child(3) { animation-delay: -2s; }
.title-mons svg { width: 100%; height: 100%; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.btn-start { font-family: var(--pix); font-size: 14px; padding: 18px 28px; background: linear-gradient(180deg, #ffe14d, #ffb800); color: #2a1600; border-radius: 14px; box-shadow: 0 5px 0 #a35d00, 0 0 30px #ffe14d66; }
.blink-slow { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.title-steps { display: grid; gap: 8px; margin: 22px 0 10px; width: 100%; max-width: 360px; text-align: left; }
.title-steps div { background: #ffffff0a; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.title-steps b { font-family: var(--pix); font-size: 11px; color: #0b0820; background: var(--cyan); border-radius: 6px; width: 24px; height: 24px; display: grid; place-items: center; flex: none; }
.title-foot { color: #7d76ad; font-size: 11.5px; margin-top: auto; padding-top: 10px; }

/* ---------- shell ---------- */
#shell { padding-bottom: calc(78px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #0d0a1fe6; backdrop-filter: blur(8px); border-bottom: 2px solid #241c55; }
.mini-logo { font-family: var(--pix); font-size: 9px; line-height: 1.3; text-align: left; }
.mini-logo span { display: block; } .mini-logo span:first-child { color: #fff; } .mini-logo span:last-child { color: var(--yellow); }
.pill-demo { font-family: var(--pix); font-size: 7px; background: var(--yellow); color: #1a1000; padding: 4px 6px; border-radius: 4px; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip-rating { font-weight: 800; font-size: 13px; background: #ffffff10; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; background: #ffffff10; border: 1px solid var(--line); font-size: 16px; }
.icon-btn.off { opacity: .4; text-decoration: line-through; }
.bottomnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 60; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #0d0a1ff2; backdrop-filter: blur(8px); border-top: 2px solid #241c55; padding: 6px 6px calc(6px + var(--safe-b)); }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; font-size: 11.5px; font-weight: 600; color: var(--muted); position: relative; }
.nav-btn .ni { font-size: 20px; line-height: 1; }
.nav-btn.on { color: var(--cyan); background: #3ef0ff14; text-shadow: 0 0 10px #3ef0ff88; }
.nav-badge { position: absolute; top: 2px; right: 22%; background: var(--pink); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 6px; }
.nav-badge:empty { display: none; }

/* ---------- scan ---------- */
.scanner-box { position: relative; border-radius: 14px; overflow: hidden; background: #05030f; border: 2px solid #2d2470; min-height: 210px; margin-bottom: 10px; }
#reader { width: 100%; }
#reader video { border-radius: 12px; }
.scanner-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 13px; padding: 14px; }
.scanner-box.live .scanner-idle { display: none; }
.laser-demo { position: relative; width: 190px; height: 110px; margin-bottom: 10px; }
.laser-demo .bars { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #e9e6ff 0 4px, transparent 4px 7px, #e9e6ff 7px 8px, transparent 8px 12px, #e9e6ff 12px 15px, transparent 15px 17px); border-radius: 4px; opacity: .85; }
.laser-demo .laser { position: absolute; left: -8px; right: -8px; height: 3px; background: var(--red); box-shadow: 0 0 14px 3px var(--red); animation: laser 1.8s ease-in-out infinite; }
.how { margin: 0; padding-left: 18px; color: #d4cff3; font-size: 13.5px; } .how li { margin: 6px 0; }
.info-panel { background: linear-gradient(180deg, #17123a, #110d2a); }

/* ---------- monster card ---------- */
.card { --rc: var(--r-common); position: relative; border-radius: 18px; padding: 3px; background: var(--rc); overflow: hidden; isolation: isolate; }
.card::before { content: ''; position: absolute; inset: -60%; z-index: -1; background: var(--rc); }
.card.r-uncommon { --rc: var(--r-uncommon); box-shadow: 0 0 14px #4ade8044; }
.card.r-rare { --rc: var(--r-rare); box-shadow: 0 0 20px #38bdf866; }
.card.r-epic { --rc: var(--r-epic); box-shadow: 0 0 26px #c084fc88; }
.card.r-epic::before { background: conic-gradient(#c084fc, #f0abfc, #7c3aed, #c084fc, #e9d5ff, #c084fc); animation: spin 5s linear infinite; }
.card.r-legendary { --rc: var(--r-legendary); box-shadow: 0 0 34px #fbbf24aa, 0 0 70px #f9731655; }
.card.r-legendary::before { background: conic-gradient(#fbbf24, #fff7cc, #f97316, #fde047, #ff3ea5, #fbbf24); animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card-in { position: relative; z-index: 1; border-radius: 15px; background: linear-gradient(180deg, #221a52, #120d2c); overflow: hidden; }
.card.r-legendary .card-in::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, #ffffff30 45%, transparent 60%); background-size: 250% 100%; animation: sheen 3.5s ease-in-out infinite; }
@keyframes sheen { 0% { background-position: 150% 0; } 60%, 100% { background-position: -100% 0; } }
.card-top { display: flex; justify-content: space-between; align-items: center; padding: 9px 11px 0; gap: 6px; }
.rar-badge { font-family: var(--pix); font-size: 8px; padding: 5px 7px; border-radius: 6px; background: var(--rc); color: #120d2c; letter-spacing: .5px; }
.el-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 8px 3px 5px; border-radius: 999px; background: #0008; border: 1px solid #ffffff22; }
.card-art { position: relative; margin: 6px 10px 0; border-radius: 12px; aspect-ratio: 1 / .92; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--el) 50%, #1d1650) 0%, color-mix(in srgb, var(--el) 14%, #120d2c) 55%, #0c0820 100%); border: 2px solid #ffffff14; }
.card-art::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, #ffffff06 0 2px, transparent 2px 4px); pointer-events: none; }
.card-art svg { width: 100%; height: 100%; display: block; }
.card-badges { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 2; align-items: flex-start; }
.badge-disc { font-family: var(--pix); font-size: 7px; background: linear-gradient(180deg, #ffe14d, #f59e0b); color: #2a1600; padding: 5px 6px; border-radius: 5px; box-shadow: 0 2px 0 #92400e; }
.badge-prism { font-family: var(--pix); font-size: 7px; background: linear-gradient(90deg, #f472b6, #a78bfa, #38bdf8, #4ade80); color: #120d2c; padding: 5px 6px; border-radius: 5px; }
.card-name { font-weight: 900; font-size: 20px; padding: 8px 12px 0; line-height: 1.1; text-shadow: 0 2px 0 #0007; }
.card-sub { color: var(--muted); font-size: 12.5px; padding: 2px 12px 0; display: flex; gap: 8px; align-items: center; }
.stars { color: var(--yellow); letter-spacing: 1px; }
.stats { display: grid; gap: 5px; padding: 10px 12px 2px; }
.stat { display: grid; grid-template-columns: 34px 1fr 36px; align-items: center; gap: 8px; font-size: 12px; }
.stat b { font-family: var(--pix); font-size: 8px; color: var(--muted); }
.stat span:last-child { text-align: right; font-weight: 800; }
.bar { height: 8px; border-radius: 99px; background: #0b0820; overflow: hidden; border: 1px solid #ffffff12; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c1, #3ef0ff), var(--c2, #a78bfa)); }
.special-box { margin: 9px 12px 0; padding: 8px 10px; border-radius: 10px; background: #0007; border: 1px solid #ffffff14; font-size: 12.5px; }
.special-box .sp-name { font-weight: 900; color: var(--yellow); font-size: 14px; }
.special-box .sp-eff { color: #cfc9f2; }
.matchup { display: flex; gap: 10px; padding: 7px 12px 0; font-size: 11.5px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.matchup span { display: inline-flex; align-items: center; gap: 3px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 11px; }
.card-foot .barcode { fill: #e9e6ff; opacity: .9; width: 110px; height: 22px; background: #fff1; border-radius: 3px; padding: 2px; }
.card-foot code { font-size: 10.5px; color: var(--muted); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* mini cards */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px 12px; }
@media (min-width: 420px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.mini { cursor: pointer; transition: transform .1s; border-radius: 14px; padding: 2px; }
.mini:active { transform: scale(.97); }
.mini .card-in { border-radius: 12px; }
.mini .card-art { margin: 5px 5px 0; border-radius: 9px; }
.mini .mini-name { font-weight: 800; font-size: 12.5px; padding: 5px 7px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .mini-sub { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: var(--muted); padding: 1px 7px 7px; }
.mini .rar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); display: inline-block; margin-right: 4px; box-shadow: 0 0 6px var(--rc); }
.mini .dup { position: absolute; right: 6px; top: 6px; z-index: 3; background: var(--pink); color: #fff; font-size: 10px; font-weight: 900; border-radius: 99px; padding: 1px 6px; }
.mini.picked { outline: 3px solid var(--cyan); outline-offset: 2px; }
.mini .pick-num { position: absolute; left: 6px; top: 6px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; background: var(--cyan); color: #0b0820; font-weight: 900; display: grid; place-items: center; font-size: 12px; }
.count-pill { font-family: var(--pix); font-size: 10px; background: var(--pink); padding: 6px 9px; border-radius: 8px; }
.rarity-tally { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rarity-tally div { text-align: center; background: #0b0820; border-radius: 10px; padding: 6px 2px; border-bottom: 3px solid var(--rc); }
.rarity-tally b { display: block; font-size: 16px; } .rarity-tally small { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; display: none; }
.empty.show { display: block; }

/* ---------- team pick ---------- */
.team-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.slot { aspect-ratio: 1; border-radius: 14px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-family: var(--pix); font-size: 10px; position: relative; overflow: hidden; background: #0b0820; }
.slot.filled { border-style: solid; border-color: var(--rc); background: radial-gradient(circle, color-mix(in srgb, var(--el) 35%, #120d2c), #0b0820); }
.slot svg { width: 100%; height: 100%; }
.slot .slot-n { position: absolute; left: 5px; top: 5px; font-size: 8px; color: var(--cyan); }
.slot .slot-lv { position: absolute; right: 5px; bottom: 4px; font-family: var(--sans); font-weight: 800; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; }
.starter { display: none; margin-top: 12px; text-align: center; background: #ff3ea514; border: 2px dashed #ff3ea566; border-radius: 12px; padding: 12px; }
.starter.show { display: block; } .starter p { margin: 0 0 8px; }

/* ---------- opponents ---------- */
.opp { margin: 10px 12px; padding: 12px; border-radius: 16px; background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 2px solid var(--line); }
.opp-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #0b0820; flex: none; }
.opp-name { font-weight: 900; font-size: 16px; } .opp-meta { font-size: 12px; color: var(--muted); }
.diff { margin-left: auto; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 99px; }
.diff.Easy { background: #4ade8033; color: var(--green); } .diff.Even { background: #ffe14d33; color: var(--yellow); } .diff.Hard { background: #ff4d6d33; color: var(--red); }
.opp-team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.opp-team .slot { aspect-ratio: 1; }

/* ---------- ladder ---------- */
.my-rank { margin-top: 12px; display: flex; align-items: center; gap: 12px; background: #0b0820; border-radius: 14px; padding: 12px; border: 2px solid var(--cyan); }
.tier-badge { font-family: var(--pix); font-size: 9px; padding: 7px 8px; border-radius: 8px; color: #0b0820; }
.my-rank .big { font-size: 26px; font-weight: 900; } .my-rank small { color: var(--muted); display: block; font-size: 12px; }
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 6px; border-bottom: 1px solid #ffffff10; font-size: 14px; }
.ladder li .rk { font-family: var(--pix); font-size: 10px; color: var(--muted); text-align: center; }
.ladder li:nth-child(1) .rk { color: #fbbf24; } .ladder li:nth-child(2) .rk { color: #e2e8f0; } .ladder li:nth-child(3) .rk { color: #d97706; }
.ladder li.me { background: #3ef0ff18; border-radius: 10px; border: 1px solid #3ef0ff66; font-weight: 800; }
.ladder .t { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; color: #0b0820; }
.ladder .r { font-weight: 800; min-width: 44px; text-align: right; }

/* ---------- arena ---------- */
.arena.active { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 10px 10px calc(10px + var(--safe-b)); gap: 8px; }
.fighter-panel { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.fp-row { display: flex; align-items: center; gap: 6px; }
.fp-name { font-weight: 900; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-lv { font-family: var(--pix); font-size: 8px; color: var(--muted); }
.fp-pips { margin-left: auto; display: flex; gap: 4px; }
.pip { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); border: 2px solid #0b0820; }
.pip.dead { background: #3a3360; box-shadow: none; }
.hpbar { position: relative; height: 13px; border-radius: 99px; background: #0b0820; border: 2px solid #000; overflow: hidden; margin-top: 6px; }
.hpbar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(180deg, #7bffb0, #22c55e); transition: width .45s ease, background .3s; }
.hpbar i.mid { background: linear-gradient(180deg, #ffe680, #f59e0b); } .hpbar i.low { background: linear-gradient(180deg, #ff8fa3, #e11d48); }
.hpbar span { position: absolute; right: 8px; top: -1px; font-size: 10px; font-weight: 900; text-shadow: 0 1px 2px #000; }
.enbar { height: 6px; border-radius: 99px; background: #0b0820; overflow: hidden; margin-top: 4px; }
.enbar i { display: block; height: 100%; background: linear-gradient(90deg, #3ef0ff, #ff3ea5); transition: width .4s; }
.enbar.full i { animation: enpulse .8s infinite alternate; }
@keyframes enpulse { to { filter: brightness(1.6); } }
.status-tags { display: flex; gap: 4px; margin-top: 4px; min-height: 16px; }
.status-tags span { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.st-burn { background: #ff5a3633; color: #ff9a7a; } .st-stun { background: #ffd60a33; color: #ffe680; }
.stage { position: relative; flex: 1; min-height: 270px; border-radius: 16px; overflow: hidden; border: 2px solid var(--line); }
.stage-bg { position: absolute; inset: 0; background: linear-gradient(180deg, #2b1f73 0%, #3b1f6e 45%, #1a1244 46%, #0d0a24 100%); }
.stage-bg::before { content: ''; position: absolute; left: -20%; right: -20%; top: 46%; bottom: 0; background: repeating-linear-gradient(90deg, #3ef0ff22 0 2px, transparent 2px 40px), repeating-linear-gradient(0deg, #3ef0ff22 0 2px, transparent 2px 26px); transform: perspective(300px) rotateX(55deg); transform-origin: top; }
.stage-bg::after { content: ''; position: absolute; left: 50%; top: 18%; width: 120px; height: 120px; margin-left: -60px; border-radius: 50%; background: radial-gradient(circle, #ff3ea5aa, #ff3ea500 70%); filter: blur(2px); }
.mon-slot { position: absolute; width: 46%; aspect-ratio: 1; transition: transform .2s; }
.mon-slot svg { width: 100%; height: 100%; overflow: visible; }
.mon-slot.enemy { right: 4%; top: 2%; width: 42%; }
.mon-slot.player { left: 3%; bottom: 0; width: 50%; }
.mon-slot.enemy::after, .mon-slot.player::after { content: ''; }
.mon-slot .mon-bob { animation: bob 2.2s ease-in-out infinite; transform-origin: 100px 180px; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3px) scale(1.01, .99); } }
.mon-slot .rays { transform-origin: 100px 105px; animation: spin 12s linear infinite; }
.card-art .rays, .title-mons .rays { transform-origin: 100px 105px; animation: spin 14s linear infinite; }
.lunge-p { animation: lungeP .35s ease; } @keyframes lungeP { 40% { transform: translate(28%, -22%) scale(1.06); } }
.lunge-e { animation: lungeE .35s ease; } @keyframes lungeE { 40% { transform: translate(-28%, 24%) scale(1.06); } }
.hit { animation: hit .4s ease; } @keyframes hit { 0%, 100% { transform: translateX(0); filter: none; } 15% { transform: translateX(-8px); filter: brightness(3) saturate(0); } 35% { transform: translateX(7px); } 55% { transform: translateX(-5px); filter: brightness(2); } 75% { transform: translateX(3px); } }
.faint { animation: faint .7s ease forwards; } @keyframes faint { to { transform: translateY(30%) scale(.8); opacity: 0; filter: grayscale(1); } }
.enter { animation: enter .45s cubic-bezier(.2, 1.6, .5, 1); } @keyframes enter { from { transform: scale(.2); opacity: 0; filter: brightness(4); } }
.charging { animation: charge .5s ease; } @keyframes charge { 50% { filter: drop-shadow(0 0 18px var(--glow, #fff)) brightness(1.5); transform: scale(1.08); } }
.shield { position: absolute; inset: 6%; border-radius: 50%; border: 3px solid #7dd3fc; background: radial-gradient(circle, #7dd3fc00 55%, #7dd3fc55); box-shadow: 0 0 20px #7dd3fc; animation: shield .7s ease forwards; pointer-events: none; }
@keyframes shield { from { transform: scale(.6); opacity: 0; } 30% { opacity: 1; transform: scale(1.03); } to { opacity: 0; transform: scale(1.1); } }
.dmg-num { position: absolute; left: 50%; top: 30%; font-family: var(--pix); font-size: 18px; color: #fff; text-shadow: 2px 2px 0 #e11d48, -1px -1px 0 #000, 0 0 10px #000; pointer-events: none; animation: dmgUp .9s ease-out forwards; z-index: 5; white-space: nowrap; transform: translateX(-50%); }
.dmg-num.crit { color: var(--yellow); font-size: 22px; } .dmg-num.heal { color: #7bffb0; text-shadow: 2px 2px 0 #065f46, 0 0 10px #000; } .dmg-num.small { font-size: 13px; }
@keyframes dmgUp { from { transform: translate(-50%, 0) scale(.6); opacity: 0; } 20% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; } to { transform: translate(-50%, -48px) scale(1); opacity: 0; } }
.projectile { position: absolute; width: 34px; height: 34px; border-radius: 50%; z-index: 4; pointer-events: none; background: radial-gradient(circle, #fff, var(--glow) 45%, transparent 70%); box-shadow: 0 0 20px var(--glow); }
.banner-fx { position: absolute; left: 0; right: 0; top: 44%; text-align: center; font-family: var(--pix); font-size: 15px; pointer-events: none; z-index: 6; opacity: 0; }
.banner-fx.show { animation: banner 1s ease forwards; }
@keyframes banner { 0% { opacity: 0; transform: scale(.4); } 20% { opacity: 1; transform: scale(1.1); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.battle-log { height: 74px; overflow-y: auto; background: #07051a; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: 12.5px; color: #d4cff3; scroll-behavior: smooth; }
.battle-log p { margin: 2px 0; } .battle-log .se { color: var(--yellow); font-weight: 800; } .battle-log .nv { color: var(--muted); } .battle-log .you { color: var(--cyan); } .battle-log .foe { color: #ff9ab8; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 8px; }
.act { border-radius: 14px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; box-shadow: 0 4px 0 #0008; transition: transform .08s, filter .15s; }
.act:active { transform: translateY(3px); box-shadow: 0 1px 0 #0008; }
.act b { font-family: var(--pix); font-size: 11px; } .act small { font-size: 10.5px; opacity: .85; text-align: center; line-height: 1.15; }
.act-attack { background: linear-gradient(180deg, #ff5a76, #c81e45); }
.act-guard { background: linear-gradient(180deg, #4fb4ff, #1f62d6); }
.act-special { background: linear-gradient(180deg, #ffe14d, #f59e0b); color: #2a1600; }
.act-special.ready { animation: readyGlow .9s infinite alternate; }
@keyframes readyGlow { to { box-shadow: 0 4px 0 #0008, 0 0 24px #ffe14d; filter: brightness(1.12); } }
.act:disabled { filter: grayscale(.9) brightness(.55); cursor: not-allowed; animation: none; }
.arena-foot { align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-family: var(--pix); font-size: 10px; cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: #2d2470; position: relative; transition: background .2s; cursor: pointer; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle input:checked { background: var(--green); } .toggle input:checked::after { left: 21px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 200; background: #05030fe8; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.summon-stage { width: 100%; max-width: 420px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; max-height: 100vh; overflow-y: auto; }
.summon-code { position: relative; width: 280px; height: 130px; background: #fff; border-radius: 10px; padding: 12px 14px 22px; box-shadow: 0 0 40px #3ef0ff66; }
.summon-code .barcode { width: 100%; height: 100%; fill: #111; }
.summon-code .code-txt { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font: 600 11px ui-monospace, monospace; color: #222; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 10px; }
.summon-code .laser { position: absolute; left: -10px; right: -10px; height: 4px; background: var(--red); box-shadow: 0 0 18px 5px var(--red); animation: laser .7s ease-in-out 2; top: 5%; }
.summon-text { font-family: var(--pix); font-size: 12px; color: var(--cyan); text-align: center; line-height: 1.6; }
.flash { position: fixed; inset: 0; background: #fff; z-index: 300; pointer-events: none; animation: flash .6s ease forwards; }
.flash.legendary { background: radial-gradient(circle, #fff7cc, #fbbf24); }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.reveal-card { width: 100%; max-width: 340px; animation: revealIn .6s cubic-bezier(.2, 1.4, .5, 1); }
@keyframes revealIn { from { transform: rotateY(90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.reveal-banner { font-family: var(--pix); font-size: 13px; text-align: center; padding: 8px 14px; border-radius: 10px; line-height: 1.5; }
.reveal-banner.new { background: var(--pink); color: #fff; box-shadow: 0 0 20px #ff3ea588; }
.reveal-banner.dup { background: #2d2470; color: var(--cyan); }
.rar-shout { font-family: var(--pix); font-size: 20px; text-align: center; color: var(--rc); text-shadow: 0 0 20px var(--rc), 3px 3px 0 #000; animation: pulse 1s infinite; }
.disc-banner { display: flex; gap: 10px; align-items: center; background: linear-gradient(90deg, #ffe14d22, #f59e0b22); border: 2px solid #ffe14d88; border-radius: 12px; padding: 9px 12px; font-size: 13px; max-width: 340px; }
.disc-banner b { color: var(--yellow); }
.disc-banner .trophy { font-size: 26px; }
.reveal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 340px; }
.reveal-actions .btn:first-child { grid-column: 1 / -1; }
.modal { position: fixed; inset: 0; z-index: 150; background: #05030fd9; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 16px 12px 40px; backdrop-filter: blur(3px); }
.modal-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; animation: viewIn .25s ease; }
.prog-box { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 2px solid var(--line); border-radius: 14px; padding: 12px; font-size: 13px; }
.prog-box .bar { height: 10px; margin: 6px 0; } .prog-box .bar i { --c1: #a3e635; --c2: #22c55e; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: #1b1543; border: 2px solid var(--cyan); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 400; opacity: 0; transition: all .25s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.result { text-align: center; }
.result h2 { font-family: var(--pix); font-size: 24px; margin: 8px 0; }
.result.win h2 { color: var(--yellow); text-shadow: 3px 3px 0 #b8287a, 0 0 24px #ffe14d88; } .result.lose h2 { color: #ff8fa3; text-shadow: 3px 3px 0 #4c0519; }
.xp-row { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: center; text-align: left; background: #0b0820; border-radius: 12px; padding: 6px 10px 6px 6px; margin: 6px 0; }
.xp-row svg { width: 54px; height: 54px; } .xp-row .bar { margin-top: 4px; } .xp-row .bar i { --c1: #a3e635; --c2: #22c55e; transition: width 1s ease; }
.lvl-up { color: var(--yellow); font-family: var(--pix); font-size: 8px; margin-left: 6px; animation: pulse .8s infinite; display: inline-block; }
.rating-delta { font-size: 20px; font-weight: 900; margin: 10px 0; }
#reader__dashboard, #reader__header_message { display: none !important; }
