/* mvc2-web page, after MvC2's own look: a night grid backdrop, chrome bars with outlined colour text, silver
   description strip. CSS only (no images, no inline styles: the CSP allows style-src 'self'). Hover and focus move
   things with transforms only, so nothing around them shifts. */
:root {
  --ink: #0a0b1e; --fg: #f4f6ff; --dim: #a9b2d6; --line: #6e74a6;
  --chrome-hi: #f4f6ff; --chrome: #c6cde2; --chrome-lo: #8189a8;
  --blue0: #050a2c; --blue1: #0b1d6b; --blue2: #1d4fd0;
  --yellow: #ffe23a; --red: #d8102a; --magenta: #ff2fb1;
  --c-host: #ffb21e; --c-join: #3cf06a; --c-arcade: #5cff7a; --c-training: #36a7ff; --c-versus: #2be3ff; --c-menu: #ff4fd8;
  --panel: rgba(9, 14, 52, .96);
  --heavy: 900 1em/1 "Arial Black", "Arial Bold", Impact, system-ui, sans-serif;
  --skew: -12deg;
  --blb-handoff: #04050f;   /* = the html background (blb-site handoff.css) */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #04050f; color: var(--fg); font: 15px/1.4 system-ui, "Segoe UI", sans-serif; overflow: hidden; }
#stage { position: fixed; inset: 0; display: grid; place-items: center; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }

/* ---- the game picture: Settings > Screen / Smoothing set these classes on <body> ---- */
#canvas { width: min(100vw, calc(100vh * 4 / 3)); height: min(100vh, calc(100vw * 3 / 4)); background: #000; }
body.size-stretch #canvas { width: 100vw; height: 100vh; }
body.size-integer #canvas { width: var(--int-w, 640px); height: var(--int-h, 480px); }
body.sharp #canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---- full-screen layers ---- */
.screen { position: absolute; inset: 0; overflow: hidden; overflow: clip; }
.overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(3, 5, 22, .72); overflow: auto; }
/* backdrop: night sky over a glowing grid floor that rolls toward you (the game's training stage, at dusk),
   with slow diagonal light streaks. Two pseudo-elements on one div; motion stops for reduced-motion users. */
.backdrop {
  background:
    radial-gradient(70% 38% at 50% 64%, rgba(255, 47, 177, .30), transparent 70%),
    radial-gradient(50% 30% at 50% 62%, rgba(43, 227, 255, .22), transparent 70%),
    linear-gradient(180deg, #04061a 0%, #0b1350 42%, #2a0f57 62%, #090420 63%, #05031a 100%);
}
.bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; perspective: 360px; perspective-origin: 50% 62%; }
.bg::before {
  content: ""; position: absolute; left: -60%; right: -60%; top: 62.5%; height: 140%;
  background:
    repeating-linear-gradient(90deg, rgba(110, 200, 255, .55) 0 2px, transparent 2px 72px),
    repeating-linear-gradient(180deg, rgba(110, 200, 255, .55) 0 2px, transparent 2px 72px);
  transform-origin: 50% 0; transform: rotateX(78deg);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 60%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 60%, transparent 100%);
  animation: floor 2.4s linear infinite;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 61.6%, rgba(255, 140, 230, .95) 62.3%, rgba(43, 227, 255, .5) 62.6%, transparent 63.4%),
    repeating-linear-gradient(115deg, transparent 0 180px, rgba(140, 190, 255, .05) 180px 230px, transparent 230px 420px),
    radial-gradient(1px 1px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 33% 9%, #cfe, transparent),
    radial-gradient(1.5px 1.5px at 71% 14%, #fff, transparent), radial-gradient(1px 1px at 86% 31%, #fce, transparent),
    radial-gradient(1px 1px at 52% 27%, #fff, transparent), radial-gradient(1px 1px at 22% 40%, #def, transparent),
    radial-gradient(1.5px 1.5px at 92% 8%, #fff, transparent), radial-gradient(1px 1px at 6% 52%, #fff, transparent);
  animation: streaks 18s linear infinite;
}
@keyframes floor { to { background-position: 0 72px, 0 72px; } }
@keyframes streaks { to { background-position: 0 0, 840px 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; } }
@keyframes spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .bg::before, .bg::after { animation: none; } }

/* ---- logo (type, not the game's artwork) ---- */
.logo {
  position: relative; z-index: 1; display: grid; grid-template-columns: auto auto; grid-template-areas: "marvel marvel" "vs capcom";
  justify-content: center; align-items: center; column-gap: .25em; width: max-content; margin: 0 auto;
  font: var(--heavy); font-style: italic; text-transform: uppercase; line-height: .95;
}
.logo-marvel, .logo-capcom {
  background: linear-gradient(#fff9b8, var(--yellow) 45%, #ff9b0f);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--yellow);
  -webkit-text-stroke: 3px var(--red); paint-order: stroke fill;
  filter: drop-shadow(0 4px 0 #2a0008);
}
.logo-marvel { grid-area: marvel; font-size: clamp(40px, 7.5vw, 84px); letter-spacing: .02em; }
.logo-capcom { grid-area: capcom; font-size: clamp(30px, 5.6vw, 62px); -webkit-text-stroke-color: #3a1cbf; }
.logo-vs { grid-area: vs; font-size: clamp(26px, 4.6vw, 50px); color: #fff; -webkit-text-stroke: 3px #10123d; paint-order: stroke fill; filter: drop-shadow(0 3px 0 #000); }
.logo-two {
  position: absolute; right: -.5em; top: -2%; z-index: -1; font-size: clamp(100px, 19vw, 220px);
  color: var(--magenta); -webkit-text-fill-color: var(--magenta);
  -webkit-text-stroke: 4px #2a0b4f; paint-order: stroke fill;
  text-shadow: 0 6px 0 #5a0a72, 0 0 30px rgba(255, 47, 177, .45);
}

/* ---- loading screen ---- */
#boot { display: grid; place-content: center; gap: 40px; padding: 16px; }
.boot-card { position: relative; z-index: 1; display: grid; gap: 12px; width: min(560px, 92vw); }
.boot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.boot-title {
  margin: 0; font: var(--heavy); font-style: italic; font-size: clamp(24px, 4vw, 34px); letter-spacing: .1em; text-transform: uppercase;
  color: var(--yellow); -webkit-text-stroke: 2px var(--red); paint-order: stroke fill; filter: drop-shadow(0 3px 0 #2a0008);
}
.boot-title.done { color: var(--c-join); -webkit-text-stroke-color: #0b3d17; }
.boot-numbers { font: 700 14px/1 ui-monospace, Consolas, monospace; color: #e7ecff; text-shadow: 0 2px 0 #000; white-space: nowrap; }
.boot-note { margin: 0; color: #dfe6ff; text-shadow: 0 2px 0 #000; min-height: 1.4em; }
.bar { height: 18px; padding: 3px; border-radius: 4px; background: #0a0d33; box-shadow: 0 0 0 2px var(--line), 0 0 0 4px #dfe3ff, 0 8px 16px rgba(0, 0, 0, .5); transform: skewX(var(--skew)); overflow: hidden; }
.bar-fill {
  width: 0; height: 100%; border-radius: 2px; transition: width .25s;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .25) 0 10px, transparent 10px 22px), linear-gradient(90deg, #ff3b1e, var(--yellow));
  background-size: 44px 100%, 100% 100%; animation: stripes .8s linear infinite;
}
.bar.indeterminate .bar-fill { width: 100% !important; opacity: .55; }
@keyframes stripes { to { background-position: 44px 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .bar-fill { animation: none; } }

/* ---- start screen: logo over a menu column and its description ---- */
#front { display: grid; grid-template-rows: 1fr auto; }
.front {
  position: relative; z-index: 1; align-self: center; justify-self: center; width: min(980px, 100%); padding: 16px 24px;
  display: grid; grid-template-columns: minmax(280px, 380px) 1fr; grid-template-areas: "logo logo" "menu desc" "lobby lobby"; gap: 22px 40px; align-items: start;
}
#front.busy .front .menu, #front.busy .desc, #front.busy .hints { display: none; }
.front .logo { grid-area: logo; margin-bottom: 6px; }
.front .menu { grid-area: menu; }
/* the arcade's EXIT link (handoff.css): out of the grid so it doesn't take a cell, pinned top-left of the start screen */
#front .blb-exit { position: absolute; top: 12px; left: 14px; margin: 0; z-index: 2; }
.desc { grid-area: desc; align-self: center; }
.desc p { position: relative; isolation: isolate; margin: 0; padding: 16px 26px; min-height: 5.6em; color: #10142e; font-weight: 600; }
.desc p::before {
  content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(var(--skew));
  background: linear-gradient(#f6f8ff, #c8cee4 55%, #9aa2c0); border-left: 6px solid var(--yellow);
  box-shadow: 0 0 0 2px var(--line), 0 10px 22px rgba(0, 0, 0, .45);
}

/* ---- menus: slanted chrome bars, one column ---- */
.menu { display: grid; gap: 8px; width: 100%; }
.menu-head { margin: 8px 0 0 6px; font: 800 11px/1 system-ui, sans-serif; letter-spacing: .3em; text-transform: uppercase; color: #bcd0ff; text-shadow: 0 1px 0 #000; }
.menu-head:first-child { margin-top: 0; }
.item {
  --c: #ffffff;
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 18px 0 22px;
  border: 0; border-radius: 3px; cursor: pointer; text-align: left;
  background: linear-gradient(#eef1fb, var(--chrome) 55%, var(--chrome-lo));
  box-shadow: 0 0 0 2px #2a2d5c, 0 6px 12px rgba(0, 0, 0, .4), inset 6px 0 0 var(--c);
  transform: skewX(var(--skew)); transition: transform .12s ease-out, background .12s, box-shadow .12s;
}
.item > * { transform: skewX(calc(-1 * var(--skew))); }
.item span {
  font: var(--heavy); font-size: 19px; text-transform: uppercase; letter-spacing: .02em; color: var(--c);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--ink); white-space: nowrap;
}
.item:hover:not(:disabled), .item:focus-visible, .item:focus-within {
  outline: none; transform: skewX(var(--skew)) translateX(10px);
  background: linear-gradient(#fffbe0, var(--yellow) 55%, #ff9b0f);
  box-shadow: 0 0 0 2px #fff, 0 0 18px 4px rgba(255, 226, 58, .55), 0 6px 12px rgba(0, 0, 0, .4), inset 6px 0 0 var(--red);
}
.item:hover:not(:disabled) span, .item:focus-visible span, .item:focus-within span { color: #fff; }
.item:active:not(:disabled) { transform: skewX(var(--skew)) translateX(10px) translateY(2px); }
.item:disabled { filter: grayscale(.8) brightness(.75); cursor: default; }
.item.small span { font-size: 15px; }
.name-row {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px 0 22px; border-radius: 3px;
  background: linear-gradient(#eef1fb, var(--chrome) 55%, var(--chrome-lo));
  box-shadow: 0 0 0 2px #2a2d5c, 0 6px 12px rgba(0, 0, 0, .4), inset 6px 0 0 var(--yellow);
  transform: skewX(var(--skew));
}
.name-row > * { transform: skewX(calc(-1 * var(--skew))); }
.name-row span { font: var(--heavy); font-size: 15px; text-transform: uppercase; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; white-space: nowrap; }
.name-row input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 2px solid var(--line); border-radius: 3px;
  background: #060a2a; color: var(--yellow); caret-color: var(--yellow);
  font: 800 16px/1 ui-monospace, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase;
}
.name-row input::placeholder { color: #3b4378; }
.name-row:focus-within { box-shadow: 0 0 0 2px #fff, 0 0 18px 4px rgba(255, 226, 58, .55), 0 6px 12px rgba(0, 0, 0, .4), inset 6px 0 0 var(--red); }
.name-row input:focus { outline: 2px solid var(--yellow); outline-offset: 1px; }
.item-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.c-host { --c: var(--c-host); } .c-join { --c: var(--c-join); } .c-arcade { --c: var(--c-arcade); }
.c-training { --c: var(--c-training); } .c-versus { --c: var(--c-versus); } .c-menu { --c: var(--c-menu); }
/* join panel: one big code box */
.code-label { justify-self: center; color: var(--dim); font-size: 12px; letter-spacing: .25em; text-transform: uppercase; }
#code {
  justify-self: center; width: 7.2em; height: 64px; padding: 0 0 0 .3em; border: 2px solid var(--line); border-radius: 4px;
  background: #060a2a; color: var(--yellow); caret-color: var(--yellow);
  font: 900 40px/1 ui-monospace, Consolas, monospace; letter-spacing: .3em; text-align: center; text-transform: uppercase;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, .6);
}
#code::placeholder { color: #3b4378; }
#code:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
#code.shake { animation: shake .3s; border-color: #ff5a6a; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.btn-row { display: flex; gap: 12px; justify-content: center; }
.btn-row .btn { min-width: 120px; }

.hints { position: relative; z-index: 1; display: flex; justify-content: center; gap: 22px; padding: 10px; color: #c8d4ff; font-size: 13px; text-shadow: 0 1px 0 #000; }
.hints span { display: flex; gap: 4px; align-items: center; }

/* ---- cards and panels ---- */
.card, .panel {
  position: relative; z-index: 1; display: grid; gap: 16px; justify-items: center; padding: 24px 30px; border-radius: 6px;
  background: var(--panel); box-shadow: 0 0 0 2px var(--line), 0 0 0 4px #dfe3ff, 0 18px 44px rgba(0, 0, 0, .6);
}
.panel { width: min(380px, 100%); justify-items: stretch; }
.panel.wide { width: min(620px, 100%); }
.lobby { grid-area: lobby; justify-self: center; width: min(520px, 100%); }
.card-title, .panel-title {
  margin: 0; justify-self: center; font: var(--heavy); font-style: italic; font-size: 28px; text-transform: uppercase;
  color: var(--yellow); -webkit-text-stroke: 2px var(--red); paint-order: stroke fill; filter: drop-shadow(0 3px 0 #2a0008);
}
.panel-note { margin: 0; color: var(--dim); font-size: 13px; text-align: center; }
.panel .menu { gap: 10px; padding: 0 10px; }
.btn {
  min-height: 38px; padding: 0 18px; border: 0; border-radius: 3px; cursor: pointer; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(#f4f6ff, var(--chrome) 60%, var(--chrome-lo)); color: var(--ink); box-shadow: 0 0 0 2px #2a2d5c;
}
.btn.primary { justify-self: center; min-width: 140px; background: linear-gradient(#fffbe0, var(--yellow) 55%, #ff9b0f); }
.btn.ghost { background: transparent; color: #dfe6ff; box-shadow: 0 0 0 2px var(--line); }
.btn:hover, .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* lobby */
.lobby-code { display: grid; grid-template-columns: auto auto; gap: 6px 14px; align-items: center; justify-items: center; }
.lobby-label { grid-column: 1 / -1; color: var(--dim); font-size: 12px; letter-spacing: .25em; text-transform: uppercase; }
#lobby-code { font: 900 46px/1 ui-monospace, Consolas, monospace; letter-spacing: .16em; color: var(--yellow); -webkit-text-stroke: 2px var(--red); paint-order: stroke fill; }
.lobby-status { margin: 0; display: flex; gap: 10px; align-items: center; color: #dfe6ff; text-align: center; }
.spinner { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: var(--yellow); animation: spin .8s linear infinite; }
.lobby.error .spinner { display: none; }
.lobby.error #status { color: #ffb4b4; }

/* pause menu volume */
.volume-quick { display: grid; grid-template-columns: auto 1fr 3em; gap: 12px; align-items: center; padding: 4px 10px 0; color: var(--dim); font-size: 13px; }
output { font: 700 13px/1 ui-monospace, Consolas, monospace; color: #fff; text-align: right; }

/* settings rows */
.rows { display: grid; gap: 4px; }
.row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; align-items: center; min-height: 44px; padding: 4px 10px; border-radius: 3px; }
.row:focus-within { background: rgba(255, 255, 255, .06); }
.row > label, .row-label { font-weight: 700; }
.row-note { margin: -2px 10px 6px; color: var(--dim); font-size: 12px; }
.ctl { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.ctl-range { display: grid; grid-template-columns: 1fr 3em; }
.ctl-buttons { flex-wrap: wrap; }
select { min-height: 34px; width: 100%; padding: 0 10px; border: 2px solid var(--line); border-radius: 3px; background: #0d1036; }
input[type="text"] { min-height: 34px; width: 100%; padding: 0 10px; border: 2px solid var(--line); border-radius: 3px; background: #0d1036;
  text-transform: uppercase; letter-spacing: .06em; }
select:focus-visible, input:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
input[type=range] { width: 100%; accent-color: var(--yellow); }
.toggle { appearance: none; -webkit-appearance: none; position: relative; width: 48px; height: 26px; margin: 0; border-radius: 999px; background: #2a2f63; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: #dfe3ff; transition: transform .15s; }
.toggle:checked { background: #1f9d44; }
.toggle:checked::after { transform: translateX(22px); }

/* controls */
.hitbox { display: flex; gap: 34px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.hb-left, .hb-right { display: grid; gap: 8px; justify-items: center; }
.hb-row { display: flex; gap: 8px; }
.hitbox small { color: var(--dim); font-size: 12px; text-align: center; }
kbd {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #fff, #c3cbe0 60%, #7c84a3); color: var(--ink);
  box-shadow: 0 0 0 2px #4b4f86, 0 4px 0 #23264d; font: 900 14px/1 system-ui, sans-serif;
}
kbd.wide { border-radius: 999px; min-width: 140px; }
.lp { --k: #ffe76a; } .hp { --k: #ff7a7a; } .lk { --k: #86d4ff; } .hk { --k: #7affb0; } .a1, .a2 { --k: #e39bff; } .m { --k: #c3cbe0; }
kbd.lp, kbd.hp, kbd.lk, kbd.hk, kbd.a1, kbd.a2 { background: radial-gradient(circle at 50% 30%, #fff, var(--k) 60%, #555b80); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin: 4px 0 0; font-size: 12px; color: #dfe6ff; }
.legend div { display: flex; gap: 6px; align-items: center; }
.legend dt { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--k); color: var(--ink); font-weight: 900; font-size: 11px; }
.legend dd { margin: 0; }
.hints kbd, .panel-note kbd { min-width: 24px; height: 22px; padding: 0 6px; border-radius: 4px; font-size: 11px; box-shadow: 0 0 0 1px #4b4f86, 0 2px 0 #23264d; }

/* ---- in-game readouts ---- */
#stats, #net-hud {
  position: absolute; z-index: 4; left: 8px; padding: 3px 8px; border-radius: 3px; pointer-events: none;
  font: 12px/1.35 ui-monospace, Consolas, monospace; color: #cfe; background: rgba(0, 0, 0, .6);
}
#stats { top: 8px; }
#stats.slow { color: #ffd38a; }
#net-hud { bottom: 8px; }
#net-hud:empty { display: none; }
#net-hud.bad { color: #fbb; background: rgba(90, 0, 0, .75); }
#toast {
  position: absolute; z-index: 6; left: 50%; top: 16px; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 32px));
  padding: 10px 16px; border-radius: 4px; background: rgba(12, 16, 52, .95); box-shadow: 0 0 0 2px var(--line), 0 10px 24px rgba(0, 0, 0, .5);
  color: #fff; font-size: 14px; animation: drop .2s ease-out;
  display: flex; gap: 14px; align-items: center;
}
#toast[hidden] { display: none; }
#toast .btn { flex: none; min-height: 30px; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ---- narrow screens: one column ---- */
@media (max-width: 760px) {
  .front { grid-template-columns: 1fr; grid-template-areas: "logo" "menu" "desc" "lobby"; gap: 14px; padding: 56px 16px 12px; }
  .front .menu { max-width: 420px; justify-self: center; }
  .desc { display: none; }
  .hints { display: none; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .ctl { justify-content: stretch; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .front { gap: 10px 40px; }
  .logo-marvel { font-size: 56px; } .logo-capcom { font-size: 42px; } .logo-vs { font-size: 34px; } .logo-two { font-size: 130px; }
  .item { min-height: 38px; } .item span { font-size: 16px; }
}

/* ---- King of the Hill lobby: the match takes the window, the panel on the right is the line-up ---- */
body.koth { --k-side: clamp(250px, 22vw, 340px); }
body.koth.k-hidden { --k-side: 0px; }
body.koth #stage { grid-template-columns: minmax(0, 1fr) var(--k-side); }
body.koth #canvas { width: min(calc(100vw - var(--k-side)), calc(100vh * 4 / 3)); height: min(100vh, calc((100vw - var(--k-side)) * 3 / 4)); }
body.koth.size-stretch #canvas { width: calc(100vw - var(--k-side)); height: 100vh; }
body.koth.size-integer #canvas { width: var(--int-w, 640px); height: var(--int-h, 480px); }
#koth {
  align-self: stretch; justify-self: stretch; min-width: 0; overflow-y: auto; padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, #0a1050, #060826 60%, #04051a); border-left: 3px solid var(--line);
}
body.k-hidden #koth { display: none; }
.k-float { position: fixed; top: 8px; right: 8px; z-index: 20; display: none; gap: 6px; opacity: .55; }
.k-float:hover, .k-float:focus-within { opacity: 1; }
body.koth.k-hidden .k-float { display: flex; }
.k-float .btn { min-height: 28px; padding: 0 10px; font-size: 13px; }
.k-code { display: flex; align-items: center; gap: 8px; }
.k-label { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.k-code strong { font: var(--heavy); font-size: 22px; letter-spacing: .14em; color: var(--yellow); }
.k-code .btn { margin-left: auto; min-height: 28px; padding: 0 10px; font-size: 13px; }
.k-live { margin: 0; font-size: 11px; letter-spacing: .16em; color: var(--dim); }
.k-live.on { color: #ff6b6b; }
.k-live.on::before { content: "● "; }
.k-card {
  position: relative; display: grid; gap: 2px; padding: 10px 12px 10px 16px; border-radius: 4px;
  background: linear-gradient(#eef1fb, var(--chrome) 55%, var(--chrome-lo)); color: var(--ink);
  box-shadow: 0 0 0 2px #2a2d5c, 0 6px 12px rgba(0, 0, 0, .4); overflow: hidden;
}
.k-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--yellow); }
.k-card.chal::before { background: var(--c-training); }
.k-card.chal.pending { opacity: .65; }
.k-card.me { box-shadow: 0 0 0 2px #2a2d5c, 0 0 0 5px var(--c-join), 0 6px 12px rgba(0, 0, 0, .4); }
.k-tag { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #3a3f78; }
.king .k-tag::before { content: "♛ "; color: #b87300; }
.k-name { font: var(--heavy); font-size: 22px; text-transform: uppercase; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-sub { font-size: 12px; color: #3a3f78; min-height: 1.2em; }
.k-vs { align-self: center; font: var(--heavy); font-style: italic; font-size: 18px; color: var(--magenta); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.k-me { margin: 2px 0 0; min-height: 1.4em; font-size: 14px; color: var(--c-join); }
.k-h { margin: 6px 0 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
#k-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#k-queue li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: baseline;
  padding: 6px 10px; border-radius: 3px; background: rgba(255, 255, 255, .07); box-shadow: inset 3px 0 0 var(--line);
}
#k-queue li:first-child { background: rgba(43, 227, 255, .12); box-shadow: inset 3px 0 0 var(--c-versus); }
#k-queue li.me { box-shadow: inset 3px 0 0 var(--c-join); outline: 1px solid var(--c-join); }
.k-n { font-weight: 800; color: var(--dim); text-align: right; }
.k-qname { font-weight: 700; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-rec { font-size: 12px; color: var(--dim); }
.k-empty { margin: 0; color: var(--dim); font-size: 13px; }
.k-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.k-actions .btn { min-height: 32px; padding: 0 12px; font-size: 13px; }

/* messages over the match picture (not over the panel) */
.k-overlay {
  position: absolute; z-index: 4; left: 0; top: 0; bottom: 0; right: var(--k-side, 0px); display: grid; place-content: center; gap: 8px; text-align: center;
  pointer-events: none; background: rgba(3, 5, 22, .55); padding: 16px;
}
.k-overlay strong { font: var(--heavy); font-style: italic; font-size: clamp(22px, 4vw, 40px); text-transform: uppercase; color: var(--yellow); -webkit-text-stroke: 3px var(--red); paint-order: stroke fill; }
.k-overlay span { color: #fff; font-size: 16px; text-shadow: 0 2px 4px #000; }
.k-overlay.k-banner { z-index: 5; place-content: center; background: transparent; animation: drop .25s ease-out; }
.k-banner strong { font-size: clamp(28px, 6vw, 64px); }
@media (max-width: 720px) {
  body.koth #stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: start; }
  body.koth #canvas { width: 100vw; height: calc(100vw * 3 / 4); }
  #koth { border-left: 0; border-top: 3px solid var(--line); }
  .k-overlay { right: 0; bottom: auto; height: calc(100vw * 3 / 4); }
}

/* the start menu has two more rows (lobby + direct versus): tighten it on shorter windows so Settings / Controls stay on screen */
@media (max-height: 940px) and (min-width: 761px) {
  .menu { gap: 5px; }
  .menu-head { margin-top: 5px; }
  .item, .name-row { min-height: 38px; }
  .item span { font-size: 16px; }
  .front { gap: 8px 40px; padding-top: 10px; padding-bottom: 10px; }
}
@media (max-height: 820px) and (min-width: 761px) {
  .logo-marvel { font-size: 56px; } .logo-capcom { font-size: 42px; } .logo-vs { font-size: 34px; } .logo-two { font-size: 130px; }
}

/* ---- random-sets lobby: the panel lists the ongoing matches (hover shows more, click watches) ---- */
#k-sets { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#k-sets[hidden] { display: none; }
#s-round { color: var(--c-versus); }
#s-round::before { content: none; }
#s-sit { align-self: flex-start; min-height: 30px; padding: 0 12px; font-size: 13px; }
#s-sit.on { background: linear-gradient(#fffbe0, var(--yellow) 55%, #ff9b0f); }
#s-matches, .s-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.s-card {
  position: relative; display: grid; gap: 3px; width: 100%; padding: 8px 10px 8px 14px; text-align: left; cursor: pointer;
  border: 0; border-radius: 4px; color: var(--ink); overflow: hidden;
  background: linear-gradient(#eef1fb, var(--chrome) 55%, var(--chrome-lo));
  box-shadow: 0 0 0 2px #2a2d5c, 0 4px 8px rgba(0, 0, 0, .35); transition: transform .12s ease-out, box-shadow .12s;
}
.s-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c-training); }
.s-card:hover:not(:disabled), .s-card:focus-visible { outline: none; transform: translateX(4px); box-shadow: 0 0 0 2px #2a2d5c, 0 0 0 4px var(--yellow), 0 6px 12px rgba(0, 0, 0, .45); }
.s-card:disabled { cursor: default; opacity: .8; }
.s-card.me { box-shadow: 0 0 0 2px #2a2d5c, 0 0 0 5px var(--c-join), 0 4px 8px rgba(0, 0, 0, .35); opacity: 1; }
.s-card.me::before { background: var(--c-join); }
.s-card.watching { box-shadow: 0 0 0 2px #2a2d5c, 0 0 0 5px var(--yellow), 0 4px 8px rgba(0, 0, 0, .35); }
.s-card.watching::before { background: var(--yellow); }
.s-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.s-names { font: var(--heavy); font-size: 14px; line-height: 1.15; text-transform: uppercase; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.s-score { font: var(--heavy); font-size: 18px; color: #1a2a9a; flex: none; }
.s-mid { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: #3a3f78; }
.s-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.s-tag { font-weight: 800; letter-spacing: .08em; color: #0a6a24; }
.s-card.watching .s-tag { color: #8a5a00; }
/* the extra line only shows on hover / focus: it never moves the other cards */
.s-detail { display: none; font-size: 12px; font-weight: 700; color: #1a2a9a; }
.s-card:hover .s-detail, .s-card:focus-visible .s-detail { display: block; }
.s-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 5px 10px; border-radius: 3px; background: rgba(255, 255, 255, .07); box-shadow: inset 3px 0 0 var(--line); }
.s-list li.me { box-shadow: inset 3px 0 0 var(--c-join); }
body.sets #koth { gap: 6px; }
