@font-face { font-family: 'Bangers'; src: url('/fonts/Bangers-Regular.woff2') format('woff2'); font-display: swap; }
:root {
  --bg: #1a0b2e; --bg2: #2b1150; --purple: #8b3fd9; --lav: #c9a2ff; --gold: #ffd21f; --orange: #f07a1a;
  --green: #5aa447; --red: #ff3a3a; --ink: #140a1e; --txt: #f6f0ff; --mut: #b9a8d6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif; overscroll-behavior: none; }
body { background: radial-gradient(ellipse at 50% -10%, #5b2a86 0%, var(--bg) 60%) fixed; }
.hidden { display: none !important; }
h1, h2, h3, .bang { font-family: 'Bangers', Impact, 'Arial Black', sans-serif; letter-spacing: .04em; font-weight: 400; }
a { color: var(--gold); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; background: #0f0619; color: var(--txt); border: 2px solid #4a2a78; border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--gold); }

#app { max-width: 1100px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 14px 40px; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.topbar .logo { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 20px #b77cff88; }
.topbar .title { font-family: 'Bangers', Impact, sans-serif; font-size: 26px; color: var(--gold); text-shadow: 2px 2px 0 var(--ink), 0 0 18px #ffb00055; cursor: pointer; }
.topbar .sp { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #ffffff14; border: 1px solid #ffffff22; padding: 6px 10px; border-radius: 999px; font-size: 14px; }
.chip img { width: 22px; height: 22px; border-radius: 50%; }
.icon-btn { background: #ffffff14; border: 1px solid #ffffff22; color: var(--txt); border-radius: 999px; padding: 6px 10px; }

.hero { text-align: center; padding: 18px 0 8px; position: relative; }
.hero canvas { width: min(520px, 92vw); height: auto; aspect-ratio: 16/9; }
.hero h1 { font-size: clamp(40px, 9vw, 86px); margin: 0; line-height: .95; color: var(--gold); text-shadow: 4px 4px 0 var(--ink), 0 0 40px #ff9d0066; -webkit-text-stroke: 2px var(--ink); }
.hero h1 small { display: block; font-size: .42em; color: var(--lav); -webkit-text-stroke: 1px var(--ink); }
.hero .tag { color: var(--mut); margin: 8px 0 0; }
.ca { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--mut); word-break: break-all; cursor: pointer; }

.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 18px 0; }
.mbtn { position: relative; text-align: left; border: 3px solid var(--ink); border-radius: 16px; padding: 16px 16px 14px; color: var(--ink); background: linear-gradient(160deg, var(--gold), var(--orange)); box-shadow: 0 6px 0 var(--ink), 0 10px 30px #0008; transition: transform .08s; min-height: 96px; }
.mbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.mbtn b { display: block; font-family: 'Bangers', Impact, sans-serif; font-size: 28px; font-weight: 400; letter-spacing: .04em; }
.mbtn span { font-size: 13px; font-weight: 600; opacity: .85; }
.mbtn.purple { background: linear-gradient(160deg, var(--lav), var(--purple)); }
.mbtn.green { background: linear-gradient(160deg, #a6f08f, var(--green)); }
.mbtn.blue { background: linear-gradient(160deg, #9fe8ff, #2a8fd9); }
.mbtn.red { background: linear-gradient(160deg, #ffb09a, #e0401b); }
.mbtn .badge { position: absolute; top: 10px; right: 10px; background: var(--ink); color: var(--gold); font-size: 11px; padding: 3px 7px; border-radius: 999px; font-weight: 800; }

.panel { background: linear-gradient(180deg, #2b1150ee, #1a0b2eee); border: 2px solid #4a2a78; border-radius: 18px; padding: 16px; margin: 12px 0; }
.panel h2 { margin: 0 0 10px; font-size: 32px; color: var(--gold); text-shadow: 2px 2px 0 var(--ink); }
.panel h3 { margin: 12px 0 6px; font-size: 22px; color: var(--lav); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.btn { border: 3px solid var(--ink); border-radius: 12px; padding: 10px 16px; background: var(--gold); color: var(--ink); font-weight: 800; box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.alt { background: var(--lav); } .btn.ghost { background: transparent; color: var(--txt); border-color: #4a2a78; box-shadow: none; }
.btn.red { background: #ff7a5a; } .btn.small { padding: 6px 10px; font-size: 13px; box-shadow: 0 2px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.mut { color: var(--mut); } .small { font-size: 13px; } .gold { color: var(--gold); } .red { color: var(--red); } .ok { color: #7dff9a; }
.code { font-family: ui-monospace, Menlo, monospace; background: #0f0619; border: 1px dashed var(--gold); padding: 6px 10px; border-radius: 8px; color: var(--gold); font-size: 18px; user-select: all; }
.back { background: none; border: none; color: var(--lav); padding: 4px 0; font-weight: 700; }

/* character select */
.cs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.cs .card { position: relative; border: 3px solid #4a2a78; border-radius: 14px; background: #0f0619; padding: 6px; text-align: center; color: var(--txt); }
.cs .card canvas { width: 100%; aspect-ratio: 1; display: block; }
.cs .card .nm { font-family: 'Bangers', Impact, sans-serif; font-size: 19px; letter-spacing: .03em; }
.cs .card.sel { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 0 26px #ffd21f88; }
.cs .card.p2sel { border-color: #6fe0ff; box-shadow: 0 0 0 3px #6fe0ff; }
.cs .card.locked { filter: grayscale(1) brightness(.4); }
.cs .card .who { position: absolute; top: 4px; left: 6px; font-weight: 900; font-size: 12px; background: var(--gold); color: var(--ink); border-radius: 6px; padding: 1px 5px; }
.bio { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
.bio canvas { width: 150px; height: 150px; }
.bio .q { font-style: italic; color: var(--lav); }
.stats { display: grid; grid-template-columns: 70px 1fr; gap: 3px 8px; font-size: 13px; align-items: center; }
.bar { height: 8px; background: #ffffff1a; border-radius: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--orange)); }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stage { border: 3px solid #4a2a78; border-radius: 12px; padding: 30px 8px 8px; color: #fff; font-weight: 800; text-shadow: 1px 1px 0 #000; text-align: left; }
.stage.sel { border-color: var(--gold); }

/* game */
#game { position: fixed; inset: 0; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; z-index: 10; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pause-btn { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%) translateY(64px); background: #0008; color: #fff; border: 1px solid #fff4; border-radius: 10px; padding: 4px 12px; font-size: 14px; z-index: 3; }
.overlay { position: absolute; inset: 0; background: #0a0414cc; display: flex; align-items: center; justify-content: center; z-index: 5; padding: 20px; overflow: auto; }
.overlay .box { background: linear-gradient(180deg, #2b1150, #1a0b2e); border: 3px solid var(--gold); border-radius: 18px; padding: 18px; min-width: min(420px, 92vw); max-width: 640px; text-align: center; }
.overlay .box h2 { font-size: 40px; margin: 0 0 8px; color: var(--gold); text-shadow: 3px 3px 0 var(--ink); }
.overlay .box .col { display: grid; gap: 10px; margin-top: 12px; }
.dialog { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); width: min(760px, 94vw); background: #140a1ef0; border: 3px solid var(--gold); border-radius: 16px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; z-index: 4; }
.dialog canvas { width: 76px; height: 76px; flex: none; }
.dialog .who { font-family: 'Bangers', Impact, sans-serif; color: var(--gold); font-size: 22px; }
.dialog .next { color: var(--mut); font-size: 12px; }

/* touch controller */
#touchpad { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.stick-zone { position: absolute; left: 0; top: 30%; bottom: 0; width: 45%; pointer-events: auto; touch-action: none; }
.stick-base { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; left: 110px; top: 60%; border-radius: 50%; background: radial-gradient(#ffffff10, #ffffff22); border: 2px solid #ffffff44; opacity: .55; }
.stick-base.on { opacity: .9; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #c9a2ff); transform: translate(-50%, -50%); box-shadow: 0 0 16px #b77cff; }
.pad-btns { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 62px); grid-template-rows: repeat(2, 62px); gap: 8px; pointer-events: auto; }
.pb { width: 62px; height: 62px; border-radius: 50%; border: 3px solid #0008; color: #140a1e; font-weight: 900; font-size: 15px; font-family: 'Bangers', Impact, sans-serif; letter-spacing: .03em; opacity: .82; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 3px 0 #0008; }
.pb.on { transform: scale(.9); opacity: 1; filter: brightness(1.3); }
.pb.light { background: #fff27a; } .pb.heavy { background: #ff9a3a; } .pb.ki { background: #6fe0ff; } .pb.special { background: #ff5fb4; }
.pb.guard { background: #9adfff; font-size: 13px; } .pb.charge { background: #b77cff; font-size: 13px; } .pb.trans { background: #ffd21f; font-size: 13px; } .pb.vanish { background: #e8e8f4; font-size: 13px; }
@media (max-height: 420px) { .pad-btns { grid-template-columns: repeat(4, 54px); grid-template-rows: repeat(2, 54px); } .pb { width: 54px; height: 54px; } }
.rotate-hint { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; background: #1a0b2e; z-index: 9; font-family: 'Bangers', Impact, sans-serif; font-size: 30px; color: var(--gold); padding: 30px; }
@media (orientation: portrait) and (pointer: coarse) { #game.need-landscape .rotate-hint { display: flex; } }

/* tournaments */
.tlist { display: grid; gap: 10px; }
.titem { display: flex; gap: 12px; align-items: center; padding: 12px; border: 2px solid #4a2a78; border-radius: 14px; background: #0f0619; cursor: pointer; }
.titem:hover { border-color: var(--gold); }
.titem .n { font-family: 'Bangers', Impact, sans-serif; font-size: 24px; }
.status { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #ffffff22; text-transform: uppercase; }
.status.registration { background: #3ad17a; color: #062; } .status.running { background: var(--gold); color: var(--ink); } .status.finished { background: var(--lav); color: var(--ink); } .status.closed { background: #ff9a3a; color: var(--ink); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tabs button { background: #ffffff10; border: 1px solid #ffffff22; color: var(--txt); border-radius: 999px; padding: 6px 12px; }
.tabs button.on { background: var(--gold); color: var(--ink); font-weight: 800; }
.bracket { display: flex; gap: 22px; overflow-x: auto; padding: 6px 2px 14px; }
.bcol { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; min-width: 190px; }
.bcol h4 { margin: 0 0 4px; font-family: 'Bangers', Impact, sans-serif; color: var(--lav); font-size: 18px; letter-spacing: .04em; font-weight: 400; }
.match { border: 2px solid #4a2a78; border-radius: 10px; background: #0f0619; font-size: 14px; overflow: hidden; }
.match.mine { border-color: var(--gold); } .match.live { border-color: #ff5a5a; box-shadow: 0 0 12px #ff5a5a66; }
.match .pl { display: flex; justify-content: space-between; gap: 6px; padding: 5px 8px; align-items: center; }
.match .pl + .pl { border-top: 1px solid #4a2a78; }
.match .pl.w { background: #ffd21f22; font-weight: 800; }
.match .pl img { width: 18px; height: 18px; border-radius: 50%; }
.match .meta { font-size: 11px; color: var(--mut); padding: 3px 8px; border-top: 1px solid #4a2a78; display: flex; justify-content: space-between; gap: 6px; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 5px 6px; text-align: left; border-bottom: 1px solid #ffffff14; }
th { color: var(--mut); font-weight: 600; font-size: 12px; }
tr.adv td:first-child { box-shadow: inset 3px 0 0 #3ad17a; }
.steps { counter-reset: s; display: grid; gap: 10px; }
.steps > div { counter-increment: s; padding-left: 38px; position: relative; }
.steps > div::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--ink); font-weight: 900; display: grid; place-items: center; }
.lb td:first-child { width: 40px; color: var(--gold); font-weight: 900; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.kbd { display: inline-block; min-width: 24px; padding: 1px 6px; border: 1px solid #ffffff44; border-bottom-width: 3px; border-radius: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; text-align: center; background: #ffffff10; }
.balls { display: flex; gap: 6px; }
.balls i { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3c0, #f39a1b); border: 2px solid #8a4a0a; display: grid; place-items: center; font-style: normal; color: #d11f1f; font-size: 11px; font-weight: 900; }
.balls i.off { filter: grayscale(1) brightness(.4); }
.memes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.memes img { width: 100%; border-radius: 12px; border: 2px solid #4a2a78; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); border: 2px solid var(--gold); color: var(--txt); padding: 10px 16px; border-radius: 12px; z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.on { opacity: 1; }
footer { margin-top: 30px; text-align: center; color: var(--mut); font-size: 13px; }
.mbtn.red, .btn.red { color: var(--ink); }

/* ---- v2 home ---- */
.hero2 { position: relative; border-radius: 28px; overflow: hidden; margin: 4px 0 22px; background: radial-gradient(120% 90% at 50% 35%, #6a2fb0 0%, #2a1050 45%, #12061f 100%); border: 1px solid #ffffff1c; box-shadow: 0 30px 80px #0009, inset 0 1px 0 #ffffff22; }
.hero2::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, #0d0418ee 100%); pointer-events: none; }
.hero2 canvas { display: block; width: 100%; height: auto; aspect-ratio: 16/7; }
.hero2-txt { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 20px 22px; text-align: center; }
.hero2 h1 { font-family: 'Bangers', Impact, sans-serif; font-size: clamp(38px, 7.5vw, 84px); margin: 0; line-height: .9; letter-spacing: 1px; background: linear-gradient(180deg, #fff6c0, #ffd21f 45%, #ff8a1a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(3px 4px 0 var(--ink)) drop-shadow(0 0 24px #ff9d0055); }
.hero2 h1 small { display: block; font-size: .38em; letter-spacing: 6px; background: linear-gradient(180deg, #fff, #c9a2ff); -webkit-background-clip: text; background-clip: text; }
.hero2 .tag { color: #d9c9f5; margin: 6px 0 12px; font-size: 15px; }
.hero2-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta { font: 800 16px/1 system-ui, sans-serif; padding: 13px 22px; border-radius: 999px; border: 0; color: var(--ink); background: linear-gradient(180deg, #ffe25a, #ffb01f); box-shadow: 0 8px 24px #ffb01f55, inset 0 -3px 0 #0003; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px #ffb01f77, inset 0 -3px 0 #0003; }
.cta.ghost { color: #fff; background: #ffffff18; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px #ffffff40; }
@media (max-width: 640px) { .hero2 canvas { aspect-ratio: 16/10; object-fit: cover; } .hero2-txt { position: relative; margin-top: -60px; } }

.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.fcard { position: relative; overflow: hidden; min-height: 190px; text-align: left; border: 1px solid #ffffff26; border-radius: 22px; padding: 18px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; box-shadow: 0 16px 40px #0007, inset 0 1px 0 #ffffff30; transition: transform .18s, box-shadow .18s; }
.fcard.story { background: linear-gradient(135deg, #ffb21f, #e2531a); }
.fcard.online { background: linear-gradient(135deg, #3d7bff, #1b2f8f); }
.fcard.tourn { background: linear-gradient(135deg, #b46cff, #4b1791); }
.fcard::before { content: ''; position: absolute; inset: 0; background: radial-gradient(80% 70% at 85% 20%, #ffffff40, transparent 60%); }
.fcard img { position: absolute; right: -8px; bottom: -10px; height: 118%; filter: drop-shadow(0 10px 18px #0008); transition: transform .25s; pointer-events: none; }
.fcard b { position: relative; font-family: 'Bangers', Impact, sans-serif; font-size: 34px; letter-spacing: .5px; text-shadow: 2px 3px 0 #0006; max-width: 60%; }
.fcard small { position: relative; max-width: 58%; font-size: 13px; opacity: .92; }
.fcard .badge { position: absolute; top: 14px; left: 14px; background: #0006; color: var(--gold); font-size: 12px; padding: 4px 9px; border-radius: 999px; font-weight: 800; backdrop-filter: blur(6px); }
.fcard:hover { transform: translateY(-4px); box-shadow: 0 24px 50px #000a, inset 0 1px 0 #ffffff40; }
.fcard:hover img { transform: scale(1.05) rotate(-2deg); }
@media (max-width: 760px) { .feat { grid-template-columns: 1fr; } .fcard { min-height: 150px; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 26px; }
.tile { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 14px 10px 10px; border-radius: 18px; border: 1px solid #ffffff1f; background: linear-gradient(180deg, #ffffff12, #ffffff06); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--txt); cursor: pointer; transition: background .15s, transform .15s, border-color .15s; }
.tile img { width: 52px; height: 52px; border-radius: 14px; background: #0006; object-fit: cover; flex: none; }
.tile b { display: block; font-size: 16px; }
.tile small { color: var(--mut); font-size: 12.5px; }
.tile:hover { background: #ffffff1c; border-color: #ffd21f88; transform: translateY(-2px); }

.roster { overflow: hidden; margin: 0 -14px 26px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.roster-track { display: flex; gap: 14px; width: max-content; animation: roster 40s linear infinite; }
.roster figure { margin: 0; text-align: center; width: 92px; }
.roster img { width: 80px; height: 80px; border-radius: 50%; border: 2px solid #ffffff30; background: #ffffff10; }
.roster figcaption { font-size: 12px; color: var(--mut); margin-top: 4px; white-space: nowrap; }
@keyframes roster { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .roster-track { animation: none; } }

.memes-wrap h3 { font-family: 'Bangers', Impact, sans-serif; font-size: 26px; color: var(--lav); margin: 0 0 10px; letter-spacing: .5px; }
.memes-wrap .memes { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.memes-wrap .memes img { flex: 0 0 min(460px, 82vw); scroll-snap-align: start; border-radius: 16px; border: 1px solid #ffffff22; box-shadow: 0 10px 30px #0007; }
.tiles { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .tiles { grid-template-columns: 1fr; } }
.memes-wrap .memes img { width: min(460px, 82vw); }
.pad-btns { grid-template-rows: 40px repeat(2, 62px); }
.pb.ult { grid-column: 3 / span 2; width: auto; height: 40px; border-radius: 20px; background: linear-gradient(90deg, #ff5fb4, #ffd21f); font-size: 17px; }
@media (max-height: 420px) { .pad-btns { grid-template-rows: 34px repeat(2, 54px); } .pb.ult { height: 34px; } }
.pad-focus { outline: 3px solid var(--gold) !important; outline-offset: 3px; box-shadow: 0 0 18px #ffd23f99 !important; transform: scale(1.03); }
/* character select: grid left, preview + stats right, at every size */
.cs-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cs-wrap .cs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cs-side { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cs-bio { background: #0f0619; border: 3px solid #4a2a78; border-radius: 16px; padding: 10px 12px; min-width: 0; }
.cs-bio h3 { margin: 6px 0 0; font-family: 'Bangers', Impact, sans-serif; font-size: 28px; letter-spacing: .03em; color: var(--gold); line-height: 1; }
.cs-bio .cs-title { margin: 2px 0 6px; }
.cs-bio .q { margin: 0 0 8px; }
.cs-hero { aspect-ratio: 4 / 3; border-radius: 12px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--aura) 55%, transparent), transparent 70%), #1a0b2b; }
.cs-hero img { height: 96%; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px #0009); }
.cs-btns { display: flex; gap: 8px; }
.cs-btns .btn { flex: 1; min-width: 0; }
@media (max-width: 700px) {
  .cs-panel { padding: 10px; }
  .cs-panel h2 { font-size: 24px; margin: 0 0 8px; }
  .cs-wrap { gap: 8px; }
  .cs-wrap .cs { gap: 5px; }
  .cs .card { padding: 3px; border-width: 2px; border-radius: 10px; }
  .cs .card .nm { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cs-bio { padding: 6px; border-width: 2px; }
  .cs-bio h3 { font-size: 20px; }
  .cs-bio .q, .cs-bio .cs-moves { display: none; }
  .cs-bio .stats { grid-template-columns: 42px 1fr; font-size: 10px; gap: 2px 5px; }
  .cs-btns { flex-direction: column; gap: 6px; }
  .cs-btns .btn { padding: 8px 6px; font-size: 14px; }
}
/* phone on its side: short screen, so a wider grid and a shorter hero */
@media (orientation: landscape) and (max-height: 520px) {
  .cs-panel { padding: 8px 10px; }
  .cs-panel h2 { font-size: 20px; margin: 0 0 6px; }
  .cs-wrap { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; }
  .cs-wrap .cs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .cs .card { padding: 3px; border-width: 2px; border-radius: 10px; }
  .cs .card canvas { width: auto; height: 17vh; margin: 0 auto; }
  .cs .card .nm { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cs-bio { padding: 6px; border-width: 2px; display: grid; grid-template-columns: 38% 1fr; gap: 0 8px; align-items: center; }
  .cs-hero { aspect-ratio: auto; height: 30vh; grid-row: span 3; }
  .cs-bio h3 { font-size: 20px; margin: 0; }
  .cs-bio .cs-title { margin: 0; font-size: 11px; }
  .cs-bio .stats { grid-column: 1 / -1; grid-template-columns: 42px 1fr; font-size: 10px; gap: 1px 6px; margin-top: 4px; }
  .cs-bio .q, .cs-bio .cs-moves { display: none; }
  .cs-btns { flex-direction: row; }
  .cs-btns .btn { padding: 7px 6px; font-size: 14px; }
  .cs-side { gap: 6px; }
  #who:empty { display: none; }
}
/* controller legend over the on-screen pad */
.pb { position: relative; }
.pb .pg { display: none; }
#touchpad.pad-legend .stick-zone { display: none; }
#touchpad.pad-legend .pad-btns { pointer-events: none; }
#touchpad.pad-legend .pb { opacity: 1; box-shadow: none; border-color: #fff5; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000, 0 1px 2px #000; }
#touchpad.pad-legend .pb .pg { display: flex; align-items: center; justify-content: center; position: absolute; right: -6px; top: -6px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px;
  font: 900 13px/1 system-ui, sans-serif; font-style: normal; color: #fff; background: #1b1b22; border: 2px solid #fff; opacity: 1; box-shadow: 0 2px 6px #000a; }
#touchpad.pad-legend .pb.light { background: #fff27a55; } #touchpad.pad-legend .pb.heavy { background: #ff9a3a55; } #touchpad.pad-legend .pb.ki { background: #6fe0ff55; }
#touchpad.pad-legend .pb.special { background: #ff5fb455; } #touchpad.pad-legend .pb.guard { background: #9adfff55; } #touchpad.pad-legend .pb.charge { background: #b77cff55; }
#touchpad.pad-legend .pb.trans { background: #ffd21f55; } #touchpad.pad-legend .pb.vanish { background: #e8e8f455; } #touchpad.pad-legend .pb.ult { background: linear-gradient(90deg, #ff5fb455, #ffd21f55); }
.pg-A { background: #2fbf4a !important; }
.pad-ps .pg-A { background: #3b6fd8 !important; } .pad-ps .pg-B { background: #e0413a !important; } .pad-ps .pg-X { background: #d85aa8 !important; } .pad-ps .pg-Y { background: #2fae8a !important; color: #fff !important; } .pg-B { background: #e0413a !important; } .pg-X { background: #2f7de0 !important; } .pg-Y { background: #e8b90f !important; color: #1b1b22 !important; }
