/* Robot Battle: a dark hangar at night, neon team colours (cyan you, red the rival), gold for rare and wins */
:root {
  --bg: #070a16;
  --panel: #10162a;
  --panel2: #172038;
  --line: #273457;
  --ink: #eef2ff;
  --muted: #8d98b8;
  --me: #3dd0ff;
  --rival: #ff4b5c;
  --gold: #ffd23f;
  --win: #4dff9a;
  --geo: #36c46a;
  --tsui: #3a8dff;
  --ana: #ff9a2e;
  --display: 'Dela Gothic One', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --body: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* moving grid floor behind everything */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(ellipse at 50% -10%, #23305e 0%, transparent 60%), radial-gradient(ellipse at 50% 120%, #3a1430 0%, transparent 55%), var(--bg); }
#bg::before { content: ''; position: absolute; left: -50%; right: -50%; bottom: -10%; height: 70%;
  background-image: linear-gradient(rgba(61, 208, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(61, 208, 255, .22) 1px, transparent 1px);
  background-size: 48px 48px; transform: perspective(500px) rotateX(62deg); transform-origin: 50% 0; animation: gridMove 2.4s linear infinite;
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
@keyframes gridMove { to { background-position: 0 48px; } }
@media (prefers-reduced-motion: reduce) { #bg::before { animation: none; } }

.screen { min-height: 100vh; }

/* ---------- title */
#title { display: grid; place-items: center; padding: 24px 16px; position: relative; }
.titleWrap { display: grid; justify-items: center; gap: 10px; text-align: center; }
.titleRobot { width: min(300px, 70vw); aspect-ratio: 1; filter: drop-shadow(0 0 30px rgba(61, 208, 255, .35)); animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.logo { margin: -10px 0 0; display: grid; line-height: .9; font-family: var(--display); font-weight: 400; letter-spacing: .02em; }
.logo .l1, .logo .l2 { font-size: clamp(54px, 15vw, 104px);
  background: linear-gradient(180deg, #ffffff 0%, #c9d6ff 45%, #5d6c9a 50%, #e6ecff 56%, #ffffff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #1c2a5a) drop-shadow(0 0 18px rgba(61, 208, 255, .5)); }
.logo .l2 { background: linear-gradient(180deg, #fff6c8 0%, #ffd23f 45%, #b86a00 50%, #ffdb6a 58%, #fff3b0 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 0 #5a2a00) drop-shadow(0 0 22px rgba(255, 170, 40, .55)); }
.logo .lj { font-size: 18px; letter-spacing: .5em; color: var(--muted); margin-top: 8px; }
.tagline { margin: 4px 0 8px; font-weight: 700; letter-spacing: .1em; }
.startBtn { font-family: var(--display); font-size: 24px; letter-spacing: .12em; padding: 16px 40px; border-radius: 999px; border: 2px solid #fff;
  background: linear-gradient(90deg, #ff3b5c, #ff8a1f, #ffd23f, #3dd0ff, #c86bff, #ff3b5c); background-size: 300% 100%; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .4);
  box-shadow: 0 0 30px rgba(255, 210, 63, .55), inset 0 -4px 0 rgba(0, 0, 0, .25); animation: rainbowBg 3s linear infinite, pulse 1.1s ease-in-out infinite; }
@keyframes rainbowBg { to { background-position: 300% 0; } }
@keyframes pulse { 50% { transform: scale(1.06); } }
.linkBtn { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 6px; }
.credit { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); margin: 0; }

/* ---------- hud */
#game { max-width: 1060px; margin: 0 auto; padding: 10px 16px 60px; display: grid; gap: 12px; align-content: start; }
.hud { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.hudBrand { font-family: var(--display); font-size: 18px; letter-spacing: .04em; }
.hudBrand b { font-weight: 400; color: var(--gold); margin-left: 4px; }
.series { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.series img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rival); background: #ccd; }
.series .pips { display: inline-flex; gap: 4px; }
.pip { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; display: inline-block; }
.pip.on { background: currentColor; box-shadow: 0 0 8px currentColor; }
.series .me { color: var(--me); } .series .rv { color: var(--rival); }
.series .gameNo { font-family: var(--display); font-weight: 400; color: var(--gold); }
.hudBtns { margin-left: auto; display: flex; gap: 6px; }
.iconBtn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel); font-size: 16px; }
.banner { font-weight: 700; padding: 10px 14px; border-radius: 12px; background: linear-gradient(90deg, rgba(61, 208, 255, .16), rgba(61, 208, 255, 0) 70%); border-left: 4px solid var(--me); line-height: 1.6; }
.banner b { font-family: var(--display); font-weight: 400; color: var(--gold); margin-right: 8px; }

/* ---------- panels */
.panel { background: linear-gradient(180deg, rgba(23, 32, 56, .92), rgba(13, 18, 34, .92)); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 12px; min-width: 0; position: relative; }
.panel > h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: .04em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.panel > h2 .sub { font-family: var(--body); font-weight: 500; color: var(--muted); font-size: 12px; }

/* ---------- bays (robots) */
.bays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bay { position: relative; border-radius: 14px; border: 2px solid var(--line); background: radial-gradient(ellipse at 50% 78%, rgba(61, 208, 255, .2), transparent 62%), linear-gradient(180deg, #0c1224, #141c34);
  padding: 8px; display: grid; gap: 6px; min-width: 0; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; }
.bay.rv { background: radial-gradient(ellipse at 50% 78%, rgba(255, 75, 92, .22), transparent 62%), linear-gradient(180deg, #1a0c14, #24121c); cursor: default; }
.bay.target { border-color: var(--me); box-shadow: 0 0 0 2px rgba(61, 208, 255, .35), 0 0 22px rgba(61, 208, 255, .35); }
.bay.sel { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 63, .45), 0 0 34px rgba(255, 210, 63, .5); transform: translateY(-4px); }
.bay.pickable:hover { border-color: var(--me); }
.bay.used { opacity: .38; filter: grayscale(.8); cursor: default; }
.bay.boardable { animation: boardGlow .8s ease-in-out infinite; }
@keyframes boardGlow { 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(255, 210, 63, .7); } }
.bayHead { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-family: var(--display); font-size: 13px; letter-spacing: .04em; }
.bayHead .no { color: var(--me); } .bay.rv .bayHead .no { color: var(--rival); }
.bay canvas.robo3d { width: min(100%, 240px); aspect-ratio: 1; display: block; margin: -4px auto -10px; }
.bays.small .bay canvas.robo3d { width: min(100%, 160px); }
.bay .stamp { position: absolute; top: 36%; left: 50%; transform: translate(-50%, -50%) rotate(-10deg); font-family: var(--display); font-size: clamp(14px, 3.4vw, 24px); color: #fff; padding: 4px 10px; border: 3px solid currentColor; border-radius: 8px; white-space: nowrap; pointer-events: none; }
.bay .stamp.down { color: #ff6a6a; background: rgba(40, 0, 0, .55); }
.bay .stamp.out { color: #9fb0d0; background: rgba(0, 0, 0, .5); }
.slots { display: grid; gap: 3px; }
.slotPip { display: flex; align-items: center; gap: 5px; font-size: 11px; min-height: 24px; padding: 2px 6px; border-radius: 7px; border: 1.5px dashed var(--line); color: var(--muted); background: rgba(0, 0, 0, .25); width: 100%; text-align: left; }
.slotPip.filled { border-style: solid; color: var(--ink); }
.slotPip .chip { font-size: 10px; font-weight: 900; color: #fff; border-radius: 4px; padding: 0 5px; }
.slotPip .sv { font-family: var(--display); margin-left: auto; font-size: 14px; }
.chip.ジオ, .mk.ジオ { background: var(--geo); } .chip.ツイ, .mk.ツイ { background: var(--tsui); } .chip.アナ, .mk.アナ { background: var(--ana); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; text-align: center; }
.stat { border-radius: 8px; background: rgba(0, 0, 0, .35); padding: 3px 0; display: grid; }
.stat span { font-size: 10px; color: var(--muted); }
.stat b { font-family: var(--display); font-weight: 400; font-size: clamp(16px, 3.4vw, 22px); line-height: 1.1; }
.stat.s b { color: #7dffb0; } .stat.a b { color: #ff8a6a; } .stat.d b { color: #7ab8ff; }
.tags { display: flex; flex-wrap: wrap; gap: 3px; min-height: 18px; }
.tag { font-size: 10px; font-weight: 900; border-radius: 999px; padding: 1px 7px; background: var(--gold); color: #2a1a00; }
.tag.set { background: linear-gradient(90deg, #ff3b5c, #ffd23f, #3dd0ff); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .5); }
.tag.pilot { background: #fff; color: #10162a; }
.tag.rank { background: transparent; border: 1px solid currentColor; color: var(--muted); }
.tag.weapon { background: rgba(255, 255, 255, .08); color: var(--ink); font-weight: 700; }
@media (max-width: 560px) {
  .bay { padding: 5px; } .bayHead { font-size: 11px; } .slotPip { font-size: 10px; padding: 1px 4px; } .slotPip .pn { display: none; }
  .tags .tag.weapon { display: none; }
}

/* ---------- cards */
.handWrap { display: grid; gap: 10px; }
.hand { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 128px; perspective: 900px; }
.pcard { --c: #555; width: 78px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .25); background: linear-gradient(170deg, #1f2a4a, #0d1326); padding: 0; overflow: hidden; display: grid; text-align: center; position: relative;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45); transition: transform .15s; transform-style: preserve-3d; }
.pcard:hover { transform: translateY(-6px) rotate(-2deg); }
.pcard .mk { font-size: 10px; font-weight: 900; color: #fff; padding: 2px 0; letter-spacing: .1em; }
.pcard img { width: 100%; aspect-ratio: 1; display: block; background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, .14), transparent 70%); }
.pcard .v { font-family: var(--display); font-size: 26px; line-height: 1; margin-top: -6px; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
.pcard .stars { font-size: 10px; letter-spacing: -1px; color: var(--gold); height: 12px; }
.pcard .pt { font-size: 10px; color: var(--muted); padding: 1px 0 4px; }
.pcard.r3 { border-color: var(--gold); background: linear-gradient(170deg, #4a3a10, #1a1206); box-shadow: 0 0 18px rgba(255, 210, 63, .55), 0 6px 14px rgba(0, 0, 0, .45); }
.pcard.r3::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 45%, rgba(255, 210, 63, .3) 50%, transparent 62%); background-size: 250% 100%; animation: shine 2.2s linear infinite; pointer-events: none; mix-blend-mode: screen; }
.pcard.r2 { border-color: #c8d4ef; background: linear-gradient(170deg, #34405e, #121a30); }
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.pcard.pilot { width: 120px; border-color: #fff; background: linear-gradient(170deg, #f4f6ff, #b9c4e6); color: #10162a; }
.pcard.pilot img { aspect-ratio: auto; height: 78px; object-fit: cover; object-position: 50% 20%; background: #cfd6ea; }
.pcard.pilot .pt { color: #34405e; font-weight: 700; font-size: 11px; line-height: 1.3; padding: 4px 4px 6px; }
.pcard.pilot .mk { background: #10162a; }
.pcard.pilot.armed { animation: boardGlow .8s ease-in-out infinite; }
/* dealing: cards start face down at the deck */
.pcard.fd { pointer-events: none; }
.pcard.fd::before { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: 8px;
  background: repeating-linear-gradient(45deg, #1b2a5c 0 6px, #22357a 6px 12px); box-shadow: inset 0 0 0 3px #3dd0ff; }
.pcard.fd::after { content: 'RB'; position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: #3dd0ff; background: none; animation: none; }
.pcard.flip { animation: flip .32s ease-out; }
@keyframes flip { 0% { transform: rotateY(90deg) scale(1.15); } 100% { transform: rotateY(0) scale(1); } }
.pcard.pop { animation: rarePop .6s cubic-bezier(.2, 2, .4, 1); }
@keyframes rarePop { 0% { transform: scale(1.6) rotate(-8deg); } 100% { transform: scale(1); } }
.flyCard { position: fixed; z-index: 70; pointer-events: none; transition: transform .38s cubic-bezier(.5, 0, .7, 1), opacity .38s; }
@media (max-width: 560px) { .pcard { width: 62px; } .pcard .v { font-size: 22px; } .pcard.pilot { width: 100px; } }

.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.bigBtn { font-family: var(--display); font-size: 20px; letter-spacing: .06em; padding: 13px 34px; border-radius: 14px; border: 0; color: #fff;
  background: linear-gradient(180deg, #4ad8ff, #1c7ce0); box-shadow: 0 5px 0 #0c3c80, 0 0 24px rgba(61, 208, 255, .45); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.bigBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #0c3c80; }
.bigBtn.go { background: linear-gradient(180deg, #ffe066, #ff8a1f); box-shadow: 0 5px 0 #8a3a00, 0 0 30px rgba(255, 170, 40, .6); animation: pulse 1s ease-in-out infinite; }
.bigBtn.red { background: linear-gradient(180deg, #ff7a8a, #d4243a); box-shadow: 0 5px 0 #6a0c18, 0 0 30px rgba(255, 75, 92, .5); }
.bigBtn:disabled { opacity: .35; animation: none; cursor: not-allowed; filter: grayscale(.6); }
.subBtn { padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 700; }
.hint { color: var(--muted); font-size: 12px; text-align: center; width: 100%; }

/* ---------- battle select */
.vsBar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.vsBar .face { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 2px solid var(--rival); background: #ccd; }
.vsBar .face.me { border-color: var(--me); }
.speech { background: #fff; color: #10162a; border-radius: 14px; padding: 8px 12px; font-weight: 700; position: relative; font-size: 13px; line-height: 1.5; }
.speech::before { content: ''; position: absolute; right: -8px; top: 18px; border: 8px solid transparent; border-left-color: #fff; border-right: 0; }
.roundDots { display: flex; justify-content: center; align-items: center; gap: 8px; font-family: var(--display); }
.roundDots .rd { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-size: 12px; background: rgba(0, 0, 0, .3); }
.rd.w { background: var(--me); border-color: var(--me); color: #00243a; box-shadow: 0 0 12px var(--me); }
.rd.l { background: var(--rival); border-color: var(--rival); color: #3a000a; }
.rd.d { background: #5a6480; border-color: #5a6480; }
.rd.now { border-color: var(--gold); color: var(--gold); animation: pulse 1s infinite; }
details.more { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: rgba(0, 0, 0, .25); }
details.more summary { cursor: pointer; font-weight: 700; }
table.mu { border-collapse: separate; border-spacing: 4px; font-size: 12px; margin-top: 8px; }
table.mu th { font-weight: 700; padding: 4px 6px; white-space: nowrap; }
table.mu th.me { color: var(--me); text-align: right; } table.mu th.rv { color: var(--rival); }
table.mu td { text-align: center; border-radius: 6px; padding: 6px 4px; font-weight: 900; min-width: 56px; }
td.w { background: rgba(77, 255, 154, .18); color: var(--win); } td.l { background: rgba(255, 75, 92, .2); color: var(--rival); } td.d { background: rgba(255, 255, 255, .06); color: var(--muted); } td.off { opacity: .25; }
.log { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; }
.log li { padding: 5px 8px; border-radius: 6px; background: rgba(255, 255, 255, .05); }

/* ---------- results */
.result { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 26px 14px; }
.result .big { font-family: var(--display); font-size: clamp(44px, 13vw, 96px); line-height: 1; letter-spacing: .02em; }
.big.win { background: linear-gradient(180deg, #fff6c8, #ffd23f 50%, #ff8a1f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #6a2a00) drop-shadow(0 0 24px rgba(255, 190, 40, .6)); }
.big.lose { color: #8a94b0; text-shadow: 0 4px 0 #1a2038; }
.big.draw { color: #9fd8ff; text-shadow: 0 4px 0 #0c2a50; }
.result .score { font-family: var(--display); font-size: 34px; }
.result .score .m { color: var(--me); } .result .score .r { color: var(--rival); }
.persona { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; width: 100%; }
.pbtn { text-align: left; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel2); display: grid; gap: 6px; transition: transform .15s, border-color .15s; }
.pbtn:hover { border-color: var(--gold); transform: translateY(-3px); }
.pbtn b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--gold); }
.pbtn span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.revealText { line-height: 1.8; max-width: 560px; text-align: left; }

/* ---------- overlay dialog, VS splash */
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(4, 6, 14, .82); backdrop-filter: blur(6px); overflow-y: auto; }
.dialog { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 12px; max-height: calc(100vh - 32px); overflow-y: auto; }
.dialog h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; }
.dialog p { margin: 0; line-height: 1.75; }
.rule { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; line-height: 1.65; }
.rule b.k { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 20px; }
.vsSplash { position: fixed; inset: 0; z-index: 45; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: #000; cursor: pointer; }
.vsSplash .side { position: relative; display: grid; place-items: end center; padding-bottom: 12vh; overflow: hidden; }
.vsSplash .side img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.vsSplash .side.me { background: #0a3a6a; clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%); animation: inL .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.vsSplash .side.rv { background: #6a0a1a; clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%); margin-left: -14%; animation: inR .5s .15s cubic-bezier(.2, 1.4, .4, 1) both; }
.vsSplash .side.me::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 60, 120, .95), transparent 55%); }
.vsSplash .side.rv::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(120, 10, 30, .95), transparent 55%); }
.vsSplash .name { position: relative; z-index: 2; font-family: var(--display); font-size: clamp(28px, 7vw, 56px); text-shadow: 0 4px 0 rgba(0, 0, 0, .5); text-align: center; line-height: 1.1; }
.vsSplash .name small { display: block; font-size: .35em; letter-spacing: .3em; opacity: .85; }
.vsSplash .vs { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 3; font-family: var(--display); font-size: clamp(80px, 22vw, 200px); color: var(--gold);
  text-shadow: 0 6px 0 #6a2a00, 0 0 40px rgba(255, 190, 40, .8); animation: vsIn .5s .45s cubic-bezier(.2, 2, .4, 1) both; }
.vsSplash .sub { position: absolute; left: 0; right: 0; bottom: 4vh; z-index: 3; text-align: center; font-weight: 900; letter-spacing: .2em; animation: fadeIn .4s .8s both; }
@keyframes inL { from { transform: translateX(-100%); } } @keyframes inR { from { transform: translateX(100%); } }
@keyframes vsIn { from { transform: translate(-50%, -50%) scale(4) rotate(-20deg); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- fx.js elements */
.fxStamp { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(1); text-align: center; font-family: var(--display); font-size: clamp(48px, 14vw, 120px); line-height: 1; white-space: nowrap;
  animation: stampIn .42s cubic-bezier(.2, 2.2, .4, 1) both; transition: opacity .4s, transform .4s; }
.fxStamp small { display: block; font-family: var(--display); font-size: .26em; margin-top: 10px; letter-spacing: .06em; color: #fff; text-shadow: 0 2px 0 #000, 0 0 10px #000; }
.fxStamp.out { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
.fxStamp.gold { color: #ffe066; text-shadow: 0 5px 0 #8a3a00, 0 0 30px rgba(255, 170, 40, .9), 0 0 2px #000; }
.fxStamp.red { color: #ff5a6a; text-shadow: 0 5px 0 #4a0010, 0 0 30px rgba(255, 40, 70, .9); }
.fxStamp.blue { color: #8fe6ff; text-shadow: 0 5px 0 #003a6a, 0 0 30px rgba(61, 208, 255, .9); }
.fxStamp.rainbow { background: linear-gradient(90deg, #ff3b5c, #ff8a1f, #ffd23f, #7dff6a, #3dd0ff, #c86bff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 5px 0 #200a30) drop-shadow(0 0 20px rgba(255, 255, 255, .6)); }
@keyframes stampIn { 0% { transform: translate(-50%, -50%) scale(3.2) rotate(-12deg); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.fxCutin { position: absolute; left: 0; right: 0; top: 18%; height: 150px; display: flex; align-items: center; animation: cutIn .3s cubic-bezier(.2, 1.3, .4, 1) both; transition: transform .35s, opacity .35s; }
.fxCutin.right { flex-direction: row-reverse; top: 52%; }
.fxCutin.out { opacity: 0; transform: translateX(-30%); }
.fxCutin.right.out { transform: translateX(30%); }
.fxCutin .band { position: absolute; inset: 0; background: repeating-linear-gradient(100deg, rgba(255, 255, 255, .15) 0 2px, transparent 2px 18px), linear-gradient(90deg, rgba(10, 80, 160, .95), rgba(10, 80, 160, .6)); transform: skewY(-4deg); border-top: 3px solid #fff; border-bottom: 3px solid #fff; animation: speed .3s linear infinite; }
.fxCutin.cpu .band { background: repeating-linear-gradient(80deg, rgba(255, 255, 255, .15) 0 2px, transparent 2px 18px), linear-gradient(270deg, rgba(160, 10, 40, .95), rgba(160, 10, 40, .6)); transform: skewY(4deg); }
@keyframes speed { to { background-position: 40px 0, 0 0; } }
.fxCutin img { position: relative; height: 170px; width: 170px; object-fit: cover; object-position: 50% 20%; margin: 0 4vw; border: 4px solid #fff; border-radius: 12px; transform: rotate(-4deg); background: #ccd; }
.fxCutin.right img { transform: rotate(4deg); }
.fxCutin .txt { position: relative; display: grid; gap: 4px; text-shadow: 0 3px 0 rgba(0, 0, 0, .6); }
.fxCutin.right .txt { text-align: right; }
.fxCutin .txt b { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 6vw, 44px); }
.fxCutin .txt span { font-weight: 900; font-size: clamp(16px, 4vw, 26px); }
@keyframes cutIn { from { transform: translateX(-100%); } }
.fxCutin.right { animation-name: cutInR; } @keyframes cutInR { from { transform: translateX(100%); } }
.fxPop { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); text-shadow: 0 3px 0 rgba(0, 0, 0, .6); animation: popUp 1.1s ease-out forwards; white-space: nowrap; }
@keyframes popUp { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 15% { transform: translate(-50%, -60%) scale(1.3); opacity: 1; } 100% { transform: translate(-50%, -200%) scale(1); opacity: 0; } }

/* ---------- battle overlay */
.battleOverlay { position: fixed; inset: 0; z-index: 50; background: #000; animation: fadeIn .3s; transition: opacity .35s; }
.battleOverlay.out { opacity: 0; }
.battleOverlay canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bHud { position: absolute; inset: 0; pointer-events: none; }
.bPlate { position: absolute; top: 10px; display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 14px; background: rgba(6, 10, 22, .72); backdrop-filter: blur(4px); max-width: 46vw; animation: fadeIn .5s .3s both; }
.bPlate.me { left: 10px; border: 2px solid var(--me); } .bPlate.cpu { right: 10px; border: 2px solid var(--rival); flex-direction: row-reverse; text-align: right; }
.bPlate img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; object-position: 50% 20%; background: #ccd; }
.bPlate small { display: block; font-size: 11px; color: var(--muted); }
.bPlate .rank { font-size: 13px; padding: 1px 7px; margin: 2px 0; }
.bPlate b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.bPlate em { display: block; font-style: normal; font-size: 10px; color: var(--muted); margin-top: 3px; }
.bStats { display: flex; gap: 4px; margin-top: 4px; }
.bPlate.cpu .bStats { justify-content: flex-end; }
.bStats span { display: grid; text-align: center; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); transition: transform .2s, background .2s; }
.bStats i { font-style: normal; font-size: 9px; color: var(--muted); }
.bStats b { font-size: 18px; line-height: 1.1; }
.bStats span.hot { background: var(--gold); color: #2a1a00; transform: scale(1.25); }
.bStats span.hot i { color: #5a3a00; }
.bRound { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-family: var(--display); color: var(--gold); font-size: 15px; text-shadow: 0 2px 0 #000; white-space: nowrap; }
.bSkip { position: absolute; right: 12px; bottom: 14px; pointer-events: auto; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .5); color: #fff; padding: 8px 16px; font-weight: 700; }
.bTap { position: absolute; left: 0; right: 0; bottom: 8vh; text-align: center; font-family: var(--display); font-size: 22px; color: #fff; text-shadow: 0 2px 0 #000; animation: pulse 1s infinite; }
@media (max-width: 560px) { .bPlate { padding: 5px; gap: 5px; } .bPlate img { width: 38px; height: 38px; } .bPlate b { font-size: 13px; } .bStats b { font-size: 14px; } .bRound { top: auto; bottom: 18px; left: 16px; transform: none; } .fxCutin { height: 110px; } .fxCutin img { width: 120px; height: 120px; } }
@media (max-width: 560px) {
  #game { padding: 8px 10px 60px; gap: 10px; }
  .hudBrand { display: none; }
  .hudBtns { margin-left: auto; }
  .iconBtn { width: 32px; height: 32px; font-size: 14px; }
  .bayHead .tag { display: none; }
  .banner { font-size: 12px; padding: 8px 10px; }
  .panel { padding: 10px; }
  .hand { min-height: 0; }
}

/* ---------- sortie deck: rival strip / face-off stage / your dock with the launch button */
.sortie { display: grid; grid-template-rows: auto minmax(220px, 1fr) auto; gap: 10px; min-height: calc(100vh - 80px); }
.strip, .dock { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: stretch; }
.dock { grid-template-columns: auto 1fr auto; padding: 10px; border-radius: 18px; background: linear-gradient(0deg, rgba(61, 208, 255, .14), rgba(61, 208, 255, .03)); border: 1px solid rgba(61, 208, 255, .35); }
.strip { padding: 8px 10px; border-radius: 18px; background: linear-gradient(180deg, rgba(255, 75, 92, .14), rgba(255, 75, 92, .03)); border: 1px solid rgba(255, 75, 92, .3); }
.stripLabel { writing-mode: vertical-rl; font-family: var(--display); letter-spacing: .2em; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 0; }
.stripLabel small { font-family: var(--body); font-weight: 900; letter-spacing: .1em; font-size: 11px; }
.stripLabel.rv { color: var(--rival); } .stripLabel.me { color: var(--me); }
.units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.unit { position: relative; border-radius: 14px; padding: 6px 8px 8px; background: linear-gradient(180deg, #121a33, #0b1022); border: 2px solid #26345c; display: grid; gap: 4px; min-width: 0; transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.unit.rv { background: linear-gradient(180deg, #2a0f1a, #160810); border-color: #5a2030; }
.unit[data-pick] { cursor: pointer; }
.unit[data-pick]:hover { transform: translateY(-4px); border-color: var(--me); }
.unit.sel { border-color: var(--gold); box-shadow: inset 0 0 30px rgba(255, 210, 63, .35); transform: translateY(-8px); }
.unit.sel::after { content: "SELECT"; position: absolute; top: 8px; left: -26px; transform: rotate(-45deg); background: var(--gold); color: #2a1a00; font-family: var(--display); font-size: 10px; padding: 2px 30px; }
.unit.used { filter: grayscale(1) brightness(.5); }
.unit.sel .uTop .no { padding-left: 22px; }
.uTop { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 12px; letter-spacing: .04em; }
.uTop .no { color: var(--me); } .unit.rv .uTop .no { color: var(--rival); }
/* the strongest / middle / weakest of a side: gold, silver, bronze */
.rank { display: inline-block; font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1.2; padding: 2px 10px; border-radius: 8px; letter-spacing: .05em; color: #10162a; text-shadow: none;
  background: linear-gradient(180deg, #eef2fb, #a9b4c8); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.rank.r0 { background: linear-gradient(180deg, #fff3a6, #ffc61a); color: #3a2400; box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 12px rgba(255, 200, 40, .55); }
.rank.r2 { background: linear-gradient(180deg, #e6b58a, #a8683a); color: #2a1206; }
@media (max-width: 560px) { .rank { font-size: 12px; padding: 1px 6px; } }
/* the robot big on the left, the numbers on the right */
.unit { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 6px; align-items: center; }
.unit .uTop { grid-column: 1 / -1; }
.unit canvas.uBot { grid-column: 1; grid-row: 2 / 4; width: 100%; aspect-ratio: 1; margin: -4px 0 -6px; display: block; }
.unit .uStats { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; gap: 3px; }
.unit .uStats span { grid-template-columns: auto 1fr; align-items: center; padding: 2px 8px; text-align: right; }
.unit .uStats i { text-align: left; font-size: 11px; }
.unit .uFoot { grid-column: 2; grid-row: 3; flex-wrap: wrap; }
.strip .unit canvas.uBot { margin: -6px 0 -8px; }
.uStats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; text-align: center; }
.uStats span { display: grid; border-radius: 6px; background: rgba(0, 0, 0, .35); padding: 1px 0; }
.uStats i { font-style: normal; font-size: 9px; color: var(--muted); }
.uStats b { font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.1; }
.uStats .s b { color: #7dffb0; } .uStats .a b { color: #ff8a6a; } .uStats .d b { color: #7ab8ff; }
.uFoot { display: flex; align-items: center; gap: 4px; font-size: 10px; min-width: 0; }
.uFoot .makers { display: inline-flex; gap: 2px; }
.uFoot .makers i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.uFoot .wpn { margin-left: auto; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uDone { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 18px; color: #fff; transform: rotate(-12deg); text-shadow: 0 2px 0 #000; pointer-events: none; }
.stage { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-radius: 22px; overflow: hidden;
  background: radial-gradient(ellipse at 25% 90%, rgba(61, 208, 255, .28), transparent 50%), radial-gradient(ellipse at 75% 90%, rgba(255, 75, 92, .28), transparent 50%), linear-gradient(180deg, #0a0f22, #160c22);
  border: 1px solid var(--line); min-height: 240px; }
.stage::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(100deg, transparent 0 40px, rgba(255, 255, 255, .025) 40px 42px); pointer-events: none; }
.stageSide { position: relative; height: 100%; display: grid; place-items: center; align-content: center; padding: 10px; min-width: 0; }
.stageSide canvas.stageBot { width: min(100%, 300px); aspect-ratio: 1; display: block; filter: drop-shadow(0 0 24px rgba(61, 208, 255, .45)); }
.stageName { font-family: var(--display); font-size: 20px; text-align: center; text-shadow: 0 2px 0 #000; margin-top: -18px; }
.stageName small { display: block; font-family: var(--body); font-weight: 900; font-size: 11px; color: var(--muted); }
.stageName.me { color: var(--me); } .stageName.rv { color: var(--rival); margin-top: 6px; }
.stagePrompt { font-family: var(--display); font-size: clamp(20px, 3.4vw, 32px); text-align: center; line-height: 1.3; color: var(--me); animation: pulse 1.2s ease-in-out infinite; }
.stagePrompt small { display: block; font-family: var(--body); font-weight: 900; font-size: 12px; color: var(--muted); margin-top: 6px; }
.rvFace { width: min(60%, 170px); aspect-ratio: 1; object-fit: cover; object-position: 50% 20%; border-radius: 18px; border: 3px solid var(--rival); box-shadow: 0 0 30px rgba(255, 75, 92, .45); background: #ccd; }
.qMark { position: absolute; top: 18%; right: 14%; font-family: var(--display); font-size: clamp(50px, 9vw, 96px); color: var(--rival); text-shadow: 0 4px 0 #3a000a, 0 0 24px rgba(255, 75, 92, .8); animation: float 2s ease-in-out infinite; }
.stageMid { display: grid; justify-items: center; gap: 8px; padding: 10px; z-index: 1; }
.roundNo { font-family: var(--display); color: var(--gold); letter-spacing: .1em; }
.vsBig { font-family: var(--display); font-size: clamp(48px, 8vw, 84px); line-height: 1; color: var(--gold); text-shadow: 0 5px 0 #6a2a00, 0 0 30px rgba(255, 190, 40, .7); }
.stageMid .score { font-family: var(--display); font-size: 24px; }
.stageMid .score .m { color: var(--me); } .stageMid .score .r { color: var(--rival); }
.stageBtns { display: flex; gap: 6px; }
.chipBtn { border-radius: 999px; border: 1.5px solid var(--line); background: rgba(0, 0, 0, .4); padding: 5px 12px; font-size: 12px; font-weight: 900; }
.chipBtn:hover { border-color: var(--gold); }
.launchBtn { width: 150px; border: 0; border-radius: 18px; display: grid; place-items: center; align-content: center; gap: 4px; color: #fff;
  background: linear-gradient(180deg, #ffe066, #ff8a1f 60%, #e0461f); box-shadow: 0 6px 0 #7a2a00, 0 0 34px rgba(255, 150, 40, .65); animation: pulse 1s ease-in-out infinite;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
.launchBtn span { font-family: var(--display); font-size: 34px; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); letter-spacing: .08em; }
.launchBtn small { font-family: var(--display); font-size: 12px; letter-spacing: .2em; }
.launchBtn:disabled { animation: none; filter: grayscale(.9) brightness(.55); cursor: not-allowed; box-shadow: none; }
.launchBtn:active:not(:disabled) { transform: translateY(4px); }
.dialog .mu { margin: 0 auto; }
@media (max-width: 700px) {
  .sortie { min-height: 0; }
  .stripLabel { display: none; }
  .strip { grid-template-columns: 1fr; padding: 6px; }
  .dock { grid-template-columns: 1fr; padding: 6px; }
  .launchBtn { width: 100%; height: 64px; grid-auto-flow: column; gap: 12px; }
  .launchBtn span { font-size: 28px; }
  .stage { min-height: 200px; }
  .stageSide canvas.stageBot { width: 100%; }
  .stageName { font-size: 14px; } .stageName small { display: none; }
  .vsBig { font-size: 40px; } .stageMid { padding: 4px; gap: 4px; }
  .rvFace { width: 80%; }
  .unit { padding: 4px 5px 6px; grid-template-columns: 1fr; } .unit canvas.uBot, .unit .uStats, .unit .uFoot { grid-column: 1; grid-row: auto; }
  .unit .uStats { grid-template-columns: repeat(3, 1fr); } .unit .uStats span { grid-template-columns: 1fr; text-align: center; padding: 1px 0; } .unit .uStats i { text-align: center; font-size: 9px; }
  .uStats b { font-size: 15px; } .uFoot .wpn { display: none; }
  .uTop { font-size: 10px; }
}

/* ---------- the pilot's seat in each robot */
.seat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px 4px 4px; border-radius: 10px; border: 1.5px dashed rgba(255, 210, 63, .6); background: rgba(255, 210, 63, .08); text-align: left; color: var(--ink); }
.seat img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; object-position: 50% 20%; background: #ccd; filter: grayscale(.7) brightness(.8); }
.seat span { display: grid; font-weight: 900; font-size: 13px; line-height: 1.25; }
.seat small { font-weight: 700; font-size: 11px; color: var(--muted); }
.seat small b { color: var(--gold); font-family: var(--display); font-weight: 400; font-size: 14px; }
.seat:hover { border-color: var(--gold); background: rgba(255, 210, 63, .18); }
.seat.free { animation: seatGlow 1.4s ease-in-out infinite; }
@keyframes seatGlow { 50% { box-shadow: 0 0 0 2px rgba(255, 210, 63, .5), 0 0 18px rgba(255, 210, 63, .35); } }
.seat.on { border: 2px solid var(--gold); background: linear-gradient(90deg, rgba(255, 210, 63, .35), rgba(255, 210, 63, .08)); }
.seat.on img { filter: none; box-shadow: 0 0 0 2px var(--gold); }
.seat.on span { color: var(--gold); }
.stat { position: relative; }
.stat.boost { box-shadow: inset 0 0 0 2px var(--gold); background: rgba(255, 210, 63, .14); }
.stat .plus { position: absolute; top: 2px; right: 4px; font-style: normal; font-family: var(--display); font-size: 10px; color: var(--gold); }
.pcard.pilot { cursor: default; }
.pcard.pilot:hover { transform: none; }
@media (max-width: 560px) { .seat img { width: 26px; height: 26px; } .seat span { font-size: 11px; } .seat small { font-size: 9px; } }

/* ---------- the rival's pick flipped open before each fight */
.pickReveal { position: fixed; inset: 0; z-index: 48; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 16px; cursor: pointer;
  background: radial-gradient(ellipse at 25% 60%, rgba(61, 208, 255, .25), transparent 50%), radial-gradient(ellipse at 75% 60%, rgba(255, 75, 92, .3), transparent 50%), rgba(4, 6, 14, .94); animation: fadeIn .25s; transition: opacity .25s; }
.pickReveal.out { opacity: 0; }
.prTitle { font-family: var(--display); font-size: clamp(20px, 4vw, 30px); color: var(--gold); text-shadow: 0 3px 0 #000; }
.prRow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; width: min(760px, 100%); }
.prVs { font-family: var(--display); font-size: clamp(36px, 8vw, 64px); color: var(--gold); text-shadow: 0 4px 0 #6a2a00, 0 0 24px rgba(255, 190, 40, .7); }
.prCard { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px; border-radius: 18px; background: linear-gradient(180deg, #121a33, #0b1022); border: 2px solid var(--me); animation: inL .4s cubic-bezier(.2, 1.4, .4, 1) both; }
.prCard.rv { border-color: var(--rival); background: linear-gradient(180deg, #2a0f1a, #160810); animation: inR .4s cubic-bezier(.2, 1.4, .4, 1) both, shakeCard .09s linear infinite; --sh: 2px; }
.prCard.rv.open { animation: flipIn .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes shakeCard { 0% { translate: calc(var(--sh) * -1) 0; } 50% { translate: var(--sh) calc(var(--sh) * -.5); } 100% { translate: calc(var(--sh) * -1) 0; } }
@keyframes flipIn { 0% { transform: rotateY(90deg) scale(1.2); } 100% { transform: rotateY(0) scale(1); } }
.prCard canvas.prBot { width: min(100%, 220px); aspect-ratio: 1; display: block; }
.prCard b { font-family: var(--display); font-weight: 400; font-size: clamp(16px, 3vw, 22px); text-align: center; }
.prCard .rank { font-size: 20px; }
.prCard.me b { color: var(--me); } .prCard.rv b { color: var(--rival); }
.prBack { position: absolute; inset: 0; z-index: 2; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-size: 96px; color: var(--rival);
  background: repeating-linear-gradient(45deg, #3a0f1c 0 10px, #4a1426 10px 20px); box-shadow: inset 0 0 0 3px var(--rival); text-shadow: 0 0 30px rgba(255, 75, 92, .8); }
.prCard.rv.open .prBack { display: none; }
.rvStats { display: flex; gap: 6px; }
.rvStats span { display: grid; justify-items: center; font-size: 10px; color: var(--muted); padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .35); }
.rvStats b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.rvStats .s b { color: #7dffb0; } .rvStats .a b { color: #ff8a6a; } .rvStats .d b { color: #7ab8ff; }
.prTalk { display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; }
.prTalk.show { opacity: 1; transform: none; }
.prTalk img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--rival); background: #ccd; }
.prTalk span { background: #fff; color: #10162a; border-radius: 14px; padding: 8px 14px; font-weight: 900; }
@media (max-width: 560px) { .prRow { gap: 6px; } .prCard { padding: 6px; } .prBack { font-size: 60px; } .rvStats span { padding: 2px 4px; } .rvStats b { font-size: 16px; } }

/* ---------- the sound control: in the header beside the help button; during a battle, over the skip button */
.volCtl { position: relative; z-index: 90; }
.bHud .volCtl { position: absolute; right: 12px; bottom: 64px; pointer-events: auto; }
.bHud .volPanel { top: auto; bottom: 50px; }
.volBtn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .35); background: rgba(6, 10, 22, .75); backdrop-filter: blur(4px); color: #fff; display: grid; place-items: center; padding: 0; }
.volBtn:hover { border-color: var(--gold); color: var(--gold); }
.volPanel { position: absolute; right: 0; top: 50px; width: 230px; display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: rgba(12, 18, 36, .96); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.volPanel b { font-family: var(--display); font-weight: 400; }
.volPanel label { display: grid; grid-template-columns: 4.5em 1fr; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.volPanel input[type=range] { width: 100%; accent-color: var(--gold); }
.volMute { padding: 7px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel2); font-weight: 700; }
@media (max-width: 560px) { .volBtn { width: 32px; height: 32px; } }

/* ---------- help cards */
.helpCard { width: min(480px, 100%); min-height: 380px; grid-template-rows: auto auto 1fr auto; border: 2px solid var(--gold); box-shadow: 0 0 40px rgba(255, 210, 63, .25); animation: flipIn .3s cubic-bezier(.2, 1.4, .4, 1); }
.helpTop { display: flex; justify-content: space-between; align-items: center; }
.helpNo { font-family: var(--display); color: var(--gold); font-size: 13px; letter-spacing: .1em; }
.helpX { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel2); font-size: 18px; line-height: 1; }
.helpCard h2 { font-size: clamp(22px, 5vw, 28px); }
.helpBody { display: grid; gap: 10px; align-content: start; line-height: 1.75; }
.helpBody p, .helpBody ul, .helpBody ol { margin: 0; }
.helpBody ul, .helpBody ol { padding-left: 1.4em; display: grid; gap: 4px; }
.helpBody b { color: var(--gold); }
.helpNav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.helpDots { display: flex; gap: 6px; }
.helpDots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: var(--line); }
.helpDots button.on { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.pcard .hov { position: absolute; top: 22px; right: 3px; font-family: var(--display); font-size: 9px; letter-spacing: .05em; padding: 1px 5px; border-radius: 4px; background: #bfe8ff; color: #0a2a44; box-shadow: 0 0 8px rgba(160, 220, 255, .8); }

/* ---------- the end of a game: the round recap and the hints */
.endTop { gap: 16px; }
.recaps { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.recap { display: grid; justify-items: center; gap: 6px; padding: 10px 14px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); min-width: 160px; }
.recap .rn { font-family: var(--display); color: var(--gold); font-size: 13px; }
.vsLine { display: flex; align-items: center; gap: 8px; }
.vsLine i { font-style: normal; font-family: var(--display); color: var(--muted); font-size: 12px; }
.resChip { font-weight: 900; font-size: 14px; padding: 2px 14px; border-radius: 999px; }
.resChip.w { background: var(--me); color: #00243a; } .resChip.l { background: var(--rival); color: #fff; } .resChip.d { background: #5a6480; color: #fff; }
.rd { font-family: var(--body); font-weight: 900; }
.hints { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.hints p { margin: 0; line-height: 1.7; }
.hints p b { color: var(--gold); }
table.habit { border-collapse: separate; border-spacing: 4px; width: 100%; }
table.habit th { font-weight: 900; font-size: 12px; text-align: center; white-space: nowrap; }
table.habit td { text-align: center; padding: 6px 0; border-radius: 8px; background: rgba(255, 255, 255, .05); color: var(--rival); letter-spacing: 2px; font-size: 13px; }
table.habit td.hot { background: rgba(255, 75, 92, .22); box-shadow: inset 0 0 0 1.5px var(--rival); }
.fit { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'n s s' 'b b num'; gap: 2px 8px; align-items: center; }
.fit b { grid-area: n; font-family: var(--display); font-weight: 400; color: var(--gold); }
.fit .seq { grid-area: s; font-size: 11px; color: var(--muted); }
.fit .bar { grid-area: b; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.fit .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff8a1f); border-radius: 999px; }
.fit .num { grid-area: num; font-family: var(--display); font-size: 13px; }
.advice .warn { padding: 8px 10px; border-radius: 10px; background: rgba(255, 75, 92, .14); border-left: 4px solid var(--rival); }
.hints .panel { align-content: start; }
.hints { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.seqTable { display: grid; gap: 6px; }
.seqRow { display: grid; grid-template-columns: 4em 1fr; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.seqRow .rn { font-family: var(--display); color: var(--gold); font-size: 13px; }
.seqRow .seq { display: flex; flex-wrap: wrap; gap: 4px; }
.seqRow .rank { font-size: 13px; padding: 1px 8px; }
.seqRow .none { color: var(--muted); font-size: 12px; }
.stageName .rvSay { display: block; margin-top: 6px; font-family: var(--body); font-weight: 900; font-size: 15px; color: #10162a; background: #fff; border-radius: 12px; padding: 4px 12px; text-shadow: none; }
@media (max-width: 700px) { .stageName .rvSay { font-size: 11px; padding: 2px 6px; } }

.fitHead, .fitRow { display: grid; grid-template-columns: 3.4em repeat(3, 1fr) 4.2em; gap: 4px; align-items: center; text-align: center; }
.fitHead span { font-size: 11px; color: var(--muted); font-weight: 900; }
.fitRow { padding: 6px 4px; border-radius: 10px; background: rgba(255, 255, 255, .03); }
.fitRow.top { background: rgba(255, 210, 63, .1); box-shadow: inset 0 0 0 1.5px rgba(255, 210, 63, .6); }
.fitRow b { font-family: var(--display); font-weight: 400; color: var(--gold); text-align: left; }
.fitRow .cell { display: grid; justify-items: center; gap: 2px; padding: 3px 0; border-radius: 8px; }
.fitRow .cell .rank { font-size: 12px; padding: 0 6px; }
.fitRow .cell small { font-size: 10px; color: var(--muted); }
.fitRow .cell.all { background: rgba(77, 255, 154, .14); } .fitRow .cell.all small { color: var(--win); font-weight: 900; }
.fitRow .cell.some small { color: var(--ink); }
.fitRow .tot { position: relative; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.fitRow .tot i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ffd23f, #ff8a1f); }
.fitRow .tot em { position: relative; font-style: normal; font-family: var(--display); font-size: 12px; line-height: 22px; text-shadow: 0 1px 2px #000; }
.hints .hint { text-align: left; width: auto; margin: 0; line-height: 1.6; }
.rank svg { width: 1.45em; height: 1.1em; display: block; margin: .05em auto; }
.rank.r0 { display: inline-grid; place-items: center; }

/* ---------- the end of the series */
.finale { gap: 16px; }
.finHero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.finHero img { width: clamp(90px, 18vw, 150px); aspect-ratio: 1; object-fit: cover; object-position: 50% 20%; border-radius: 18px; border: 3px solid var(--rival); box-shadow: 0 0 30px rgba(255, 75, 92, .4); background: #ccd; }
.finHero .big { font-family: var(--display); font-size: clamp(36px, 8vw, 72px); line-height: 1.05; }
.finHero p { margin: 6px 0 0; line-height: 1.7; }
.finHero .pName { font-family: var(--display); font-weight: 400; font-size: 1.3em; color: var(--gold); }
.finHero .sub { font-size: 12px; color: var(--muted); }
.finScore { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--display); }
.finScore span { font-size: 14px; color: var(--muted); font-family: var(--body); font-weight: 900; }
.finScore b { font-weight: 400; font-size: 48px; } .finScore b.m { color: var(--me); } .finScore b.r { color: var(--rival); }
.finScore i { font-style: normal; font-size: 32px; color: var(--muted); }
.verdict { display: grid; justify-items: center; gap: 2px; padding: 14px; border-radius: 16px; text-align: center;
  background: linear-gradient(90deg, rgba(61, 208, 255, .12), rgba(255, 210, 63, .18), rgba(255, 75, 92, .12)); border: 1px solid rgba(255, 210, 63, .5); }
.verdict span { font-size: 13px; color: var(--muted); font-weight: 900; }
.verdict b { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 7vw, 56px); color: var(--gold); text-shadow: 0 4px 0 #6a2a00, 0 0 24px rgba(255, 190, 40, .5); line-height: 1.1; }
.verdict p { margin: 0; font-weight: 900; }
.gameCards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.gameCard { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1.5px solid var(--line); }
.gameCard.w { border-color: var(--me); } .gameCard.l { border-color: var(--rival); }
.gcTop { display: flex; align-items: center; gap: 6px; }
.gcTop b { font-family: var(--display); font-weight: 400; margin-right: auto; }
.gcScore { font-family: var(--display); }
.gcTop .resChip { padding: 1px 8px; font-size: 12px; }
.gcBars { display: flex; flex-wrap: wrap; gap: 4px; }
.gcBars span { font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.gcBars i { font-style: normal; color: var(--muted); margin: 0 3px; }
.gcList { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; line-height: 1.5; }
.gcList li { padding-left: 1.4em; position: relative; }
.gcList li.good::before { content: '◎'; position: absolute; left: 0; color: var(--win); }
.gcList li.bad::before { content: '△'; position: absolute; left: 0; color: var(--rival); }
.gal { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.galNav { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel2); font-size: 26px; line-height: 1; }
.galNav:hover { border-color: var(--gold); color: var(--gold); }
.galStage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 12px; }
.galStage canvas.galBot { width: min(100%, 300px); aspect-ratio: 1; display: block; justify-self: center; filter: drop-shadow(0 0 24px rgba(61, 208, 255, .35)); }
.galInfo { display: grid; gap: 8px; align-content: center; justify-items: start; }
.galInfo b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--me); }
.galInfo .wpn { color: var(--muted); font-weight: 700; }
.galStats { display: flex; gap: 6px; }
.galStats span { display: grid; justify-items: center; font-size: 11px; color: var(--muted); padding: 4px 12px; border-radius: 10px; background: rgba(0, 0, 0, .35); }
.galStats b { font-family: var(--display); font-weight: 400; font-size: 26px; }
.galStats .s b { color: #7dffb0; } .galStats .a b { color: #ff8a6a; } .galStats .d b { color: #7ab8ff; }
.galParts { display: grid; gap: 4px; font-size: 12px; font-weight: 700; }
.galParts span { display: flex; align-items: center; gap: 6px; }
.galParts .chip { font-style: normal; font-size: 10px; font-weight: 900; color: #fff; border-radius: 4px; padding: 0 5px; }
.galChips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
.galChips button { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font-size: 11px; font-weight: 900; }
.galChips button.on { background: var(--me); color: #00243a; border-color: var(--me); }
.finCta { justify-items: center; text-align: center; gap: 14px; }
.shareRow, .linkRow { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ctaLink { display: inline-block; padding: 11px 20px; border-radius: 12px; font-weight: 900; text-decoration: none; color: var(--ink); background: var(--panel2); border: 1.5px solid var(--gold); }
.ctaLink:hover { background: rgba(255, 210, 63, .15); }
.ctaLink.yt { border-color: #ff4b5c; }
@media (max-width: 560px) { .galStage { grid-template-columns: 1fr; } .galInfo { justify-items: center; } .finHero { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* where the series is */
.steps { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.steps i { font-style: normal; color: var(--muted); }
.step { display: grid; justify-items: center; padding: 6px 12px; border-radius: 12px; font-weight: 900; font-size: 13px; background: rgba(255, 255, 255, .05); border: 1.5px solid var(--line); color: var(--muted); }
.step small { font-family: var(--display); font-size: 12px; }
.step.done { color: var(--ink); border-color: var(--me); background: rgba(61, 208, 255, .12); }
.step.done::before { content: '✓'; color: var(--me); font-size: 11px; }
.step.next { color: #2a1a00; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 210, 63, .6); animation: pulse 1.2s ease-in-out infinite; }
.bigBtn small { display: block; font-family: var(--body); font-weight: 900; font-size: 12px; letter-spacing: .05em; opacity: .9; }
.series .gameNo small { font-size: 11px; color: var(--muted); }

/* ---------- the robots you have built */
.titleLinks { display: flex; gap: 14px; }
.colBtn { font-family: var(--display); font-size: 12px; }
.colDialog { width: min(920px, 100%); max-height: calc(100vh - 32px); }
.colDialog .helpTop h2 { margin: 0; }
.colBig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px; border-radius: 14px; background: radial-gradient(ellipse at 30% 70%, rgba(61, 208, 255, .2), transparent 60%), rgba(0, 0, 0, .25); }
.colBig canvas.galBot { width: min(100%, 280px); justify-self: center; }
.colWhen { font-size: 12px; color: var(--muted); font-weight: 700; }
.colGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.colItem { position: relative; padding: 4px; border-radius: 12px; border: 1.5px solid var(--line); background: linear-gradient(180deg, #121a33, #0b1022); display: grid; justify-items: center; gap: 2px; }
.colItem img { width: 100%; aspect-ratio: 1; display: block; }
.colItem.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 210, 63, .45); }
.colItem:hover { border-color: var(--me); }
.colStat { font-family: var(--display); font-size: 12px; }
.colItem .resChip { position: absolute; top: 4px; right: 4px; font-size: 10px; padding: 0 6px; }
@media (max-width: 560px) { .colBig { grid-template-columns: 1fr; } .colBig .galInfo { justify-items: center; } }
