@font-face { font-family: 'Unbounded'; font-weight: 600; src: url('/fonts/Unbounded-600.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Unbounded'; font-weight: 900; src: url('/fonts/Unbounded-900.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Chakra Petch'; font-weight: 500; src: url('/fonts/ChakraPetch-500.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Chakra Petch'; font-weight: 700; src: url('/fonts/ChakraPetch-700.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; src: url('/fonts/JetBrainsMono-400.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; src: url('/fonts/JetBrainsMono-700.woff2') format('woff2'); font-display: swap; }
:root {
  --ink: #080A04; --panel: #0E1206; --line: #23271a; --lime: #CCFF00; --pale: #EDFFB0; --cream: #FAFFE6;
  --txt: #F4F6F4; --mut: #A6AA9C; --red: #FF2A3C; --deep: #B3121F;
  --head: 'Unbounded', 'Arial Black', Impact, sans-serif; --ui: 'Chakra Petch', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--txt); font: 500 16px/1.4 var(--ui); overscroll-behavior: none; }
.hidden { display: none !important; }
h1, h2, h3, .bang { font-family: var(--head); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; }
a { color: var(--lime); }
b, strong { font-weight: 700; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; background: var(--ink); color: var(--txt); border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lime); }

#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: 12px; border: 2px solid var(--lime); cursor: pointer; }
.topbar .title { font-family: var(--head); font-weight: 900; font-size: 18px; color: var(--lime); cursor: pointer; white-space: nowrap; }
.topbar .title i { font-style: normal; color: var(--red); }
.topbar .sp { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; font-size: 14px; color: var(--txt); text-decoration: none; }
.chip img { width: 22px; height: 22px; border-radius: 50%; }
.icon-btn { background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; }
.ca { font-family: var(--mono); 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); outline: 2px solid var(--lime); border-radius: 16px; padding: 16px 16px 14px; color: var(--ink); background: var(--lime); box-shadow: 0 6px 0 #8FB300; transition: transform .08s; min-height: 96px; }
.mbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #8FB300; }
.mbtn b { display: block; font-family: var(--head); font-size: 20px; font-weight: 900; text-transform: uppercase; }
.mbtn span { font-size: 13px; font-weight: 700; opacity: .85; }
.mbtn.pale { background: var(--pale); }
.mbtn.dark { background: var(--line); color: var(--txt); outline-color: var(--line); box-shadow: 0 6px 0 #000; }
.mbtn.red { background: var(--red); color: var(--ink); outline-color: var(--red); box-shadow: 0 6px 0 var(--deep); }
.mbtn .badge { position: absolute; top: 10px; right: 10px; background: var(--ink); color: var(--lime); font-size: 11px; padding: 3px 7px; border-radius: 999px; font-weight: 700; }

.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 16px; margin: 12px 0; }
.panel h2 { margin: 0 0 10px; font-size: 24px; color: var(--lime); }
.panel h3 { margin: 14px 0 6px; font-size: 15px; color: var(--pale); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.btn { border: 2px solid var(--ink); border-radius: 12px; padding: 10px 16px; background: var(--lime); color: var(--ink); font-weight: 700; box-shadow: 0 4px 0 #8FB300; text-decoration: none; display: inline-block; text-align: center; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8FB300; }
.btn.alt { background: var(--pale); }
.btn.ghost { background: transparent; color: var(--txt); border-color: var(--line); box-shadow: none; }
.btn.red { background: var(--red); color: var(--ink); box-shadow: 0 4px 0 var(--deep); }
.btn.small { padding: 6px 10px; font-size: 13px; box-shadow: 0 2px 0 #8FB300; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.mut { color: var(--mut); } .small { font-size: 13px; } .gold { color: var(--lime); } .red { color: var(--red); } .ok { color: var(--lime); }
.code { font-family: var(--mono); background: var(--ink); border: 1px dashed var(--lime); padding: 6px 10px; border-radius: 8px; color: var(--lime); font-size: 18px; user-select: all; }
.back { background: none; border: none; color: var(--pale); 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 var(--line); border-radius: 14px; background: var(--ink); padding: 6px; text-align: center; color: var(--txt); min-width: 0; }
.cs .card canvas { width: 100%; aspect-ratio: 1; display: block; }
.cs .card .nm { font-family: var(--head); font-weight: 600; font-size: 11px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs .card.bear { border-color: #4a1218; }
.cs .card.sel { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime); }
.cs .card.p2sel { border-color: var(--red); box-shadow: 0 0 0 3px var(--red); }
.cs .card.locked { filter: grayscale(1) brightness(.4); }
.cs .card .who { position: absolute; top: 4px; left: 6px; font-weight: 700; font-size: 12px; background: var(--lime); color: var(--ink); border-radius: 6px; padding: 1px 5px; }
.cs .card .who.p2 { background: var(--red); left: auto; right: 6px; }
.q { font-style: italic; color: var(--pale); }
.stats { display: grid; grid-template-columns: 92px 1fr; gap: 3px 8px; font-size: 13px; align-items: center; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--lime); }
.bear-side .bar i { background: var(--red); }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stage { border: 3px solid var(--line); border-radius: 12px; padding: 30px 8px 8px; color: #fff; font-weight: 700; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; text-align: left; }
.stage:hover, .stage.sel { border-color: var(--lime); }

/* 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: calc(min(1vw, 1.786vh) * 8.5); left: 50%; transform: translateX(-50%); background: #080A04cc; color: var(--txt); border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; font-size: 14px; z-index: 3; }
.overlay { position: absolute; inset: 0; background: #080A04dd; display: flex; align-items: center; justify-content: center; z-index: 5; padding: 20px; overflow: auto; }
.overlay .box { background: var(--panel); border: 3px solid var(--lime); border-radius: 18px; padding: 18px; min-width: min(420px, 92vw); max-width: 640px; text-align: center; }
.overlay .box h2 { font-size: 26px; margin: 0 0 8px; color: var(--lime); }
.overlay .box .col { display: grid; gap: 10px; margin-top: 12px; }
.dialog { position: absolute; left: 50%; top: max(3%, env(safe-area-inset-top)); transform: translateX(-50%); width: min(760px, 94vw); background: #080A04f2; border: 3px solid var(--lime); border-radius: 16px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; z-index: 4; }
.dialog.bear { border-color: var(--red); }
.dialog canvas { width: 76px; height: 76px; flex: none; }
.dialog .who { font-family: var(--head); font-weight: 900; color: var(--lime); font-size: 15px; text-transform: uppercase; }
.dialog.bear .who { color: var(--red); }
.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: #F4F6F41a; border: 2px solid #F4F6F455; opacity: .55; }
.stick-base.on { opacity: .9; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; border-radius: 50%; background: var(--lime); border: 3px solid var(--ink); transform: translate(-50%, -50%); }
.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: 40px repeat(2, 62px); gap: 8px; pointer-events: auto; }
.pb { position: relative; width: 62px; height: 62px; border-radius: 50%; border: 3px solid var(--ink); color: var(--ink); font: 700 13px/1 var(--ui); opacity: .85; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 3px 0 #000a; }
.pb.on { transform: scale(.9); opacity: 1; filter: brightness(1.2); }
.pb.light { background: var(--cream); } .pb.heavy { background: var(--lime); } .pb.ki { background: var(--pale); } .pb.special { background: var(--red); }
.pb.guard { background: #C9CEC4; } .pb.charge { background: var(--pale); } .pb.trans { background: var(--lime); font-size: 11px; } .pb.vanish { background: var(--txt); }
.pb.ult { grid-column: 3 / span 2; width: auto; height: 40px; border-radius: 20px; background: var(--red); font-size: 15px; }
@media (max-height: 420px) { .pad-btns { grid-template-columns: repeat(4, 54px); grid-template-rows: 34px repeat(2, 54px); } .pb { width: 54px; height: 54px; } .pb.ult { height: 34px; } }
.rotate-hint { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; background: var(--ink); z-index: 9; font-family: var(--head); font-weight: 900; font-size: 22px; text-transform: uppercase; color: var(--lime); 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 var(--line); border-radius: 14px; background: var(--ink); cursor: pointer; }
.titem:hover { border-color: var(--lime); }
.titem .n { font-family: var(--head); font-weight: 600; font-size: 15px; text-transform: uppercase; }
.status { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--line); text-transform: uppercase; white-space: nowrap; }
.status.registration { background: var(--lime); color: var(--ink); } .status.running { background: var(--red); color: var(--ink); } .status.finished { background: var(--pale); color: var(--ink); } .status.closed { background: var(--mut); color: var(--ink); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tabs button { background: var(--ink); border: 1px solid var(--line); color: var(--txt); border-radius: 999px; padding: 6px 12px; }
.tabs button.on { background: var(--lime); color: var(--ink); font-weight: 700; }
.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: var(--head); font-weight: 600; color: var(--pale); font-size: 12px; text-transform: uppercase; }
.match { border: 2px solid var(--line); border-radius: 10px; background: var(--ink); font-size: 14px; overflow: hidden; }
.match.mine { border-color: var(--lime); } .match.live { border-color: var(--red); }
.match .pl { display: flex; justify-content: space-between; gap: 6px; padding: 5px 8px; align-items: center; }
.match .pl + .pl { border-top: 1px solid var(--line); }
.match .pl.w { background: #CCFF0022; font-weight: 700; }
.match .pl b { font-family: var(--mono); }
.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 var(--line); 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 var(--line); }
td { font-family: var(--mono); font-size: 13px; }
th { color: var(--mut); font-weight: 500; font-size: 12px; }
tr.adv td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
.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(--lime); color: var(--ink); font-weight: 700; display: grid; place-items: center; }
.lb td:first-child { width: 40px; color: var(--lime); font-weight: 700; }
.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 var(--mut); border-bottom-width: 3px; border-radius: 6px; font-family: var(--mono); font-size: 12px; text-align: center; background: var(--line); }
.candles { display: flex; gap: 6px; align-items: flex-end; height: 40px; }
.candles i { width: 16px; background: var(--lime); border: 2px solid var(--ink); outline: 1px solid var(--lime); border-radius: 3px; }
.candles i.off { background: var(--line); outline-color: var(--line); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); border: 2px solid var(--lime); 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; }

/* home */
.hero2 { position: relative; border-radius: 24px; overflow: hidden; margin: 4px 0 18px; background: var(--panel); border: 2px solid var(--line); }
.hero2 canvas { display: block; width: 100%; height: auto; aspect-ratio: 16/7; }
.hero2-txt { position: relative; z-index: 1; padding: 0 20px 22px; margin-top: -34px; text-align: center; }
.hero2 h1 { font-size: clamp(30px, 6.4vw, 72px); margin: 0; line-height: .95; color: var(--lime); text-shadow: 0 4px 0 var(--ink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.hero2 h1 i { font-style: normal; color: var(--txt); font-size: .5em; vertical-align: middle; padding: 0 .2em; }
.hero2 h1 em { font-style: normal; color: var(--red); }
.hero2 h1 small { display: block; font-size: .3em; color: var(--pale); letter-spacing: .06em; margin-top: 12px; -webkit-text-stroke: 0; }
.hero2 .tag { color: var(--pale); margin: 8px 0 14px; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hero2-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta { font: 700 16px/1 var(--ui); text-transform: uppercase; padding: 14px 22px; border-radius: 999px; border: 2px solid var(--ink); color: var(--ink); background: var(--lime); box-shadow: 0 5px 0 #8FB300; cursor: pointer; transition: transform .12s; }
.cta:hover { transform: translateY(-2px); }
.cta.ghost { color: var(--txt); background: var(--line); box-shadow: 0 5px 0 #000; }
@media (max-width: 640px) { .hero2 canvas { aspect-ratio: 16/10; } .hero2-txt { margin-top: -14px; } }

.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: 3px solid var(--ink); outline: 2px solid var(--line); border-radius: 22px; padding: 18px; color: var(--ink); display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; transition: transform .18s; }
.fcard.story { background: var(--pale); }
.fcard.online { background: var(--lime); }
.fcard.tourn { background: var(--red); }
.fcard img { position: absolute; right: -8px; bottom: -10px; height: 112%; transition: transform .25s; pointer-events: none; }
.fcard b { position: relative; font-family: var(--head); font-weight: 900; font-size: 19px; text-transform: uppercase; max-width: 62%; line-height: 1; margin-bottom: 6px; }
.fcard small { position: relative; max-width: 56%; font-size: 13px; font-weight: 700; }
.fcard .badge { position: absolute; top: 14px; left: 14px; background: var(--ink); color: var(--lime); font-size: 12px; padding: 4px 9px; border-radius: 999px; font-weight: 700; }
.fcard:hover { transform: translateY(-4px); }
.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(3, 1fr); gap: 10px; margin-bottom: 26px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .tiles { grid-template-columns: 1fr; } }
.tile { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 14px 10px 10px; border-radius: 18px; border: 2px solid var(--line); background: var(--panel); color: var(--txt); cursor: pointer; transition: transform .15s, border-color .15s; }
.tile img { width: 52px; height: 52px; border-radius: 14px; background: var(--line); object-fit: cover; flex: none; }
.tile b { display: block; font-size: 16px; text-transform: uppercase; }
.tile small { color: var(--mut); font-size: 12.5px; }
.tile:hover { border-color: var(--lime); 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: 104px; }
.roster img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--lime); background: var(--panel); }
.roster figure.bear img { border-color: var(--red); }
.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; } }

.pad-focus { outline: 3px solid var(--cream) !important; outline-offset: 3px; 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: var(--ink); border: 3px solid var(--line); border-radius: 16px; padding: 10px 12px; min-width: 0; }
.cs-bio h3 { margin: 8px 0 0; font-size: 20px; color: var(--lime); line-height: 1; }
.cs-bio.bear-side h3 { color: var(--red); }
.cs-bio .cs-title { margin: 4px 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: var(--aura); border: 3px solid var(--ink); }
.cs-hero img { height: 96%; width: auto; max-width: 100%; object-fit: contain; }
.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: 18px; 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: 8.5px; }
  .cs-bio { padding: 6px; border-width: 2px; }
  .cs-bio h3 { font-size: 14px; }
  .cs-bio .q, .cs-bio .cs-moves { display: none; }
  .cs-bio .stats { grid-template-columns: 64px 1fr; font-size: 10px; gap: 2px 5px; }
  .cs-btns { flex-direction: column; gap: 6px; }
  .cs-btns .btn { padding: 8px 6px; font-size: 14px; }
  .topbar .title { font-size: 13px; }
}
/* 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: 16px; 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: 8.5px; }
  .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: 14px; margin: 0; }
  .cs-bio .cs-title { margin: 0; font-size: 11px; }
  .cs-bio .stats { grid-column: 1 / -1; grid-template-columns: 64px 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 .pg { display: none; }
#touchpad.pad-legend .stick-zone { display: none; }
#touchpad.pad-legend .pad-btns { pointer-events: none; }
#touchpad.pad-legend .pb { opacity: .55; box-shadow: none; }
#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: 700 13px/1 var(--ui); font-style: normal; color: var(--ink); background: var(--txt); border: 2px solid var(--ink); }
.pad-btns .pb { opacity: .6; }
.pad-btns .pb:active { opacity: 1; }

/* first-visit intro */
.intro { position: fixed; inset: 0; z-index: 60; background: var(--ink); display: grid; grid-template: "top" auto "art" minmax(0, 1fr) "txt" auto "foot" auto / minmax(0, 1fr); gap: 12px; justify-items: center; cursor: pointer; user-select: none; -webkit-user-select: none;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.intro > * { width: 100%; max-width: 980px; }
.in-top { grid-area: top; display: flex; justify-content: space-between; align-items: center; }
.in-dots { display: flex; gap: 8px; }
.in-dots i { width: 28px; height: 6px; border-radius: 3px; background: var(--line); }
.in-dots i.on { background: var(--lime); }
.in-skip { min-height: 44px; min-width: 96px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--mut); background: var(--panel); color: var(--txt); font: 700 14px/1 var(--ui); cursor: pointer; }
.in-art { grid-area: art; position: relative; overflow: hidden; border: 3px solid var(--lime); border-radius: 18px; background: var(--panel) center / cover no-repeat; }
.in-art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(#080A0455, #080A0422 55%, #080A0499); }
.in-sp { position: absolute; bottom: 5%; height: 76%; max-width: 46%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 0 8px #EDFFB088); }
.in-sp.l { left: 5%; } .in-sp.r { right: 5%; transform: scaleX(-1); } .in-sp.r.near { right: 16%; }
.in-vs { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font: 900 clamp(34px, 9vw, 96px)/1 var(--head); color: var(--red); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.in-beam { position: absolute; left: 36%; right: 30%; bottom: 44%; height: 7%; border-radius: 99px; background: linear-gradient(90deg, var(--cream), var(--lime)); box-shadow: 0 0 24px 8px #CCFF0099; }
.in-hype { position: absolute; left: 4%; top: 6%; display: flex; gap: 5px; align-items: center; padding: 6px 10px; border-radius: 10px; background: #080A04cc; font: 700 12px/1 var(--head); color: var(--txt); }
.in-hype i { width: clamp(22px, 5vw, 44px); height: 12px; background: #1a1d12; }
.in-hype i.on { background: var(--cream); }
.in-modes { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.in-modes > div { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; justify-items: center; overflow: hidden; padding: 8px 4px; border-radius: 14px; background: #080A04a6; border: 2px solid var(--ink); text-align: center; }
.in-modes img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.in-modes b { font: 800 clamp(11px, 1.5vw, 20px)/1.2 var(--head); color: var(--lime); text-transform: uppercase; }
.in-modes small { color: var(--txt); font-size: clamp(11px, 1.4vw, 14px); }
.in-txt { grid-area: txt; text-align: center; min-height: 168px; display: grid; align-content: center; }
.in-txt h2 { margin: 0 0 6px; font: 900 clamp(22px, 5.4vw, 44px)/1.05 var(--head); color: var(--lime); }
.in-txt p { margin: 0 auto; max-width: 620px; font-size: clamp(15px, 2.4vw, 19px); line-height: 1.35; color: var(--txt); }
.in-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin: 4px 0 8px; }
.in-key { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.in-key small { color: var(--mut); font-size: 12px; }
.in-key .kbd { font-size: 16px; min-width: 32px; padding: 4px 8px; margin: 0 1px; color: var(--txt); }
.in-key .pb { display: grid; place-items: center; width: 46px; height: 46px; opacity: 1; font-style: normal; box-shadow: 0 3px 0 #000a; }
.in-key .pb.ult { width: 76px; height: 46px; border-radius: 23px; }
.in-stick { display: block; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--mut); background: radial-gradient(circle at 60% 40%, var(--lime) 0 32%, transparent 34%); }
.in-foot { grid-area: foot; display: flex; justify-content: center; }
.in-next { min-height: 52px; width: min(340px, 100%); font: 800 18px/1 var(--head); cursor: pointer; }
.in-art.in, .in-txt.in { animation: introIn .35s ease-out both; }
.in-sp.l { animation: introBob 2.4s ease-in-out infinite; }
@keyframes introIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes introBob { 50% { translate: 0 -1.2%; } }
@media (orientation: landscape) and (max-height: 520px) {
  .intro { grid-template: "top top" auto "art txt" minmax(0, 1fr) "art foot" auto / minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px 14px; }
  .in-top { max-width: none; }
  .in-txt { align-self: center; min-height: 0; }
  .in-txt h2 { font-size: clamp(18px, 3vw, 28px); }
  .in-modes b { font-size: 11px; }
  .in-txt p { font-size: 15px; }
  .in-next { min-height: 46px; }
}
@media (orientation: portrait) {
  .in-art { aspect-ratio: 5 / 4; align-self: center; max-height: 100%; }
  .in-sp.r.near { right: 6%; }
  .in-modes { grid-template-columns: 1fr; }
  .in-modes > div { grid-template: "img b" 1fr "img s" 1fr / 34% 1fr; justify-items: start; column-gap: 10px; text-align: left; padding: 4px 10px; }
  .in-modes img { grid-area: img; }
  .in-modes b { align-self: end; font-size: 17px; }
  .in-modes small { align-self: start; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .in-art.in, .in-txt.in, .in-sp.l { animation: none; } }
