:root {
  --bg: #050913;
  --text: #eef4ff;
  --muted: #8ea2bd;
  --dim: #5a6d88;
  --line: #9fbfe624;
  --line-2: #9fbfe63d;
  --glass: #ffffff08;
  --human: #4cc9ff;
  --human-deep: #164a7c;
  --jev: #b7ff69;
  --jev-deep: #2f5a22;
  --draw: #ffc86b;
  --danger: #ff6b7a;
  --card: clamp(112px, min(18vw, 21vh), 210px);
  --ease-pop: cubic-bezier(.3, 1.6, .5, 1);
  --ease-out: cubic-bezier(.2, .9, .3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "PingFang SC", "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: var(--bg); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
kbd { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- stage ---------- */
.stage-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse 120% 80% at 50% 0%, #0f1c35 0%, #070d1b 55%, var(--bg) 100%); }
.aurora { position: absolute; top: 12%; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(110px); opacity: .14; transition: opacity 1s ease, transform 1.2s var(--ease-out); animation: drift 14s ease-in-out infinite alternate; }
.aurora-human { left: -30vmax; background: var(--human); }
.aurora-jev { right: -30vmax; background: var(--jev); animation-delay: -7s; }
body.lean-human .aurora-human, body.lean-jev .aurora-jev { opacity: .26; }
body.hot-human .aurora-human { opacity: .36; transform: scale(1.15); }
body.hot-jev .aurora-jev { opacity: .36; transform: scale(1.15); }
@keyframes drift { to { translate: 0 6vmax; } }
.floor { position: absolute; left: -50%; right: -50%; bottom: -12%; height: 62%; background-image: linear-gradient(#4cc9ff17 1px, transparent 1px), linear-gradient(90deg, #4cc9ff17 1px, transparent 1px); background-size: 58px 58px; transform: perspective(620px) rotateX(64deg); transform-origin: bottom; mask-image: linear-gradient(to top, #000 8%, transparent 80%); -webkit-mask-image: linear-gradient(to top, #000 8%, transparent 80%); animation: floor-run 6s linear infinite; }
@keyframes floor-run { to { background-position: 0 58px, 0 0; } }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 55%, #000a 100%); }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.flash { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0; }
.flash.go { animation: flash .7s ease-out; }
.flash.human_win { background: radial-gradient(circle at 30% 45%, #4cc9ff66, transparent 60%); }
.flash.jev_win { background: radial-gradient(circle at 70% 45%, #b7ff6966, transparent 60%); }
.flash.draw { background: radial-gradient(circle at 50% 45%, #ffc86b44, transparent 60%); }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- top hud ---------- */
.hud-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; width: min(1000px, calc(100% - 32px)); height: 56px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--jev); color: #10240f; font-weight: 900; font-size: 18px; box-shadow: 0 0 24px #b7ff6966; }
.brand-word { font-size: 13px; font-weight: 900; letter-spacing: .18em; }
.brand-word b { color: var(--jev); margin-left: .35em; }
.hud-actions { display: flex; align-items: center; gap: 8px; }
.hud-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; min-width: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 99px; background: #0b1426b3; backdrop-filter: blur(10px); font-size: 12px; font-weight: 800; text-decoration: none; color: #d6e4f5; transition: transform .15s var(--ease-pop), border-color .15s, color .15s, background .15s; }
.hud-button:hover { transform: translateY(-2px); border-color: var(--jev); color: var(--jev); }
.hud-button:focus-visible { outline: 2px solid var(--jev); outline-offset: 2px; }
#sound-button { padding: 0; font-size: 15px; }
.hud-button.quiet:hover { border-color: var(--danger); color: var(--danger); }
.hud-button:disabled { opacity: .45; transform: none; }
.sound-icon::before { content: "🔊"; }
#sound-button[aria-pressed="false"] .sound-icon::before { content: "🔇"; }
.lab-link span:first-child { font-size: 14px; }

/* ---------- layout ---------- */
.game { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; width: min(1000px, calc(100% - 32px)); min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); margin: 0 auto; padding: 2px 0 18px; }

/* ---------- scoreboard ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 22px 12px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(90deg, #4cc9ff14, transparent 32%, transparent 68%, #b7ff6914), #0b1323cc; backdrop-filter: blur(12px); box-shadow: 0 18px 44px #0007, inset 0 1px 0 #ffffff0d; }
.side { display: flex; align-items: center; gap: 14px; min-width: 0; }
.side-jev { flex-direction: row-reverse; }
.avatar { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; font-size: 18px; font-weight: 900; color: #06223a; background: linear-gradient(145deg, #9be3ff, var(--human)); box-shadow: 0 0 24px #4cc9ff55; }
.side-jev .avatar { color: #10240f; background: linear-gradient(145deg, #e2ffbf, var(--jev)); box-shadow: 0 0 24px #b7ff6955; }
.side-text { display: flex; flex-direction: column; gap: 2px; }
.side-jev .side-text { align-items: flex-end; }
.tag { font-size: 10px; font-weight: 900; letter-spacing: .18em; color: var(--human); }
.side-jev .tag { color: var(--jev); }
.tag-row { display: flex; align-items: center; gap: 8px; }
.best { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-2); background: #ffffff0a; color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.best span:first-child { font-size: 10px; }
.best b { color: #eef4ff; font-size: 11px; }
.best.record { animation: record 1.6s var(--ease-out); transform-origin: center; }
.side-human .best.record { transform-origin: left center; }
.side-jev .best.record { transform-origin: right center; }
@keyframes record { 0% { transform: scale(.7); } 15% { transform: scale(1.18); color: #ffe7a3; border-color: #ffd166; background: #ffd16633; box-shadow: 0 0 24px #ffd166aa; } 70% { color: #ffe7a3; border-color: #ffd166aa; background: #ffd1661f; } 100% { transform: scale(1); } }
.score { font-size: 50px; line-height: .95; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--human); text-shadow: 0 0 30px #4cc9ff66; }
.side-jev .score { color: var(--jev); text-shadow: 0 0 30px #b7ff6966; }
.score.bump { animation: bump .55s var(--ease-pop); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.5); filter: brightness(1.6); } 100% { transform: scale(1); } }
.streak { padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 900; white-space: nowrap; color: var(--human); background: #4cc9ff1f; border: 1px solid #4cc9ff66; }
.side-jev .streak { color: var(--jev); background: #b7ff691f; border-color: #b7ff6966; }
.streak.pop { animation: streak-pop .5s var(--ease-pop); }
.streak.hot { animation: streak-pop .5s var(--ease-pop), glow-pulse 1.1s ease-in-out .5s infinite; }
@keyframes streak-pop { from { transform: scale(0) rotate(-15deg); } }
@keyframes glow-pulse { 50% { box-shadow: 0 0 20px currentColor; } }
.round-pill { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 0 18px; }
.round-pill small { font-size: 10px; font-weight: 900; letter-spacing: .24em; color: var(--muted); }
.round-pill strong { font-size: 32px; line-height: 1.1; font-weight: 900; font-variant-numeric: tabular-nums; }
.round-pill strong.bump { animation: bump .45s var(--ease-pop); }
.round-pill span { font-size: 11px; color: var(--muted); }
.round-pill b { color: var(--draw); margin-left: 2px; font-variant-numeric: tabular-nums; }
.tug { grid-column: 1 / -1; position: relative; height: 8px; margin-top: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--jev-deep), var(--jev)); box-shadow: 0 0 16px #b7ff6933; }
.tug-fill { position: absolute; inset: 0 auto 0 0; width: 50%; border-radius: 99px 0 0 99px; background: linear-gradient(90deg, var(--human-deep), var(--human)); box-shadow: 0 0 16px #4cc9ff55; transition: width .8s cubic-bezier(.2, 1.1, .3, 1.15); }
.tug-knob { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid #0b1323; box-shadow: 0 0 14px #fff9; transform: translate(-50%, -50%); transition: left .8s cubic-bezier(.2, 1.1, .3, 1.15); }
.timeline { grid-column: 1 / -1; display: flex; justify-content: center; gap: 3px; min-height: 7px; margin-top: 12px; }
.timeline i { flex: 0 1 12px; min-width: 3px; height: 7px; border-radius: 3px; background: var(--dim); opacity: .9; }
.timeline i.human_win { background: var(--human); box-shadow: 0 0 6px #4cc9ff66; }
.timeline i.jev_win { background: var(--jev); box-shadow: 0 0 6px #b7ff6966; }
.timeline i.draw { background: var(--draw); opacity: .55; }
.timeline i.fresh { animation: pip .6s var(--ease-pop); }
@keyframes pip { from { transform: translateY(-14px) scale(2.2); opacity: 0; } }

/* ---------- arena ---------- */
.arena { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "human vs jev" "banner banner banner"; align-items: center; justify-items: center; padding: 48px 28px 12px; border: 1px solid var(--line); border-radius: 30px; background: radial-gradient(ellipse 70% 60% at 50% 38%, #1b2f52cc 0%, #0e1a30cc 55%, #0a1324e6 100%); box-shadow: 0 26px 60px #0009, inset 0 1px 0 #ffffff12; }
.arena::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(90deg, #4cc9ff10, transparent 40%, transparent 60%, #b7ff6910); }
.arena.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97); }
.arena.punch { animation: punch .45s var(--ease-pop); }
@keyframes shake { 15% { transform: translate(-9px, 3px) rotate(-.6deg); } 30% { transform: translate(8px, -3px) rotate(.5deg); } 45% { transform: translate(-6px, 2px); } 60% { transform: translate(4px, -1px); } 80% { transform: translate(-2px, 0); } }
@keyframes punch { 30% { transform: scale(1.025); } }
.fighter { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fighter-human { grid-area: human; }
.fighter-jev { grid-area: jev; }
.fighter-name { font-size: 11px; font-weight: 900; letter-spacing: .3em; color: var(--human); opacity: .85; }
.fighter-jev .fighter-name { color: var(--jev); }

.card { position: relative; width: var(--card); height: calc(var(--card) * 1.14); perspective: 1000px; transition: transform .4s var(--ease-pop), filter .35s ease; }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, 1.3, .45, 1); }
.arena[data-face="back"] .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 28px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: box-shadow .35s, border-color .35s; }
.card-face::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(140deg, #ffffff26 0%, transparent 38%, transparent 70%, #ffffff0a 100%); }
.face-human { background: linear-gradient(165deg, #21477a, #10233f 70%); border: 1px solid #3f76ad; box-shadow: inset 0 0 50px #4cc9ff1f, 0 22px 44px #0009; }
.face-front { background: linear-gradient(165deg, #2c5a2a, #132a17 70%); border: 1px solid #568a3f; box-shadow: inset 0 0 50px #b7ff691f, 0 22px 44px #0009; }
.face-back { transform: rotateY(180deg); border: 1px solid #568a3f; box-shadow: inset 0 0 50px #b7ff6926, 0 22px 44px #0009; background: radial-gradient(circle at 50% 50%, #1f3f1ecc, #0c1a0e 72%), repeating-linear-gradient(45deg, #b7ff6912 0 10px, transparent 10px 20px); background-blend-mode: normal; }
.face-back::before { content: ""; position: absolute; inset: 12px; border-radius: 20px; border: 1px dashed #b7ff6940; }
.hand { position: relative; z-index: 1; font-size: calc(var(--card) * .52); line-height: 1; user-select: none; -webkit-user-select: none; filter: drop-shadow(0 12px 18px #000a); transition: opacity .2s, transform .2s var(--ease-pop); }
#human-hand.empty { font-size: calc(var(--card) * .4); font-weight: 900; color: #4cc9ff66; filter: none; }
.fighter-jev .hand { transform: scaleX(-1); }
.hand.ghost { opacity: .5; transform: scale(.9); }
.hand.pop { animation: hand-pop .5s cubic-bezier(.3, 1.9, .5, 1); }
.fighter-jev .hand.pop { animation-name: hand-pop-jev; }
@keyframes hand-pop { 0% { transform: scale(.3) rotate(-25deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes hand-pop-jev { 0% { transform: scaleX(-1) scale(.3) rotate(-25deg); } 100% { transform: scaleX(-1) scale(1) rotate(0); } }

/* jev card back states */
.scan, .seal, .think-dots { position: absolute; z-index: 1; opacity: 0; transition: opacity .25s; }
.scan { left: 10%; right: 10%; top: 0; height: 30%; background: linear-gradient(180deg, transparent, #b7ff6940, transparent); animation: scan 1.3s ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateY(-20%); } to { transform: translateY(260%); } }
.seal { display: grid; place-items: center; gap: 6px; }
.seal-icon { display: grid; place-items: center; width: calc(var(--card) * .42); height: calc(var(--card) * .42); border-radius: 50%; font-size: calc(var(--card) * .2); background: radial-gradient(circle, #b7ff6933, #b7ff6908 70%); border: 2px solid #b7ff6999; box-shadow: 0 0 34px #b7ff6955, inset 0 0 18px #b7ff6933; }
.seal small { font-size: 11px; font-weight: 900; letter-spacing: .3em; color: var(--jev); }
.think-dots { bottom: 18%; display: flex; gap: 7px; }
.think-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--jev); animation: blink 1s infinite; }
.think-dots i:nth-child(2) { animation-delay: .15s; }
.think-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .15; transform: translateY(-4px); } }
.arena[data-lock="thinking"] .scan, .arena[data-lock="thinking"] .think-dots { opacity: 1; }
.arena[data-lock="locked"] .seal { opacity: 1; }
.seal.stamp { animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp { 0% { transform: scale(2.4) rotate(-18deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.arena[data-lock="error"] .face-back { filter: grayscale(.8) brightness(.7); }

.mini-lock { position: absolute; z-index: 3; top: -12px; right: -12px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; background: #0c1a0e; border: 2px solid #b7ff6988; box-shadow: 0 0 18px #b7ff6944; opacity: 0; transform: scale(.4); transition: opacity .25s, transform .35s var(--ease-pop); }
.arena[data-face="front"][data-lock="thinking"] .mini-lock, .arena[data-face="front"][data-lock="locked"] .mini-lock { opacity: 1; transform: scale(1); }
.arena[data-lock="thinking"] .mini-lock::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--jev); border-right-color: transparent; animation: spin .8s linear infinite; }
.arena[data-lock="locked"] .mini-lock::before { content: "🔒"; }
@keyframes spin { to { transform: rotate(360deg); } }

/* fighters in motion */
.fighter.pumping .card { animation: pump .3s ease-in-out infinite alternate; }
@keyframes pump { from { transform: translateY(0) rotate(0); } to { transform: translateY(-20px) rotate(-3deg); } }
.fighter-jev.pumping .card { animation-name: pump-jev; }
@keyframes pump-jev { from { transform: translateY(0) rotate(0); } to { transform: translateY(-20px) rotate(3deg); } }
.arena.waiting .fighter:not(.winner, .loser, .tied) .card { animation: breathe 3.2s ease-in-out infinite; }
.arena.waiting .fighter-jev:not(.winner, .loser, .tied) .card { animation-delay: -1.6s; }
@keyframes breathe { 50% { transform: translateY(-6px); } }
.fighter.winner .card { transform: scale(1.09) translateY(-8px); }
.fighter-human.winner .face-human { border-color: var(--human); box-shadow: 0 0 0 4px #4cc9ff38, 0 0 70px #4cc9ff88, 0 22px 44px #0009; }
.fighter-jev.winner .face-front { border-color: var(--jev); box-shadow: 0 0 0 4px #b7ff6938, 0 0 70px #b7ff6988, 0 22px 44px #0009; }
.fighter.loser .card { transform: scale(.9) translateY(10px) rotate(-5deg); filter: grayscale(.8) brightness(.65); }
.fighter-jev.loser .card { transform: scale(.9) translateY(10px) rotate(5deg); }
.fighter.tied .card { transform: scale(.98); }
.fighter-human.tied .face-human, .fighter-jev.tied .face-front { border-color: var(--draw); box-shadow: 0 0 0 3px #ffc86b2e, 0 0 44px #ffc86b55, 0 22px 44px #0009; }

/* versus */
.versus { grid-area: vs; position: relative; display: grid; place-items: center; width: 92px; height: 92px; margin: 0 22px; border-radius: 50%; background: radial-gradient(circle, #13233f, #0a1426 70%); box-shadow: 0 0 40px #0009, inset 0 0 20px #ffffff0d; }
.versus-ring { position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(from 0deg, var(--human), transparent 25%, var(--jev) 50%, transparent 75%, var(--human)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); animation: spin 5s linear infinite; }
.versus-text { position: relative; font-size: 22px; font-weight: 900; letter-spacing: .04em; color: #cfdcf0; text-shadow: 0 0 18px #fff4; }
.versus-text.count { color: #fff; font-size: 24px; animation: tick .32s var(--ease-pop); }
.versus.hot .versus-ring { animation-duration: .6s; }
.versus.boom { animation: boom .5s var(--ease-out); }
@keyframes tick { from { transform: scale(1.9); opacity: .2; } }
@keyframes boom { 0% { box-shadow: 0 0 0 0 #fff9, 0 0 40px #0009; } 100% { box-shadow: 0 0 0 40px #fff0, 0 0 40px #0009; } }

/* banner */
.banner { grid-area: banner; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 84px; margin-top: 12px; text-align: center; }
.banner strong { display: block; font-size: 36px; line-height: 1.1; font-weight: 900; letter-spacing: -.01em; color: #dce8f7; }
.banner p { margin: 8px 0 0; min-height: 1.5em; font-size: 13px; color: var(--muted); }
.banner p b { color: var(--text); }
.banner .verified { margin-left: 8px; color: #cfeeb2; font-weight: 700; white-space: nowrap; }
.banner .verified.bad { color: var(--danger); }
.banner.human_win strong { color: var(--human); text-shadow: 0 0 34px #4cc9ffaa; }
.banner.jev_win strong { color: var(--jev); text-shadow: 0 0 34px #b7ff69aa; }
.banner.draw strong { color: var(--draw); text-shadow: 0 0 30px #ffc86b77; }
.banner.slam strong { animation: slam .55s cubic-bezier(.2, 1.5, .4, 1); }
.banner.slam p { animation: rise .5s .15s var(--ease-out) backwards; }
.banner.idle strong { font-size: 22px; color: #c9d7ea; }
.banner .insight { display: inline-flex; align-items: center; gap: 7px; margin: 8px 0 0; padding: 0; border-radius: 99px; font-size: 12px; font-weight: 700; color: #b9c8dc; line-height: 1.4; }
.banner .insight:empty { display: none; }
.banner .insight:not(:empty) { padding: 5px 12px; background: #ffffff0c; border: 1px solid var(--line-2); }
.banner.slam .insight:not(:empty) { animation: rise .5s .32s var(--ease-out) backwards; }
.banner .insight.caught { color: #eaffd6; border-color: #b7ff6999; background: #b7ff691c; box-shadow: 0 0 22px #b7ff6933; }
.banner .insight.none { color: var(--muted); }
.insight-icon { font-size: 13px; }
.banner.past { opacity: .62; transform: scale(.94); transition: opacity .4s, transform .4s var(--ease-out); }
@keyframes slam { 0% { transform: scale(2.6); opacity: 0; letter-spacing: .4em; filter: blur(6px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: scale(1); letter-spacing: -.01em; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* speech bubble */
.bubble { position: absolute; z-index: 4; bottom: calc(100% - 2px); left: 50%; translate: -50% 0; width: max-content; max-width: min(230px, 46vw); padding: 8px 13px; border-radius: 14px; background: #eaffd6; color: #173012; font-size: 13px; font-weight: 800; line-height: 1.35; text-align: center; box-shadow: 0 10px 26px #0008; opacity: 0; transform: translateY(8px) scale(.85); transform-origin: 50% 100%; transition: opacity .2s, transform .3s var(--ease-pop); pointer-events: none; }
.bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: #eaffd6; }
.bubble.show { opacity: 1; transform: translateY(-10px) scale(1); }

/* ---------- status ---------- */
.status-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 32px; }
.lock-chip, .session-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: #0a1324cc; color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; transition: color .2s, border-color .2s, background .2s; }
.session-chip { color: #d7c7f9; border-color: #a78bfa55; }
.lock-icon { display: inline-grid; place-items: center; width: 14px; }
.lock-chip[data-state="idle"] .lock-icon { display: none; }
.lock-chip[data-state="thinking"] .lock-icon::before { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.lock-chip[data-state="thinking"] { color: #d8ffb0; }
.lock-chip[data-state="locked"] { color: var(--jev); border-color: #b7ff6966; background: #b7ff6914; }
.lock-chip[data-state="locked"] .lock-icon::before { content: "🔒"; font-size: 11px; }
.lock-chip[data-state="error"] { color: var(--danger); border-color: #ff6b7a66; }
.lock-chip[data-state="error"] .lock-icon::before { content: "!"; font-weight: 900; }
.lock-chip[data-state="gate"] { color: #d7c7f9; border-color: #a78bfa66; }
.lock-chip[data-state="gate"] .lock-icon::before { content: "⏸"; }
.lock-chip.nudge { animation: nudge .4s ease; }
@keyframes nudge { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 0 auto; max-width: 640px; padding: 10px 14px; border-radius: 14px; border: 1px solid #ff6b7a55; background: #3a1b25cc; color: #ffdfe2; font-size: 12px; line-height: 1.5; text-align: center; }
.notice.soft { border-color: #a78bfa55; background: #221b3acc; color: #e6dcff; }
.notice-button { flex: none; height: 28px; padding: 0 12px; border: 1px solid #ffffff33; border-radius: 99px; background: #ffffff14; font-size: 12px; font-weight: 800; line-height: 26px; text-decoration: none; }
.notice-button:hover { background: #ffffff26; }

/* ---------- moves ---------- */
.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.move-button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 110px; overflow: hidden; border: 1px solid var(--line-2); border-radius: 24px; background: linear-gradient(180deg, #1a2d4a, #0f1c31); box-shadow: 0 14px 30px #0007, inset 0 1px 0 #ffffff14; transition: transform .18s var(--ease-pop), border-color .18s, box-shadow .18s, opacity .25s, filter .25s; }
.move-button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, #ffffff1f 50%, transparent 65%); transform: translateX(-110%); transition: transform .6s ease; pointer-events: none; }
.move-button kbd { position: absolute; top: 10px; left: 12px; display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line-2); background: #ffffff08; color: var(--muted); font-size: 11px; font-weight: 800; }
.move-emoji { font-size: 44px; line-height: 1.1; filter: drop-shadow(0 8px 12px #0008); transition: transform .2s var(--ease-pop); }
.move-button strong { font-size: 15px; letter-spacing: .08em; }
.moves.ready .move-button { animation: invite 2.6s ease-in-out infinite; }
.moves.ready .move-button:nth-child(2) { animation-delay: .2s; }
.moves.ready .move-button:nth-child(3) { animation-delay: .4s; }
@keyframes invite { 0%, 70%, 100% { box-shadow: 0 14px 30px #0007, inset 0 1px 0 #ffffff14; } 85% { box-shadow: 0 14px 30px #0007, inset 0 1px 0 #ffffff14, 0 0 0 2px #4cc9ff55, 0 0 30px #4cc9ff33; } }
.move-button:hover:not(:disabled), .move-button:focus-visible:not(:disabled) { transform: translateY(-6px); border-color: var(--human); box-shadow: 0 18px 38px #4cc9ff2e, inset 0 1px 0 #ffffff1f; animation: none; }
.move-button:hover:not(:disabled)::after { transform: translateX(110%); }
.move-button:hover:not(:disabled) .move-emoji { transform: scale(1.18) rotate(-10deg); }
.move-button:active:not(:disabled) { transform: translateY(0) scale(.95); }
.move-button:focus-visible { outline: 2px solid var(--human); outline-offset: 3px; }
.move-button.chosen { border-color: var(--human); background: linear-gradient(180deg, #1f4f82, #143258); box-shadow: 0 0 0 3px #4cc9ff44, 0 0 40px #4cc9ff44; opacity: 1; filter: none; }
.move-button.chosen .move-emoji { transform: scale(1.2); }
.move-button:disabled:not(.chosen) { opacity: .42; filter: saturate(.5); }
.hint { margin: 2px 0 0; text-align: center; font-size: 11px; color: var(--dim); }
.hint kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); font-size: 10px; font-weight: 800; }

.float-score { position: fixed; z-index: 70; pointer-events: none; font-size: 30px; font-weight: 900; color: var(--human); text-shadow: 0 0 20px currentColor; }
.float-score.jev { color: var(--jev); }
body.is-loading .moves { opacity: .5; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  :root { --card: min(33vw, 150px); }
  .hud-top, .game { width: calc(100% - 24px); }
  .hud-top { height: 54px; }
  .game { gap: 12px; }
  .scoreboard { padding: 12px 14px 12px; border-radius: 18px; }
  .side { gap: 9px; }
  .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 14px; }
  .score { font-size: 38px; }
  .tag { font-size: 9px; letter-spacing: .12em; }
  .tag-row { gap: 5px; }
  .best { padding: 1px 6px; }
  .best-label { display: none; }
  .side { position: relative; }
  .streak { position: absolute; top: calc(50% + 10px); z-index: 1; min-width: 34px; padding: 1px 5px; font-size: 0; text-align: center; background: #0b1323; }
  .streak::after { content: "🔥" attr(data-count); font-size: 11px; }
  .side-human .streak { left: 0; }
  .side-jev .streak { right: 0; background: #0b1323; }
  .round-pill { min-width: 70px; padding: 0 8px; }
  .round-pill strong { font-size: 26px; }
  .tug { margin-top: 12px; }
  .game { justify-content: flex-start; }
  .arena { flex-grow: 1; align-content: center; padding: 54px 10px 12px; border-radius: 24px; }
  .mini-lock { right: auto; left: -10px; }
  .versus { width: 56px; height: 56px; margin: 0 8px; }
  .versus-text { font-size: 15px; }
  .versus-text.count { font-size: 15px; }
  .card-face { border-radius: 22px; }
  .banner { min-height: 82px; margin-top: 14px; }
  .banner strong { font-size: 28px; }
  .banner.idle strong { font-size: 19px; }
  .banner p { font-size: 12px; padding: 0 6px; }
  .banner .insight { font-size: 11px; text-align: left; }
  .bubble { left: auto; right: -6px; translate: 0 0; transform-origin: 80% 100%; font-size: 12px; }
  .bubble::after { left: auto; right: calc(var(--card) / 2 - 1px); }
  .moves { gap: 9px; }
  .move-button { min-height: 100px; border-radius: 20px; }
  .move-button kbd { display: none; }
  .move-emoji { font-size: 38px; }
  .move-button strong { font-size: 14px; }
}
@media (max-width: 520px) {
  .hud-actions { gap: 6px; }
  .hud-button { padding: 0 10px; }
  .hud-button span:not(:first-child):not(.sr-only):not(.chip-avatar) { display: none; }
}
@media (max-width: 380px) {
  .brand-word { display: none; }
}
@media (max-height: 860px) {
  .hint { display: none; }
}
@media (hover: none) {
  .hint { display: none; }
  .move-button:hover:not(:disabled) { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- challenger identity ---------- */
.avatar.named { background: linear-gradient(145deg, hsl(var(--hue) 95% 82%), hsl(var(--hue) 78% 56%)); color: hsl(var(--hue) 70% 14%); box-shadow: 0 0 24px hsl(var(--hue) 90% 60% / .45); }
.avatar.pop { animation: avatar-pop .5s var(--ease-pop); }
@keyframes avatar-pop { 0% { transform: scale(.6) rotate(-12deg); } 60% { transform: scale(1.15) rotate(4deg); } 100% { transform: scale(1); } }
.player-avatar { padding: 0; border: 0; font: inherit; font-size: 18px; font-weight: 900; cursor: pointer; transition: transform .18s var(--ease-pop); }
.player-avatar:hover { transform: translateY(-2px) rotate(-4deg); }
.player-avatar:focus-visible, .player-name:focus-visible { outline: 2px solid var(--human); outline-offset: 3px; }
.player-name { display: inline-flex; align-items: center; gap: 6px; max-width: 160px; padding: 0; border: 0; background: none; color: #bfeaff; font: inherit; font-size: 13px; font-weight: 900; letter-spacing: .04em; cursor: pointer; }
.player-name #player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-name .swap { font-size: 11px; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.player-name:hover .swap, .player-avatar:hover + .side-text .swap { opacity: 1; transform: none; }
.player-name.guest { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.player-name.guest .swap { opacity: .8; transform: none; }

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; background: #03060dcc; backdrop-filter: blur(8px); animation: modal-fade .25s ease; }
@keyframes modal-fade { from { opacity: 0; } }
.modal-card { width: min(440px, 100%); max-height: calc(100dvh - 36px); display: flex; flex-direction: column; gap: 12px; padding: 24px 22px 20px; overflow: auto; border: 1px solid var(--line-2); border-radius: 24px; background: radial-gradient(ellipse at 50% 0%, #17294a, #0b1323 65%); box-shadow: 0 30px 80px #000c, 0 0 60px #4cc9ff1f; animation: modal-in .45s var(--ease-pop); }
@keyframes modal-in { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.modal-card .eyebrow { color: var(--human); font-size: 10px; font-weight: 900; letter-spacing: .22em; }
.modal-card h2 { margin: 0; font-size: 24px; }
.modal-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-error { margin: 0; color: #ffc4ca; font-size: 12px; }
.modal-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
.modal-primary { width: 100%; height: 50px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #9be3ff, var(--human)); color: #06223a; font-size: 16px; font-weight: 900; box-shadow: 0 10px 28px #4cc9ff33; transition: transform .15s var(--ease-pop); }
.modal-primary:hover:not(:disabled) { transform: translateY(-2px); }
.modal-primary:disabled { filter: grayscale(.6); }
.modal-quiet { padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.modal-quiet:hover { color: #fff; }
.board-modal .modal-card { width: min(560px, 100%); }
.board-head { display: flex; align-items: flex-start; justify-content: space-between; }
.board-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff06; }
.board-tab { flex: 1; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; font-weight: 800; }
.board-tab[aria-selected="true"] { background: #ffffff12; color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.board-body { display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.board-row { display: grid; grid-template-columns: 34px 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff05; animation: rise .35s var(--ease-out) backwards; }
.board-row:nth-child(2) { animation-delay: .04s; } .board-row:nth-child(3) { animation-delay: .08s; } .board-row:nth-child(n+4) { animation-delay: .12s; }
.board-row.podium { background: linear-gradient(90deg, #ffd16614, transparent 60%); border-color: #ffd16633; }
.board-row.me { border-color: var(--human); box-shadow: 0 0 0 2px #4cc9ff33; }
.board-row.dim { opacity: .6; }
.board-rank { font-size: 20px; font-weight: 900; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.board-who strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-who small, .board-score small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.board-score { display: flex; flex-direction: column; align-items: flex-end; }
.board-score strong { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff4d6; }
.board-empty { padding: 26px 12px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.6; }
/* challenger entrance */
.challenger .modal-card { width: min(480px, 100%); gap: 14px; padding: 26px 24px 20px; text-align: center; border-color: #4cc9ff44; background: radial-gradient(ellipse 90% 60% at 50% 0%, #1b3560, #0b1323 70%); }
.challenger .modal-card.leaving { animation: challenger-out .22s ease-in forwards; }
@keyframes challenger-out { to { transform: translateY(-16px) scale(.96); opacity: 0; } }
.challenger-hero { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 4px 0 2px; }
.hero-avatar { width: 72px; height: 72px; border-radius: 22px; font-size: 30px; }
.hero-avatar:not(.named):not(.hero-jev) { color: #4cc9ffaa; background: #0a1628; border: 2px dashed #4cc9ff55; box-shadow: none; }
.hero-jev { color: #10240f; background: linear-gradient(145deg, #e2ffbf, var(--jev)); box-shadow: 0 0 28px #b7ff6966; }
.hero-vs { font-size: 18px; font-weight: 900; letter-spacing: .08em; color: #cfdcf0; text-shadow: 0 0 18px #fff4; }
.challenger .eyebrow { margin-top: 2px; }
.nameplate { position: relative; }
.nameplate input { width: 100%; height: 58px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 16px; background: #060c18; color: var(--text); font: inherit; font-size: 22px; font-weight: 900; text-align: center; letter-spacing: .04em; transition: border-color .15s, box-shadow .15s; }
.nameplate input:focus { outline: none; border-color: var(--human); box-shadow: 0 0 0 4px #4cc9ff26, 0 0 30px #4cc9ff22; }
.nameplate input::placeholder { color: #5a6d88; font-weight: 700; letter-spacing: 0; }
.roster-title { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .2em; text-align: left; }
.roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 190px; overflow: auto; }
.roster-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff06; color: inherit; font: inherit; text-align: left; transition: border-color .15s, background .15s, transform .15s var(--ease-pop); }
.roster-item:hover { transform: translateY(-2px); border-color: var(--line-2); background: #ffffff0c; }
.roster-item.picked { border-color: var(--human); background: #4cc9ff14; box-shadow: 0 0 0 2px #4cc9ff26; }
.roster-item .avatar { flex: none; width: 34px; height: 34px; border-radius: 11px; font-size: 14px; }
.roster-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.roster-text strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.roster-text small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.challenger-go { width: 100%; height: 54px; margin-top: 2px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #9be3ff, var(--human)); color: #06223a; font: inherit; font-size: 17px; font-weight: 900; letter-spacing: .04em; box-shadow: 0 12px 30px #4cc9ff3a, inset 0 1px 0 #ffffffaa; transition: transform .15s var(--ease-pop), filter .15s; }
.challenger-go:hover:not(:disabled) { transform: translateY(-2px); }
.challenger-go:disabled { filter: grayscale(.7) brightness(.75); cursor: default; }
.board-avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 14px; }
@media (max-width: 520px) {
  .modal-card { padding: 20px 16px 16px; border-radius: 20px; }
  .hero-avatar { width: 60px; height: 60px; font-size: 25px; border-radius: 18px; }
  .roster { grid-template-columns: 1fr; }
  .board-row { grid-template-columns: 26px 30px minmax(0, 1fr) auto; gap: 8px; padding: 9px 10px; }
  .board-avatar { width: 30px; height: 30px; }
  .board-score strong { font-size: 18px; }
  .player-name { max-width: 84px; }
}

/* ---------- who is playing: topbar chip, guest reminder ---------- */
.challenger-chip { gap: 8px; padding: 0 14px 0 4px; }
.challenger-chip .chip-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 13px; box-shadow: none; }
.challenger-chip.guest { border-color: #4cc9ffaa; color: #d6f1ff; background: linear-gradient(90deg, #4cc9ff26, #0b1426b3); animation: chip-call 2.4s ease-in-out infinite; }
.challenger-chip.guest .chip-avatar { background: #0a1628; color: #4cc9ff; border: 1px dashed #4cc9ff88; }
@keyframes chip-call { 50% { box-shadow: 0 0 0 4px #4cc9ff22, 0 0 22px #4cc9ff44; } }
.guest-chip { height: 32px; padding: 0 14px; border: 1px dashed #4cc9ff66; border-radius: 99px; background: #4cc9ff10; color: #bfeaff; font: inherit; font-size: 12px; font-weight: 700; }
.guest-chip b { color: #fff; }
.guest-chip:hover { border-style: solid; background: #4cc9ff1f; }
.challenger-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.guest-short { display: none; }
@media (max-width: 520px) {
  .challenger-chip { padding: 0 4px; }
  .challenger-chip .chip-label { display: none; }
  .brand-word { display: none; }
  .guest-long { display: none; }
  .guest-short { display: inline; }
}
