@font-face { font-family: 'Russo One'; src: url(fonts/russo-one.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Bebas Neue'; src: url(fonts/bebas-neue.woff2) format('woff2'); font-display: swap; }
:root {
  --display: 'Russo One', system-ui, sans-serif;
  --numbers: 'Bebas Neue', 'Russo One', system-ui, sans-serif;
  --bg: #111214;
  --panel: #1b1d21;
  --ink: #f2f1ec;
  --muted: #9a9ca3;
  --aura: #ff2a3d;
  --red: #ff2a3d;
  --red-deep: #8e0d1a;
  --steel-hi: #eef0f3;
  --steel: #a9aeb6;
  --steel-lo: #4b5058;
  --aura-soft: rgba(255, 42, 61, 0.18);
  --line: rgba(255, 255, 255, 0.14);
  --stage: #f1f0ec;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: none;              /* no pinch / double-tap zoom, no scroll */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

body.fighting { background: var(--stage); }

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
}

/* ------------------------------------------------------------------ screens */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: min(3vh, 22px);
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 40%, #1d2633 0%, var(--bg) 70%);
  z-index: 10;
}
.screen[hidden], #pad[hidden], .pause-btn[hidden], .sound-btn[hidden] { display: none; }
.screen.dim { background: rgba(10, 11, 13, 0.78); }

h1 {
  margin: 0;
  font-size: clamp(44px, 12vh, 110px);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 0.95;
  text-align: center;
}
h1 span {
  display: block;
  color: var(--aura);
  text-shadow: 0 0 18px rgba(255, 42, 61, 0.7), 0 0 42px rgba(255, 42, 61, 0.35);
}
h2 { margin: 0; font-size: clamp(22px, 6vh, 44px); font-weight: 800; letter-spacing: 0.04em; }

button {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 22px;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover, button:focus-visible { border-color: var(--aura); outline: none; }
button.big {
  font-size: clamp(18px, 4.5vh, 28px);
  padding: 14px 40px;
  background: linear-gradient(180deg, #2a3442, #1b2028);
  border-color: rgba(255, 42, 61, 0.55);
  box-shadow: 0 0 24px var(--aura-soft);
}
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
button.big.alt { background: linear-gradient(180deg, #3a2a2a, #241b1b); border-color: rgba(255, 106, 90, 0.55); box-shadow: 0 0 24px rgba(255, 106, 90, 0.15); }
.or { color: var(--muted); }
#room-code {
  font: inherit; font-size: clamp(18px, 4.5vh, 28px); font-weight: 800; letter-spacing: 0.2em;
  width: 6.2em; padding: 12px 14px; text-align: center;
  color: var(--ink); background: #0c0d10; border: 1px solid var(--line); border-radius: 10px;
  user-select: text; -webkit-user-select: text; touch-action: manipulation;
}
#room-code::placeholder { letter-spacing: 0.02em; font-weight: 600; font-size: 0.75em; }
#room-code:focus { outline: none; border-color: var(--aura); }
.status { margin: 0; min-height: 1.4em; color: var(--muted); text-align: center; font-size: clamp(14px, 3.6vh, 19px); }
.status b { color: var(--ink); font-size: 1.5em; letter-spacing: 0.15em; }
.status .err { color: #ff7a6b; }
#net-wait {
  position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 6;
  padding: 8px 16px; border-radius: 10px; background: rgba(10, 11, 13, 0.75); color: #fff; font-weight: 700;
}
#net-wait[hidden] { display: none; }
.keys { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.keys b { color: var(--ink); }
.error { color: #ff7a6b; white-space: pre-wrap; font-size: 13px; max-width: 90vw; }
body.touch .only-pc { display: none; }

/* ------------------------------------------------------------------ select grid (3 × 4) */
.grid {
  /* sized from the space the select row really has (cqw: % of .select-main, which already
     excludes the notch / safe-area padding in fullscreen), not from the whole screen (vw) */
  --cell: min(26vh, 17cqw, 175px);
  --gap: min(1.6vh, 12px);
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), var(--cell));
  grid-auto-rows: var(--cell);
  gap: var(--gap);
  /* 3 rows on screen; more fighters scroll. 2 px of slack so rounding never adds a scrollbar */
  max-height: calc(2.3 * var(--cell) + var(--gap) + 4px);
  overflow-x: hidden;            /* never sideways */
  overflow-y: auto;
  scrollbar-gutter: stable;      /* a scrollbar takes its own room, never the 4th column's */
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding-right: 2px;
}
.cell {
  position: relative;
  border-radius: 10px;
  background: var(--panel);
  border: 2px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.cell:hover:not(.cursor):not(.cursor2), .cell:focus-visible:not(.cursor):not(.cursor2) { border-color: #4a4e57; }
.cell canvas { width: 100%; height: 100%; display: block; }
.cell.empty { color: #3a3d44; font-size: calc(var(--cell) * 0.4); font-weight: 900; cursor: default; }
.cell.cursor { border-color: var(--steel-hi); box-shadow: 0 0 16px rgba(230, 234, 240, 0.45) inset; }
.cell .tag {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--steel-hi);
}
.cell.cursor2 { border-color: var(--red); box-shadow: 0 0 16px rgba(255, 42, 61, 0.5) inset; }
.cell.cursor.cursor2 { border-color: #ff9aa3; }
.cell .tag.p2 { left: auto; right: 6px; color: var(--red); }

/* ------------------------------------------------------------------ arena select: big cells, 3 across
   (the painted arenas, then the photo row: P1 left, P2 right), the buttons in one row at the bottom */
#arena { gap: min(1.6vh, 12px); padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
#arena h2 { font-size: clamp(14px, 3.6vh, 24px); }
.arena-bar { flex-wrap: nowrap; }
.arena-bar .big { min-width: 0; }
.arena-cell {
  position: relative; padding: 0; overflow: hidden;
  aspect-ratio: 16 / 9; border: 3px solid var(--line); border-radius: 12px; background: var(--panel);
}
.arena-cell canvas { width: 100%; height: 100%; display: block; }
.arena-cell .label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px;
  font-size: clamp(10px, calc(var(--aw) * 0.075), 22px); font-weight: 800; letter-spacing: 0.04em; text-align: left;
  color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}
.arena-cell.empty { color: #3a3d44; font-size: calc(var(--aw) * 0.2); font-weight: 900; cursor: default; }
.arena-cell.empty .label { color: #6b6f78; background: none; text-align: center; font-size: clamp(11px, 2.8vh, 14px); }
.arena-cell:hover:not(.cursor) { border-color: #4a4e57; }
.arena-cell.cursor { border-color: var(--red); box-shadow: 0 0 22px rgba(255, 42, 61, 0.55); }
.arena-cell.peer:not(.cursor) { border-color: var(--steel); border-style: dashed; }
.arena-cell.take { color: var(--steel-hi); font-size: calc(var(--aw) * 0.22); background: repeating-linear-gradient(135deg, #1b1d21 0 12px, #202227 12px 24px); }
.arena-cell.take .label { color: var(--red); background: none; text-align: center; }
.arena-remove { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, 0.7);
  color: #fff; font-size: 15px; line-height: 26px; text-align: center; cursor: pointer; z-index: 2; }
.arena-remove:hover { background: var(--red); }
.arena-tag { position: absolute; top: 4px; padding: 1px 7px; border-radius: 6px; font-family: var(--display); font-size: 12px; }
.arena-tag.p0 { left: 4px; background: var(--steel-hi); color: #111; }
.arena-tag.p1 { left: 52px; background: var(--red); color: #fff; }
.arena-tag[hidden] { display: none; }
.coinflip { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(5, 5, 7, 0.82); }
.cf-coin { width: min(22vh, 140px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--steel-hi), var(--steel) 45%, var(--steel-lo)); border: 6px solid var(--red); animation: cf-spin 0.25s linear infinite; }
.coinflip.done .cf-coin { animation: none; transform: scale(1.1); box-shadow: 0 0 40px rgba(255, 42, 61, 0.8); }
.cf-text { font-family: var(--display); font-size: clamp(18px, 5vh, 32px); letter-spacing: 0.06em; color: #fff; text-align: center; padding: 0 16px; }
.coinflip.done .cf-text { color: var(--red); }
@keyframes cf-spin { 50% { transform: scaleX(0.08); } }
.photo-floor { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: rgba(5, 5, 7, 0.92); }
.pf-card { width: min(920px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 8px; }
.pf-card h3 { margin: 0; font-family: var(--display); font-size: clamp(16px, 4.5vh, 24px); }
.pf-tip { margin: 0; color: var(--muted); font-size: 14px; }
.pf-stage { position: relative; touch-action: none; cursor: ns-resize; min-height: 0; }
.pf-pic { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 8px; }
.pf-line { position: absolute; left: 0; right: 0; height: 0; border-top: 4px solid var(--red); box-shadow: 0 0 12px rgba(255, 42, 61, 0.9); pointer-events: none; }
.pf-line span { position: absolute; right: 8px; top: -26px; padding: 2px 8px; border-radius: 6px; background: var(--red); color: #fff; font-family: var(--display); font-size: 13px; }
.pf-bar { display: flex; justify-content: flex-end; gap: 12px; }
.arena-name { font-weight: 800; font-size: clamp(16px, 4.4vh, 26px); letter-spacing: 0.08em; min-height: 1.3em; }
#btn-arena-go { padding: 8px 34px; font-size: clamp(16px, 4vh, 24px); }

/* the two big previews: P1 on the left, P2 on the right */
.select-main { container-type: inline-size; display: flex; align-items: stretch; justify-content: safe center; gap: min(2.4cqw, 22px); width: 100%; min-width: 0; }
.side {
  position: relative;
  flex: 0 1 min(26vw, 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 85%, rgba(255, 42, 61, 0.22), transparent 70%);
  min-width: 0;
}
#side-1 { background: radial-gradient(ellipse at 50% 85%, rgba(255, 106, 90, 0.2), transparent 70%); }
.side canvas { width: 100%; flex: 1 1 0; min-height: 0; object-fit: contain; display: block; }
.side-who { position: absolute; top: 2px; left: 10px; font-weight: 900; font-size: clamp(14px, 3.6vh, 22px); color: var(--aura); }
#side-1 .side-who { left: auto; right: 10px; color: #ff6a5a; }
.side-share { position: absolute; top: 0; right: 8px; padding: 4px 10px; font-size: clamp(12px, 3vh, 15px); line-height: 1.1; }
#side-1 .side-share { right: auto; left: 8px; }
.side-share.done { border-color: #6ee07a; color: #c9f5ce; }
.side-name { font-weight: 800; font-size: clamp(14px, 4vh, 24px); letter-spacing: 0.06em; min-height: 1.3em; text-align: center; }
.side.locked .side-name::after { content: " ✓"; color: #6ee07a; }
.side .ready { margin-top: 6px; min-width: 9em; padding: 8px 18px; font-size: clamp(14px, 3.6vh, 20px); }
.side.turn .ready:not(:disabled) { border-color: var(--aura); box-shadow: 0 0 16px var(--aura-soft); }
#side-1.turn .ready:not(:disabled) { border-color: #ff6a5a; box-shadow: 0 0 16px rgba(255, 106, 90, 0.25); }
.side .ready.on { background: rgba(110, 224, 122, 0.18); border-color: #6ee07a; color: #c9f5ce; }
.side .ready:disabled { cursor: default; opacity: 0.6; }
.side .ready.on:disabled { opacity: 1; }
.cell .tag.ok::after { content: " ✓"; color: #6ee07a; }
#btn-fight { padding: 8px 30px; font-size: clamp(16px, 4vh, 24px); }
.select-bar { display: flex; align-items: center; gap: 18px; min-height: 40px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 8px 16px; }
.seg button.on { background: rgba(255, 42, 61, 0.22); color: var(--ink); }
.seg.locked button { cursor: default; }
.seg.locked button:not(.on) { opacity: 0.45; }

/* ------------------------------------------------------------------ pause button */
.pause-btn {
  position: fixed;
  bottom: max(8px, env(safe-area-inset-bottom));   /* bottom center: free on phones (pads left and right), away from the HUD */
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 6px 12px;
  font-size: 16px;
  color: #333;
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------------------------ touch pads */
#pad {
  position: fixed;
  inset: auto 0 0 0;
  height: 0;
  z-index: 4;
}
.dpad {
  --s: min(38vh, 190px);
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: var(--s);
  height: var(--s);
  display: grid;
  grid-template: 1fr 1fr 1fr / 1fr 1fr 1fr;
  touch-action: none;
}
.dpad .arrow, .dpad .hub {
  background: rgba(30, 30, 34, 0.32);
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.dpad .arrow.on { background: rgba(255, 42, 61, 0.75); }
.dpad .up    { grid-area: 1 / 2; border-radius: 8px 8px 0 0; }
.dpad .left  { grid-area: 2 / 1; border-radius: 8px 0 0 8px; }
.dpad .hub   { grid-area: 2 / 2; border-radius: 0; }
.dpad .right { grid-area: 2 / 3; border-radius: 0 8px 8px 0; }
.dpad .down  { grid-area: 3 / 2; border-radius: 0 0 8px 8px; }
.dpad .arrow::after {
  content: "";
  display: block;
  margin: 35% auto 0;
  width: 0;
  height: 0;
  border: calc(var(--s) * 0.05) solid transparent;
}
.dpad .up::after    { border-bottom-color: rgba(255, 255, 255, 0.85); margin-top: 20%; }
.dpad .down::after  { border-top-color: rgba(255, 255, 255, 0.85); margin-top: 45%; }
.dpad .left::after  { border-right-color: rgba(255, 255, 255, 0.85); margin-left: 15%; }
.dpad .right::after { border-left-color: rgba(255, 255, 255, 0.85); margin-left: 45%; }

.btns {
  --s: min(40vh, 200px);
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: var(--s);
  height: var(--s);
  display: grid;
  grid-template: 1fr 1fr 1fr / 1fr 1fr 1fr;
}
.btns button {
  border-radius: 50%;
  padding: 0;
  font-size: calc(var(--s) * 0.13);
  font-weight: 900;
  color: #fff;
  background: rgba(30, 30, 34, 0.38);
  border: 2px solid rgba(0, 0, 0, 0.25);
  touch-action: none;
}
.btns button.on { background: rgba(255, 42, 61, 0.8); transform: scale(0.94); }
.btns .b-aura  { grid-area: 1 / 2; border-color: rgba(255, 42, 61, 0.8); }
.btns .b-punch { grid-area: 2 / 1; }
.btns .b-kick  { grid-area: 2 / 3; }
.btns .b-def   { grid-area: 3 / 2; }
.btns .b-throw { grid-area: 1 / 3; translate: 0 -100%; }   /* on the S-P-A diagonal, above K */
.btns .b-sig   { grid-area: 3 / 1; translate: -100% 0; border-color: #ffd23a; color: #ffd23a; background: rgba(60, 40, 0, 0.55); box-shadow: 0 0 18px rgba(255, 210, 58, 0.7); animation: sig-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both, sig-glow 1.2s 0.35s ease-in-out infinite; }
.btns .b-sig[hidden] { display: none; }
@keyframes sig-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes sig-glow { 50% { box-shadow: 0 0 30px rgba(255, 210, 58, 1); } }

/* ------------------------------------------------------------------ rotate overlay */
#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  color: var(--ink);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-weight: 700;
}
#rotate .phone {
  width: 50px;
  height: 86px;
  border: 4px solid var(--aura);
  border-radius: 10px;
  animation: turn 1.8s ease-in-out infinite;
}
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: flex; }
}

/* sound toggle, top-right corner */
.sound-btn {
  position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 20;
  width: 44px; height: 44px; padding: 0; line-height: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(20, 22, 26, 0.7);
}

/* sound settings panel (an overlay: the screen under it keeps running) */
.settings-panel {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: rgba(8, 9, 11, 0.72); padding: 16px;
}
.settings-panel[hidden] { display: none; }
.settings-box {
  display: flex; flex-direction: column; gap: min(2.4vh, 16px); align-items: stretch;
  width: min(460px, 100%); max-height: 100%; overflow: auto;
  padding: min(3vh, 22px) 24px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
}
.settings-box h2 { text-align: center; font-size: clamp(20px, 5vh, 32px); }
.set-row { display: grid; grid-template-columns: 5.2em 1fr 3.2em; align-items: center; gap: 12px; font-weight: 700; }
.set-row .seg { grid-column: 2 / 4; justify-self: start; }
.set-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.set-row input[type=range] { width: 100%; accent-color: var(--aura); touch-action: manipulation; height: 28px; }
#btn-settings-done { align-self: center; padding: 8px 40px; }

/* ------------------------------------------------------------------ menu look */
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 9; display: block; }
#fx[hidden] { display: none; }
.screen.fxbg { background: transparent; }
h1, h2, button, .side-name, .side-who, .arena-name, .status b, #result-text { font-family: var(--display); }
h1 {
  font-style: italic; font-weight: 400; letter-spacing: 0.04em; line-height: 0.9;
  font-size: clamp(54px, 17vh, 150px);
  will-change: transform;                        /* the shake is a GPU transform: no repaint */
  color: #f4f6fb;
  text-shadow: 0 4px 0 #120406, 0 0 30px rgba(255, 42, 61, 0.35);
}
#title h1 { font-size: clamp(48px, 15vh, 132px); }
h1 .t1, h1 .t2 { display: block; }
/* FRIENDS: brushed steel; FIGHT: hot red. The big initial Fs get a gray metal rim */
h1 .t1 {
  background: linear-gradient(180deg, #ffffff 0%, #dfe2e7 40%, #9aa0a9 62%, #e9ecef 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #120406) drop-shadow(0 0 18px rgba(255, 42, 61, 0.35));
  text-shadow: none;
}
h1 .t2 {
  color: #ff2a3d;
  background: linear-gradient(180deg, #ffd0d4 0%, #ff5a66 35%, #ff1a2e 62%, #8e0d1a 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 42, 61, 0.85)) drop-shadow(0 4px 0 #120406);
  text-shadow: none;
}
h1 .cap {
  display: inline-block; font-size: 1.32em; line-height: 0.8; margin-right: 0.02em;
  -webkit-text-stroke: 0.045em #b7bcc4;          /* the metal rim */
  paint-order: stroke fill;
}
h1 .t2 .cap { -webkit-text-stroke-color: #c9cdd3; }
#title { gap: min(3vh, 22px); }
#title button.big { width: min(430px, 72vw); }  /* the menu entries all the same length */
button.big {
  font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em;
  border: 0; border-radius: 4px;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  background: linear-gradient(180deg, #ff3b4c, #b3101f);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.3);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  transition: filter 0.12s, transform 0.12s;
}
button.big:hover, button.big:focus-visible { filter: brightness(1.18); transform: translateY(-2px); }
button.big:active { transform: translateY(1px) scale(0.98); }
button.big.alt { background: linear-gradient(180deg, #c3c8cf, #6d737c); color: #111; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
button.big:disabled { filter: grayscale(0.7) brightness(0.7); }
.gate-icon { width: min(26vh, 160px); filter: drop-shadow(0 0 30px rgba(255, 42, 61, 0.7)); animation: gate-pulse 1.1s ease-in-out infinite; }
.gate-wait { margin: 0; font-family: var(--display); font-size: clamp(16px, 4vh, 24px); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
#gate:not(.loading) .gate-wait, #gate.loading .gate-text, #gate.failed .gate-wait { display: none; }
#title.arming { pointer-events: none; }
.gate-text { margin: 0; font-family: var(--display); font-size: clamp(18px, 5vh, 30px); letter-spacing: 0.12em; text-transform: uppercase; color: #ffe3e5; animation: gate-blink 1.1s ease-in-out infinite; }
body:not(.touch) .only-touch, body.touch .gate-text .only-pc { display: none; }
@keyframes gate-pulse { 50% { transform: scale(1.08); filter: drop-shadow(0 0 50px rgba(255, 42, 61, 1)); } }
@keyframes gate-blink { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .gate-icon, .gate-text { animation: none; } }

/* title entrance: after 0.4 s, from a dot at the centre it blows up past full size, as if about to
   smash the screen, and settles back to normal, all in 0.2 s; the shake starts as it lands
   (menufx burst). The inner .t-zoom is animated: the h1 itself is moved by the shake. */
h1 .t-zoom { display: block; transform-origin: 50% 50%; }
h1.enter .t-zoom { animation: smash 0.2s 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) both; }   /* waits 0.4 s, then 0.2 s */
/* the menu circles come in with the title; meanwhile black edges close in, like a camera
   focusing, and open as the title lands */
#title.enter #home-row { animation: smash 0.2s 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
#title::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 48%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.92) 78%, #000 100%); }
#title.enter::after { animation: focus 0.55s ease-in both; }
@keyframes focus { 0%, 72% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #title.enter #home-row, #title.enter::after { animation: none; } }
@keyframes smash {
  0% { transform: scale(0.02); opacity: 0; }
  10% { opacity: 1; }
  60% { transform: scale(1.5); }
  85% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { h1.enter .t-zoom { animation: none; } }

/* ------------------------------------------------------------------ create fighter (src/ui/creator.js) */
button.big.create { background: linear-gradient(180deg, #3a3e45, #1c1e22); box-shadow: inset 0 0 0 2px var(--red), inset 0 2px 0 rgba(255, 255, 255, 0.2); }
#btn-add-fighter { border-color: rgba(110, 224, 122, 0.6); }
.cell.custom::after { content: "★"; position: absolute; right: 6px; bottom: 2px; color: #6ee07a; font-size: 14px; }
.creator { justify-content: stretch; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.cr-view { display: flex; flex-direction: column; align-items: center; gap: min(2vh, 12px); width: 100%; height: 100%; min-height: 0; }
.cr-view[hidden] { display: none; }
.cr-head { display: flex; align-items: baseline; gap: 18px; padding-right: 56px; }
.cr-head h2 { font-size: clamp(20px, 5.4vh, 34px); }
.cr-count { color: var(--muted); font-weight: 700; }
.cr-banner { color: #ffcf6b; background: rgba(255, 190, 60, 0.1); border: 1px solid rgba(255, 190, 60, 0.4); border-radius: 10px; padding: 6px 12px; font-size: 14px; max-width: 100%; }
.cr-grid {
  --c: clamp(72px, 21vh, 132px);    /* 8 × 3 cards fit a landscape phone without scrolling */
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--c), 1fr)); grid-auto-rows: auto;
  gap: 8px; overflow-y: auto; touch-action: pan-y; align-content: start; padding: 2px;
}
.cr-card { height: var(--c); position: relative; padding: 0; display: flex; flex-direction: column; align-items: stretch; overflow: hidden; border-width: 2px; }
.cr-card canvas { flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; }
.cr-label { font-size: clamp(11px, 2.8vh, 14px); padding: 2px 4px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-state { position: absolute; top: 4px; right: 6px; font-weight: 900; color: #6ee07a; }
.cr-opt { position: absolute; top: 3px; left: 4px; right: 4px; font-size: 9px; line-height: 1.1; color: var(--muted); font-weight: 600; text-align: left; }
.cr-card.optional { border-style: dashed; }
.cr-sep { grid-column: 1 / -1; padding: 6px 2px 0; font-size: 13px; color: var(--muted); }
.cr-sep b { color: #f4f6fb; }
.cr-card.done { border-color: rgba(110, 224, 122, 0.7); }
.cr-card.bad { border-color: var(--red); }
.cr-card.bad .cr-state { color: var(--red); }
.cr-card.warn { border-color: #ffb03a; }                 /* the build passed, but this move could be better */
.cr-card.warn .cr-state { color: #ffb03a; }
.cr-banner.warn { border-color: #ffb03a; color: #ffd9a0; }
.cr-warn li.move { color: #ffd9a0; }
.cr-mine { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; font-size: 14px; }
.cr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 99px; }
.cr-x { padding: 2px 8px; border-radius: 99px; background: transparent; border: 0; color: var(--muted); }
.cr-sub { color: var(--muted); font-size: 14px; }
.cr-small { color: var(--muted); font-size: 13px; margin: 0; }
.cr-small a, .cr-consent a { color: var(--aura); }
.cr-bar { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.cr-bar button.big { padding: 8px 28px; font-size: clamp(16px, 4vh, 22px); }
.cr-bar button:disabled { opacity: 0.45; cursor: default; }
.cr-msg { color: #ffcf6b; min-height: 1.2em; font-size: 14px; text-align: center; }

/* record: the camera fills the screen, controls float on top */
.cr-record { position: fixed; inset: 0; background: #000; z-index: 1; gap: 0; }
.cr-cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.cr-cam.mirror { transform: scaleX(-1); }
.cr-frame { position: absolute; inset: 8% 22%; border: 2px dashed rgba(255, 255, 255, 0.4); border-radius: 12px; pointer-events: none; }
.cr-frame span { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 12px; color: rgba(255, 255, 255, 0.6); white-space: nowrap; }
.cr-info { position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); max-width: 46%; padding: 8px 12px; border-radius: 10px; background: rgba(10, 11, 13, 0.66); }
.cr-rtitle { font-family: var(--display); font-size: clamp(18px, 5vh, 28px); }
.cr-tip { font-size: clamp(12px, 3vh, 15px); color: #d8dadf; }
/* the example: Andrei filming the move -> the cut-out fighter the game makes of it */
.cr-guide { --h: min(30vh, 190px); position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(64px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 12px; background: rgba(10, 11, 13, 0.62); border: 1px solid var(--line); pointer-events: none; }
.cr-exbox { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cr-exbox figcaption { font-size: 11px; color: rgba(255, 255, 255, 0.65); line-height: 1.1; }
.cr-exvid { display: block; height: calc(var(--h) - 18px); width: auto; max-width: calc(var(--h) * 0.9); object-fit: contain; border-radius: 8px; background: #000; }
.cr-excut { display: block; width: calc(var(--h) - 18px); height: calc(var(--h) - 18px); }
.cr-arrow { font-size: 22px; color: var(--aura, #ff2a3d); }
.cr-guide.novid .vid, .cr-guide.novid .cr-arrow { display: none; }
.cr-level { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 99px; background: rgba(255, 196, 0, 0.92); color: #111; font-weight: 800; pointer-events: none; z-index: 2; }
.cr-setup { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: rgba(6, 7, 9, 0.9); overflow-y: auto; }
.cr-setupcard { width: min(760px, 100%); display: flex; flex-direction: column; gap: 12px; }
.cr-setupcard h3 { margin: 0; font-size: 22px; text-align: center; }
.cr-setupchoices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cr-choice { display: flex; flex-direction: column; gap: 4px; padding: 14px; text-align: left; border-radius: 12px; }
.cr-choice b { font-size: 18px; }
.cr-choice span { font-size: 13px; font-weight: 400; opacity: 0.8; }
.cr-choice.on { outline: 3px solid var(--aura, #ff2a3d); }
.cr-tips { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, 0.85); }
@media (max-height: 420px) { .cr-tips { font-size: 12px; } .cr-choice { padding: 10px; } .cr-choice b { font-size: 16px; } }
button.danger { color: #ff8080; }
.cr-big { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--numbers); font-size: 34vh; color: #fff; text-shadow: 0 0 30px rgba(255, 42, 61, 0.9); pointer-events: none; }
.cr-timebar { position: absolute; left: 0; right: 0; top: 0; height: 8px; background: rgba(255, 255, 255, 0.15); }
.cr-timebar i { display: block; height: 100%; width: 0; background: #ff4d4d; }
.cr-record.rec .cr-frame { border-color: rgba(255, 77, 77, 0.8); border-style: solid; }
.cr-cammsg { position: absolute; top: 45%; left: 10%; right: 10%; text-align: center; font-weight: 700; color: #ffcf6b; }
.cr-recbadge { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 99px; background: rgba(0, 0, 0, 0.55); color: #ff4d4d; font-weight: 800; letter-spacing: 0.05em; animation: crblink 1s steps(2, start) infinite; pointer-events: none; }
@keyframes crblink { to { opacity: 0.35; } }
.cr-turn { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(0, 0, 0, 0.82); color: #fff; font-weight: 800; text-align: center; }
.cr-turn[hidden] { display: none; }
.cr-turn .phone { width: 50px; height: 86px; border: 4px solid var(--aura); border-radius: 10px; animation: turn 1.8s ease-in-out infinite; }
/* the voice: six rows of example / record / yours */
.cr-voices { flex: 1 1 auto; min-width: 0; overflow-y: auto; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.cr-voices h3 { margin: 0 0 2px; font-size: 16px; }
.cr-voices > .cr-sub { margin: 0 0 8px; font-size: 13px; }
.cr-vrow { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.cr-vrow.done .cr-vlab b::after { content: ' ✓'; color: #6ee07a; }
.cr-vlab { flex: 1 1 auto; min-width: 84px; display: flex; flex-direction: column; font-size: 14px; }
.cr-vlab .cr-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-vbtn { padding: 5px 8px; font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
.cr-vbtn.rec { color: #ff6b6b; }
.cr-vbtn.rec.on { background: #ff4d4d; color: #fff; border-color: #ff4d4d; }
.cr-vbtn:disabled { opacity: 0.4; }
.cr-rbar { position: absolute; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 0 12px; }
.cr-rbar > button, .cr-rbar .seg { background: rgba(20, 22, 26, 0.8); }
.cr-recbtn { border-color: rgba(255, 77, 77, 0.8) !important; box-shadow: 0 0 24px rgba(255, 77, 77, 0.3) !important; }
.cr-rbar button.big { padding: 8px 30px; font-size: clamp(16px, 4vh, 22px); }

/* trim */
.cr-trimvid { flex: 1 1 0; min-height: 0; max-width: 100%; background: #000; border-radius: 10px; }
.cr-trimrow { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; font-weight: 700; }
.cr-trimrow input[type=range] { width: min(30vw, 240px); accent-color: var(--aura); vertical-align: middle; touch-action: manipulation; }
.cr-trimlabel { color: var(--muted); font-variant-numeric: tabular-nums; }

/* submit + queue */
.cr-submit, .cr-queue { justify-content: center; }
.cr-subrow { flex: 1 1 auto; min-height: 0; width: min(1000px, 100%); display: flex; gap: 20px; align-items: stretch; }
.cr-subleft { flex: 0 1 300px; min-width: 220px; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; }
.cr-subprev { width: min(30vh, 220px); height: min(30vh, 220px); border-radius: 14px; background: radial-gradient(ellipse at 50% 80%, rgba(255, 42, 61, 0.18), transparent 70%); }
.cr-subface { flex: 0 0 auto; position: relative; display: grid; place-items: center; overflow: hidden; color: #8a8f99;
  border: 2px solid var(--c, #ff2a3d); background: #15161b; box-shadow: 0 0 18px -6px var(--c, #ff2a3d); }
.cr-subface svg { width: 58%; height: 58%; }
.cr-subface img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cr-subface.has-photo svg { display: none; }
.cr-vpresets { display: flex; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.cr-vpre { padding: 6px 12px; font-size: 13px; border-radius: 999px; }
.cr-vpre.on { background: var(--red, #ff2a3d); border-color: var(--red, #ff2a3d); color: #fff; }
.cr-vrow.preset .cr-vlab b::after { content: ' ·  ready-made'; color: #8a8f99; font-weight: 400; }
.cr-form { display: flex; flex-direction: column; gap: 10px; }
.cr-name {
  font: inherit; font-family: var(--display); font-size: clamp(20px, 5vh, 30px); width: 9em; padding: 8px 12px; color: var(--ink);
  background: #0c0d10; border: 1px solid var(--line); border-radius: 10px; user-select: text; -webkit-user-select: text; touch-action: manipulation;
}
.cr-name:focus { outline: none; border-color: var(--aura); }
.cr-swatches { display: flex; gap: 8px; }
.cr-sw { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: var(--c); border: 3px solid transparent; box-shadow: 0 0 12px var(--c); }
.cr-sw.on { border-color: #fff; }
.cr-up { min-height: 1.3em; font-weight: 700; color: var(--ink); text-align: center; }
.cr-qtext { font-size: clamp(15px, 4vh, 20px); text-align: center; max-width: 640px; }
.cr-qbar { width: min(520px, 80vw); height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.cr-qbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1846c8, var(--aura)); transition: width 0.6s; }
.cr-warn { max-width: 640px; font-size: 13px; color: var(--muted); max-height: 22vh; overflow: auto; touch-action: pan-y; }
.cr-warn summary { cursor: pointer; }
.cr-consent { justify-content: center; }
.cr-consent .settings-box p { margin: 0; line-height: 1.4; }

.cr-subleft .cr-msg { font-size: 12px; text-align: center; }
.cr-subleft .cr-name { width: 100%; }

/* ------------------------------------------------------------------ home: three circles */
.home-row { display: flex; align-items: center; justify-content: center; gap: min(5vw, 46px); }
.home-btn {
  --d: min(24vh, 150px);
  width: var(--d); height: var(--d); padding: 0; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; color: #fff; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em;
  font-size: calc(var(--d) * 0.095);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3), inset 0 -5px 0 rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s, filter 0.12s;
}
.home-btn svg { width: 46%; height: 46%; }
.home-btn svg.fist { width: 60%; height: 60%; margin-top: 2%; }   /* the punch: framed tightly, bigger, centred */
.home-btn span { max-width: 84%; line-height: 1.05; text-align: center; }
.home-btn:hover, .home-btn:focus-visible { filter: brightness(1.15); transform: translateY(-3px); }
.home-btn:active { transform: scale(0.95); }
.home-btn.red { background: linear-gradient(180deg, #ff3b4c, #b3101f); }
.home-btn.steel { background: linear-gradient(180deg, #c3c8cf, #6d737c); color: #111; }
.home-btn.create {
  --d: min(31vh, 196px);
  background: radial-gradient(circle at 50% 35%, #3a3e45, #16181c);
  box-shadow: inset 0 0 0 4px var(--red), 0 0 34px rgba(255, 42, 61, 0.55), 0 8px 24px rgba(0, 0, 0, 0.5);
}
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: clamp(12px, 3vh, 15px); padding: 2px 8px; }
#title .home-row + .link-btn { margin-top: -6px; }

/* the invite lobby: on P2's side while waiting for the friend */
.invite-box { position: absolute; inset: 18% 6% auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.invite-box p { margin: 0; font-size: clamp(11px, 2.8vh, 14px); color: var(--muted); }
.invite-code { font-family: var(--display); color: #fff; font-size: clamp(14px, 3.6vh, 20px); letter-spacing: 0.08em; }
.invite-code b { color: var(--red); letter-spacing: 0.18em; }
#btn-invite { padding: 10px 18px; font-size: clamp(14px, 3.4vh, 18px); }
#invite { gap: min(2.4vh, 16px); }
#inv-title { margin: 0; font-family: var(--display); color: #fff; text-align: center; text-shadow: 0 0 18px rgba(255, 42, 61, 0.6); }
.inv-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 760px; }
.inv-actions button.big { width: min(260px, 40vw); }
.result-sub { margin: 0; color: var(--muted); font-size: clamp(13px, 3.4vh, 16px); }
.challenge-btn { border-color: var(--red); color: #fff; }
.clip-btn { border-color: #ffd23f; color: #fff; }
#clip-done[hidden], #btn-clip[hidden] { display: none; }
.ch-info { margin: 0; max-width: min(640px, 90vw); text-align: center; color: #e6e7ea; font-size: clamp(13px, 3.6vh, 17px); }

/* the pool: the default fighters in a row, "Your fighter" as one wide box under them */
.cell.own { grid-column: 1 / -1; justify-self: center; width: calc(var(--cell) * 1.3); height: calc(var(--cell) * 1.3); position: relative; border-color: rgba(255, 42, 61, 0.45); }
.cell.own canvas { width: 100%; height: 100%; }
#grid { grid-auto-rows: auto; }
.own-label { position: absolute; left: 0; right: 0; text-align: center; bottom: 4px; font-family: var(--display); font-size: clamp(11px, 2.6vh, 14px); color: var(--red); letter-spacing: 0.08em; }
.own-nav { position: absolute; top: 50%; transform: translateY(-50%); padding: 4px 6px; font-size: clamp(16px, 4vh, 24px); color: #fff; background: rgba(0, 0, 0, 0.35); border-radius: 8px; }
.own-nav.prev { left: 2px; }
.own-nav.next { right: 2px; }
.cell.create-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff;
  background: repeating-linear-gradient(135deg, #1b1d21 0 12px, #202227 12px 24px); border-style: dashed; border-color: var(--red); }
.cell.create-cell b { font-size: clamp(22px, 6vh, 38px); color: var(--red); line-height: 1; }
.cell.create-cell span { font-family: var(--display); font-size: clamp(12px, 3vh, 17px); text-transform: uppercase; }
.cell.create-cell small { color: var(--muted); font-size: clamp(10px, 2.4vh, 13px); }
#side-0 .side-who { color: var(--steel-hi); }

/* arena select: the photo slots (the last row) */
.arena-cell.photo { border-style: dashed; }

/* ------------------------------------------------------------------ creator: the moves (left) · optional (right) */
.cr-layout {
  --c: clamp(54px, min(calc((100vh - 150px) / 3.3), calc((100vw - 240px) / 5.6)), 112px);
  position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; align-items: stretch; justify-content: center; gap: min(4vw, 44px); padding: 2px;
}
.cr-must { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.cr-row { display: flex; align-items: center; gap: 8px; }
.cr-row-head { width: calc(var(--c) * 1.05); font-family: var(--display); font-size: clamp(10px, calc(var(--c) * 0.16), 15px); color: var(--red);
  text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.1; text-align: right; text-shadow: 0 0 10px rgba(255, 42, 61, 0.45); }
.cr-layout .cr-card { width: var(--c); height: var(--c); }
.cr-layout .cr-card.cr-card-lg { width: calc(var(--c) * 1.18); height: calc(var(--c) * 1.18); }
.cr-optside { position: relative; display: flex; flex-direction: column; min-width: calc(var(--c) * 1.5); }
.cr-opthalf { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.cr-optlabel { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.cr-extragrid { position: absolute; z-index: 6; right: calc(100% + 12px); bottom: 2px; padding: 8px 10px 10px;
  background: rgba(12, 13, 16, 0.97); border: 1px solid var(--red); border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7); }
.cr-extragrid[hidden] { display: none; }
.cr-extrahead { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cr-extracards { display: grid; grid-template-columns: repeat(4, var(--c)); gap: 6px; }
.cr-extra-toggle { align-items: center; justify-content: center; border-style: dashed; }
.cr-extra-toggle .cr-plus { font-size: calc(var(--c) * 0.38); line-height: 1; color: var(--red); }
.cr-extra-toggle.open { border-style: solid; border-color: var(--red); }
.cr-settings { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(5, 5, 7, 0.85); }
.cr-settings[hidden] { display: none; }
.cr-setcard { width: min(560px, 92vw); max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
  background: #16181c; border: 1px solid var(--line); border-radius: 12px; }
.cr-setcard h3 { margin: 0; font-family: var(--display); }
.cr-setcard .cr-mine { display: flex; flex-direction: column; gap: 8px; }
.cr-fighter { display: flex; align-items: center; gap: 10px; }
.cr-fighter b { flex: 0 0 auto; }
.cr-fighter .cr-sub { flex: 1 1 auto; color: var(--muted); font-size: 12px; }
.cr-fighter button { padding: 4px 10px; font-size: 13px; }
.cr-choicebar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cr-photochoice .pf-card { align-items: center; }
.cr-card.sig { border-color: rgba(255, 210, 58, 0.7); }
.cr-card.photo { border-color: rgba(230, 234, 240, 0.6); }
.cr-effects { display: flex; gap: 8px; }
.cr-eff { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; min-width: 84px; }
.cr-eff b { font-size: 20px; line-height: 1; }
.cr-eff span { font-size: 12px; }
.cr-eff.on { border-color: #ffd23a; box-shadow: 0 0 12px rgba(255, 210, 58, 0.5); }
.cr-efftip { font-size: 12px; color: var(--muted); min-height: 1.2em; }
.cr-photostage { position: relative; align-self: center; }
.cr-photostage .pf-pic { max-height: 56vh; width: auto; max-width: 100%; }
.cr-photoguide { position: absolute; left: 22%; right: 22%; top: 8%; bottom: 0; border: 3px dashed rgba(255, 255, 255, 0.75);
  border-radius: 50% 50% 18% 18% / 38% 38% 12% 12%; pointer-events: none; }
.cr-extracount { position: absolute; top: 3px; right: 6px; font-size: 11px; font-weight: 800; color: var(--muted); }
.cr-optside .cr-card .cr-label { white-space: nowrap; }
.cr-fighter { justify-content: flex-start; text-align: left; } .cr-fighter .cr-sub { text-align: left; margin: 0; }
.cr-vcredit { margin: 6px 0 0; font-size: 11px; opacity: 0.7; } .cr-vcredit a { color: inherit; }
/* name screen: the column stretches (centred content in a scrolling column gets cut on the left) */
.cr-subleft { align-items: stretch; }
.cr-subleft > .cr-subface { align-self: center; width: min(24vh, 170px); height: min(24vh, 170px); }
.cr-subleft .cr-swatches, .cr-subleft .cr-effects { flex-wrap: wrap; justify-content: center; }
.cr-subleft .cr-swatches { gap: 6px; } .cr-subleft .cr-sw { width: 34px; height: 34px; }
/* combo strings as button chips (creator style picker, pause menu) */
.combo-list { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.combo-row { display: flex; gap: 5px; align-items: flex-start; }
.combo-key { position: relative; display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px;
  background: #2a2d33; border: 1px solid #4a4f58; color: #f2f1ec; font: 700 14px/1 var(--font-ui, system-ui); }
.combo-key.ender { background: #3a2a10; border-color: #ffd23a; color: #ffd23a; margin-bottom: 12px; }
.combo-key.ender::after { content: attr(data-name); position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em; color: #c9a43a; white-space: nowrap; text-transform: uppercase; }
.cr-stylecombos { display: flex; justify-content: center; }
.cr-stylecombos .combo-list { align-items: center; }
/* pause menu: my combos */
.pause-combos { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  background: rgba(15, 16, 20, 0.7); border: 1px solid #3a3d44; }
.pause-combos .pc-head { font-weight: 800; letter-spacing: 0.04em; }
.pause-combos .pc-note { font-size: 12px; color: var(--muted); }
.pause-combos .combo-list { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
.move-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13px; }
.move-item { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.move-list .combo-key { min-width: 36px; height: 26px; font-size: 13px; }
/* select: the style under the fighter's name */
.side-name[data-style]:not([data-style=""])::after { content: attr(data-style); display: block; font-size: 0.5em; letter-spacing: 0.18em; color: #c9a43a; margin-top: 2px; }
.cr-subleft .cr-styles { flex-wrap: nowrap; gap: 6px; }
.cr-styles .cr-eff { min-width: 0; flex: 1 1 0; padding: 5px 4px; }
.cr-styles .cr-eff b { font-size: 16px; }
.cr-stylecombos .combo-key { min-width: 26px; height: 26px; font-size: 12px; }

/* ------------------------------------------------------------------ Challenge: 1v1 / round robin, the tournament, the inbox */
/* the title's rows (home, Challenge): the pressed one fades out over the select sound (--fade), the next
   fades in fast. The Challenge row keeps the home row's height, so the title doesn't move */
/* (the rows' arrivals and exits: the Impact block at the end) */
.challenge-row { position: relative; height: min(31vh, 196px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.title-row[hidden] { display: none; }
.challenge-row .back-btn { position: absolute; top: 100%; left: 50%; translate: -50% 0; margin-top: 6px; }
.connect { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.connect .muted { max-width: 520px; text-align: center; font-size: 14px; }
.join-row { gap: 8px; }
#cup-code { width: 9em; }
.cup-table { border-collapse: collapse; margin: 6px auto; font-size: clamp(12px, 3vh, 16px); }
.cup-table th, .cup-table td { padding: 3px 10px; text-align: center; border-bottom: 1px solid var(--line); }
.cup-table td:nth-child(2) { text-align: left; min-width: 8em; font-weight: 700; }
.cup-table tr.me td { color: #fff; background: rgba(255, 42, 61, 0.18); }
.cup-table tr.left td, .cup-table tr.empty td { color: var(--muted); }
.cup-matches { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 16px; justify-content: center; font-size: clamp(11px, 2.6vh, 14px); margin: 6px 0 10px; }
.cup-match { color: var(--muted); }
.cup-match .won { color: #fff; font-weight: 800; }
.cup-match i { margin-left: 4px; color: var(--steel-hi); }
.cup-match.ready i, .cup-match.playing i { color: var(--red); }
.cup-banner { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px;
  padding: 10px 14px 10px 18px; border-radius: 14px; background: rgba(18, 19, 23, 0.95); border: 2px solid var(--red);
  box-shadow: 0 0 26px rgba(255, 42, 61, 0.45); font-weight: 700; max-width: calc(100vw - 32px); }
.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 61; padding: 10px 18px; border-radius: 12px;
  background: rgba(18, 19, 23, 0.95); border: 1px solid var(--line); font-weight: 700; max-width: calc(100vw - 32px); text-align: center; }
.inbox-btn { position: absolute; top: 12px; left: 12px; width: 48px; height: 48px; border-radius: 50%; font-size: 22px; line-height: 1;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); color: #fff; padding: 0; }
.inbox-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 12px; line-height: 20px; font-family: system-ui, sans-serif; }
.inbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; margin: 8px 0 14px; text-align: left; }
.inbox-msg { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: #1b1d21; }
.inbox-msg b { font-weight: 600; }
.inbox-msg.unread b { font-weight: 900; color: #fff; }
.inbox-msg span { color: var(--steel-hi); font-size: 14px; }
.inbox-msg small { color: var(--muted); font-size: 12px; }

/* ================================================================== the Impact look
   Ink outlines and hard offset shadows, a dotted grid over the menus; a pressed title button cracks
   and shatters (ui/impact.js), the next row slams down with dust, Back swipes. */
:root { --ink-line: #050506; }
.screen:not(#gate)::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1; opacity: 0.14;
  background: radial-gradient(circle, #fff 1px, transparent 1.5px) 0 0 / 7px 7px; }
#title:has(#challenge-row:not([hidden])) .keys { visibility: hidden; }
/* the title mark: flat, inked, a hard red and black offset, a slight tilt */
h1 .t1, h1 .t2 { transform: rotate(-3deg); }
h1 .t1 { background: none; -webkit-text-fill-color: #fff; color: #fff; -webkit-text-stroke: 0.035em var(--ink-line); paint-order: stroke fill;
  filter: drop-shadow(0.06em 0.06em 0 var(--red)) drop-shadow(0.035em 0.035em 0 var(--ink-line)); }
h1 .t2 { background: none; -webkit-text-fill-color: var(--red); color: var(--red); -webkit-text-stroke: 0.035em var(--ink-line); paint-order: stroke fill;
  filter: drop-shadow(0.06em 0.06em 0 #fff) drop-shadow(0.035em 0.035em 0 var(--ink-line)); }
h1 .cap, h1 .t2 .cap { -webkit-text-stroke: 0.045em var(--ink-line); }
/* the round buttons: ink rim, hard shadow, flat colours */
.home-btn { border: 4px solid var(--ink-line); box-shadow: 6px 6px 0 var(--ink-line); transition: transform 0.08s, box-shadow 0.08s; position: relative; }
.home-btn.red { background: var(--red); color: #fff; }
.home-btn.steel { background: var(--steel); color: #111; }
.home-btn.create { background: #1a1b1f; color: #fff; border-color: var(--red); box-shadow: 6px 6px 0 var(--red); }
.home-btn:hover, .home-btn:focus-visible { filter: none; transform: translate(-2px, -2px) rotate(-2deg); box-shadow: 9px 9px 0 var(--ink-line); }
.home-btn.create:hover, .home-btn.create:focus-visible { box-shadow: 9px 9px 0 var(--red); }
.home-btn:focus-visible::after { content: ""; position: absolute; inset: -12px; border: 3px dashed #fff; border-radius: 50%; animation: impact-spin 6s linear infinite; pointer-events: none; }
@keyframes impact-spin { to { transform: rotate(360deg); } }
.home-btn.impact-hit { transform: scale(0.86, 1.08) rotate(4deg); }
.impact-cracks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.impact-cracks path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: impact-crack 0.12s ease-out forwards; filter: drop-shadow(0 0 3px #000); }
@keyframes impact-crack { to { stroke-dashoffset: 0; } }
.impact-knock { transition: transform 0.4s cubic-bezier(0.3, 0, 0.9, 0.6), opacity 0.4s !important; opacity: 0; pointer-events: none; }
.impact-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
#title .title-row.impact-slam, #title #home-row.impact-slam { animation: impact-slam 0.32s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
#title .title-row.impact-swipe-in, #title #home-row.impact-swipe-in { animation: impact-sw-in 0.14s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
#title .title-row.impact-swipe-out, #title #home-row.impact-swipe-out { animation: impact-sw-out 0.11s ease-in both; pointer-events: none; }
@keyframes impact-slam { from { transform: translateY(-70vh) rotate(-6deg); } to { transform: none; } }
@keyframes impact-sw-out { to { transform: translateX(60vw) skewX(-20deg); opacity: 0; } }
@keyframes impact-sw-in { from { transform: translateX(-60vw) skewX(20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.impact-shake { animation: impact-shake 0.18s linear; }
@keyframes impact-shake { 0% { transform: translate(7px, -5px); } 25% { transform: translate(-6px, 4px); } 50% { transform: translate(4px, 3px); } 75% { transform: translate(-3px, -2px); } 100% { transform: none; } }
/* Back: a white tag, inked, a red offset, tilted */
button.back-btn { font-family: var(--display); font-size: clamp(13px, 3.4vh, 17px); text-transform: uppercase; letter-spacing: 0.04em; padding: 7px 16px;
  background: #fff; color: #111; border: 3px solid var(--ink-line); border-radius: 0; box-shadow: 4px 4px 0 var(--red); transform: rotate(-3deg); text-decoration: none; }
button.back-btn:hover, button.back-btn:focus-visible { background: var(--red); color: #fff; border-color: var(--ink-line); }
/* the other buttons: inked too */
button.big { border: 3px solid var(--ink-line); border-radius: 0; box-shadow: 5px 5px 0 var(--ink-line); background: var(--red); color: #fff; transform: skewX(-8deg); }
button.big:hover, button.big:focus-visible { border-color: var(--ink-line); box-shadow: 7px 7px 0 var(--ink-line); filter: brightness(1.1); }
.seg { border: 3px solid var(--ink-line); border-radius: 0; box-shadow: 4px 4px 0 var(--ink-line); }
.seg button.on { background: var(--red); color: #fff; }
@media (prefers-reduced-motion: reduce) { .home-btn:focus-visible::after { animation: none; } }

/* ------------------------------------------------------------------ fighter select: a wheel (Orbit)
   the fighters are round blobs on a big circle whose centre is below the screen; the one under the
   moving cursor sits at the top, big, with its name; the players' plates in the bottom corners */
#select { padding-top: 0; padding-bottom: 0; justify-content: flex-start; align-items: stretch; }   /* the sides keep the safe-area gutter (notches) */
#select #select-title { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 0; right: 0; z-index: 3; text-align: center; pointer-events: none;
  font-size: clamp(15px, 4.4vh, 28px); text-transform: uppercase; text-shadow: 3px 3px 0 var(--ink-line); }
#select .select-hint { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + clamp(15px, 4.4vh, 28px) * 1.2 + 4px); left: 0; right: 0; z-index: 3; margin: 0;
  text-align: center; color: var(--muted); font-size: clamp(11px, 2.8vh, 14px); pointer-events: none; }
#select .select-main { position: relative; flex: 1 1 auto; width: 100%; display: block; container-type: normal; overflow: hidden; }
#select .grid { position: absolute; left: 50%; width: 0; height: 0; display: block; max-height: none; overflow: visible; padding: 0; scrollbar-gutter: auto; }
#select .cell { position: absolute; left: 0; top: 0; width: var(--blob); height: var(--blob); margin: calc(var(--blob) / -2) 0 0 calc(var(--blob) / -2); padding: 0;
  border-radius: 50%; border: 4px solid var(--ink-line); overflow: visible; background: radial-gradient(circle at 50% 30%, #2d3038, #121317); box-shadow: 5px 5px 0 var(--ink-line);
  transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s, border-color 0.15s; grid-column: auto; justify-self: auto; }
#select .cell canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
#select .cell:not(.top):not(.picked) canvas { filter: brightness(0.6) saturate(0.6); }
#select .cell.far { opacity: 0; pointer-events: none; }
#select .cell.top { border-color: var(--red); box-shadow: 5px 5px 0 var(--ink-line), 0 0 34px rgba(255, 42, 61, 0.5); }
#select .cell.cursor2:not(.top) { border-color: var(--steel); }
#select .cell .nm { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--display); font-size: clamp(11px, 3vh, 16px);
  text-transform: uppercase; color: #fff; -webkit-text-stroke: 2px var(--ink-line); paint-order: stroke fill; opacity: 0; transition: opacity 0.2s; }
#select .cell .sty { position: absolute; top: calc(100% + 4px + clamp(11px, 3vh, 16px) * 1.25); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); opacity: 0; transition: opacity 0.2s; }
#select .cell.top .nm, #select .cell.top .sty { opacity: 1; }
#select .cell .tag { top: -6px; bottom: auto; left: -6px; right: auto; z-index: 2; font-family: var(--display); font-size: 12px; padding: 1px 7px; background: #fff; color: #111; border: 2px solid var(--ink-line); }
#select .cell .tag.p2 { left: auto; right: -6px; background: var(--red); color: #fff; }
#select .cell.create-cell { border-style: dashed; border-color: var(--red); background: repeating-linear-gradient(135deg, #0e0e11 0 10px, #141418 10px 20px); overflow: hidden; }
#select .cell.create-cell b { font-size: calc(var(--blob) * 0.3); }
#select .cell.create-cell span { font-size: calc(var(--blob) * 0.08); }
#select .cell.create-cell small { display: none; }
#select .cell.own { width: var(--blob); height: var(--blob); border-color: var(--red-deep); }
#select .cell.own.top { border-color: var(--red); }
#select .own-label { top: auto; bottom: -2px; left: 50%; right: auto; transform: translateX(-50%); z-index: 2; font-size: 9px; padding: 1px 5px; background: var(--ink-line); }
#select .own-nav { z-index: 2; }
#select .cell.custom::after { z-index: 2; right: 4px; bottom: 4px; }
/* the players' plates */
#select .side { position: absolute; z-index: 3; bottom: max(10px, env(safe-area-inset-bottom)); width: min(23vw, 230px); flex: none; gap: 2px; padding: 8px 12px;
  background: rgba(8, 8, 10, 0.86); border: 3px solid var(--ink-line); border-radius: 0; box-shadow: 5px 5px 0 var(--red); align-items: flex-start; justify-content: flex-start; }
#select #side-0 { left: max(10px, env(safe-area-inset-left)); }
#select #side-1 { right: max(10px, env(safe-area-inset-right)); align-items: flex-end; box-shadow: -5px 5px 0 var(--steel); }
#select .side-who { position: static; font-size: clamp(11px, 2.8vh, 14px); letter-spacing: 0.1em; }
#select .side-name { font-size: clamp(14px, 4.4vh, 24px); text-align: inherit; min-height: 0; }
#select .side-share { position: static; padding: 3px 10px; font-size: 12px; }
#select .side .ready { margin-top: 4px; min-width: 7em; padding: 6px 14px; border: 3px solid var(--ink-line); border-radius: 0; box-shadow: 3px 3px 0 var(--ink-line); }
#select .side.turn .ready:not(:disabled) { background: var(--red); color: #fff; border-color: var(--ink-line); box-shadow: 3px 3px 0 var(--ink-line); }
#select .select-bar { position: absolute; z-index: 3; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); justify-content: center; pointer-events: none; min-height: 0; }
#select .select-bar > * { pointer-events: auto; }
#select #btn-select-back { position: fixed; top: max(10px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); }
#select .select-bar { gap: 12px; }
#select .seg button { padding: 6px 10px; }
#select #btn-fight { padding: 6px 20px; }

/* ------------------------------------------------------------------ arena select: a carousel (Blade)
   the highlighted arena big and slanted in the middle, its neighbours smaller either side, the rest
   out of reach; behind, the same arena blurred, drifting with the cursor */
#arena { justify-content: space-between; overflow: hidden; }
#arena .arena-bg { position: absolute; inset: -4%; width: 108%; height: 108%; z-index: -1; opacity: 0.32; filter: blur(8px) saturate(1.3); transition: transform 0.5s ease-out; pointer-events: none; }
#arena h2 { z-index: 2; text-transform: uppercase; text-shadow: 3px 3px 0 var(--ink-line); transform: skewX(-10deg); }
.arena-grid { --aw: min(56vw, calc((100vh - 130px) * 16 / 9 * 0.92)); position: relative; flex: 1 1 auto; width: 100%; min-height: 0; }
.arena-cell { position: absolute; left: 50%; top: 50%; width: var(--aw); max-width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden;
  border: 4px solid var(--ink-line); border-radius: 0; background: var(--panel); clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
  transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s, filter 0.3s; }
.arena-cell.side { filter: brightness(0.55); }
.arena-cell.far { opacity: 0; pointer-events: none; }
.arena-cell.cursor { border-color: var(--red); box-shadow: none; filter: none; }
.arena-cell:hover:not(.cursor) { border-color: #4a4e57; }
.arena-cell .label { left: 7%; right: 7%; padding: 4px 8px 8px; font-family: var(--display); font-size: clamp(12px, calc(var(--aw) * 0.045), 26px); text-transform: uppercase;
  -webkit-text-stroke: 1px #000; paint-order: stroke fill; text-shadow: 2px 2px 0 #000; }
.arena-cell.empty { font-size: calc(var(--aw) * 0.16); }
.arena-cell.take { font-size: calc(var(--aw) * 0.16); }
.arena-cell .arena-tag { top: 6px; border-radius: 0; border: 2px solid var(--ink-line); }
.arena-cell .arena-tag.p0 { left: 7%; }
.arena-cell .arena-tag.p1 { left: calc(7% + 50px); }
.arena-cell .arena-remove { right: 7%; top: 6px; }
.arena-cell.photo { border-style: dashed; }
#arena .arena-bar { z-index: 2; gap: 14px; }
#arena .seg { transform: skewX(-10deg); }
#arena #btn-arena-back { transform: rotate(-3deg); }

/* ------------------------------------------------------------------ settings: Sound / Keybindings tabs (PC) */
.set-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.set-tabs button { font-family: var(--display); text-transform: uppercase; font-size: clamp(13px, 3.4vh, 17px); padding: 6px 14px; border: 3px solid var(--ink-line); border-radius: 0; background: #1a1b1f; color: var(--muted); transform: skewX(-8deg); }
.set-tabs button.on { background: var(--red); color: #fff; box-shadow: 4px 4px 0 var(--ink-line); }
.set-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 22px; max-height: 58vh; overflow-y: auto; text-align: left; }
.keys-group h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.keys-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 14px; }
.keys-row kbd { min-width: 46px; padding: 2px 6px; text-align: center; font-family: var(--display); font-size: 12px; color: #111; background: #fff; border: 2px solid var(--ink-line); box-shadow: 2px 2px 0 var(--red); white-space: nowrap; }
.set-keys[hidden] { display: none; }
.settings-box:has(#set-keys:not([hidden])) { width: min(820px, 94vw); max-width: none; }
.settings-box:has(#set-keys:not([hidden])) .set-keys { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ------------------------------------------------------------------ friends' fighters: the golden blob and wheel */
:root { --gold: #ffd23a; --gold-deep: #b8860b; }
#select .cell.friends-cell, #select .cell.back-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: radial-gradient(circle at 50% 35%, #4a3a0c, #16120a); border-color: var(--gold); color: var(--gold); font-family: var(--display); overflow: visible; }
#select .cell.friends-cell b, #select .cell.back-cell b { font-size: calc(var(--blob) * 0.32); line-height: 1; }
#select .cell.friends-cell span, #select .cell.back-cell span { font-size: calc(var(--blob) * 0.1); text-transform: uppercase; color: #fff; }
#select .cell.friends-cell small { font-size: calc(var(--blob) * 0.08); color: #e8d48a; }
#select .cell.friends-cell.top, #select .cell.back-cell.top { border-color: var(--gold); box-shadow: 5px 5px 0 var(--ink-line), 0 0 34px rgba(255, 210, 58, 0.55); }
#select .grid.golden .cell.gold { border-color: var(--gold-deep); }
#select .grid.golden .cell.gold.top { border-color: var(--gold); box-shadow: 5px 5px 0 var(--ink-line), 0 0 34px rgba(255, 210, 58, 0.55); }
#select .grid.golden .cell .nm { color: var(--gold); }
#select .friend-remove { position: absolute; top: 2px; right: 2px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; display: none;
  background: var(--ink-line); color: #fff; font-size: 14px; line-height: 26px; text-align: center; cursor: pointer; }
#select .cell.top .friend-remove { display: block; }
#select .side-add { padding: 3px 10px; font-size: 12px; border: 2px solid var(--gold); color: var(--gold); background: #1a1508; border-radius: 0; }
#select .side-add[hidden] { display: none; }

/* ------------------------------------------------------------------ the account panel */
.profile-btn { left: 68px; display: grid; place-items: center; }
.profile-dot { position: absolute; bottom: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: #6ee07a; border: 2px solid var(--ink-line); }
.profile-box { width: min(560px, 100%); }
.acc-form { display: flex; flex-direction: column; gap: 10px; }
.acc-form input { font: inherit; font-size: 16px; padding: 10px 12px; border: 3px solid var(--ink-line); background: #fff; color: #111; border-radius: 0; }
.acc-buttons { justify-content: center; gap: 12px; }
.acc-note { font-size: 12px; margin: 0; }
.acc-stats { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.acc-big { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.acc-big div { border: 3px solid var(--ink-line); background: #1a1b1f; box-shadow: 4px 4px 0 var(--ink-line); padding: 6px 4px; }
.acc-big b { display: block; font-family: var(--display); font-size: clamp(20px, 6vh, 32px); color: #fff; }
.acc-big span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.acc-big div.hot b { color: var(--red); }
.acc-rows { display: grid; grid-template-columns: 1fr auto; gap: 3px 14px; font-size: 14px; }
.acc-rows .k { color: var(--muted); }
.acc-rows .v { font-family: var(--display); }
.acc-recent { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); max-height: 18vh; overflow-y: auto; }
.acc-recent li b.won { color: #6ee07a; }
.acc-recent li b.lost { color: var(--red); }
.acc-stats h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.acc-form[hidden] { display: none; }
/* the account panel: one view at a time, made to fit the screen (no scrolling) */
#profile .settings-box { overflow: visible; gap: min(1.6vh, 10px); padding-block: min(2.4vh, 16px); }
#profile h2 { font-size: clamp(18px, 5vh, 28px); }
.acc-view[hidden], #profile [hidden] { display: none !important; }
.acc-view { display: flex; flex-direction: column; gap: min(1.6vh, 10px); }
#profile .acc-form input { padding: min(1.4vh, 9px) 12px; }
#profile .acc-rows { grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 12px; font-size: 15px; }
#profile .acc-rows .v { font-family: var(--display); overflow-wrap: anywhere; }
#profile .acc-rows button { padding: 5px 12px; font-size: 13px; }
#profile .muted { margin: 0; font-size: clamp(12px, 3.2vh, 14px); }
#profile .link-btn { align-self: center; }
#profile .status { margin: 0; min-height: 1.2em; font-size: 13px; }
#btn-profile-close { padding: 6px 28px; font-size: clamp(15px, 4vh, 20px); }
/* the creator: which fighter (a new one, or one of yours to modify) */
.cr-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.cr-picker[hidden] { display: none; }
.cr-pick-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.cr-pick { padding: 4px 12px; font-size: 13px; border: 2px solid var(--ink-line); border-radius: 0; background: #1a1b1f; }
.cr-pick.on { background: var(--red); color: #fff; box-shadow: 3px 3px 0 var(--ink-line); }
.cr-pick.improve { border-color: #ffb03a; color: #ffd9a0; }
/* multiplayer: rating, matches, leaderboard */
.mp-btn { left: 12px; display: grid; place-items: center; color: var(--gold, #ffd23a); }
.mp-btn[hidden] { display: none; }
.mp-box { width: min(860px, 100%); gap: min(1.6vh, 10px); }
#mp h2 { font-size: clamp(18px, 5vh, 28px); }
.mp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; min-height: 0; }
.mp-me { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.mp-me .muted { margin: 0; }
.mp-rating { display: flex; align-items: baseline; gap: 10px; border: 3px solid var(--ink-line); background: #1a1b1f; box-shadow: 4px 4px 0 var(--red); padding: 6px 12px; }
.mp-rating b { font-family: var(--display); font-size: clamp(28px, 9vh, 48px); color: #fff; }
.mp-rating span { color: var(--muted); font-size: 13px; }
.mp-board { min-height: 0; display: flex; flex-direction: column; text-align: left; }
.mp-board h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.mp-board .cup-table { display: block; max-height: min(48vh, 360px); overflow-y: auto; }
@media (max-width: 600px) { .mp-cols { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ creator: the fighter on top, ⓘ, a 2 × 5 grid */
.cr-moves { position: relative; }
.cr-head { width: 100%; justify-content: center; padding: 0 56px; }
.cr-picker { gap: 10px; }
.cr-pick { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; font-family: var(--display); font-size: clamp(13px, 3.6vh, 18px);
  border: 3px solid var(--ink-line); border-radius: 999px; background: #1a1b1f; color: #fff; }
.cr-pick-face { width: clamp(30px, 9vh, 52px); height: clamp(30px, 9vh, 52px); border-radius: 50%; background: radial-gradient(circle at 50% 30%, #2d3038, #121317); border: 2px solid var(--ink-line); }
.cr-pick.on { background: var(--red); box-shadow: 4px 4px 0 var(--ink-line); }
.cr-pick:disabled { opacity: 0.45; }
.cr-pick.improve { padding: 6px 14px; border-radius: 0; }
.cr-info-btn { position: absolute; top: 0; left: max(4px, env(safe-area-inset-left)); width: 44px; height: 44px; border-radius: 50%; padding: 0; z-index: 7;
  font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 22px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); color: #fff; }
.cr-info-btn.err::after, .cr-info-btn.warn::after { content: ""; position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-line); }
.cr-info-btn.err::after { background: var(--red); }
.cr-info-btn.warn::after { background: #ffb03a; }
.cr-info { position: absolute; top: 50px; left: max(4px, env(safe-area-inset-left)); z-index: 8; width: min(440px, 86vw); max-height: 70vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; text-align: left; font-size: 14px;
  background: rgba(12, 13, 16, 0.97); border: 3px solid var(--ink-line); box-shadow: 5px 5px 0 var(--red); }
.cr-info[hidden] { display: none; }
.cr-info p { margin: 0; line-height: 1.35; }
.cr-info .cr-info-count { font-family: var(--display); color: #fff; }
.cr-info .err { color: #ff8a94; }
.cr-info .warn { color: #ffd9a0; }
.cr-layout { --c: clamp(54px, min(calc((100vh - 180px) / 2.15), calc((100vw - 110px) / 8.3)), 150px); align-items: center; }
.cr-must { display: grid; grid-template-columns: repeat(5, var(--c)); grid-auto-rows: var(--c); gap: 8px; align-content: center; }
.cr-sigside { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.cr-sigside .cr-card { width: var(--c); height: var(--c); }
.cr-fighter-face { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; background: radial-gradient(circle at 50% 30%, #2d3038, #121317); }
