@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: #40aaff;
  --aura-soft: rgba(64, 170, 255, 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(64, 170, 255, 0.7), 0 0 42px rgba(64, 170, 255, 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(64, 170, 255, 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 {
  --cell: min(19vh, 13vw, 150px);
  display: grid;
  grid-template-columns: repeat(4, var(--cell));
  grid-template-rows: repeat(3, var(--cell));
  gap: min(1.6vh, 12px);
}
.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(--aura); box-shadow: 0 0 16px rgba(64, 170, 255, 0.5) inset; }
.cell .tag {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--aura);
}
.cell.cursor2 { border-color: #ff6a5a; box-shadow: 0 0 16px rgba(255, 106, 90, 0.45) inset; }
.cell.cursor.cursor2 { border-color: #c48cff; }
.cell .tag.p2 { left: auto; right: 6px; color: #ff6a5a; }

/* ------------------------------------------------------------------ arena select (1 × 4) */
.arena-grid {
  --aw: min(21vw, 290px);
  display: grid;
  grid-template-columns: repeat(4, var(--aw));
  gap: min(1.6vw, 16px);
}
.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(12px, 3.2vh, 17px); font-weight: 800; letter-spacing: 0.05em; 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(--aura); box-shadow: 0 0 22px rgba(64, 170, 255, 0.55); }
.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 { display: flex; align-items: stretch; justify-content: center; gap: min(2.4vw, 22px); width: 100%; }
.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(64, 170, 255, 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-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(64, 170, 255, 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(64, 170, 255, 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(64, 170, 255, 0.8); transform: scale(0.94); }
.btns .b-aura  { grid-area: 1 / 2; border-color: rgba(64, 170, 255, 0.8); }
.btns .b-punch { grid-area: 2 / 1; }
.btns .b-kick  { grid-area: 2 / 3; }
.btns .b-def   { grid-area: 3 / 2; }

/* ------------------------------------------------------------------ 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 #0b1220, 0 0 30px rgba(120, 190, 255, 0.35);
}
h1 .t1, h1 .t2 { display: block; }
h1 .t1 { color: #f4f6fb; text-shadow: 0 4px 0 #0b1220, 0 0 30px rgba(120, 190, 255, 0.35); }
h1 .t2 {
  color: #5fc0ff;
  background: linear-gradient(180deg, #e8f7ff 0%, #7fd0ff 38%, #1f7fff 72%, #0b3fb0 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(64, 170, 255, 0.85)) drop-shadow(0 4px 0 #071233);
  text-shadow: none;
}
#title { gap: min(3.4vh, 26px); }
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, #3a8dff, #1650c8);
  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, #ff6a3a, #c8261a); }
button.big:disabled { filter: grayscale(0.7) brightness(0.7); }
.gate-icon { width: min(26vh, 160px); filter: drop-shadow(0 0 30px rgba(64, 170, 255, 0.7)); animation: gate-pulse 1.1s ease-in-out infinite; }
.gate-text { margin: 0; font-family: var(--display); font-size: clamp(18px, 5vh, 30px); letter-spacing: 0.12em; text-transform: uppercase; color: #dfeaff; 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(64, 170, 255, 1)); } }
@keyframes gate-blink { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .gate-icon, .gate-text { animation: none; } }

/* title entrance: AURA slams in from the left, FIGHT from the right (~0.25 s);
   the shake starts as they land (menufx burst) */
h1.enter .t1 { animation: slam-l 0.2s cubic-bezier(0.2, 1.5, 0.45, 1) both; }
h1.enter .t2 { animation: slam-r 0.2s 0.06s cubic-bezier(0.2, 1.5, 0.45, 1) both; }
@keyframes slam-l { from { transform: translateX(-110vw) skewX(-30deg) scale(1.8); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }
@keyframes slam-r { from { transform: translateX(110vw) skewX(30deg) scale(1.8); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { h1.enter .t1, h1.enter .t2 { animation: none; } }

/* ------------------------------------------------------------------ create fighter (src/ui/creator.js) */
button.big.create { background: linear-gradient(180deg, #4fd36a, #17863a); }
#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: var(--c);
  gap: 8px; overflow-y: auto; touch-action: pan-y; align-content: start; padding: 2px;
}
.cr-card { 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-card.done { border-color: rgba(110, 224, 122, 0.7); }
.cr-card.bad { border-color: #ffb03a; }
.cr-card.bad .cr-state { color: #ffb03a; }
.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; }
.cr-guide { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(64px, env(safe-area-inset-right)); width: min(30vh, 200px); height: min(30vh, 200px); border-radius: 12px; background: rgba(10, 11, 13, 0.55); border: 1px solid var(--line); }
.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(64, 170, 255, 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-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 { display: flex; gap: 24px; align-items: center; }
.cr-subprev { width: min(38vh, 240px); height: min(38vh, 240px); border-radius: 14px; background: radial-gradient(ellipse at 50% 80%, rgba(64, 170, 255, 0.18), transparent 70%); }
.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; }
