/* IN NOMINE RALLY — v2 PUNK GAMBERRO: Día de Muertos versión punk / chatarrería.
   Papel rasgado, cinta americana, pegatinas torcidas, nota de rescate, halftone, stencil y glitch. */
:root {
  --ink: #121014;
  --acid: #b6ff00;
  --pink: #ff1f6d;
  --toxic: #ffe600;
  --rust: #b5482a;
  --blood: #8b0d1a;
  --bruise: #3a1450;
  --bone: #eee3c7;
  --black: #000;
  --f-title: 'Rubik Dirt', 'Permanent Marker', Impact, sans-serif;
  --f-marker: 'Permanent Marker', 'Comic Sans MS', cursive;
  --f-num: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --f-type: 'Special Elite', 'Courier New', monospace;
  --hard: 4px 4px 0 var(--black);
  --hard-lg: 7px 7px 0 var(--black);
  --torn: polygon(0% 2%, 6% 0%, 13% 1.5%, 21% 0.2%, 30% 1.8%, 38% 0%, 47% 1.2%, 55% 0.1%, 64% 1.9%, 72% 0.4%, 81% 1.6%, 90% 0%, 100% 1.5%, 99.4% 20%, 100% 45%, 99.2% 70%, 100% 98%, 93% 100%, 85% 98.3%, 76% 99.8%, 67% 98.1%, 58% 100%, 49% 98.4%, 40% 99.9%, 31% 98.2%, 22% 100%, 13% 98.5%, 5% 99.8%, 0% 98%, 0.7% 75%, 0% 50%, 0.8% 25%);
  --torn-strip: polygon(0% 8%, 4% 0%, 9% 10%, 15% 2%, 22% 9%, 30% 0%, 38% 8%, 46% 1%, 54% 10%, 62% 2%, 70% 9%, 78% 0%, 86% 8%, 93% 1%, 100% 9%, 99% 50%, 100% 92%, 95% 100%, 88% 91%, 80% 99%, 72% 90%, 64% 100%, 56% 92%, 48% 99%, 40% 90%, 32% 100%, 24% 91%, 16% 99%, 8% 90%, 0% 98%, 1% 50%);
  --tape-cut: polygon(2% 0%, 98% 4%, 100% 22%, 97% 40%, 100% 60%, 97% 80%, 99% 100%, 1% 96%, 3% 78%, 0% 58%, 3% 40%, 0% 20%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--f-type);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button, input { font-family: inherit; }
.hidden { display: none !important; }
b { font-weight: normal; font-family: var(--f-num); letter-spacing: 0.5px; }

.ico { width: 1em; height: 1em; vertical-align: -0.14em; flex: none; display: inline-block; }

#game {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, var(--blood) 0%, transparent 60%), linear-gradient(170deg, var(--bruise) 0%, #1c0d1e 60%, var(--ink) 100%);
}
#game canvas { display: block; }
.layer { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }

/* ---------------- Pantallas de menú ---------------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(139, 13, 26, 0.75) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(58, 20, 80, 0.95) 0%, transparent 60%),
    linear-gradient(165deg, #2a0d1c 0%, var(--ink) 55%, #1d0a26 100%);
  animation: screenIn 0.3s steps(4) both;
}
.screen.overlay { background: rgba(18, 16, 20, 0.84); }
@keyframes screenIn {
  0% { opacity: 0; transform: translateX(-6px); filter: hue-rotate(90deg); }
  50% { opacity: 1; transform: translateX(4px); }
  100% { opacity: 1; transform: none; filter: none; }
}
.screen > *:not(.deco):not(.confetti) { position: relative; z-index: 1; }

/* Decoración */
.deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.deco .halftone {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255, 31, 109, 0.22) 1.3px, transparent 1.6px);
  background-size: 7px 7px;
  -webkit-mask-image: radial-gradient(ellipse at 85% 15%, #000 0%, transparent 55%), radial-gradient(ellipse at 10% 90%, #000 0%, transparent 45%);
  mask-image: radial-gradient(ellipse at 85% 15%, #000 0%, transparent 55%), radial-gradient(ellipse at 10% 90%, #000 0%, transparent 45%);
}
.deco .grain { position: absolute; inset: -50%; background-image: var(--grain); opacity: 0.5; mix-blend-mode: overlay; animation: grain 0.6s steps(3) infinite; }
@keyframes grain { 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } }
.deco .spray {
  position: absolute;
  font-family: var(--f-title);
  font-size: clamp(60px, 10vw, 150px);
  white-space: nowrap;
  opacity: 0.1;
  transform: rotate(var(--r));
  filter: blur(0.6px);
  text-shadow: 0 0 12px currentColor;
}
.deco .tape {
  position: absolute;
  width: 190px; height: 40px;
  background: linear-gradient(180deg, rgba(160, 158, 150, 0.92), rgba(120, 118, 112, 0.92));
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 5px), linear-gradient(180deg, rgba(170, 168, 160, 0.95), rgba(118, 116, 110, 0.95));
  clip-path: var(--tape-cut);
  transform: rotate(var(--r));
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}
.deco .sticker {
  position: absolute;
  font-family: var(--f-num);
  font-size: 15px;
  letter-spacing: 1.5px;
  padding: 5px 10px;
  border: 2px solid var(--black);
  transform: rotate(var(--r));
  box-shadow: 3px 3px 0 var(--black);
  white-space: nowrap;
  opacity: 0.9;
}
.deco .sticker.s0 { background: var(--toxic); color: var(--ink); }
.deco .sticker.s1 { background: var(--pink); color: var(--bone); border-radius: 30px; }
.deco .sticker.s2 { background: var(--bone); color: var(--blood); font-family: var(--f-marker); font-size: 17px; }
.deco .sticker.s3 { background: var(--ink); color: var(--acid); border-color: var(--acid); }
.deco .stencil-skull { position: absolute; color: var(--bone); opacity: 0.06; transform: rotate(var(--r)) scale(var(--s)); }
.deco .stencil-skull .ico { width: 140px; height: 140px; }

/* Papel rasgado: el fondo va en ::before (clip-path) y la sombra dura en el filtro del padre. */
.paper, .torn, .torn-box { position: relative; filter: drop-shadow(6px 7px 0 var(--black)); isolation: isolate; }
.paper::before, .torn::before, .torn-box::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bone);
  background-image: var(--grain), linear-gradient(175deg, #f4ead2 0%, var(--bone) 50%, #d9cba8 100%);
  clip-path: var(--torn);
}

/* ---------------- Logo ---------------- */
.logo { text-align: center; margin-bottom: 4px; animation: logoIn 0.7s steps(6) both; }
@keyframes logoIn {
  0% { opacity: 0; transform: scale(1.3) rotate(-4deg); filter: blur(4px); }
  60% { opacity: 1; transform: scale(0.97) rotate(1deg); filter: none; }
  100% { transform: none; }
}
.ransom { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px; }
.ransom .rs-gap { width: 0.45em; }
.ransom .rs {
  display: inline-block;
  padding: 0.04em 0.14em 0;
  line-height: 1.05;
  transform: translateY(var(--y)) rotate(var(--r));
  box-shadow: 3px 3px 0 var(--black);
}
.rs0 { background: var(--bone); color: var(--ink); font-family: var(--f-type); }
.rs1 { background: var(--ink); color: var(--toxic); font-family: var(--f-num); border: 2px solid var(--toxic); }
.rs2 { background: var(--pink); color: var(--bone); font-family: var(--f-title); }
.rs3 { background: #f6f2e6; color: #111; font-family: Georgia, 'Times New Roman', serif; font-weight: 900; font-style: italic; }
.rs4 { background: var(--acid); color: var(--ink); font-family: var(--f-marker); }
.rs5 { background: var(--rust); color: var(--bone); font-family: var(--f-num); }
.rs6 { background: var(--toxic); color: var(--ink); font-family: var(--f-title); }
.rs7 { background: var(--bruise); color: var(--acid); font-family: var(--f-type); border: 2px dashed var(--acid); }
.logo-top { font-size: clamp(30px, 5.2vw, 70px); }
.logo-rally { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: -4px; }
.logo-skull { color: var(--acid); font-size: clamp(70px, 11vw, 150px); filter: drop-shadow(5px 5px 0 var(--black)) drop-shadow(-2px 0 0 var(--pink)); animation: skullHead 1.1s steps(2) infinite; }
@keyframes skullHead { 50% { transform: rotate(-6deg) translateY(-3px); } }
.rally-word {
  position: relative;
  font-family: var(--f-title);
  font-size: clamp(90px, 15vw, 210px);
  line-height: 0.95;
  color: var(--pink);
  -webkit-text-stroke: 3px var(--black);
  paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--black), 10px 10px 0 var(--acid);
  transform: rotate(-3deg);
}
.rally-word::before, .rally-word::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  -webkit-text-stroke: 0;
  text-shadow: none;
  pointer-events: none;
}
.rally-word::before { color: var(--acid); clip-path: inset(0 0 72% 0); animation: glitchA 2.6s steps(1) infinite; }
.rally-word::after { color: var(--toxic); clip-path: inset(62% 0 18% 0); animation: glitchB 3.1s steps(1) infinite; }
@keyframes glitchA { 0%, 88%, 100% { transform: none; opacity: 0; } 90% { transform: translate(-8px, 2px); opacity: 0.9; } 94% { transform: translate(6px, -1px); opacity: 0.9; } }
@keyframes glitchB { 0%, 80%, 100% { transform: none; opacity: 0; } 82% { transform: translate(9px, 0); opacity: 0.9; } 86% { transform: translate(-5px, 1px); opacity: 0.9; } }

.subtitle { margin: 14px 0 26px; padding: 12px 30px; transform: rotate(-1.8deg); text-align: center; }
.subtitle span { font-family: var(--f-type); font-size: clamp(15px, 1.8vw, 22px); color: var(--ink); }
.subtitle .ico { color: var(--blood); }
.tagline { opacity: 0.75; font-size: 13px; margin-top: 22px; text-align: center; line-height: 1.8; }

/* ---------------- Botones: pegatinas / cinta ---------------- */
.btn {
  font-family: var(--f-num);
  font-size: 22px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bone);
  border: 3px solid var(--black);
  border-radius: 0;
  padding: 10px 26px 9px;
  box-shadow: var(--hard);
  cursor: pointer;
  outline: none;
  min-width: 230px;
  transform: rotate(-1deg);
  transition: transform 0.08s steps(2);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn:nth-child(2n) { transform: rotate(1.2deg); }
.btn:hover, .btn:focus-visible, .btn.focus {
  transform: rotate(1.5deg) scale(1.06);
  box-shadow: 6px 6px 0 var(--black), 0 0 0 3px var(--acid);
  text-shadow: 2px 0 0 rgba(255, 31, 109, 0.7), -2px 0 0 rgba(0, 200, 255, 0.5);
}
.btn:focus { outline: none; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--black); }
.btn.primary {
  background: var(--pink);
  color: var(--bone);
  font-family: var(--f-title);
  font-size: 30px;
  letter-spacing: 1px;
  padding: 12px 34px 10px;
  text-shadow: 3px 3px 0 var(--black);
  background-image: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(0, 0, 0, 0.12) 14px 20px);
}
.btn.primary:hover, .btn.primary:focus-visible { animation: shove 0.4s steps(2) infinite; background-color: var(--pink); }
@keyframes shove { 50% { transform: rotate(-1.5deg) scale(1.08) translateX(-2px); } }
.btn.secondary { background: var(--toxic); }
.btn.ghost { background: var(--ink); color: var(--bone); border-color: var(--bone); box-shadow: 4px 4px 0 var(--pink); }
.btn.ghost:hover, .btn.ghost:focus-visible { box-shadow: 6px 6px 0 var(--pink), 0 0 0 3px var(--acid); }
.btn.small { font-size: 15px; padding: 6px 14px; min-width: 0; }
.btn-col { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.btn-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

h1.title, h2.title { margin: 0 0 16px; text-align: center; font-size: clamp(26px, 3.6vw, 44px); transform: rotate(-1.2deg); }

/* ---------------- Configuración ---------------- */
.setup { width: min(1240px, 100%); display: flex; flex-direction: column; align-items: center; }
.setup h2.title { margin-bottom: 10px; font-size: clamp(22px, 3vw, 36px); }
.round-bar {
  display: flex; flex-wrap: wrap; gap: 2px 14px; justify-content: center; align-items: center;
  background: var(--ink);
  border: 2px dashed rgba(238, 227, 199, 0.4);
  padding: 4px 16px;
  margin-bottom: 12px;
  box-shadow: 5px 5px 0 var(--blood);
}
.round-bar .row { margin: 0; padding: 4px 6px; }
.round-bar .row label { color: var(--acid); }
.round-bar .spinner .value { min-width: 92px; font-size: 15px; padding: 3px 8px; }
.round-bar .spinner .arrow { width: 26px; height: 26px; }
.round-bar .vol-row .pct { display: none; }
.round-bar .vol-row input[type=range] { width: 70px; }
.round-bar .row label { font-size: 14px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 22px; width: 100%; }
.setup-grid.n1 { max-width: 640px; }
.card {
  color: var(--ink);
  padding: 14px 18px 12px;
  animation: cardIn 0.35s steps(4) both;
}
.card:nth-child(2) { animation-delay: 0.06s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) rotate(2deg); } to { opacity: 1; transform: none; } }
.card h3 {
  font-family: var(--f-num);
  font-weight: normal;
  letter-spacing: 1px;
  margin: -2px -6px 10px;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--card-accent, var(--pink));
  font-size: 20px;
  transform: rotate(-0.8deg);
  box-shadow: 3px 3px 0 var(--card-accent, var(--pink));
  display: flex; align-items: center; gap: 10px;
}
.card h3 .ico { color: var(--card-accent, var(--pink)); }
.card-head .pl-num { font-family: var(--f-title); font-size: 30px; color: var(--card-accent); line-height: 1; }
.card-head .row { flex: 1; margin: 0; padding: 2px 4px; }
.card-head .row label { display: none; }
.card-head .spinner { width: 100%; justify-content: flex-end; }
.card-head .spinner .value { background: transparent; color: var(--bone); border-color: rgba(238, 227, 199, 0.4); flex: 1; font-size: 14px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  margin: 3px -8px;
  outline: none;
}
.row:focus-visible, .row:focus, .row:focus-within {
  background: rgba(255, 31, 109, 0.16);
  box-shadow: inset 4px 0 0 var(--pink), inset 0 0 0 2px var(--pink);
}
.row label { font-family: var(--f-num); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 6px; }
.spinner { display: flex; align-items: center; gap: 6px; }
.spinner .arrow {
  width: 30px; height: 30px;
  border: 2px solid var(--black);
  background: var(--toxic);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--black);
  color: var(--ink);
  padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.spinner .arrow:active { transform: translate(2px, 2px); box-shadow: none; }
.spinner .value {
  min-width: 170px;
  text-align: center;
  font-family: var(--f-num);
  letter-spacing: 0.8px;
  font-size: 16px;
  background: var(--ink);
  color: var(--bone);
  border: 2px solid var(--black);
  padding: 4px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spinner .value .ico { color: var(--acid); }
.row input[type=text] {
  width: 220px;
  font-family: var(--f-marker);
  font-size: 18px;
  padding: 4px 10px;
  border: 2px solid var(--black);
  border-bottom-width: 4px;
  background: #fffaf0;
  color: var(--ink);
  outline: none;
  transform: rotate(0.6deg);
}
.row input[type=text]::placeholder { color: rgba(18, 16, 20, 0.38); }
.row input[type=text]:focus { box-shadow: 0 0 0 3px var(--pink); }

/* Rejilla de personajes */
.char-row { justify-content: center; padding: 6px 4px; }
.char-grid { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.char-tile {
  position: relative;
  width: 66px; height: 66px; padding: 2px;
  border: 3px solid var(--black);
  background: var(--ink);
  cursor: pointer;
  transition: transform 0.08s steps(2);
  box-shadow: 2px 2px 0 var(--black);
  overflow: hidden;
}
.char-tile:nth-child(odd) { transform: rotate(-2deg); }
.char-tile:nth-child(even) { transform: rotate(1.5deg); }
.char-tile .portrait { pointer-events: none; }
.char-tile.sel { border-color: var(--pc); transform: rotate(-4deg) scale(1.12); box-shadow: 0 0 0 3px var(--black), 4px 4px 0 3px var(--pink); z-index: 2; }
.char-tile.taken { filter: grayscale(1) brightness(0.55); cursor: not-allowed; }
.char-tile .taken-tag {
  position: absolute; left: -8px; right: -8px; top: 26px;
  background: var(--blood); color: var(--bone);
  font-family: var(--f-num); font-size: 12px; letter-spacing: 1px; text-align: center;
  transform: rotate(-24deg);
  border-top: 1px solid var(--black); border-bottom: 1px solid var(--black);
}
.char-info { display: flex; gap: 14px; align-items: center; margin: 4px 0 2px; min-height: 92px; }
.setup-grid.n2 .char-info { min-height: 0; }
.setup-grid.n2 .char-info .portrait.big { display: none; }
.setup-grid.n2 .char-tile { width: 60px; height: 60px; }
.setup-grid.n2 ~ .hint { display: none; }
.setup-grid.n2 .char-name { font-size: 22px; }
.setup-grid.n2 .car-tile .car-svg { width: 50px; height: 23px; }
.setup-grid.n2 .car-tile { padding: 3px 4px 2px; }
.setup-grid.n2 .stats { gap: 1px 8px; }
.char-info .portrait.big { border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--pc, var(--pink)); transform: rotate(-3deg); background: var(--ink); }
.char-text { flex: 1; min-width: 0; }
.char-name { font-family: var(--f-marker); font-size: 26px; line-height: 1.05; color: var(--ink); }
.char-tag { font-family: var(--f-type); font-size: 14px; color: #3d3327; margin-top: 2px; }
.char-fav { font-size: 12px; margin-top: 4px; color: var(--blood); }
.char-fav b { color: var(--ink); }

/* Selector de coche */
.car-row { justify-content: center; padding: 6px 4px; }
.car-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.car-tile {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 4px 4px;
  border: 2px solid var(--black);
  background: rgba(18, 16, 20, 0.08);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--black);
}
.car-tile .car-svg { width: 62px; height: 29px; color: var(--ink); --hole: var(--bone); }
.car-tile .car-name { font-family: var(--f-num); font-size: 16px; letter-spacing: 0.8px; }
.car-tile .car-tag { font-family: var(--f-type); font-size: 10px; opacity: 0.7; }
.car-tile.sel { background: var(--toxic); transform: rotate(-2deg) scale(1.06); box-shadow: 4px 4px 0 var(--black); }
.car-tile.sel .car-svg { --hole: var(--toxic); }
.car-info { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; align-items: center; margin-top: 6px; }
.car-desc { font-size: 13px; line-height: 1.3; color: #3d3327; }
.stats { display: grid; grid-template-columns: 82px 1fr; gap: 3px 8px; align-items: center; font-family: var(--f-num); font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase; }
.statbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; height: 12px; }
.statbar i { border: 1.5px solid var(--ink); background: transparent; transform: skewX(-14deg); }
.statbar i.on { background: var(--ink); }
.statbar i.on:nth-child(5) { background: var(--pink); }
.hint { font-size: 13px; opacity: 0.85; margin-top: 10px; text-align: center; max-width: 900px; line-height: 1.5; }
.hint b { color: var(--toxic); }
.hint .ico { color: var(--acid); }
.kbd {
  display: inline-block;
  font-family: var(--f-num);
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 1px 7px;
  background: var(--ink);
  color: var(--toxic);
  border: 1.5px solid var(--toxic);
  margin: 0 2px;
  box-shadow: 2px 2px 0 var(--pink);
}
.warn { color: var(--pink); font-family: var(--f-marker); font-size: 18px; min-height: 26px; text-align: center; margin-top: 6px; text-shadow: 2px 2px 0 var(--black); }

/* Volumen */
.vol-row { gap: 10px; }
.vol-ctl { display: flex; align-items: center; gap: 8px; }
.vol-row input[type=range] { accent-color: var(--pink); width: 120px; }
.vol-row .pct { font-family: var(--f-num); width: 28px; text-align: right; font-size: 14px; }

/* Controles */
.controls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; width: min(1220px, 100%); }
.controls-grid table { width: 100%; border-collapse: collapse; font-size: 14px; }
.controls-grid td { padding: 5px 4px; border-bottom: 1.5px dashed rgba(18, 16, 20, 0.3); }
.controls-grid td:first-child { font-family: var(--f-num); letter-spacing: 0.5px; }
.card.weapons { margin-top: 20px; width: min(1220px, 100%); }
.weapon-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 22px; font-size: 14px; }
.weapon-list li { display: flex; gap: 10px; align-items: flex-start; }
.weapon-list li > .ico { font-size: 26px; color: var(--blood); flex: none; }
.weapon-list b { color: var(--blood); }

/* ---------------- Retratos ---------------- */
.portrait { width: var(--ps); height: var(--ps); flex: none; display: inline-block; position: relative; line-height: 0; }
.portrait > * { width: 100% !important; height: 100% !important; display: block; }
.portrait-fallback { display: flex !important; align-items: center; justify-content: center; background: var(--ink); color: var(--pc, var(--bone)); }
.portrait-fallback .ico { width: 70%; height: 70%; }

/* ---------------- HUD ---------------- */
#hud { font-family: var(--f-num); }
.hud-panel { position: absolute; pointer-events: none; overflow: hidden; }
.hud-panel .tl, .hud-panel .tr, .hud-panel .bl, .hud-panel .br { position: absolute; }
.hud-panel .tl { top: 12px; left: 14px; }
.hud-panel .tr { top: 12px; right: 14px; text-align: right; }
.hud-panel .bl { bottom: 14px; left: 14px; }
.hud-panel .br { bottom: 14px; right: 14px; text-align: right; }
.hud-panel.mirror .tl { left: auto; right: 14px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.hud-panel.mirror .bl { left: auto; right: 14px; text-align: right; }
.hud-panel.mirror .tr { right: auto; left: 14px; text-align: left; }
.hud-panel.mirror .br { right: auto; left: 14px; text-align: left; }

.id-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.hud-panel.mirror .id-row { flex-direction: row-reverse; }
.hud-face .portrait { border: 3px solid var(--black); outline: 2px solid var(--pc); background: var(--ink); transform: rotate(-4deg); box-shadow: 3px 3px 0 var(--black); }
.hud-name {
  font-family: var(--f-marker);
  font-size: 18px;
  padding: 1px 12px 0;
  background: var(--pc, var(--bone));
  color: var(--ink);
  border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  transform: rotate(-2deg);
  white-space: nowrap;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.hud-pos {
  font-family: var(--f-num);
  font-size: 76px;
  line-height: 0.95;
  color: var(--bone);
  -webkit-text-stroke: 3px var(--black);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--black), 7px 7px 0 var(--pink);
}
.hud-pos sup { font-size: 34px; vertical-align: top; position: relative; top: 6px; }
.hud-pos small { font-size: 30px; color: var(--toxic); margin-left: 2px; }
.hud-pos.bump { animation: bump 0.35s steps(3); }
@keyframes bump { 0% { transform: scale(1.4) rotate(-6deg); filter: drop-shadow(3px 0 0 var(--acid)); } 100% { transform: none; } }
.hud-lap {
  font-family: var(--f-num);
  font-size: 26px;
  color: var(--bone);
  -webkit-text-stroke: 2px var(--black);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--black);
  letter-spacing: 1px;
}
.hud-lap .lbl { font-size: 14px; color: var(--acid); letter-spacing: 2px; margin-right: 2px; }
.hud-lap .of { font-size: 18px; color: var(--toxic); }
.hud-pack {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px;
  font-size: 11px; letter-spacing: 1.5px;
  padding: 2px 8px;
  background: rgba(18, 16, 20, 0.82);
  color: var(--acid);
  border: 1.5px dashed var(--acid);
  transform: rotate(-1.5deg);
  animation: packPulse 1.6s ease-in-out infinite;
}
.hud-pack .ico { font-size: 15px; }
@keyframes packPulse { 50% { opacity: 0.55; } }

.bars { display: flex; flex-direction: column; gap: 6px; width: 270px; }
.bar-row { display: flex; align-items: center; gap: 6px; }
.hud-panel.mirror .bar-row { flex-direction: row-reverse; }
.bar-ico { font-size: 20px; width: 22px; color: var(--bone); filter: drop-shadow(2px 2px 0 var(--black)); display: flex; }
.bar-lbl { font-size: 12px; letter-spacing: 1.5px; width: 46px; color: var(--bone); text-shadow: 2px 2px 0 var(--black), -1px -1px 0 var(--black); }
.hud-panel.mirror .bar-lbl { text-align: right; }
.bar {
  flex: 1;
  height: 20px;
  position: relative;
  background: rgba(18, 16, 20, 0.85);
  border: 2px solid var(--black);
  clip-path: var(--tape-cut);
  box-shadow: inset 0 0 0 1px rgba(238, 227, 199, 0.25);
}
.bar .fill { height: 100%; transition: width 0.15s; }
.hud-panel.mirror .bar .fill { margin-left: auto; }
.bar .ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(0, 0, 0, 0.55) calc(10% - 2px) 10%); }
.bar.hp .fill { background: var(--acid); background-image: repeating-linear-gradient(-45deg, transparent 0 7px, rgba(0, 0, 0, 0.16) 7px 12px); }
.bar.hp.mid .fill { background-color: var(--toxic); }
.bar.hp.low .fill { background-color: var(--pink); animation: blink 0.4s steps(2) infinite; }
.bar.turbo .fill { background: linear-gradient(90deg, var(--rust), var(--pink) 60%, var(--toxic)); }
.bar.turbo.active .fill { animation: turboGlow 0.16s steps(2) infinite; }
@keyframes turboGlow { 50% { filter: brightness(1.7) saturate(1.4); } }
.ammo { display: flex; align-items: flex-end; gap: 2px; height: 20px; flex: 1; }
.hud-panel.mirror .ammo { flex-direction: row-reverse; }
.ammo i { width: 7px; height: 100%; background: var(--toxic); border: 1.5px solid var(--black); border-radius: 4px 4px 0 0; }
.ammo i.empty { background: rgba(18, 16, 20, 0.7); border-color: rgba(238, 227, 199, 0.25); }
.ammo .num { font-size: 20px; margin: 0 6px; color: var(--toxic); -webkit-text-stroke: 1.5px var(--black); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--black); line-height: 1; }
.ammo.low .num { color: var(--pink); }

.item-box {
  width: 84px; height: 84px;
  border: 3px solid var(--black);
  background:
    radial-gradient(circle at 9px 9px, #2a2224 2.5px, transparent 3.2px),
    radial-gradient(circle at calc(100% - 9px) 9px, #2a2224 2.5px, transparent 3.2px),
    radial-gradient(circle at 9px calc(100% - 9px), #2a2224 2.5px, transparent 3.2px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #2a2224 2.5px, transparent 3.2px),
    linear-gradient(150deg, #d76a45 0%, var(--rust) 45%, #6f2715 100%);
  box-shadow: 5px 5px 0 var(--black);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
  color: var(--bone);
  position: relative;
  margin-left: auto;
  transform: rotate(3deg);
}
.item-box .ico { filter: drop-shadow(3px 3px 0 var(--black)); }
.item-box.it-pinata .ico { color: var(--pink); }
.item-box.it-turuleco .ico { color: var(--toxic); }
.item-box.it-mines .ico { color: var(--ink); filter: drop-shadow(2px 2px 0 var(--bone)); }
.item-box.it-oil .ico { color: var(--ink); filter: drop-shadow(2px 2px 0 var(--acid)); }
.hud-panel.mirror .item-box { margin-left: 0; margin-right: auto; transform: rotate(-3deg); }
.item-box.empty { background: rgba(18, 16, 20, 0.6); border-style: dashed; border-color: rgba(238, 227, 199, 0.4); box-shadow: none; }
.item-box .q { font-family: var(--f-title); font-size: 40px; color: rgba(238, 227, 199, 0.35); }
.item-box.new { animation: itemPop 0.35s steps(4); }
@keyframes itemPop { 0% { transform: scale(0.3) rotate(-30deg); } 60% { transform: scale(1.2) rotate(8deg); } 100% { transform: scale(1) rotate(3deg); } }
.item-box .cnt {
  position: absolute; right: -12px; bottom: -10px;
  font-size: 18px;
  background: var(--pink);
  color: var(--bone);
  border: 2px solid var(--black);
  padding: 0 6px;
  transform: rotate(-8deg);
  box-shadow: 2px 2px 0 var(--black);
}
.item-name { font-family: var(--f-marker); font-size: 16px; margin-top: 9px; color: var(--bone); text-shadow: 2px 2px 0 var(--black), -1px -1px 0 var(--black); }

/* Avisos y estados en el lateral (no encima del coche): derecha en 1 jugador; en split, borde exterior de cada vista */
.flags { position: absolute; top: 42%; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.hud-split .hud-panel:not(.mirror) .flags,
.hud-split .hud-panel:not(.mirror) .hud-toasts { right: auto; left: 14px; align-items: flex-start; }
.flag {
  font-family: var(--f-num);
  letter-spacing: 1.5px;
  font-size: 28px;
  padding: 6px 20px 4px;
  border: 3px solid var(--black);
  box-shadow: var(--hard);
  color: var(--bone);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  transform: rotate(-2deg);
}
.flag.turuleco { background: var(--bruise); color: var(--acid); animation: shake 0.22s steps(2) infinite; }
.flag.rubber { background: var(--toxic); color: var(--ink); font-size: 18px; transform: rotate(2deg); }
.flag.dead { background: var(--ink); color: var(--pink); font-family: var(--f-title); font-size: 38px; letter-spacing: 0; border-color: var(--blood); box-shadow: 6px 6px 0 var(--blood); animation: bump 0.4s steps(3); }
.flag.dead small { display: block; width: 100%; font-family: var(--f-type); font-size: 15px; color: var(--bone); text-align: center; }
.flag.finished { background: var(--acid); color: var(--ink); }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes shake { 25% { transform: translateX(-3px) rotate(-3deg); } 75% { transform: translateX(3px) rotate(1deg); } }

.hud-toasts { position: absolute; top: 56%; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 46%; }
.toast {
  font-family: var(--f-num);
  letter-spacing: 1px;
  font-size: 20px;
  padding: 5px 16px 3px;
  background: var(--bone);
  color: var(--ink);
  border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  transform: rotate(var(--r, -1deg));
  animation: toastIn 0.25s steps(3) both;
  display: flex; align-items: center; gap: 8px;
}
.toast.out { animation: toastOut 0.25s steps(3) both; }
.toast.lap { background: var(--toxic); }
.toast.finish { background: var(--acid); font-size: 24px; }
.toast.danger { background: var(--pink); color: var(--bone); }
.toast.kill { background: var(--blood); color: var(--bone); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.6) rotate(-8deg); } to { opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px) scale(0.85); } }

/* Glitch al recibir daño (sólo en el panel del jugador tocado) */
.glitch-fx {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 5px),
    linear-gradient(90deg, rgba(255, 31, 109, 0.0) 0%, rgba(255, 31, 109, 0.0) 100%);
  box-shadow: inset 0 0 80px rgba(255, 31, 109, 0.55), inset 0 0 0 4px rgba(255, 31, 109, 0.6);
}
.hud-panel.glitch .glitch-fx { opacity: 1; animation: glitchFx 0.12s steps(2) infinite; }
.hud-panel.glitch .tl, .hud-panel.glitch .bl, .hud-panel.glitch .tr { animation: glitchShift 0.1s steps(2) infinite; }
@keyframes glitchFx {
  0% { clip-path: inset(0 0 0 0); transform: none; }
  50% { clip-path: inset(12% 0 30% 0); transform: translateX(6px); }
  100% { clip-path: inset(55% 0 5% 0); transform: translateX(-4px); }
}
@keyframes glitchShift {
  0% { transform: translate(-4px, 1px); filter: drop-shadow(3px 0 0 rgba(255, 31, 109, 0.95)) drop-shadow(-3px 0 0 rgba(182, 255, 0, 0.9)); }
  50% { transform: translate(3px, -2px) skewX(-4deg); filter: drop-shadow(-4px 0 0 rgba(255, 31, 109, 0.95)) drop-shadow(4px 0 0 rgba(0, 220, 255, 0.8)); }
  100% { transform: translate(1px, 2px); filter: none; }
}

/* Radio: retrato + bocadillo */
.radio-slot { margin-top: 10px; min-height: 0; }
.radio-msg { display: flex; align-items: flex-start; gap: 8px; max-width: 360px; animation: radioIn 0.25s steps(3) both; transform: rotate(var(--r, 0deg)); }
.radio-msg.out { animation: toastOut 0.25s steps(3) both; }
.hud-panel.mirror .radio-msg { flex-direction: row-reverse; text-align: right; }
.radio-msg .radio-face { border: 3px solid var(--black); outline: 2px solid var(--pc); background: var(--ink); box-shadow: 3px 3px 0 var(--black); }
.radio-msg .bubble {
  position: relative;
  background: var(--bone);
  color: var(--ink);
  border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  padding: 4px 10px 6px;
  min-width: 120px;
}
.radio-msg .bubble::before {
  content: ''; position: absolute; left: -10px; top: 12px;
  border: 6px solid transparent; border-right: 8px solid var(--black);
}
.hud-panel.mirror .radio-msg .bubble::before { left: auto; right: -10px; border-right-color: transparent; border-left: 8px solid var(--black); }
.radio-msg .who { font-family: var(--f-num); font-size: 11px; letter-spacing: 1.5px; color: var(--pc); background: var(--ink); display: inline-flex; align-items: center; gap: 4px; padding: 0 5px; margin-bottom: 2px; }
.radio-msg .say { font-family: var(--f-type); font-size: 16px; line-height: 1.2; font-weight: bold; }
.radio-msg.hot .bubble { background: var(--toxic); }
.radio-msg.compact { max-width: 300px; }
.radio-msg.compact .say { font-size: 14px; }
@keyframes radioIn { 0% { opacity: 0; transform: translateX(-20px) rotate(-6deg); } 60% { opacity: 1; transform: translateX(3px); } 100% { opacity: 1; } }
.radio-global { position: absolute; right: 14px; top: 132px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.radio-global .radio-msg { flex-direction: row-reverse; text-align: right; }
.radio-global .radio-msg .bubble::before { left: auto; right: -10px; border-right-color: transparent; border-left: 8px solid var(--black); }
.hud-split .radio-global { right: auto; left: 50%; transform: translateX(-50%); top: auto; bottom: 176px; align-items: center; }
.hud-split .radio-global .radio-msg { max-width: 260px; }

/* Separador de pantalla partida: cinta americana */
.split-divider {
  position: absolute;
  background-color: #8f8c86;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 5px), repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 3px, transparent 3px 9px);
  box-shadow: 0 0 0 2px var(--black);
}

/* Cuenta atrás */
/* En la franja superior (no en el centro): el coche local va centrado y lleva encima el indicador "TÚ"/J1/J2 durante la cuenta atrás */
.countdown { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 4vh; pointer-events: none; }
.countdown span {
  font-family: var(--f-num);
  font-size: min(34vw, 320px, 27vh);
  line-height: 1;
  color: var(--toxic);
  -webkit-text-stroke: 8px var(--black);
  paint-order: stroke fill;
  text-shadow: 10px 10px 0 var(--black), 18px 18px 0 var(--pink);
  animation: countPop 0.9s steps(6) both;
}
.countdown span.go { font-family: var(--f-title); color: var(--acid); font-size: min(19vw, 220px, 20vh); text-shadow: 8px 8px 0 var(--black), 14px 14px 0 var(--pink); animation: goPop 1s steps(6) both; }
@keyframes countPop {
  0% { transform: scale(2.4) rotate(-14deg); opacity: 0; }
  25% { transform: scale(1) rotate(4deg); opacity: 1; }
  80% { transform: scale(0.94) rotate(-2deg); opacity: 1; }
  100% { transform: scale(0.6); opacity: 0; }
}
@keyframes goPop {
  0% { transform: scale(0.3) rotate(12deg); opacity: 0; }
  25% { transform: scale(1.1) rotate(-5deg); opacity: 1; }
  75% { transform: scale(1) rotate(-3deg); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

.big-msg { position: absolute; top: 40%; left: 0; right: 0; text-align: center; animation: toastIn 0.35s steps(3) both; }
.big-msg span {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--f-title);
  font-size: clamp(30px, 5vw, 64px);
  color: var(--bone);
  background: var(--ink);
  padding: 6px 30px;
  border: 3px solid var(--black);
  box-shadow: 6px 6px 0 var(--pink);
  transform: rotate(-2deg);
}
.big-msg .ico { color: var(--acid); }
.finish-timer {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%) rotate(-1deg);
  font-family: var(--f-num); font-size: 20px; letter-spacing: 1px;
  background: var(--pink); color: var(--bone);
  border: 2px solid var(--black); padding: 3px 14px 1px;
  box-shadow: var(--hard);
  display: flex; align-items: center; gap: 8px;
  animation: blink 1s steps(2) infinite;
}

/* Kill feed */
.killfeed { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kill {
  font-family: var(--f-num);
  font-size: 15px;
  letter-spacing: 0.5px;
  background: rgba(18, 16, 20, 0.88);
  color: var(--bone);
  border-left: 5px solid var(--pink);
  padding: 3px 12px 2px;
  animation: toastIn 0.25s steps(3) both;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  box-shadow: 3px 3px 0 var(--black);
}
.kill i { font-family: var(--f-type); font-style: normal; font-size: 13px; color: rgba(238, 227, 199, 0.8); }
.kill .k-ico { color: var(--pink); }
.kill.out { animation: toastOut 0.25s steps(3) both; }

/* Minimapa */
.minimap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: 3px solid var(--black);
  outline: 2px dashed rgba(238, 227, 199, 0.35);
  outline-offset: -8px;
  background: rgba(18, 16, 20, 0.78);
  box-shadow: 5px 5px 0 var(--black);
  transform: rotate(1.5deg);
}
.hud-split .minimap { right: auto; left: 50%; transform: translateX(-50%) rotate(1.5deg); bottom: 14px; }

/* Clasificación en vivo */
.standings {
  position: absolute;
  left: 14px;
  top: 52%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 3px;
  font-family: var(--f-num); font-size: 14px; letter-spacing: 0.5px;
}
.hud-split .standings { left: 50%; top: 44%; transform: translate(-50%, -50%); }
.hud-split .standings .st { min-width: 150px; padding-top: 1px; padding-bottom: 1px; }
.hud-split .killfeed { top: 132px; }
.standings .st {
  display: flex; align-items: center; gap: 6px;
  background: rgba(18, 16, 20, 0.82);
  border-left: 5px solid var(--pc);
  padding: 2px 8px 2px 4px;
  min-width: 158px;
  box-shadow: 2px 2px 0 var(--black);
}
.standings .st.human { background: var(--pink); color: var(--bone); }
.standings .st .p { width: 16px; text-align: center; color: var(--toxic); font-size: 16px; }
.standings .st.human .p { color: var(--ink); }
.standings .st .n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.standings .st .me { font-size: 11px; line-height: 1; letter-spacing: 1px; padding: 2px 4px 1px; background: var(--ink); color: var(--toxic); border: 1px solid var(--black); transform: rotate(-3deg); }
.standings .st .s { color: var(--acid); display: flex; }
.standings .st-face { border: 1px solid var(--black); background: var(--ink); }
.standings .st.dead { opacity: 0.5; }

/* ---------------- Resultados / Podio ---------------- */
.results { width: min(1040px, 100%); }
.res-head { display: flex; flex-direction: column; align-items: center; }
.race-num { font-family: var(--f-num); letter-spacing: 3px; color: var(--acid); font-size: 16px; margin-bottom: 4px; }
.quotes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 0 0 12px; }
.quote-card { display: flex; align-items: center; gap: 10px; max-width: 400px; }
.quote-card .say { font-size: 14px !important; }
.quote-card .portrait { flex: none; }
.quote-card .portrait { border: 3px solid var(--black); outline: 2px solid var(--pc); background: var(--ink); box-shadow: 4px 4px 0 var(--black); transform: rotate(-3deg); }
.quote-card .bubble { background: var(--bone); color: var(--ink); border: 2px solid var(--black); box-shadow: 4px 4px 0 var(--black); padding: 5px 12px 7px; transform: rotate(1deg); }
.quote-card.win .bubble { background: var(--toxic); }
.quote-card .who { font-family: var(--f-num); font-size: 12px; letter-spacing: 1.5px; color: var(--blood); }
.quote-card .say { font-family: var(--f-type); font-size: 16px; font-weight: bold; }
.table-wrap { padding: 10px 14px 12px; }
table.res { width: 100%; border-collapse: separate; border-spacing: 0 4px; color: var(--ink); font-size: 14px; }
table.res th { font-family: var(--f-num); font-weight: normal; letter-spacing: 1.5px; font-size: 13px; color: var(--blood); text-align: left; padding: 0 8px; }
table.res td { padding: 3px 8px; background: rgba(18, 16, 20, 0.06); border-top: 1.5px solid rgba(18, 16, 20, 0.5); border-bottom: 1.5px solid rgba(18, 16, 20, 0.5); vertical-align: middle; }
table.res td:first-child { border-left: 6px solid var(--pc); font-family: var(--f-num); font-size: 24px; width: 60px; }
table.res td:last-child { border-right: 1.5px solid rgba(18, 16, 20, 0.5); }
table.res td .ico { color: var(--blood); }
table.res td.who .who-in { display: flex; align-items: center; gap: 8px; }
table.res td.who .nm { font-family: var(--f-marker); font-size: 17px; flex: 1; white-space: nowrap; }
table.res td.who .tag .ico { color: rgba(18, 16, 20, 0.5); }
table.res td.who .car { display: flex; align-items: center; gap: 4px; opacity: 0.75; }
table.res td.who .car .car-svg { width: 40px; height: 19px; --hole: var(--bone); }
table.res td.who .car small { font-family: var(--f-num); font-size: 11px; letter-spacing: 0.5px; }
.res-face { border: 2px solid var(--black); background: var(--ink); }
table.res tr { animation: rowIn 0.3s steps(4) both; }
table.res tr.first td { background: rgba(255, 230, 0, 0.55); }
table.res tr.human td { background: rgba(255, 31, 109, 0.2); }
table.res tr.human.first td { background: rgba(255, 230, 0, 0.6); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.pts-plus { color: var(--pink); font-family: var(--f-num); font-size: 18px; -webkit-text-stroke: 0.5px var(--black); }
.breakdown { font-size: 11px; opacity: 0.75; margin-left: 6px; }
table.res td.pos { white-space: nowrap; }
.levelup {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--f-num);
  letter-spacing: 1px;
  font-size: 12px;
  background: var(--acid);
  border: 2px solid var(--black);
  padding: 1px 6px;
  transform: rotate(-4deg);
  animation: levelUp 0.5s steps(4) both, blink 0.8s steps(2) 0.6s infinite;
}
@keyframes levelUp { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(-4deg); } }
.grid-notice {
  margin-top: 16px;
  background: var(--ink);
  border: 2px dashed var(--toxic);
  padding: 10px 16px;
  text-align: center;
  box-shadow: 5px 5px 0 var(--blood);
  font-size: 14px;
}
.grid-notice b { color: var(--toxic); }
.grid-notice .ico { color: var(--toxic); }
.grid-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; font-size: 13px; }
.grid-list span, .grid-notice.rest span { background: rgba(238, 227, 199, 0.08); border-left: 4px solid var(--pc); padding: 2px 8px; margin: 2px 4px; display: inline-block; }

.podium-screen .title { margin-bottom: 6px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 22px; margin: 6px 0 6px; }
.podium .step { display: flex; flex-direction: column; align-items: center; animation: podiumIn 0.6s steps(5) both; }
.podium .step:nth-child(1) { animation-delay: 0.35s; }
.podium .step:nth-child(2) { animation-delay: 0.8s; }
.podium .step:nth-child(3) { animation-delay: 0.1s; }
@keyframes podiumIn { from { opacity: 0; transform: translateY(140px); } to { opacity: 1; transform: none; } }
.podium .who { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 8px; max-width: 230px; }
.podium .who .crown { font-size: 46px; color: var(--toxic); filter: drop-shadow(3px 3px 0 var(--black)); animation: skullHead 0.9s steps(2) infinite; line-height: 1; }
.podium-face { border: 3px solid var(--black); outline: 3px solid var(--pc); background: var(--ink); box-shadow: 5px 5px 0 var(--black); transform: rotate(-3deg); }
.podium .nm { font-family: var(--f-marker); font-size: 22px; margin-top: 8px; color: var(--bone); text-shadow: 2px 2px 0 var(--black); }
.podium .pts { font-size: 13px; font-family: var(--f-type); }
.podium .pts b { color: var(--toxic); }
.podium .say { font-family: var(--f-type); font-size: 13px; margin-top: 4px; background: var(--bone); color: var(--ink); padding: 3px 8px; border: 2px solid var(--black); box-shadow: 3px 3px 0 var(--black); transform: rotate(1.5deg); }
.podium .p1 .say { background: var(--toxic); }
.podium .block {
  width: 170px;
  border: 3px solid var(--black);
  box-shadow: 6px 0 0 var(--black);
  display: flex; align-items: flex-start; justify-content: center;
  font-family: var(--f-num); font-size: 64px; color: var(--ink);
  padding-top: 4px;
  background:
    radial-gradient(circle at 10px 10px, #2a2224 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 10px) 10px, #2a2224 3px, transparent 3.5px);
}
.podium .p1 .block { height: 140px; background-color: var(--toxic); background-image: radial-gradient(circle at 10px 10px, #2a2224 3px, transparent 3.5px), radial-gradient(circle at calc(100% - 10px) 10px, #2a2224 3px, transparent 3.5px), repeating-linear-gradient(-45deg, transparent 0 18px, rgba(0, 0, 0, 0.85) 18px 30px); background-size: auto, auto, auto; background-position: 0 0, 0 0, 0 60px; }
.podium .p1 .block span { background: var(--toxic); padding: 0 10px; border: 3px solid var(--black); }
.podium .p2 .block { height: 100px; background-color: #a8a49b; }
.podium .p3 .block { height: 70px; background-color: var(--rust); color: var(--bone); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti i { position: absolute; top: -20px; height: 12px; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* Pausa */
.pause-box { color: var(--ink); padding: 30px 40px 22px; text-align: center; animation: cardIn 0.25s steps(3) both; min-width: 380px; }
.pause-box h2 { margin-top: 0; }
.pause-box .tape { position: absolute; width: 120px; height: 32px; background: rgba(150, 148, 140, 0.92); clip-path: var(--tape-cut); }
.pause-box .tape.t1 { top: -12px; left: -30px; transform: rotate(-30deg); }
.pause-box .tape.t2 { top: -10px; right: -34px; transform: rotate(26deg); }
.pause-sub { font-family: var(--f-marker); font-size: 20px; color: var(--blood); margin: -6px 0 18px; }
.pause-box .vol-row { margin-top: 10px; justify-content: space-between; }
.pause-box .btn-col { margin-bottom: 14px; }

/* Error visible */
#error {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: repeating-linear-gradient(-45deg, var(--ink) 0 30px, #1c0b10 30px 60px);
  padding: 30px;
  text-align: center;
}
#error h2 { font-family: var(--f-title); font-weight: normal; color: var(--pink); font-size: 36px; text-shadow: 3px 3px 0 var(--black); }
#error pre {
  max-width: 90vw; max-height: 55vh; overflow: auto;
  text-align: left; background: var(--bone); color: var(--ink); border: 3px solid var(--black);
  box-shadow: 6px 6px 0 var(--pink);
  padding: 14px; font-size: 13px; white-space: pre-wrap;
  user-select: text;
  font-family: var(--f-type);
}
.noscript { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; }

.mute-btn {
  position: fixed; right: 14px; top: 14px; z-index: 50;
  width: 44px; height: 44px;
  border: 2px solid var(--black); background: var(--bone); color: var(--ink); font-size: 24px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--black);
  transform: rotate(3deg);
  pointer-events: auto;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.now-playing {
  position: fixed; left: 14px; bottom: 14px; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  max-width: 60vw;
  font-family: var(--f-num); letter-spacing: 1px; font-size: 15px;
  background: var(--ink); color: var(--acid);
  border: 2px solid var(--acid);
  padding: 4px 12px 3px;
  box-shadow: 4px 4px 0 var(--pink);
  transform: rotate(-1deg);
  pointer-events: none;
}
.now-playing span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-playing.pop { animation: toastIn 0.25s steps(3) both; }
body.racing .now-playing { left: 50%; bottom: auto; top: 12px; transform: translateX(-50%) rotate(-1deg); }

/* Compacto (pantalla partida) */
.hud-panel.compact .hud-pos { font-size: 58px; }
.hud-panel.compact .hud-pos small { font-size: 24px; }
.hud-panel.compact .hud-lap { font-size: 21px; }
.hud-panel.compact .bars { width: 220px; }
.hud-panel.compact .bar-lbl { display: none; }
.hud-panel.compact .item-box { width: 68px; height: 68px; font-size: 42px; }
.hud-panel.compact .hud-name { font-size: 15px; max-width: 160px; }
.hud-panel.compact .flag { font-size: 22px; }
.hud-panel.compact .flag.dead { font-size: 28px; }
.hud-panel.compact .toast { font-size: 16px; }

@media (max-height: 760px) {
  .hud-pos { font-size: 60px; }
  .item-box { width: 66px; height: 66px; font-size: 40px; }
  .rally-word { font-size: 120px; }
  .logo-skull { font-size: 90px; }
  .screen { justify-content: flex-start; padding-top: 22px; }
  .title-screen, .pause-screen { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

body.racing .mute-btn { display: none; }

table.res td .dnf { font-size: 14px; margin-left: 4px; }

/* ---------------- Circuitos: tarjeta, minimapa, cartel previo ---------------- */
.track-card {
  display: flex; gap: 14px; align-items: center; text-align: left;
  background: var(--ink); color: var(--bone);
  border: 2px solid var(--tc, var(--pink)); border-left-width: 8px;
  padding: 8px 14px 8px 8px; box-shadow: 5px 5px 0 var(--black);
  transform: rotate(-0.6deg); max-width: 640px; width: 100%;
}
.track-map-wrap { flex: none; background: #000; border: 2px solid var(--bone); transform: rotate(2deg); box-shadow: 3px 3px 0 var(--tc, var(--pink)); line-height: 0; }
.track-map { display: block; }
.track-text { min-width: 0; }
.track-label { font-family: var(--f-num); letter-spacing: 2px; font-size: 13px; color: var(--acid); }
.track-name { font-family: var(--f-title); font-size: 22px; color: var(--tc, var(--pink)); text-shadow: 2px 2px 0 var(--black); line-height: 1.1; }
.track-blurb { font-size: 13px; line-height: 1.35; margin-top: 3px; opacity: 0.92; }
.track-fav { font-size: 13px; margin-top: 4px; }
.track-fav b { color: var(--toxic); }
.track-fav .ico { color: var(--pink); }
.track-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 12px; width: 100%; }
.track-rotation { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.track-rotation .track-card { width: auto; max-width: 300px; padding-right: 10px; }
.track-rotation .track-blurb { display: none; }
.track-rotation .track-name { font-size: 16px; }
.track-rotation-title { font-family: var(--f-marker); color: var(--toxic); font-size: 15px; transform: rotate(-1deg); }
/* Selector de circuitos: ROTACIÓN + una tarjeta por circuito (radiogroup). */
.track-picker { display: flex; gap: 10px; width: 100%; max-width: 1240px; overflow-x: auto; padding: 6px 8px 10px; outline: none; }
.track-opt { position: relative; flex: 1 1 0; min-width: 176px; display: flex; cursor: pointer; outline: none; }
.track-picker.ro .track-opt { cursor: default; }
.track-opt.rot { flex: 0.75 1 0; min-width: 132px; }
.track-opt .track-card { gap: 8px; padding: 5px 8px 5px 5px; max-width: none; height: 100%; opacity: 0.62; transition: opacity 0.1s, transform 0.1s; }
.track-opt .track-blurb { display: none; }
.track-opt .track-name { font-size: 15px; }
.track-opt .track-fav { font-size: 11px; line-height: 1.25; margin-top: 2px; }
.track-picker:not(.ro) .track-opt:hover .track-card { opacity: 0.9; }
.track-opt.sel .track-card, .track-opt.in-rot .track-card { opacity: 1; border-width: 4px; border-left-width: 10px; transform: rotate(-1.2deg) scale(1.03); box-shadow: 5px 5px 0 var(--black), 0 0 0 2px var(--tc, var(--pink)); }
.track-opt:focus-visible .track-card { outline: 3px dashed var(--acid); outline-offset: 3px; opacity: 1; }
.rot-card { --tc: var(--toxic); justify-content: center; }
.rot-card .rot-ico { font-size: 30px; color: var(--toxic); line-height: 0; }
.rot-card .rot-ico .ico { width: 30px; height: 30px; }
.track-chosen { display: none; position: absolute; top: -7px; right: 4px; z-index: 2; font-family: var(--f-num); font-size: 12px; letter-spacing: 1.5px; background: var(--tc, var(--toxic)); color: var(--ink); padding: 1px 6px; transform: rotate(3deg); box-shadow: 2px 2px 0 var(--black); }
.track-opt.rot .track-chosen { --tc: var(--toxic); }
.track-opt.sel .track-chosen { display: block; }
.next-track { display: flex; justify-content: center; margin-top: 14px; }
.next-track .track-card { max-width: 560px; }

.track-poster {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(18, 16, 20, 0.55) 0%, rgba(18, 16, 20, 0.9) 75%);
  animation: screenIn 0.25s steps(3) both; cursor: pointer;
}
.poster-box {
  position: relative; text-align: center; padding: 22px 38px 18px; max-width: min(900px, 92vw);
  background: var(--bone); color: var(--ink); clip-path: var(--torn);
  transform: rotate(-2deg); animation: posterSlam 0.35s steps(4) both;
}
.track-poster .poster-wrap { filter: drop-shadow(10px 10px 0 var(--black)); }
.poster-num { display: inline-block; font-family: var(--f-num); letter-spacing: 4px; font-size: 18px; background: var(--ink); color: var(--acid); padding: 2px 12px; transform: rotate(2deg); }
.poster-name {
  font-family: var(--f-title); font-size: clamp(42px, 8vw, 104px); line-height: 0.95; margin: 10px 0 6px;
  color: var(--tc, var(--pink)); -webkit-text-stroke: 2px var(--black);
  text-shadow: 5px 5px 0 var(--black), 9px 9px 0 var(--pink);
}
.poster-blurb { font-family: var(--f-type); font-size: 17px; max-width: 640px; margin: 0 auto 10px; }
.poster-map { display: inline-block; background: #000; padding: 4px; border: 3px solid var(--ink); transform: rotate(3deg); line-height: 0; }
.poster-skip { font-size: 12px; opacity: 0.6; margin-top: 8px; font-family: var(--f-type); }
@keyframes posterSlam { 0% { transform: scale(2.2) rotate(-12deg); opacity: 0; } 70% { transform: scale(0.95) rotate(-1deg); opacity: 1; } 100% { transform: rotate(-2deg); } }

/* =====================================================================
   ONLINE: título, entrada, sala (lobby), pie de resultados, HUD de red
   ===================================================================== */
.mode-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.btn.mode-btn { flex-direction: column; gap: 2px; min-width: 260px; padding: 12px 26px 10px; }
.btn.mode-btn .mode-main { display: inline-flex; align-items: center; gap: 12px; font-size: 34px; line-height: 1; }
.btn.mode-btn small { font-family: var(--f-type); font-size: 13px; letter-spacing: 0; text-shadow: none; opacity: 0.92; text-transform: none; }
.btn.mode-btn.online { background-color: var(--acid); color: var(--ink); text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25); }
.btn.mode-btn.online:hover, .btn.mode-btn.online:focus-visible { background-color: var(--acid); }

.online-screen h2.title { margin-bottom: 8px; }
.online-screen .subtitle { margin: 4px 0 18px; }
.subtitle.connecting span { display: inline-flex; gap: 10px; align-items: center; animation: blink 1s steps(2) infinite; }
.entry-grid { display: flex; flex-direction: column; gap: 18px; width: min(900px, 100%); align-items: stretch; }
.entry-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.entry-card .btn-col { margin-top: 10px; }
.entry-card .row input[type=text] { flex: 1; width: auto; min-width: 0; }
.entry-note { font-size: 13px; color: #3d3327; margin: 2px 0 6px; }
.code-box { position: relative; justify-content: center; padding: 10px 8px 12px; cursor: text; }
.code-letters { display: flex; gap: 10px; justify-content: center; pointer-events: none; }
.code-ch {
  width: 64px; height: 76px; display: inline-flex !important; align-items: center; justify-content: center;
  font-size: 52px; line-height: 1; border: 3px solid var(--black);
}
.code-ch.empty { background: rgba(18, 16, 20, 0.1); color: rgba(18, 16, 20, 0.3); border-style: dashed; box-shadow: none; font-family: var(--f-num); }
.code-ch.bad { background: var(--blood) !important; color: var(--bone) !important; text-decoration: line-through; }
.code-real { position: absolute; inset: 0; width: 100% !important; height: 100%; opacity: 0; cursor: text; font-size: 16px; }
.code-box:focus-within .code-letters .code-ch:not(.empty) { box-shadow: 4px 4px 0 var(--pink); }
.code-box:focus-within .code-ch.empty { border-color: var(--pink); animation: blink 1s steps(2) infinite; }
.btn.dim { opacity: 0.55; }

/* Partida rápida: botón gordo en la entrada + cuenta atrás en la cola */
.quick-card .btn-col { align-items: stretch; }
.btn.quick-btn { flex-direction: column; gap: 4px; width: 100%; padding: 14px 26px 12px; background-color: var(--toxic); color: var(--ink); text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18); transform: rotate(-0.6deg); }
.btn.quick-btn:hover, .btn.quick-btn:focus-visible { background-color: var(--toxic); }
.btn.quick-btn .mode-main { display: inline-flex; align-items: center; gap: 14px; font-size: 40px; line-height: 1; }
.btn.quick-btn small { font-family: var(--f-type); font-size: 13px; letter-spacing: 0; text-shadow: none; text-transform: none; opacity: 0.9; }
.quick-box { color: var(--ink); padding: 8px 22px 10px; text-align: center; transform: rotate(-1.2deg); }
.quick-clock { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.quick-clock small { font-family: var(--f-num); letter-spacing: 3px; font-size: 13px; color: var(--blood); }
.quick-clock b { font-family: var(--f-title); font-size: 64px; letter-spacing: 1px; margin: 2px 0 4px; color: var(--ink); text-shadow: 3px 3px 0 var(--toxic); }
.quick-clock.hot b { color: var(--blood); text-shadow: 3px 3px 0 var(--black); animation: blink 0.5s steps(2) infinite; }
.quick-count { font-family: var(--f-num); font-size: 15px; letter-spacing: 0.6px; display: inline-flex; gap: 6px; align-items: center; }
.quick-count b { color: var(--blood); font-size: 20px; }
.waiting-host.auto-next b { font-size: 30px; }

/* Sala */
.lobby { width: min(1240px, 100%); display: flex; flex-direction: column; align-items: center; }
.lobby-head { display: flex; align-items: center; justify-content: center; gap: 22px 34px; flex-wrap: wrap; margin-bottom: 12px; }
.lobby-head h2.title { margin: 0; }
.room-box { color: var(--ink); padding: 8px 18px 10px; text-align: center; transform: rotate(1.2deg); }
.room-lbl { font-family: var(--f-num); letter-spacing: 3px; font-size: 13px; color: var(--blood); }
.room-code .code-ransom { font-size: 46px; gap: 6px; margin: 2px 0 6px; }
.room-share { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.room-link { font-size: 11px; opacity: 0.7; user-select: all; max-width: 260px; overflow-wrap: anywhere; }
.lobby-grid { display: grid; grid-template-columns: minmax(330px, 1fr) minmax(330px, 1.15fr); gap: 22px; width: 100%; align-items: start; }
.slots-card h3 .slots-count { margin-left: auto; font-size: 13px; color: var(--bone); opacity: 0.8; }
.slots { display: flex; flex-direction: column; gap: 5px; }
.slot {
  display: grid; grid-template-columns: 50px 1fr auto auto; gap: 10px; align-items: center;
  padding: 4px 8px 4px 4px; background: rgba(18, 16, 20, 0.07);
  border: 1.5px solid rgba(18, 16, 20, 0.45); border-left: 6px solid var(--pc, var(--ink));
}
.slot.me { background: rgba(255, 31, 109, 0.18); }
.slot-face .portrait { border: 2px solid var(--black); background: var(--ink); transform: rotate(-3deg); box-shadow: 2px 2px 0 var(--black); }
.slot-face.bot { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--ink); color: rgba(238, 227, 199, 0.5); border: 2px dashed rgba(18, 16, 20, 0.6); }
.slot-main { min-width: 0; }
.slot-name { font-family: var(--f-marker); font-size: 18px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-name small { font-family: var(--f-type); font-size: 12px; color: var(--blood); }
.slot-name .crown { color: var(--rust); margin-right: 4px; font-size: 18px; }
.slot-sub { font-size: 12px; color: #3d3327; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-car .car-svg { width: 34px; height: 16px; vertical-align: -3px; --hole: var(--bone); }
.slot-ping { font-family: var(--f-num); font-size: 13px; letter-spacing: 0.5px; padding: 1px 6px; background: var(--ink); color: var(--bone); }
.slot-ping.good { color: var(--acid); }
.slot-ping.meh { color: var(--toxic); }
.slot-ping.bad { color: var(--pink); }
.slot-ready { font-family: var(--f-num); font-size: 14px; letter-spacing: 1px; padding: 2px 8px; border: 2px solid var(--black); background: rgba(18, 16, 20, 0.12); color: rgba(18, 16, 20, 0.55); transform: rotate(-3deg); min-width: 68px; text-align: center; }
.slot-ready.on { background: var(--acid); color: var(--ink); box-shadow: 2px 2px 0 var(--black); }
.slot.empty { opacity: 0.6; border-left-color: rgba(18, 16, 20, 0.4); border-style: dashed; }
.slot.empty .slot-name { font-family: var(--f-num); letter-spacing: 2px; }
.slot.empty .slot-num { font-family: var(--f-title); font-size: 22px; color: rgba(18, 16, 20, 0.35); grid-column: 3 / 5; }
.picker-card .char-tile { width: 56px; height: 56px; }
.picker-card .char-info { min-height: 0; margin: 2px 0; }
.picker-card .char-name { font-size: 22px; }
.picker-card .row input[type=text] { width: 200px; }
.lobby-config { margin: 14px 0 6px; }
.cfg-ro { font-family: var(--f-num); font-size: 15px; letter-spacing: 0.8px; padding: 6px 8px; display: flex; gap: 8px; align-items: center; }
.cfg-ro label { color: var(--acid); text-transform: uppercase; font-size: 14px; }
.cfg-ro .ico { color: var(--acid); }
.cfg-ro.note { font-family: var(--f-type); font-size: 13px; opacity: 0.75; }
.cfg-ro.note .ico { color: var(--toxic); }
.lobby-preview { width: 100%; }
.lobby-preview .track-preview { margin-bottom: 4px; }
.lobby-actions, .setup > .btn-row, .results .online-row {
  position: sticky; bottom: -28px; z-index: 5;
  width: calc(100% + 32px); margin: 10px -16px -28px; padding: 12px 16px 16px;
  background: linear-gradient(180deg, rgba(18, 16, 20, 0) 0%, rgba(18, 16, 20, 0.92) 26%, rgba(18, 16, 20, 0.97) 100%);
  align-items: center;
}
.lobby-hint { width: 100%; margin-top: 2px; }
.btn.force { background-color: var(--rust); }
.btn.force:hover, .btn.force:focus-visible { background-color: var(--rust); }
.ready-btn.on { background-color: var(--acid); color: var(--ink); text-shadow: none; }
.ready-btn.on:hover, .ready-btn.on:focus-visible { background-color: var(--acid); }
@media (max-width: 860px) { .lobby-grid { grid-template-columns: 1fr; } }

/* Pie online de resultados / podio */
.online-row { align-items: center; }
.online-next { display: flex; align-items: center; }
.waiting-host {
  font-family: var(--f-num); font-size: 22px; letter-spacing: 1px; color: var(--ink);
  background: var(--toxic); border: 3px solid var(--black); box-shadow: var(--hard);
  padding: 10px 22px 8px; transform: rotate(1deg); display: inline-flex; gap: 10px; align-items: center;
  animation: packPulse 1.6s ease-in-out infinite;
}
.waiting-host b { color: var(--blood); }
.online-clock { font-family: var(--f-num); font-size: 15px; letter-spacing: 1px; color: var(--bone); opacity: 0.85; display: inline-flex; gap: 6px; align-items: center; }
.online-clock b { color: var(--toxic); }
.podium-screen .online-row { position: static; width: auto; margin: 16px 0 0; padding: 0; background: none; }
table.res tr.me td { background: rgba(182, 255, 0, 0.35) !important; }
table.res tr.me td.who .nm::after { content: ' (TÚ)'; font-family: var(--f-num); font-size: 12px; color: var(--blood); }

/* Aviso a pantalla */
.online-msg { max-width: min(620px, 92vw); }
.msg-text { font-size: 17px; line-height: 1.45; margin: 4px 0 20px; }

/* HUD: sala + ping */
.net-badge {
  position: absolute; top: 12px; right: 220px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-num); font-size: 14px; letter-spacing: 1px;
  background: rgba(18, 16, 20, 0.85); color: var(--bone);
  border: 2px solid var(--black); box-shadow: 3px 3px 0 var(--black);
  padding: 3px 10px 2px; transform: rotate(-1deg);
}
.net-badge b { color: var(--toxic); }
.net-badge .ico { color: var(--bone); }
.net-badge .png { padding-left: 6px; border-left: 1.5px solid rgba(238, 227, 199, 0.3); }
.net-badge.good .png { color: var(--acid); }
.net-badge.meh .png { color: var(--toxic); }
.net-badge.bad .png { color: var(--pink); animation: blink 0.8s steps(2) infinite; }

/* Avisos de red (cambio de anfitrión, gente que se pira) */
.net-toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.net-toast {
  font-family: var(--f-num); font-size: 18px; letter-spacing: 0.8px;
  background: var(--bone); color: var(--ink); border: 3px solid var(--black); box-shadow: 5px 5px 0 var(--pink);
  padding: 6px 16px 4px; display: block; text-align: center; transform: rotate(-1deg);
  animation: toastIn 0.25s steps(3) both; max-width: 90vw;
}
.net-toast b { color: var(--blood); }
.net-toast .ico { color: var(--pink); }
.net-toast.out { animation: toastOut 0.25s steps(3) both; }

/* ---------------- Setup local compacto (pantallas bajas) ---------------- */
.screen { justify-content: safe center; }
.setup > .btn-row .btn.primary { padding: 10px 28px 8px; }
@media (max-height: 980px) {
  .setup-screen { padding-top: 18px; }
  .setup h2.title { margin-bottom: 6px; font-size: clamp(20px, 2.6vw, 30px); }
  .round-bar { margin-bottom: 8px; }
  .setup .track-preview { margin-bottom: 8px; }
  .setup .card { padding: 10px 16px 8px; }
  .setup .card h3 { margin-bottom: 6px; font-size: 18px; }
  .setup .char-info { min-height: 0; margin: 2px 0; }
  .setup .hint { margin-top: 6px; }
  .setup .warn { min-height: 0; margin-top: 2px; }
  .lobby-screen { padding-top: 18px; }
  .lobby-head { margin-bottom: 8px; }
  .lobby-head h2.title { font-size: clamp(22px, 3vw, 34px); }
  .room-code .code-ransom { font-size: 38px; }
  .lobby .card { padding: 10px 16px 8px; }
  .lobby .card h3 { margin-bottom: 6px; }
}
/* ===== CONTROLES: táctil y reasignación ===== */
/* --- Reasignar teclas (pantalla CONTROLES) --- */
.bind-status {
  width: min(1220px, 100%); min-height: 30px; margin: -4px 0 12px; padding: 6px 14px 5px;
  font-size: 14px; line-height: 1.5; text-align: center;
  background: var(--ink); color: var(--bone); border: 2px dashed rgba(238, 227, 199, 0.4);
  box-shadow: 4px 4px 0 var(--bruise); transform: rotate(-0.4deg);
}
.bind-status b { color: var(--toxic); }
.bind-status .ico { color: var(--acid); }
.bind-status.ok { border-color: var(--acid); box-shadow: 4px 4px 0 var(--acid); }
.bind-status.bad { border-color: var(--pink); box-shadow: 4px 4px 0 var(--pink); animation: bindShake 0.25s steps(3); }
.bind-status.bad .ico { color: var(--pink); }
@keyframes bindShake { 33% { transform: translateX(-6px) rotate(-1deg); } 66% { transform: translateX(6px) rotate(1deg); } }
.bind-list { display: flex; flex-direction: column; }
.bind-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 34px; padding: 4px 8px; margin: 0;
  background: transparent; color: var(--ink); border: 0; border-bottom: 1.5px dashed rgba(18, 16, 20, 0.3);
  font: 14px var(--f-type); text-align: left; cursor: pointer; outline: none;
}
.bind-btn .bind-act { font-family: var(--f-num); letter-spacing: 0.5px; font-size: 15px; }
.bind-btn .bind-val { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.bind-btn:hover, .bind-btn:focus, .bind-btn:focus-visible {
  background: rgba(255, 31, 109, 0.16); box-shadow: inset 4px 0 0 var(--pink), inset 0 0 0 2px var(--pink);
}
.bind-btn.listening { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 2px var(--acid); }
.kbd.hot { color: var(--ink); background: var(--acid); border-color: var(--black); animation: bindBlink 0.7s steps(2) infinite; }
.kbd.none { color: var(--pink); border-color: var(--pink); }
@keyframes bindBlink { 50% { background: var(--pink); color: var(--bone); } }
.bind-note { font-size: 12px; opacity: 0.8; margin: 8px 0 4px; line-height: 1.7; }
.bind-note .kbd { font-size: 11px; padding: 0 5px; }
.btn.bind-reset { font-size: 14px; padding: 5px 12px 4px; min-width: 0; margin-top: 6px; box-shadow: 3px 3px 0 var(--pink); }
.touch-card .row label { color: var(--ink); }
.touch-help { grid-template-columns: 1fr; margin-top: 8px; font-size: 13px; }
.touch-help li > .ico { font-size: 22px; }

/* --- Menús con el dedo: nada de zoom por doble toque ni destellos azules --- */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
body.touch-ui .bind-btn { min-height: 42px; }
@media (pointer: coarse) {
  .spinner .arrow { width: 38px; height: 38px; }
  .screen { overscroll-behavior: contain; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .btn { min-width: 0; }
}

/* --- Capa táctil en carrera --- */
/* Sin z-index: va en el DOM entre #hud y #ui, así la pausa y los menús la tapan. */
.touch-layer { position: fixed; inset: 0; pointer-events: none; display: none; touch-action: none; user-select: none; -webkit-user-select: none; }
body.racing.touch-ui .touch-layer { display: block; }
body.racing.touch-ui #game, body.racing.touch-ui #hud { touch-action: none; }
.touch-layer .ico { width: 1em; height: 1em; }
.tc-zone { position: absolute; left: 0; bottom: 0; width: 46%; height: 72%; pointer-events: auto; touch-action: none; }
.tc-zone-hint {
  position: absolute; left: calc(max(18px, env(safe-area-inset-left)) + 30px); bottom: calc(max(18px, env(safe-area-inset-bottom)) + 4px);
  font-family: var(--f-num); font-size: 12px; letter-spacing: 3px; color: var(--bone); opacity: 0.45; pointer-events: none;
}
.tc-stick {
  --r: 60px;
  position: absolute; left: calc(max(18px, env(safe-area-inset-left)) + var(--r) + 10px); top: calc(100% - var(--r) - max(40px, env(safe-area-inset-bottom) + 22px));
  width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border-radius: 50%; pointer-events: none;
  border: 3px dashed rgba(238, 227, 199, 0.55); background: radial-gradient(circle, rgba(18, 16, 20, 0.15) 0 40%, rgba(18, 16, 20, 0.45) 72%);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); opacity: 0.55; transition: opacity 0.1s steps(2);
}
.tc-zone.on .tc-stick { opacity: 1; border-color: var(--acid); }
.tc-zone.on .tc-zone-hint { opacity: 0; }
.tc-knob {
  position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; margin: -23% 0 0 -23%; border-radius: 50%;
  background: var(--acid); border: 3px solid var(--black); box-shadow: 3px 3px 0 var(--black), inset 0 0 0 5px rgba(0, 0, 0, 0.18);
}
.tc-zone.braking .tc-knob { background: var(--pink); }
.tc-zone.braking .tc-stick { border-color: var(--pink); }

.tc-btn {
  position: absolute; pointer-events: auto; touch-action: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: var(--s); height: var(--s); padding: 0; border-radius: 50%;
  font-family: var(--f-num); font-size: calc(var(--s) * 0.15); letter-spacing: 1px; line-height: 1;
  color: var(--ink); background: var(--bg, var(--bone)); border: 3px solid var(--black);
  box-shadow: 4px 4px 0 var(--black); opacity: 0.82; cursor: pointer; outline: none;
  -webkit-user-select: none; user-select: none;
}
.tc-btn .ico { font-size: calc(var(--s) * 0.42); }
.tc-btn.on { transform: translate(3px, 3px) scale(0.94); box-shadow: 1px 1px 0 var(--black), 0 0 0 4px var(--acid); opacity: 1; }
.tc-fire { --s: clamp(78px, 21vmin, 120px); --bg: var(--pink); color: var(--bone); right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); transform: rotate(-4deg); }
.tc-fire .ico { color: var(--bone); }
.tc-turbo { --s: clamp(60px, 15.5vmin, 88px); --bg: var(--toxic); right: calc(max(16px, env(safe-area-inset-right)) + clamp(78px, 21vmin, 120px) + 12px); bottom: max(14px, env(safe-area-inset-bottom)); transform: rotate(3deg); }
.tc-item { --s: clamp(50px, 12.5vmin, 72px); --bg: var(--acid); right: calc(max(16px, env(safe-area-inset-right)) + 14px); bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(78px, 21vmin, 120px) + 12px); transform: rotate(-2deg); }
.tc-brake { --s: clamp(78px, 21vmin, 120px); --bg: var(--bone); right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); transform: rotate(-4deg); } /* estilo Brawl Stars: FRENO el grande de la esquina, TURBO mediano al lado, OBJETO pequeño encima */
.tc-brake .ico { color: var(--blood); }
.tc-top {
  position: absolute; top: max(10px, env(safe-area-inset-top)); pointer-events: auto; touch-action: none;
  width: 46px; height: 46px; padding: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--ink); background: var(--bone); border: 2px solid var(--black); box-shadow: 3px 3px 0 var(--black);
  opacity: 0.8; cursor: pointer; outline: none;
}
.tc-top:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--black); }
.tc-pause { left: calc(50% - 52px); transform: rotate(-3deg); background: var(--toxic); }
.tc-full { left: calc(50% + 6px); transform: rotate(2deg); }
.tc-rotate {
  display: none; position: absolute; left: 50%; top: 40%; transform: translateX(-50%) rotate(-1.5deg);
  align-items: center; gap: 8px; width: max-content; max-width: 86vw; padding: 6px 12px 5px;
  font: 13px var(--f-type); color: var(--ink); background: var(--toxic); border: 2px solid var(--black); box-shadow: 3px 3px 0 var(--black);
  pointer-events: none; animation: tcGone 7s steps(6) forwards;
}
@keyframes tcGone { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.tc-rotate .ico { font-size: 22px; flex: none; }
@media (orientation: portrait) {
  .tc-rotate { display: flex; }
  .tc-zone { width: 50%; height: 50%; }
}
/* Con controles táctiles el HUD de abajo deja sitio a los dedos: minimapa arriba a la derecha, barras más arriba */
body.racing.touch-ui .minimap { top: 112px; bottom: auto; right: 14px; transform: rotate(1.5deg) scale(0.8); transform-origin: top right; }
body.racing.touch-ui .hud-panel .bl { bottom: auto; top: 58%; }
body.racing.touch-ui .now-playing { top: 64px; }
/* Móvil: sin kill feed ni cartel de REMONTADA (tus bajas ya salen como aviso propio); radio de 1 línea */
body.racing.touch-ui .killfeed,
body.racing.touch-ui .flag.rubber { display: none; }
body.racing.touch-ui .radio-slot .radio-msg { max-width: 260px; }
body.racing.touch-ui .radio-slot .radio-msg .say { font-size: 13px; }
/* Avisos arriba en el centro (donde estaba el kill feed), lejos de los botones; cartel de muerte más chico */
body.racing.touch-ui .hud-toasts { top: 62px; right: auto; left: 50%; transform: translateX(-50%); align-items: center; max-width: 60%; }
body.racing.touch-ui .toast { font-size: 15px; padding: 4px 12px 3px; }
body.racing.touch-ui .flags { top: 30%; right: 50%; transform: translateX(50%); align-items: center; }
body.racing.touch-ui .flag { font-size: 18px; padding: 4px 12px 3px; }
body.racing.touch-ui .flag.dead { font-size: 24px; }
body.racing.touch-ui .flag.dead small { font-size: 12px; }
/* Móvil en horizontal (poca altura): todo más chico y fuera la clasificación (la posición ya sale arriba) */
@media (max-height: 520px) {
  body.racing.touch-ui .standings { display: none; }
  body.racing.touch-ui .hud-panel .tl { transform: scale(0.72); transform-origin: top left; }
  body.racing.touch-ui .hud-panel .tr { transform: scale(0.72); transform-origin: top right; }
  body.racing.touch-ui .hud-panel .bl { top: 44%; transform: scale(0.72); transform-origin: top left; }
  body.racing.touch-ui .minimap { top: 8px; right: 84px; transform: rotate(1.5deg) scale(0.55); }
  body.racing.touch-ui .radio-global { top: 70px; transform: scale(0.8); transform-origin: top right; right: 200px; }
  body.racing.touch-ui .tc-top { width: 40px; height: 40px; font-size: 19px; }
}
@media (orientation: portrait) {
  body.racing.touch-ui .standings { display: none; }
  body.racing.touch-ui .minimap { top: 104px; transform: rotate(1.5deg) scale(0.6); }
  body.racing.touch-ui .hud-panel .tl { transform: scale(0.8); transform-origin: top left; }
  body.racing.touch-ui .hud-panel .bl { top: 34%; transform: scale(0.8); transform-origin: top left; }
}

.touch-card .spinner .value { min-width: 116px; }
/* ===== TUTORIAL / UN JUGADOR ===== */
/* Título: 1 JUGADOR / 2 JUGADORES / ONLINE + fila de Campeonato, Carrera de prueba y Controles */
.btn.mode-btn.duo { background-color: var(--toxic); color: var(--ink); text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2); }
.btn.mode-btn.duo:hover, .btn.mode-btn.duo:focus-visible { background-color: var(--toxic); }
.solo-row { margin-top: 0; }
.solo-row .btn small { font-family: var(--f-type); font-size: 12px; letter-spacing: 0; text-transform: none; opacity: 0.85; margin-left: 4px; }

/* Selector de dificultad de los bots */
.diff-row .value { transition: color 0.15s; }
.diff-row.diff-pringao .value { color: var(--acid); }
.diff-row.diff-normal .value { color: var(--toxic); }
.diff-row.diff-cabron .value { color: var(--pink); text-shadow: 2px 2px 0 var(--black); animation: shake 0.9s steps(2) infinite; }
.champ-note { margin-top: 10px; font-family: var(--f-type); font-size: 14px; }
.champ-note b { color: var(--toxic); }
.champ-note .ico { color: var(--pink); }

/* Chuleta del tutorial: papel pegado con cinta abajo en el centro */
.tuto-box {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) rotate(-0.8deg);
  width: min(560px, calc(100vw - 32px)); pointer-events: none;
  background: var(--bone); color: var(--ink); border: 3px solid var(--black);
  box-shadow: 6px 6px 0 var(--pink); padding: 10px 18px 10px;
  font-family: var(--f-type); font-size: 15px; line-height: 1.4;
}
body:not(.racing) .tuto-box { display: none; }
.tuto-box.dim { opacity: 0.7; }
.tuto-box.pop { animation: tutoIn 0.35s steps(3) both; }
@keyframes tutoIn { from { opacity: 0; transform: translateX(-50%) translateY(18px) rotate(-4deg) scale(0.8); } to { opacity: 1; transform: translateX(-50%) rotate(-0.8deg); } }
@keyframes tutoPraise { from { opacity: 0; transform: translateX(-50%) scale(0.4) rotate(-12deg); } to { opacity: 1; transform: translateX(-50%) rotate(-3deg); } }
.tuto-step { position: absolute; top: 8px; right: 14px; font-family: var(--f-num); font-size: 12px; letter-spacing: 1.5px; background: var(--ink); color: var(--acid); padding: 1px 7px; transform: rotate(3deg); }
.tuto-title { font-family: var(--f-title); font-size: 24px; line-height: 1.1; margin-bottom: 4px; }
.tuto-text b { color: var(--blood); }
.tuto-text .kbd { font-size: 14px; }
.tuto-subs { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.tuto-subs:empty { display: none; }
.tuto-subs span { display: inline-flex; align-items: center; gap: 5px; opacity: 0.7; }
.tuto-subs span.ok { opacity: 1; font-weight: bold; color: var(--blood); }
.tuto-subs i { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border: 2px solid var(--ink); font-style: normal; font-size: 12px; line-height: 1; }
.tuto-subs span.ok i { background: var(--acid); }
.tuto-bar { height: 9px; border: 2px solid var(--ink); margin-top: 7px; background: rgba(18, 16, 20, 0.12); }
.tuto-bar i { display: block; height: 100%; width: 0; background: var(--pink); transition: width 0.12s; }
.tuto-note { margin-top: 6px; font-size: 13px; color: var(--rust); font-weight: bold; }
.tuto-praise {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%) rotate(-3deg); white-space: nowrap;
  font-family: var(--f-num); font-size: 30px; letter-spacing: 1.5px;
  background: var(--acid); color: var(--ink); border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--black); padding: 2px 14px 0;
}
.tuto-praise.lazy { background: var(--toxic); font-size: 22px; }
.tuto-praise.pop { animation: tutoPraise 0.3s steps(3) both; }
/* Móvil: el cartel del tutorial arriba (debajo de pausa), estrecho y chico, sin tapar pista ni botones */
body.touch-ui .tuto-box { top: 56px; bottom: auto; width: min(360px, 42vw); padding: 4px 9px 5px; font-size: 11px; line-height: 1.25; box-shadow: 4px 4px 0 var(--pink); }
body.touch-ui .tuto-title { font-size: 12px; margin-bottom: 1px; }
body.touch-ui .tuto-title * { font-size: inherit !important; }
body.touch-ui .tuto-step { top: 4px; right: 8px; font-size: 10px; }
body.touch-ui .tuto-text .kbd { font-size: 10px; padding: 0 4px; }
body.touch-ui .tuto-subs { font-size: 11px; gap: 8px; margin-top: 3px; }
body.touch-ui .tuto-bar { height: 6px; margin-top: 4px; }
body.touch-ui .tuto-note { font-size: 11px; margin-top: 3px; }
body.touch-ui .tuto-praise { bottom: auto; top: calc(100% + 8px); font-size: 18px; }
body.racing.touch-ui:has(.tuto-box) .hud-toasts { top: 168px; }
.tuto-end .pause-sub b { color: var(--blood); }
.tuto-offer .pause-sub { max-width: 460px; margin-left: auto; margin-right: auto; }
@media (max-width: 640px) {
  .tuto-box { font-size: 13px; padding: 8px 12px; }
  .tuto-title { font-size: 19px; }
}

/* ===== PANTALLA COMPLETA (botón de esquina, aviso de iPhone) ===== */
.fs-corner {
  position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 46;
  width: 40px; height: 40px; padding: 8px; display: grid; place-items: center; cursor: pointer;
  background: rgba(18, 16, 20, .78); color: #eee3c7; border: 2px solid #000; box-shadow: 3px 3px 0 #000;
  opacity: .7; transition: opacity .15s, color .15s, background .15s;
}
.fs-corner svg { width: 100%; height: 100%; fill: currentColor; }
.fs-corner:hover, .fs-corner:focus-visible { opacity: 1; color: #121014; background: #b6ff00; outline: none; }
.fs-corner:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
#hud:not(.hidden) ~ .fs-corner { display: none; } /* en carrera estorba: F11, la pausa o el botón táctil */
.fs-tip {
  position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 52px); z-index: 47;
  width: min(320px, calc(100vw - 32px)); padding: 14px 16px; background: #eee3c7; color: #121014;
  border: 3px solid #000; box-shadow: 6px 6px 0 #000; font: 14px/1.45 'Special Elite', 'Courier New', monospace; transform: rotate(-1deg);
}
.fs-tip.hidden { display: none; }
.fs-tip > b { font-family: 'Anton', sans-serif; letter-spacing: 1px; color: #ff1f6d; }
.fs-tip p { margin: 6px 0 10px; }
.fs-tip svg { width: 18px; height: 18px; vertical-align: -3px; fill: currentColor; }
/* Móvil apaisado (poca altura): las cajas de papel (pausa, "¿primera vez?"...) caben enteras o hacen scroll por dentro. */
@media (max-height: 520px) {
  .pause-screen .pause-box { max-height: calc(100svh - 16px); overflow-y: auto; padding: 12px 22px 8px; min-width: 0; max-width: calc(100vw - 32px); }
  .pause-screen .pause-box h2 { font-size: 30px; margin-bottom: 4px; }
  .pause-screen .pause-sub { font-size: 15px; margin: 0 0 10px; }
  .pause-screen .btn-col { gap: 8px; margin-bottom: 6px; }
  .pause-screen .btn-col .btn { font-size: 20px; padding: 8px 18px; }
}

/* ===== ONLINE: chat/emotes ===== */
/* (sólo gestos de lista fija; sin chat de texto) */
.emote-card { width: 100%; padding: 8px 14px 8px; }
.emote-card h3 { margin-bottom: 6px; }
.emote-card h3 small { font-family: var(--f-type); font-size: 12px; opacity: 0.7; margin-left: 6px; }
.emote-row { display: flex; flex-wrap: wrap; gap: 6px; }
.emote-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 14px; }
.emote-btn .emote-ico { font-size: 22px; }
.emote-btn .emote-lbl { font-family: var(--f-marker); font-size: 13px; white-space: nowrap; }
.emote-feed { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; min-height: 0; }
.emote-line { width: fit-content; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); animation: emoteIn 0.25s steps(3) both; }
.emote-line:not(:first-child) { opacity: 0.55; }
.emote-who { font-family: var(--f-marker); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emote-what .emote-ico { font-size: 18px; color: var(--pink); vertical-align: -3px; }
.emote-txt { font-family: var(--f-type); }
.slot-face { position: relative; }
.emote-bubble {
  position: absolute; right: -12px; top: -10px; z-index: 2;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--toxic); color: var(--ink); border: 2px solid var(--black, #000); box-shadow: 2px 2px 0 var(--black, #000);
  transform: rotate(8deg); font-size: 22px; animation: emotePop 0.3s steps(3) both;
}
.slot.away { opacity: 0.6; filter: grayscale(0.7); }
.slot.away .slot-ping { animation: emoteBlink 1s steps(2) infinite; }
@keyframes emotePop { from { transform: scale(0.3) rotate(-20deg); } to { transform: scale(1) rotate(8deg); } }
@keyframes emoteBlink { 50% { opacity: 0.35; } }
@keyframes emoteIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
/* en carrera: gestos recibidos (esquina superior) y aviso de reconexión */
.race-emotes { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.race-emote { display: flex; align-items: center; gap: 8px; padding: 3px 12px; background: var(--ink); color: var(--bone); border: 2px solid var(--toxic); box-shadow: 3px 3px 0 var(--pink); font-family: var(--f-marker); font-size: 16px; animation: emoteIn 0.25s steps(3) both; }
.race-emote .emote-ico { font-size: 24px; color: var(--toxic); }
.race-emote.out { opacity: 0; transition: opacity 0.3s; }
.net-drop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(18, 16, 20, 0.55); pointer-events: none; }
.net-drop .pause-box { pointer-events: auto; max-width: 440px; text-align: center; }
@media (max-width: 600px) { .emote-btn .emote-lbl { display: none; } }
@media (prefers-reduced-motion: reduce) { .emote-line, .emote-bubble, .race-emote { animation: none; } .slot.away .slot-ping { animation: none; } }
/* Gestos dentro de "La panda": fila de iconos (el nombre sale al pasar el ratón; el último gesto, en el retrato y en la lista) */
.emote-card.in-slots { padding: 8px 0 0; margin-top: 8px; border-top: 2px dashed rgba(18, 16, 20, 0.35); }
.emote-card.in-slots .emote-head { font-family: var(--f-title); font-size: 15px; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.emote-card.in-slots .emote-head small { font-family: var(--f-type); font-size: 12px; opacity: 0.7; }
.emote-card.in-slots .emote-row { gap: 5px; }
.emote-card.in-slots .emote-btn { padding: 4px 7px; }
.emote-card.in-slots .emote-btn .emote-lbl { display: none; }
.emote-card.in-slots .emote-feed { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; min-height: 20px; }

/* ===== MÓVIL (pantalla bajita): pantallas más sencillas =====
   Mismo estilo, menos adorno: fuera pegatinas, cintas y pintadas de fondo; resultados en una sola pantalla. */
@media (max-height: 520px) {
  .deco .sticker, .deco .tape, .deco .spray { display: none; }
  .results-screen .quotes, .results-screen .next-track,
  table.res td.who .car, table.res .breakdown { display: none; }
  .results-screen { padding-top: 8px; padding-bottom: 8px; }
  .results-screen .race-num { font-size: 11px; margin-bottom: 0; }
  .results-screen .title { font-size: 22px; margin: 0 0 4px; }
  .results-screen .title * { font-size: inherit !important; }
  .results-screen .table-wrap { padding: 4px 8px 6px; }
  table.res { font-size: 12px; border-spacing: 0 2px; }
  table.res th { font-size: 10px; padding: 0 6px; }
  table.res td { padding: 1px 6px; }
  table.res td:first-child { font-size: 16px; width: 40px; }
  table.res td.who .nm { font-size: 13px; }
  table.res .res-face { width: 22px !important; height: 22px !important; }
  .pts-plus { font-size: 14px; }
  .levelup { font-size: 9px; padding: 0 4px; }
  .results-screen .grid-notice { margin-top: 6px; padding: 4px 10px; font-size: 11px; box-shadow: 3px 3px 0 var(--blood); }
  .results-screen .btn-row { margin-top: 8px; }
  .results-screen .btn { padding-top: 6px; padding-bottom: 6px; font-size: 15px; }
}

/* ===== TÍTULO SENCILLO: tu nombre arriba, 3 botones grandes y lo demás en pequeño ===== */
.screen.title-screen > .profile-chip {
  position: absolute; top: 60px; left: 20px; z-index: 2; display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--bone); border: 2px solid var(--black); box-shadow: 4px 4px 0 var(--pink);
  padding: 4px 12px 4px 4px; font-family: var(--f-num); font-size: 18px; letter-spacing: 1px; cursor: pointer;
}
.profile-chip .pc-face { border: 2px solid var(--black); }
.profile-chip .pc-edit { opacity: 0.6; font-size: 16px; }
.profile-chip:hover .pc-edit, .profile-chip:focus-visible .pc-edit { opacity: 1; color: var(--acid); }
.profile-chip input { width: 9.5em; font: inherit; color: var(--ink); background: var(--bone); border: 2px solid var(--acid); padding: 0 4px; }
.more-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; }
.btn.small-link { font-size: 14px; padding: 5px 12px; min-width: 0; box-shadow: 3px 3px 0 var(--black); }
.code-slot { display: inline-flex; gap: 6px; align-items: center; }
.code-mini { width: 5.2em; font-family: var(--f-num); font-size: 18px; letter-spacing: 4px; text-align: center; text-transform: uppercase; background: var(--bone); color: var(--ink); border: 2px solid var(--black); padding: 3px 4px; }
.code-mini.bad { border-color: var(--pink); animation: shake 0.22s steps(2) 2; }
.title-screen.simple .mode-row .btn.mode-btn { min-width: 220px; }
/* Móvil (pantalla bajita): todo en una pantalla, sin scroll */
@media (max-height: 520px) {
  .screen.title-screen > .profile-chip { top: 8px; left: 50%; transform: translateX(-50%); font-size: 14px; padding: 2px 10px 2px 2px; }
  .profile-chip .pc-face { width: 26px !important; height: 26px !important; }
  .title-screen.simple { padding-top: 44px; padding-bottom: 6px; }
  .title-screen.simple .logo { zoom: 0.5; margin: 0; }
  .title-screen.simple .subtitle { display: none; }
  .title-screen.simple .btn-col { gap: 10px; }
  .title-screen.simple .mode-row { gap: 10px; flex-wrap: nowrap; }
  .title-screen.simple .mode-row .btn.mode-btn { min-width: 0; padding: 8px 14px 6px; }
  .title-screen.simple .btn.mode-btn .mode-main { font-size: 22px; gap: 8px; }
  .title-screen.simple .btn.mode-btn small { font-size: 10px; }
  .btn.small-link { font-size: 12px; padding: 4px 9px; }
}

/* Botones secundarios del título: columna en el lateral derecho (debajo del altavoz), separados para el dedo */
.screen.title-screen > .more-row {
  position: absolute; right: 18px; top: 84px; z-index: 2;
  flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; width: 190px;
}
.screen.title-screen > .more-row .btn.small-link { justify-content: flex-start; min-height: 40px; width: 100%; }
.screen.title-screen > .more-row .code-slot { flex-wrap: wrap; width: 100%; }
.screen.title-screen > .more-row .code-slot .code-mini + .btn.small-link { width: auto; }
.screen.title-screen > .more-row .code-mini { width: 100%; }
@media (max-height: 520px) {
  .screen.title-screen > .more-row { top: 64px; right: 12px; width: 150px; gap: 8px; }
  .title-screen.simple { padding-right: 170px; } /* el centro se aparta de la columna de la derecha */
  .screen.title-screen > .more-row .btn.small-link { min-height: 38px; font-size: 12px; }
  .screen.title-screen > .more-row .code-mini { font-size: 15px; }
}

/* JUGAR en móvil: personaje + coche + botón, sin scroll. Opciones: solo las filas (circuito con ◀ ▶) */
@media (max-height: 520px) {
  .setup-screen { padding-top: 6px; padding-bottom: 6px; }
  .setup h2.title { font-size: 18px; margin-bottom: 4px; }
  .setup h2.title * { font-size: inherit !important; }
  .setup-simple .char-info, .setup-simple .car-info { display: none; }
  .setup-simple .player-card { padding: 8px 12px; }
  .setup-simple .char-tile .portrait { width: 52px !important; height: 52px !important; }
  .setup-simple .car-grid { margin-top: 10px; gap: 6px; }
  .setup-simple .car-tile { padding: 4px 4px 3px; }
  .setup-simple .car-tile .car-svg { width: 44px; height: 21px; }
  .setup-simple .car-tile .car-name { font-size: 14px; }
  .setup-opts .track-preview, .setup-opts .hint { display: none; }
  .setup .btn-row { margin-top: 8px; }
  .setup .btn-row .btn { font-size: 16px; padding: 6px 16px 5px; }
  .setup > .btn-row .btn.primary { padding: 6px 20px 5px; }
  .round-bar .row label { font-size: 12px; }
  .round-bar .spinner .value { min-width: 78px; font-size: 13px; padding: 2px 6px; }
}

/* Paso 2 (circuito) en móvil: tarjetas en rejilla 3+2, sin scroll lateral ni textos largos */
@media (max-height: 520px) {
  .setup-track .track-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow: visible; max-width: 760px; }
  .setup-track .track-opt, .setup-track .track-opt.rot { min-width: 0; }
  .setup-track .track-opt .track-fav, .setup-track .track-rotation-title { display: none; }
  .setup-track .track-opt .track-name { font-size: 13px; }
}

/* Escaparate 3D del coche (JUGAR, 1 jugador) */
.car-stage { position: relative; display: block; width: 100%; height: 260px; padding: 0; margin-top: 8px; }
.car-stage:focus-visible { outline: 3px dashed var(--acid); outline-offset: 2px; }
.showroom, .showroom-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.showroom-canvas:active { cursor: grabbing; }
.cs-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: var(--toxic); color: var(--ink); border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--black); cursor: pointer; font-size: 26px;
}
.cs-arrow .ico { width: 28px; height: 28px; }
.cs-arrow.prev { left: 6px; transform: translateY(-50%) rotate(-3deg); }
.cs-arrow.next { right: 6px; transform: translateY(-50%) rotate(3deg); }
.cs-arrow:active { transform: translateY(-50%) scale(0.92); }
.cs-label { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; pointer-events: none; text-align: center; width: 70%; }
.cs-name { font-family: var(--f-num); font-size: 26px; letter-spacing: 1px; background: var(--ink); color: var(--toxic); padding: 0 12px; transform: rotate(-2deg); }
.cs-tag { font-family: var(--f-type); font-size: 12px; color: var(--ink); background: var(--bone); padding: 1px 8px; margin-top: 3px; }
@media (max-height: 520px) {
  .car-stage { height: 150px; margin-top: 2px; }
  .cs-arrow { width: 42px; height: 42px; }
  .cs-name { font-size: 18px; }
  .cs-tag { display: none; }
}

/* Garaje: coche 3D a la izquierda (grande), características a la derecha */
.garage { display: grid; grid-template-columns: 1fr 280px; gap: 14px; align-items: center; width: 100%; margin-top: 8px; }
.garage .car-stage { margin-top: 0; }
.garage .car-info { display: flex; flex-direction: column; gap: 8px; background: var(--ink); color: var(--bone); border: 3px solid var(--black); box-shadow: 5px 5px 0 var(--pink); padding: 10px 12px; transform: rotate(0.6deg); }
.garage .car-info .car-desc { font-size: 13px; color: var(--bone); }
.garage .car-info .stat-row, .garage .car-info label, .garage .car-info span { color: var(--bone); }
@media (max-height: 520px) {
  .setup-simple .garage .car-info { display: flex; padding: 6px 8px; gap: 4px; }
  .garage { grid-template-columns: 1fr 210px; gap: 8px; margin-top: 2px; }
  .garage .car-info .car-desc { display: none; }
  .garage .car-stage { height: 170px; }
}

/* ---- Garaje cartoon punk: persiana metálica, neón, franja de peligro y suelo de taller con manchas de aceite ---- */
.garage .statbar i { border-color: rgba(238, 227, 199, 0.45); }
.garage .statbar i.on { background: var(--toxic); border-color: var(--toxic); }
.garage .statbar i.on:nth-child(5) { background: var(--pink); border-color: var(--pink); }
.garage .stats { grid-template-columns: auto 1fr; }
.row.car-stage, .row.car-stage:focus, .row.car-stage:hover, .row.car-stage:focus-visible {
  border: 3px solid var(--black); box-shadow: 5px 5px 0 var(--black); overflow: hidden;
  background:
    radial-gradient(ellipse 16% 7% at 22% 84%, rgba(10, 8, 12, 0.75), transparent 70%),
    radial-gradient(ellipse 10% 5% at 80% 92%, rgba(10, 8, 12, 0.6), transparent 70%),
    radial-gradient(ellipse 7% 3% at 66% 76%, rgba(10, 8, 12, 0.5), transparent 70%),
    linear-gradient(180deg, transparent 0 63%, #5b524b 63% 100%),
    repeating-linear-gradient(180deg, #4b4552 0 7px, #322d38 7px 10px, #57505e 10px 12px);
}
.row.car-stage:focus-visible { outline: 3px dashed var(--acid); outline-offset: 2px; }
.car-stage::before { /* letrero de neón */
  content: 'TALLER DEL DIABLO'; position: absolute; top: 10px; left: 50%; transform: translateX(-50%) rotate(-2deg); z-index: 1;
  font-family: var(--f-marker); font-size: 18px; white-space: nowrap; color: #ffd6e6; padding: 1px 12px;
  border: 2px solid var(--pink); border-radius: 6px; background: rgba(18, 16, 20, 0.6);
  text-shadow: 0 0 4px var(--pink), 0 0 10px var(--pink), 0 0 18px var(--pink); box-shadow: 0 0 10px var(--pink), inset 0 0 8px var(--pink);
  animation: neonFlick 4s steps(1) infinite;
}
.car-stage::after { /* franja de peligro entre pared y suelo */
  content: ''; position: absolute; left: 0; right: 0; top: 63%; height: 9px; z-index: 0;
  background: repeating-linear-gradient(45deg, var(--toxic) 0 10px, var(--black) 10px 20px);
}
@keyframes neonFlick { 0%, 46%, 50%, 100% { opacity: 1; } 47%, 49% { opacity: 0.35; } }
.showroom { z-index: 1; }
@media (max-height: 520px) {
  .garage .car-stage { height: 152px; }
  .car-stage::before { font-size: 12px; top: 5px; }
}

/* Tu perfil (nombre + personaje) */
.profile { width: min(760px, 100%); display: flex; flex-direction: column; align-items: center; }
.profile-card { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 14px 18px; }
.profile .name-row { display: flex; align-items: center; gap: 12px; }
.profile .name-row label { font-family: var(--f-num); letter-spacing: 1px; color: var(--blood); white-space: nowrap; }
.profile .name-row input { flex: 1; font-family: var(--f-num); font-size: 22px; letter-spacing: 1px; padding: 4px 10px; background: var(--bone); color: var(--ink); border: 3px solid var(--black); }
/* JUGAR con 1 jugador: el coche es el protagonista */
.setup-simple .n1 .garage .car-stage { height: 380px; }
@media (max-height: 520px) {
  .profile h2.title { font-size: 18px; margin-bottom: 4px; }
  .profile h2.title * { font-size: inherit !important; }
  .profile-card { gap: 6px; padding: 8px 12px; }
  .profile .name-row input { font-size: 16px; padding: 2px 8px; }
  .profile .char-tile .portrait { width: 52px !important; height: 52px !important; }
  .profile .char-info .big { width: 52px !important; height: 52px !important; }
  .profile .btn-row { margin-top: 8px; }
  .profile .btn-row .btn { font-size: 16px; padding: 6px 16px 5px; }
  .setup-simple .n1 .garage .car-stage { height: 230px; }
}

/* Garaje grande en PC (1 jugador) */
.setup-simple .setup-grid.n1 { max-width: 1100px; }
.setup-simple .n1 .garage { grid-template-columns: 1fr 300px; }
.setup-simple .n1 .cs-tag { display: none; } /* la descripción ya sale en la ficha de la derecha */

/* Repintados de una pantalla ya abierta: nada de zoom/entrada otra vez */
.screen.rebuilt .card, .screen.rebuilt .round-bar, .screen.rebuilt .track-opt, .screen.rebuilt .char-tile, .screen.rebuilt .car-tile { animation: none !important; }

/* Garaje con 2 jugadores (uno por tarjeta): coche arriba, ficha debajo, compacto */
.setup-grid.n2 .garage { grid-template-columns: 1fr; gap: 6px; }
.setup-grid.n2 .garage .car-stage { height: 200px; }
.setup-grid.n2 .garage .car-info { transform: none; padding: 6px 10px; }
.setup-grid.n2 .garage .car-info .car-desc { display: none; }
.setup-grid.n2 .cs-tag { display: none; }

/* ===== SALA ONLINE sencilla ===== */
/* Las 4 pantallas del flujo (título · garaje · circuito · sala) con el mismo esqueleto: cabecera, contenido y barra
   abajo (◀ atrás a la izquierda · secundario en medio · principal a la derecha). Sin scroll en 844x390 ni en 1400x900. */

/* --- barra de abajo común (garaje y circuito) */
.setup > .btn-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.setup > .btn-row > .btn { margin: 0; }
.setup > .btn-row > .btn:first-child { justify-self: start; }
.setup > .btn-row > .btn:last-child { grid-column: 3; justify-self: end; }
.setup > .btn-row > .btn:nth-child(2):not(:last-child) { grid-column: 2; justify-self: center; }
@media (max-height: 520px) {
  .setup > .btn-row .btn { min-height: 44px; }
}

/* --- garaje: columna derecha = ficha del coche (cuadro negro) arriba + la tarjeta del circuito abajo: la MISMA
   .track-opt/.track-card de "¿DÓNDE TE MATAS?". Pulsable (.pick) si se puede cambiar: abre la pantalla de circuito. */
.garage-side { align-self: stretch; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.garage-side > .car-info { flex: 1 1 auto; min-height: 0; }
.garage .garage-side .car-info { transform: none; justify-content: center; }
.garage-trackpick.track-opt { flex: none; min-width: 0; width: 100%; padding-top: 6px; cursor: default; }
.garage-trackpick.track-opt.pick { cursor: pointer; }
.garage-trackpick .track-card { padding: 6px 10px 6px 6px; transform: rotate(-0.6deg); }
.garage-trackpick .track-name { font-size: 17px; }
.garage-trackpick .track-fav { font-size: 12px; line-height: 1.25; }
.garage-trackpick .track-chosen { display: block; display: inline-flex; align-items: center; gap: 2px; }
.garage-trackpick .track-chosen .ico { width: 12px; height: 12px; }
.garage-trackpick.pick:hover .track-card, .garage-trackpick.pick:focus-visible .track-card { box-shadow: 5px 5px 0 var(--black), 0 0 0 3px var(--acid); }
.setup-grid.n2 .garage-side { gap: 10px; }
.setup-grid.n2 .garage-trackpick .track-fav { display: none; }
@media (max-height: 520px) {
  .garage-side { gap: 10px; }
  .garage-trackpick.track-opt { padding-top: 4px; }
  .garage-trackpick .track-card { gap: 6px; padding: 3px 6px 3px 3px; border-left-width: 6px; }
  .garage-trackpick .track-map-wrap canvas { width: 40px !important; height: 40px !important; }
  .garage-trackpick .rot-ico .ico { width: 22px; height: 22px; }
  .garage-trackpick .track-name { font-size: 13px; }
  .garage-trackpick .track-fav { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .setup-grid.n2 .garage-trackpick .track-map-wrap canvas { width: 30px !important; height: 30px !important; }
}

/* --- 2 en este PC en móvil: dos garajes lado a lado sin scroll (personajes en una fila, coche en el taller) */
@media (max-height: 520px) {
  .setup-grid.n2 { gap: 10px; grid-template-columns: 1fr 1fr; }
  .setup-grid.n2 .player-card { padding: 4px 8px 6px; display: flex; flex-direction: column; gap: 4px; }
  .setup-grid.n2 .card-head { margin: 0; padding: 0 6px; }
  .setup-grid.n2 .card-head .pl-num { font-size: 20px; }
  .setup-grid.n2 .card-head .spinner .value { font-size: 12px; padding: 1px 4px; }
  .setup-grid.n2 .card-head .spinner .arrow { width: 30px; height: 30px; }
  .setup-grid.n2 .char-row { margin: 0; padding: 2px 4px; }
  .setup-grid.n2 .char-grid { flex-wrap: nowrap; gap: 3px; }
  .setup-grid.n2 .char-tile { width: 40px; height: 40px; padding: 1px; border-width: 2px; line-height: 0; }
  .setup-grid.n2 .char-tile .portrait { width: 34px !important; height: 34px !important; }
  .setup-grid.n2 .char-tile.sel { transform: rotate(-4deg) scale(1.06); }
  .setup-grid.n2 .char-tile .taken-tag { display: none; } /* pillado = en gris */
  .setup-grid.n2 .char-info { display: none; }
  .setup-grid.n2 .garage { grid-template-columns: 1fr; margin-top: 0; }
  .setup-grid.n2 .garage .car-stage { height: 150px; }
  .setup-grid.n2 .garage-side { display: none; } /* ficha y circuito: en PC; aquí no caben con dos garajes */
}

/* --- carreras en la pantalla de circuito (online, anfitrión) */
.track-races { margin: 10px auto 0; }
@media (max-height: 520px) { .track-races { margin-top: 4px; padding: 0 10px; } .track-races .spinner .arrow { width: 32px; height: 32px; } }

/* --- SALA */
.screen.l2-screen { justify-content: center; padding: 16px 24px 14px; }
.l2 { width: min(1240px, 100%); height: 100%; max-height: 760px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.l2-head { display: flex; align-items: center; justify-content: center; gap: 10px 26px; flex-wrap: wrap; flex: none; }
.l2-head h2.title { margin: 0; font-size: clamp(22px, 3vw, 36px); }
.l2-room { display: flex; align-items: center; gap: 10px; font-family: var(--f-num); letter-spacing: 1px; font-size: 14px; color: var(--bone); background: var(--ink); border: 2px dashed rgba(238, 227, 199, 0.4); padding: 4px 6px 4px 12px; box-shadow: 4px 4px 0 var(--blood); }
.l2-room .ico { color: var(--acid); }
.l2-room-lbl { color: var(--acid); }
.l2-code .code-ransom { font-size: 30px; line-height: 1; }
.l2-copy.btn.small { font-size: 15px; padding: 6px 12px; min-width: 0; min-height: 44px; box-shadow: 3px 3px 0 var(--black); }
.l2-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 16px; align-items: stretch; }
/* tu coche en 3D (mismo taller que el garaje): tocarlo = cambiar coche */
.row.car-stage.l2-mycar { height: auto; min-height: 0; margin: 0; cursor: pointer; }
.l2-mycar .cs-name { font-size: 22px; }
.l2-mycar-tag { position: absolute; top: 6px; right: 6px; z-index: 3; display: inline-flex; align-items: center; gap: 2px; font-family: var(--f-num); font-size: 13px; letter-spacing: 1.5px; background: var(--toxic); color: var(--ink); padding: 2px 8px; border: 2px solid var(--black); box-shadow: 2px 2px 0 var(--black); transform: rotate(3deg); }
.l2-mycar-tag .ico { width: 12px; height: 12px; }
.l2-mycar::before { display: none; } /* sin letrero de neón: aquí no cabe */
.row.car-stage.l2-mycar:hover, .row.car-stage.l2-mycar:focus-visible { box-shadow: 5px 5px 0 var(--black), 0 0 0 3px var(--acid); }
/* circuito en grande (centro) */
.l2-center.card { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 14px; min-height: 0; overflow: hidden; }
.l2-track { display: flex; justify-content: center; min-height: 0; }
.l2-circuit { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; width: min(100%, 560px); text-align: center; background: var(--ink); color: var(--bone); padding: 12px 16px; border: 3px solid var(--black); border-top: 8px solid var(--tc); box-shadow: 6px 6px 0 var(--black); overflow: hidden; }
.l2-circuit .track-map-wrap { box-shadow: 4px 4px 0 var(--tc, var(--pink)); }
.l2-maps { display: grid; grid-template-columns: repeat(2, auto); gap: 12px; }
.l2-ctop { display: flex; align-items: baseline; justify-content: center; gap: 8px; max-width: 100%; min-width: 0; }
.l2-clabel { flex: none; font-family: var(--f-num); font-size: 14px; letter-spacing: 2px; color: var(--acid); }
.l2-cname { min-width: 0; font-size: 26px; color: var(--tc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l2-races { font-family: var(--f-num); font-size: 18px; letter-spacing: 1px; }
.l2-races b { color: var(--toxic); }
.l2-races .ico { color: var(--acid); }
.l2-circuit .track-fav, .l2-plan { font-size: 14px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.l2-plan { font-family: var(--f-num); letter-spacing: 1px; color: var(--toxic); }
.l2-change { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.l2-change .btn.small { min-height: 44px; font-size: 16px; padding: 6px 14px; min-width: 0; box-shadow: 4px 4px 0 var(--black); }
/* la panda (derecha) */
.l2-panda.card { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.l2-panda h3 { margin: -2px -4px 4px; font-size: 18px; padding: 4px 10px; }
.l2-panda h3 .slots-count { margin-left: auto; font-size: 15px; color: var(--bone); }
.l2-slots { display: flex; flex-direction: column; gap: 5px; }
.l2-slot { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; min-height: 44px; padding: 3px 8px 3px 4px; background: rgba(18, 16, 20, 0.07); border: 1.5px solid rgba(18, 16, 20, 0.45); border-left: 6px solid var(--pc, var(--ink)); }
.l2-slot.me { background: rgba(255, 31, 109, 0.18); }
.l2-slot.away { opacity: 0.6; filter: grayscale(0.7); }
.l2-slot .slot-face { position: relative; line-height: 0; }
.l2-slot .slot-face .portrait { border: 2px solid var(--black); background: var(--ink); }
.l2-slot .emote-bubble { width: 26px; height: 26px; font-size: 17px; right: -10px; top: -8px; }
.l2-who { min-width: 0; }
.l2-name { font-family: var(--f-marker); font-size: 17px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l2-name small { font-family: var(--f-type); font-size: 12px; color: var(--blood); }
.l2-name .crown { color: var(--rust); margin-right: 3px; }
.l2-car { font-family: var(--f-num); font-size: 12px; letter-spacing: 1px; color: #3d3327; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l2-car .car-svg { width: 28px; height: 13px; vertical-align: middle; --hole: var(--bone); }
.l2-slot .slot-ping { font-size: 12px; padding: 0 5px; white-space: nowrap; }
.l2-state { font-family: var(--f-num); font-size: 13px; letter-spacing: 1px; padding: 1px 6px; border: 2px solid var(--black); color: rgba(18, 16, 20, 0.55); }
.l2-state.on { background: var(--acid); color: var(--ink); }
.l2-bots { font-family: var(--f-num); font-size: 15px; letter-spacing: 1px; color: rgba(18, 16, 20, 0.75); padding: 4px 8px; border: 1.5px dashed rgba(18, 16, 20, 0.45); }
.l2-bots .ico { color: var(--blood); }
/* aviso flotante y barra de abajo: ◀ Salir · gestos · principal */
.l2-warn { position: absolute; left: 0; right: 0; bottom: 84px; z-index: 6; margin: 0; min-height: 0; pointer-events: none; }
.l2-warn:empty { display: none; }
.l2-bar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.l2-bar > .l2-exit { justify-self: start; }
.l2-bar > .l2-main-act { justify-self: end; }
.l2-bar .btn.l2-exit { min-width: 160px; font-size: 20px; padding: 10px 20px 9px; }
.l2-emotes { justify-content: center; flex-wrap: nowrap; gap: 6px; }
.l2-emotes .emote-btn { padding: 0; width: 46px; height: 46px; justify-content: center; box-shadow: 3px 3px 0 var(--black); transform: none; }
.l2-emotes .emote-btn .emote-ico { font-size: 26px; }
.l2-main-act .btn.primary { min-width: 230px; font-size: 28px; padding: 10px 28px 8px; }
.l2-main-act .btn.primary small { font-family: var(--f-num); font-size: 14px; text-shadow: none; }
.l2-clock { flex-direction: row; align-items: baseline; gap: 10px; background: var(--bone); color: var(--ink); border: 3px solid var(--black); box-shadow: 5px 5px 0 var(--pink); padding: 4px 18px 2px; transform: rotate(-1.5deg); }
.l2-clock small { font-size: 14px; }
.l2-clock b { font-size: 42px; margin: 0; }
@media (max-width: 1100px) { .l2-grid { grid-template-columns: 240px minmax(0, 1fr) 280px; } }
/* móvil apaisado (pantalla bajita) */
@media (max-height: 520px) {
  .screen.l2-screen { padding: 6px 16px 6px; }
  .l2 { gap: 6px; }
  .l2-head h2.title { font-size: 20px; }
  .l2-head h2.title * { font-size: inherit !important; }
  .l2-room { font-size: 12px; padding: 2px 4px 2px 8px; gap: 8px; }
  .l2-code .code-ransom { font-size: 20px; }
  .l2-copy.btn.small { font-size: 13px; padding: 3px 10px; min-height: 36px; }
  .l2-grid { grid-template-columns: 190px minmax(0, 1fr) 230px; gap: 10px; }
  .l2-mycar .cs-name { font-size: 16px; }
  .l2-mycar-tag { font-size: 12px; padding: 1px 5px; top: 4px; right: 4px; }
  .l2-slot .slot-ping { display: none; }
  .l2-state { font-size: 12px; padding: 0 4px; }
  .l2-center.card { padding: 8px 10px; gap: 8px; }
  .l2-circuit { gap: 4px; padding: 4px 8px 6px; border-top-width: 5px; box-shadow: 4px 4px 0 var(--black); }
  .l2-map canvas { width: 104px !important; height: 104px !important; }
  .l2-maps { gap: 6px; }
  .l2-maps canvas { width: 50px !important; height: 50px !important; }
  .l2-clabel { font-size: 12px; }
  .l2-cname { font-size: 17px; }
  .l2-races { font-size: 14px; }
  .l2-circuit .track-fav, .l2-plan { font-size: 12px; line-height: 1.3; }
  .l2-change { gap: 8px; }
  .l2-change .btn.small { font-size: 13px; padding: 4px 10px; }
  .l2-panda.card { padding: 6px 8px; gap: 4px; }
  .l2-panda h3 { font-size: 15px; padding: 2px 8px; margin-bottom: 2px; }
  .l2-slots { gap: 3px; }
  .l2-slot { grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 5px; min-height: 34px; padding: 1px 5px 1px 2px; }
  .l2-slot .portrait { width: 26px !important; height: 26px !important; }
  .l2-name { font-size: 14px; }
  .l2-car { display: none; }
  .l2-bots { font-size: 12px; padding: 2px 6px; }
  .l2-bar { gap: 8px; }
  .l2-bar .btn.l2-exit { min-width: 0; min-height: 44px; font-size: 16px; padding: 6px 14px 5px; }
  .l2-emotes { gap: 4px; }
  .l2-emotes .emote-btn { width: 44px; height: 44px; }
  .l2-emotes .emote-btn .emote-ico { font-size: 22px; }
  .l2-main-act .btn.primary { min-width: 0; min-height: 44px; font-size: 18px; padding: 6px 18px 5px; }
  .l2-main-act .btn.primary small { font-size: 12px; }
  .l2-clock { padding: 2px 12px 0; gap: 6px; }
  .l2-clock small { font-size: 12px; letter-spacing: 1px; }
  .l2-clock b { font-size: 28px; }
  .l2-warn { bottom: 54px; font-size: 14px; }
}

/* --- pausa y menú online en móvil: dos columnas (botones | volumen y opciones) para que quepa sin scroll */
@media (max-height: 520px) {
  .pause-screen:not(.tuto-offer) .pause-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); column-gap: 22px; align-items: center; max-height: none; overflow: visible; padding: 10px 20px 10px; }
  .pause-screen:not(.tuto-offer) .pause-box > h2 { grid-column: 1; grid-row: 1; }
  .pause-screen:not(.tuto-offer) .pause-box > .pause-sub { grid-column: 1; grid-row: 2; }
  .pause-screen:not(.tuto-offer) .pause-box > .btn-col { grid-column: 1; grid-row: 3 / span 3; }
  .pause-screen:not(.tuto-offer) .pause-box > .row { grid-column: 2; margin: 0; padding: 4px 6px; }
  .pause-screen:not(.tuto-offer) .pause-box > .hint { display: none; } /* atajos de teclado: aquí no pintan */
  .pause-screen .btn-col .btn { min-height: 44px; font-size: 17px; padding: 6px 14px; }
  .pause-screen .pause-box > .row input[type=range] { width: 110px; }
}

/* --- podio en móvil: entero en la pantalla (caras más pequeñas, sin bocadillos) */
@media (max-height: 520px) {
  .podium-screen { padding-top: 6px; padding-bottom: 6px; }
  .podium-screen .title { font-size: 22px; margin: 0 0 2px; }
  .podium-screen .title * { font-size: inherit !important; }
  .podium-screen .subtitle { margin: 0 0 4px; font-size: 13px; }
  .podium { margin: 2px 0; gap: 14px; }
  .podium .who { margin-bottom: 4px; }
  .podium .who .crown { font-size: 24px; }
  .podium .podium-face { width: 56px !important; height: 56px !important; }
  .podium .p1 .podium-face { width: 70px !important; height: 70px !important; }
  .podium .nm { font-size: 15px; margin-top: 4px; }
  .podium .pts { font-size: 12px; }
  .podium .say { display: none; }
  .podium .p1 .block { height: 54px; }
  .podium .p2 .block { height: 38px; }
  .podium .p3 .block { height: 26px; }
  .podium .block span { font-size: 22px; }
  .podium-screen .grid-notice { margin-top: 4px; padding: 3px 10px; font-size: 12px; }
  .podium-screen .btn-row { margin-top: 6px; }
  .podium-screen .btn-row .btn { min-height: 44px; font-size: 16px; padding: 6px 16px; }
}

/* --- fichas de personaje: el retrato nunca más grande que su casilla */
.char-tile > .portrait { display: block; max-width: 100% !important; max-height: 100% !important; }
.setup-grid.n2 .char-tile .taken-tag { display: none; } /* con dos garajes no cabe el cartel: pillado = en gris */

/* ---------------------------------------------------------------------------------------------------------------
   SISTEMA VISUAL "punk sin tanta película" (CRITICA.md §2): superficies gris oscuro con radio pequeño, rosa SOLO para
   la acción principal, acid SOLO para selección/foco, dos sombras neutras, 0° de giro en lo que se pulsa o se lee,
   cintas/pegatinas solo en título y podio. Los títulos ransom y los personajes siguen siendo el punk.
   --------------------------------------------------------------------------------------------------------------- */
:root {
  --bg: #141117; --surface-1: #1e1a22; --surface-2: #29232e; --surface-3: #342d3a;
  --line: rgba(238, 227, 199, 0.12); --line-strong: rgba(238, 227, 199, 0.28);
  --text: #eee3c7; --text-dim: rgba(238, 227, 199, 0.64); --text-on-accent: #141117;
  --accent: var(--pink); --focus: var(--acid); --warn: var(--toxic); --danger: var(--rust);
  --r: 6px;
  --sh-btn: 0 4px 0 #000; --sh-btn-press: 0 1px 0 #000; --sh-panel: 0 10px 30px rgba(0, 0, 0, 0.45); --ring: 0 0 0 3px var(--focus);
  --hard: var(--sh-btn); --hard-lg: var(--sh-panel);
}

/* esquinas: nada por encima del contenido. "← Web" vive en Opciones › Partida; ⛶ junto al altavoz, arriba */
.web-link { display: none !important; }
.mute-btn { transform: none; border-radius: var(--r); background: var(--surface-3); color: var(--text); border: 2px solid #000; box-shadow: var(--sh-btn); }
.fs-corner { top: 14px; bottom: auto; right: 66px; width: 44px; height: 44px; border-radius: var(--r); background: var(--surface-3); box-shadow: var(--sh-btn); opacity: 1; }
.fs-tip { top: 66px; bottom: auto; transform: none; border-radius: var(--r); box-shadow: var(--sh-panel); }
/* un solo hueco de avisos arriba-centro; fuera si tapa el cartel previo o la pausa */
.now-playing { left: 50%; right: auto; bottom: auto; top: 12px; transform: translateX(-50%); max-width: min(60vw, 420px); background: var(--surface-1); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--sh-panel); }
.now-playing .ico { color: var(--focus); }
body.racing .now-playing { transform: translateX(-50%); }
body:has(.track-poster) .now-playing, body:has(.pause-screen) .now-playing, body:has(.opts-modal) .now-playing { display: none; }
.radio-msg { transform: none; }

/* botones: rectos, radio pequeño, sombra negra abajo; el primario rosa, el resto neutro */
.btn, .btn:nth-child(2n) { transform: none; border-radius: var(--r); border-width: 2px; box-shadow: var(--sh-btn); }
.btn:hover, .btn:focus-visible, .btn.focus { transform: translateY(-1px); box-shadow: var(--sh-btn), var(--ring); text-shadow: none; }
.btn:active { transform: translateY(3px); box-shadow: var(--sh-btn-press); }
.btn.primary { text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55); }
.btn.primary:hover, .btn.primary:focus-visible { animation: none; }
.btn.secondary, .btn.secondary:hover, .btn.secondary:focus-visible { background: var(--surface-3); color: var(--text); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); box-shadow: none; }
.btn.ghost:hover, .btn.ghost:focus-visible { box-shadow: var(--ring); }
.btn.danger, .btn.danger:hover, .btn.danger:focus-visible { background: var(--danger); color: var(--text); }
.btn:not(.primary):not(.secondary):not(.ghost):not(.danger):not(.emote-btn) { background: var(--surface-3); color: var(--text); }

/* paneles: superficie gris oscuro (el papel rasgado queda para el título, la pausa y el podio) */
.paper:not(.pause-box) { filter: none; }
.paper:not(.pause-box)::before { background: var(--surface-1); background-image: none; clip-path: none; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-panel); }
.card { color: var(--text); }
.card h3 { transform: none; box-shadow: none; background: var(--surface-2); border-radius: var(--r); color: var(--text); }
.card h3 .ico { color: var(--focus); }
.garage .car-info, .garage .garage-side .car-info { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; transform: none; }
.garage .statbar i.on:nth-child(5) { background: var(--focus); border-color: var(--focus); }
.garage .statbar i.on { background: var(--text); border-color: var(--text); }
.row.car-stage, .row.car-stage:focus, .row.car-stage:hover, .row.car-stage:focus-visible { border-radius: var(--r); border: 2px solid #000; box-shadow: var(--sh-panel); }
.row.car-stage:focus-visible, .row.car-stage.l2-mycar:hover { box-shadow: var(--sh-panel), var(--ring); outline: none; }
.cs-arrow, .cs-arrow.prev, .cs-arrow.next { transform: translateY(-50%); border-radius: var(--r); box-shadow: var(--sh-btn); width: 56px; height: 56px; }
.cs-arrow:active { transform: translateY(calc(-50% + 3px)); box-shadow: var(--sh-btn-press); }
.cs-name { transform: none; border-radius: var(--r); }

/* tarjetas de circuito: neutras; la elegida, anillo acid + ✓ */
.track-card { background: var(--surface-2); border: 1px solid var(--line); border-left-width: 1px; border-radius: var(--r); transform: none; box-shadow: none; }
.track-card .track-name, .track-name { color: var(--text); text-shadow: none; }
.track-map-wrap { transform: none !important; box-shadow: none !important; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.track-fav b { color: var(--text); }
.track-fav .ico { color: var(--text-dim); }
.rot-card .rot-ico { color: var(--text); }
.track-opt .track-card { opacity: 0.72; }
.track-opt.sel .track-card, .track-opt.in-rot .track-card { opacity: 1; transform: none; border-width: 1px; border-left-width: 1px; box-shadow: inset 0 0 0 3px var(--focus); }
.track-opt.in-rot:not(.sel) .track-card { box-shadow: inset 0 0 0 1px var(--focus); }
.track-opt:focus-visible .track-card { outline: none; box-shadow: inset 0 0 0 3px var(--focus), var(--ring); opacity: 1; }
.track-chosen { top: 6px; right: 6px; transform: none; background: var(--focus); color: var(--text-on-accent); box-shadow: none; border-radius: 4px; padding: 0 6px; }
/* selector "¿DÓNDE TE MATAS?": 5 tarjetas verticales iguales en fila */
.setup-track .track-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; overflow: visible; max-width: 1200px; padding: 6px 4px 10px; }
.setup-track .track-opt, .setup-track .track-opt.rot { min-width: 0; flex: none; }
.setup-track .track-opt .track-card { flex-direction: column; justify-content: flex-start; align-items: center; text-align: center; gap: 10px; padding: 12px 10px; height: 100%; }
.setup-track .track-opt .track-map-wrap canvas { width: 150px !important; height: 150px !important; }
.setup-track .rot-card .rot-ico { flex: none; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: 4px; }
.setup-track .rot-card .rot-ico .ico { width: 64px; height: 64px; }
.setup-track .track-opt .track-name { font-size: 18px; }
.setup-track .track-opt .track-fav { font-size: 13px; line-height: 1.3; }
.setup-track .track-rotation-title { font-family: var(--f-type); color: var(--text-dim); font-size: 14px; transform: none; }
@media (max-height: 520px) {
  .setup-track .track-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: none; }
  .setup-track .track-opt .track-card { gap: 6px; padding: 8px 6px; }
  .setup-track .track-opt .track-map-wrap canvas { width: 96px !important; height: 96px !important; }
  .setup-track .rot-card .rot-ico { width: 96px; height: 96px; }
  .setup-track .rot-card .rot-ico .ico { width: 40px; height: 40px; }
  .setup-track .track-opt .track-name { font-size: 13px; }
  .setup-track .track-opt .track-fav { display: none; }
  .setup-track .track-rotation-title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
/* garaje: la tarjeta del circuito, recta, entera pulsable con un chevron dentro */
.garage-trackpick .track-card { transform: none; position: relative; padding-right: 30px; }
.garage-trackpick .track-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.garage-trackpick .track-text { min-width: 0; }
.garage-trackpick .gt-chev { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text); line-height: 0; }
.garage-trackpick .gt-chev .ico { width: 18px; height: 18px; }
.garage-trackpick.pick:hover .track-card, .garage-trackpick.pick:focus-visible .track-card { box-shadow: inset 0 0 0 3px var(--focus), var(--ring); }
.garage-trackpick.track-opt.sel .track-card { box-shadow: none; }

/* personajes: rectos; el elegido con anillo acid */
.char-tile, .char-tile:nth-child(odd), .char-tile:nth-child(even) { transform: none; border-radius: var(--r); box-shadow: none; border: 2px solid var(--line-strong); }
.char-tile.sel { transform: none; border-color: var(--focus); box-shadow: var(--ring); }
.char-info .portrait.big { transform: none; box-shadow: none; border: 2px solid var(--line-strong); border-radius: var(--r); }
.char-grid { justify-content: center; }

/* decoración: solo título y podio (y sin la pintada de fondo animada) */
.screen:not(.title-screen):not(.podium-screen) > .deco .tape,
.screen:not(.title-screen):not(.podium-screen) > .deco .sticker,
.screen:not(.title-screen):not(.podium-screen) > .deco .spray { display: none; }
.deco .grain { animation: none; opacity: 0.18; }
.deco .halftone { opacity: 0.12; }
.pause-box .tape { display: none; }

/* título: JUGAR es lo principal; ONLINE y COLEGAS neutros del mismo tamaño */
.btn.mode-btn.online, .btn.mode-btn.duo, .btn.mode-btn.online:hover, .btn.mode-btn.duo:hover, .btn.mode-btn.online:focus-visible, .btn.mode-btn.duo:focus-visible { background-color: var(--surface-3); background-image: none; color: var(--text); text-shadow: none; }
.profile-chip { transform: none; border-radius: var(--r); box-shadow: var(--sh-btn); }
@media (pointer: coarse) { .screen.title-screen [data-id="local"] { display: none; } }

/* pausa: 4 botones del mismo ancho (SEGUIR · OPCIONES · REINICIAR · SALIR) */
.pause-screen:not(.tuto-offer) .btn-col { align-items: stretch; width: min(360px, 100%); margin: 0 auto; }
.pause-screen:not(.tuto-offer) .btn-col .btn { width: 100%; }
@media (max-height: 520px) {
  .pause-screen:not(.tuto-offer) .pause-box { display: block; padding: 10px 26px 14px; }
  .pause-screen:not(.tuto-offer) .btn-col { gap: 8px; }
}

/* resultados: datos, sin adornos; el 1º solo con su posición, tu fila en rosa */
table.res { color: var(--text); }
table.res th { color: var(--text-dim); }
table.res td { background: rgba(238, 227, 199, 0.04); border-color: var(--line); }
table.res td:first-child { border-left: 3px solid var(--line-strong); }
table.res td:last-child { border-right-color: var(--line); }
table.res td .ico, table.res td.who .tag .ico { color: var(--text-dim); }
table.res tr.first td { background: rgba(238, 227, 199, 0.08); }
table.res tr.me td { background: rgba(255, 31, 109, 0.18) !important; }
table.res tr.me td.who .nm::after { color: var(--accent); }
table.res td.who .car .car-svg { --hole: var(--surface-1); }
.levelup { background: none; color: var(--warn); transform: none; box-shadow: none; border: none; padding: 0 0 0 6px; }
.pts-plus { color: var(--warn); }

/* sala: superficies neutras, sin sombras de color */
.l2-room { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; transform: none; }
.l2-circuit { background: var(--surface-2); border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
.l2-cname { color: var(--text); text-shadow: none; }
.l2-slot { background: rgba(238, 227, 199, 0.05); border: 1px solid var(--line); border-left: 4px solid var(--pc, var(--line-strong)); border-radius: 4px; }
.l2-slot.me { background: rgba(255, 31, 109, 0.18); }
.l2-car { color: var(--text-dim); }
.l2-car .car-svg { --hole: var(--surface-1); }
.l2-name small { color: var(--accent); }
.l2-state { color: var(--text-dim); border: 1px solid var(--line-strong); border-radius: 4px; transform: none; }
.l2-state.on { background: var(--focus); color: var(--text-on-accent); border-color: var(--focus); }
.l2-bots { color: var(--text-dim); border: 1px dashed var(--line-strong); border-radius: 4px; }
.l2-bots .ico { color: var(--text-dim); }
.l2-mycar-tag { transform: none; border-radius: 4px; box-shadow: none; background: var(--focus); }
.l2-clock { transform: none; border-radius: var(--r); box-shadow: var(--sh-btn); background: var(--surface-3); color: var(--text); border: 2px solid #000; }
.l2-clock small { color: var(--text-dim); }
.l2-clock b { color: var(--text); text-shadow: none; }
.l2-clock.hot b { color: var(--accent); text-shadow: none; }
.l2-mid { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; }
.l2-fanbtn, .l2-optsbtn { min-width: 0; min-height: 46px; padding: 6px 14px; font-size: 18px; }
.l2-fanbtn { width: 50px; padding: 0; }
.l2-fanbtn .emote-ico { font-size: 26px; }
.l2-fanbtn.on { box-shadow: var(--sh-btn), var(--ring); }
.l2-emote-fan { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 8; display: flex; flex-wrap: nowrap; gap: 6px; padding: 8px; background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--sh-panel); }
.l2-emote-fan[hidden] { display: none; }
.l2-emote-fan .emote-btn { width: 46px; height: 46px; padding: 0; justify-content: center; }
.l2-emote-fan .emote-btn .emote-ico { font-size: 26px; }
@media (max-height: 520px) {
  .l2-fanbtn, .l2-optsbtn { min-height: 44px; font-size: 15px; padding: 4px 10px; }
  .l2-fanbtn { width: 46px; padding: 0; }
  .l2-emote-fan .emote-btn { width: 44px; height: 44px; }
}

/* ---- Opciones: modal único con pestañas PARTIDA · SONIDO · CONTROLES · PERFIL ---- */
.screen.opts-modal { position: fixed; inset: 0; z-index: 70; padding: 16px; justify-content: center; align-items: center; overflow: hidden; background: rgba(10, 8, 12, 0.72); animation: optsIn 0.16s ease-out both; }
@keyframes optsIn { from { opacity: 0; } to { opacity: 1; } }
.opts-box { width: min(880px, 100%); height: min(640px, 100%); display: flex; flex-direction: column; background: var(--surface-1); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--sh-panel); overflow: hidden; animation: optsBoxIn 0.16s ease-out both; }
@keyframes optsBoxIn { from { transform: translateY(12px); } to { transform: none; } }
.opts-tabs { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); }
.opts-tab { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--f-num); font-size: 18px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); background: transparent; border: none; border-bottom: 3px solid transparent; cursor: pointer; outline: none; }
.opts-tab:hover, .opts-tab:focus-visible { color: var(--text); background: var(--surface-2); border-radius: var(--r) var(--r) 0 0; }
.opts-tab.on { color: var(--text); border-bottom-color: var(--focus); }
.opts-tab .ico { width: 18px; height: 18px; }
.opts-body { flex: 1; min-height: 0; overflow: hidden; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.opts-body > .row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; margin: 0; padding: 6px 8px; border-radius: var(--r); }
.opts-body > .row label { color: var(--text-dim); }
.opts-body .spinner { justify-self: start; }
.opts-body .spinner .arrow { width: 44px; height: 44px; border-radius: var(--r); }
.opts-body .spinner .value { min-width: 190px; border-radius: var(--r); background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.opts-body .row:focus, .opts-body .row:focus-visible, .opts-body .row:focus-within { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--focus); }
.opts-note { font-size: 14px; line-height: 1.4; color: var(--text-dim); padding: 4px 8px; }
.opts-note b { color: var(--text); }
.opts-sub { display: flex; gap: 8px; flex-wrap: wrap; }
.opts-chip { min-height: 44px; padding: 4px 14px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-num); font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; outline: none; }
.opts-chip.on { background: var(--focus); color: var(--text-on-accent); border-color: var(--focus); }
.opts-chip:focus-visible { box-shadow: var(--ring); }
.opts-controles .bind-status { margin: 0; width: auto; transform: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; color: var(--text); font-size: 13px; padding: 4px 10px; min-height: 0; }
.opts-controles .card { padding: 8px 10px; flex: 1; min-height: 0; animation: none; }
.opts-controles .card.paper::before { background: transparent; border: none; box-shadow: none; }
.opts-controles .card h3 { display: none; }
.opts-controles .bind-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.opts-controles .bind-note { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.opts-controles .touch-help { font-size: 13px; }
.opts-perfil > .row.name-row { grid-template-columns: 170px 1fr; }
.opts-perfil .name-row input { font-family: var(--f-num); font-size: 22px; letter-spacing: 1px; padding: 4px 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r); }
.opts-perfil .char-tile { width: 84px; height: 84px; }
.opts-perfil .char-info { min-height: 0; }
.opts-perfil .char-info .char-tag { color: var(--text-dim); }
.opts-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.opts-foot .btn { min-width: 0; font-size: 18px; padding: 8px 18px; }
.opts-foot .btn.primary { font-size: 22px; min-width: 160px; }
.opts-foot-left { display: flex; gap: 10px; }
.opts-web { text-decoration: none; }
@media (max-height: 520px) {
  .screen.opts-modal { padding: 8px 16px; }
  .opts-box { height: 100%; border-radius: 8px; }
  .opts-tabs { padding: 4px 6px 0; gap: 4px; }
  .opts-tab { min-height: 44px; font-size: 14px; gap: 4px; }
  .opts-body { padding: 6px 12px; gap: 4px; }
  .opts-body > .row { grid-template-columns: 130px 1fr; padding: 2px 6px; }
  .opts-body .spinner .value { min-width: 150px; font-size: 13px; }
  .opts-note { font-size: 12px; padding: 2px 6px; }
  .opts-chip { font-size: 13px; padding: 2px 10px; }
  .opts-controles .bind-status { font-size: 12px; padding: 2px 8px; }
  .opts-controles .card { padding: 4px 6px; }
  .opts-controles .bind-row, .opts-controles .bind-list > * { min-height: 36px; padding-top: 2px; padding-bottom: 2px; }
  .opts-controles .bind-note { display: none; }
  .opts-controles .touch-help { display: none; }
  .opts-perfil .name-row input { font-size: 16px; padding: 2px 8px; }
  .opts-perfil .char-tile { width: 54px; height: 54px; }
  .opts-perfil .char-info .portrait.big { display: none; }
  .opts-foot { padding: 4px 10px; }
  .opts-foot .btn { min-height: 44px; font-size: 15px; padding: 4px 12px; }
  .opts-foot .btn.primary { font-size: 18px; min-width: 120px; }
}
@media (max-height: 520px) {
  .opts-partida { display: grid; grid-template-columns: 1fr 1fr; align-content: start; column-gap: 12px; row-gap: 4px; }
  .opts-partida > .opts-note { grid-column: 1 / -1; }
  .opts-partida > .row { grid-template-columns: 96px 1fr; }
  .opts-partida .spinner .value { min-width: 0; width: 160px; }
  .opts-perfil .char-fav { display: none; }
  .opts-perfil .char-tile { width: 50px; height: 50px; }
}
/* spinners y teclas: neutros (el amarillo solo para números) */
.spinner .arrow { background: var(--surface-3); color: var(--text); border: 2px solid #000; border-radius: var(--r); box-shadow: var(--sh-btn); }
.spinner .arrow:hover, .spinner .arrow:focus-visible { box-shadow: var(--sh-btn), var(--ring); }
.spinner .value { border-radius: var(--r); }
.opts-modal .bind-act { color: var(--text); }
.track-opt.in-rot:not(.sel) .track-card { box-shadow: none; }
/* garaje: escena con proporción fija (PC 16:9, móvil 2:1) y el nombre del coche como título de su ficha */
.setup-simple .n1 .garage { align-items: start; }
.setup-simple .n1 .garage .car-stage, .setup-simple .n1 .garage .car-stage:focus, .setup-simple .n1 .garage .car-stage:hover { height: auto; aspect-ratio: 16 / 9; width: 100%; }
.garage .garage-side { align-self: stretch; }
.ci-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ci-name { font-family: var(--f-title); font-size: 26px; line-height: 1.05; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ci-count { flex: none; font-family: var(--f-num); font-size: 15px; letter-spacing: 1px; color: var(--text-dim); }
.garage .car-info .stats { width: 100%; }
@media (max-height: 520px) {
  .setup-simple .n1 .garage .car-stage, .setup-simple .n1 .garage .car-stage:focus, .setup-simple .n1 .garage .car-stage:hover { aspect-ratio: 2 / 1; height: auto; max-height: 228px; }
  .ci-head { padding-bottom: 3px; }
  .ci-name { font-size: 18px; }
  .ci-count { font-size: 12px; }
}
.setup-grid.n2 .ci-name { font-size: 18px; }
/* opciones › perfil: la rejilla de personajes a todo el ancho */
.opts-body > .row.char-row { display: block; }
.opts-perfil .char-grid { flex-wrap: wrap; }
body:has(.title-screen) .now-playing { top: auto; bottom: 12px; } /* en el título arriba está tu perfil */
@media (max-height: 520px) { .title-screen .btn-col { margin-top: 14px; } }
.garage .car-info { align-items: stretch; }
table.res tr.human:not(.me) td { background: rgba(238, 227, 199, 0.04); }
@media (max-height: 520px) {
  .podium .block span { font-size: 18px; line-height: 1; padding: 0 6px; }
  .podium .p3 .block { height: 32px; }
}
table.res tr.human.first:not(.me) td, table.res tr.first:not(.me) td { background: rgba(238, 227, 199, 0.08); }

/* ===== Taller del Diablo: ilustración de fondo (la peana es la del dibujo; el coche 3D va encima) ===== */
.row.car-stage, .row.car-stage:focus, .row.car-stage:hover, .row.car-stage:focus-visible {
  background: #120d14 url(/img/taller.jpg) center / cover no-repeat;
}
.car-stage::before, .car-stage::after { content: none !important; display: none !important; }

/* ---------------------------------------------------------------------------------------------------------------
   RONDA 3 de pulido (CRITICA2.md): contraste en Opciones, nada encima de nada, restos del estilo viejo, HUD móvil
   y PC que aprovecha la pantalla.
   --------------------------------------------------------------------------------------------------------------- */
/* 1. Opciones: todo texto claro sobre gris (nada heredado del papel) */
.opts-body { color: var(--text); }
.opts-body .row label, .opts-body .char-name, .opts-body .touch-card label, .opts-body .bind-act, .opts-body li, .opts-body .weapon-list span { color: var(--text); }
.opts-body .char-tag, .opts-body .char-fav, .opts-body .bind-note { color: var(--text-dim); }
.opts-body .char-fav b, .opts-body .weapon-list b, .opts-body li b { color: var(--focus); }
.opts-body .weapon-list .ico, .opts-body li .ico { color: var(--text-dim); }
.opts-body .touch-card > .row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; margin: 0 0 4px; }
.opts-body .touch-card .spinner .value { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.opts-body .bind-btn { color: var(--text); border-color: var(--line); }
.opts-body .opts-note { grid-column: 1 / -1; }

/* 2. avisos: la canción solo en carrera (arriba-centro) y en el título (abajo); en el resto de menús no tapa títulos */
body:not(.racing):not(:has(.title-screen)) .now-playing { display: none; }
/* HUD PC: la posición no se corta por la izquierda ni se sacude; la radio debajo, sin tapar posición ni vuelta */
.hud-panel .tl { left: max(18px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); }
.hud-panel.mirror .tl { right: max(18px, env(safe-area-inset-right)); }
.hud-panel.glitch .tl { animation: none; }
.hud-pos.bump { animation: none; }
.radio-slot { margin-top: 14px; position: relative; z-index: 0; }
.radio-slot .radio-msg { max-width: 300px; }

/* 3. decoración: nunca encima de algo pulsable — fuera cintas y pegatinas en todas las pantallas */
.deco .tape, .deco .sticker, .deco .spray { display: none !important; }
.profile-chip { box-shadow: var(--sh-btn); border-color: #000; }

/* 4. restos del estilo viejo */
.l2-mycar-chev { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); z-index: 3; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: rgba(20, 17, 23, 0.72); color: var(--text); border-radius: 50%; line-height: 0; }
.l2-mycar-chev .ico { width: 18px; height: 18px; }
.quote-card .portrait { transform: none; outline: none; border: 2px solid var(--line-strong); border-radius: var(--r); box-shadow: none; }
.quote-card .bubble, .quote-card.win .bubble { transform: none; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
.quote-card .who { color: var(--text-dim); }
.grid-notice { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; color: var(--text); }
.grid-notice b { color: var(--text); }
.grid-notice .ico { color: var(--text-dim); }
.grid-list span, .grid-notice.rest span { background: var(--surface-2); border-left: none; border-radius: 4px; }
.podium-face { transform: none; outline: none; border: 3px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--sh-panel); }
.podium .p1 .podium-face { border-color: var(--focus); }

/* 5. trazado que no se pudo dibujar: fuera la caja negra */
.track-map-wrap:has(canvas[data-empty]) { display: none; }

/* 6. sala: ¡JUGAR! esperando a gente = gris (no color de peligro) */
.btn.primary.waiting, .btn.primary.waiting:hover, .btn.primary.waiting:focus-visible { background-color: var(--surface-3); background-image: none; color: var(--text); text-shadow: none; }
.btn.primary.waiting small { color: var(--text-dim); }
.l2-slot { grid-template-columns: 34px minmax(0, 1fr) auto; }
.l2-car { display: flex; align-items: center; gap: 8px; }
.l2-car .slot-ping { background: transparent; padding: 0; font-size: 12px; }
.l2-car .slot-ping.good { color: var(--focus); }
.l2-car .slot-ping.meh { color: var(--warn); }
.l2-car .slot-ping.bad { color: var(--accent); }
@media (max-height: 520px) { .l2-slot { grid-template-columns: 28px minmax(0, 1fr) auto; } }
/* cabecera de la rápida: el aviso no se amontona con los iconos de arriba a la derecha */
.l2-head { padding-right: 120px; padding-left: 120px; }
@media (max-height: 520px) {
  .l2-head { padding-right: 112px; padding-left: 0; justify-content: flex-start; }
  .l2-quick .l2-room { font-size: 12px; }
}

/* 7. HUD móvil: pausa y pantalla completa iguales; barras arriba (junto a posición/vuelta), fuera de la carretera */
.tc-top, .tc-pause, .tc-full { transform: none; background: var(--surface-3); color: var(--text); border: 2px solid #000; border-radius: var(--r); box-shadow: var(--sh-btn); opacity: 0.9; }
.tc-top:active { transform: translateY(2px); box-shadow: var(--sh-btn-press); }
@media (max-height: 520px) {
  body.racing.touch-ui .hud-panel .bl { top: 54px; bottom: auto; left: 128px; transform: scale(0.6); transform-origin: top left; }
  body.racing.touch-ui .hud-panel .bars { width: 230px; gap: 4px; }
  body.racing.touch-ui .hud-panel .bar-lbl { display: none; }
}

/* botones táctiles del título a 12 px mínimo */
@media (max-height: 520px) { .title-screen.simple .btn.mode-btn small { font-size: 12px; } }

/* 8. PC: que el contenido use la pantalla (1400x900, 1920x1080) */
@media (min-width: 1200px) and (min-height: 760px) {
  .title-screen.simple > .btn-col { zoom: 1.15; }
  .setup-simple { width: 100%; }
  .setup-simple .setup-grid.n1 { max-width: min(1640px, calc((100vh - 280px) * 1.7778 + 380px)); }
  .setup-simple .n1 .garage { grid-template-columns: 1fr 360px; }
  .setup-simple .n1 .car-info .stats, .setup-simple .n1 .car-info .stats span { font-size: 15px; }
  .setup-simple .n1 .car-info .car-desc { font-size: 15px; }
  .setup-track .track-picker { max-width: 1500px; gap: 16px; }
  .setup-track .track-opt .track-map-wrap canvas { width: min(210px, 12vw) !important; height: min(210px, 12vw) !important; }
  .setup-track .rot-card .rot-ico { width: min(210px, 12vw); height: min(210px, 12vw); }
  .setup-track .track-opt .track-name { font-size: 20px; }
  .setup-track .track-opt .track-fav { font-size: 14px; }
  .l2 { width: min(1700px, 100%); max-height: none; }
  .l2-grid { grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.3fr) minmax(340px, 0.9fr); }
  .l2-map canvas { width: min(300px, 28vh) !important; height: min(300px, 28vh) !important; }
  .l2-maps canvas { width: min(140px, 13vh) !important; height: min(140px, 13vh) !important; }
  .l2-name { font-size: 20px; }
  .results { width: min(1500px, 100%); }
  table.res { font-size: 16px; }
  table.res td { padding: 6px 10px; }
  table.res td.who .nm { font-size: 20px; }
}

/* ---------------------------------------------------------------------------------------------------------------
   UN SOLO NIVEL DE CAJA (dueño): nada de panel dentro de panel ni franjas. La escena del garaje a sangre entre el título
   y la barra; título pequeño arriba; botones pegados al borde de abajo (solo el margen mínimo), sin caja ni franja.
   --------------------------------------------------------------------------------------------------------------- */
/* barra de abajo sin franja: pegada al borde (12 px o el safe-area) en garaje, circuito y resultados */
.lobby-actions, .setup > .btn-row, .results .online-row { position: static; width: 100%; margin: 0; padding: 0; background: none; }
.screen.setup-screen { padding: max(8px, 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)); justify-content: stretch; }
.setup-screen > .setup { width: 100%; max-width: none; height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.setup-screen > .setup > h2.title { flex: none; margin: 0; min-height: 50px; display: flex; align-items: center; justify-content: center; font-size: clamp(20px, 2.4vw, 30px); padding: 0 110px; }
.setup-screen > .setup > .btn-row { flex: none; margin-top: auto; }
.setup-screen > .setup > .warn { flex: none; margin: 0; min-height: 0; }
.setup-screen > .setup > .warn:empty { display: none; }
/* garaje de 1 jugador: sin panel alrededor; el taller ocupa todo el alto disponible; ficha y circuito en una columna */
.setup-simple .setup-grid.n1 { flex: 1; min-height: 0; max-width: none !important; width: 100%; display: flex; }
.setup-simple .n1 .player-card.paper { flex: 1; min-height: 0; padding: 0; display: flex; animation: none; }
.setup-simple .n1 .player-card.paper::before { display: none; }
.setup-simple .n1 .garage { flex: 1; height: 100%; min-height: 0; margin: 0; align-items: stretch; grid-template-columns: minmax(0, 1fr) clamp(220px, 24vw, 380px); gap: clamp(10px, 1.4vw, 20px); }
.setup-simple .n1 .garage .car-stage, .setup-simple .n1 .garage .car-stage:focus, .setup-simple .n1 .garage .car-stage:hover, .setup-simple .n1 .garage .car-stage:focus-visible { height: 100% !important; max-height: none !important; aspect-ratio: auto !important; border: none; border-radius: 0; box-shadow: none; }
.setup-simple .n1 .garage .car-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.setup-simple .n1 .garage-side { gap: 10px; justify-content: flex-start; }
.setup-simple .n1 .garage-side > .car-info { flex: 0 1 auto; }
.setup-simple .n1 .garage-side > .garage-trackpick { margin-top: auto; }
/* 2 jugadores: cada jugador su tarjeta (un nivel); dentro, el taller sin borde */
.setup-grid.n2 { flex: 1; min-height: 0; max-width: none; align-content: stretch; }
.setup-grid.n2 .garage .car-stage { border: none; box-shadow: none; border-radius: 0; }
/* circuito: las tarjetas en el centro del hueco */
.setup-track .track-preview { flex: 1; min-height: 0; justify-content: center; margin: 0; }
.setup-track .track-races { margin: 0 auto; }

/* sala: sin paneles alrededor (el coche, el circuito y la panda son las únicas cajas) */
.screen.l2-screen { padding: max(8px, 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)); justify-content: stretch; }
.l2 { width: 100%; max-width: none; max-height: none; height: 100%; }
.l2-center.card.paper::before { display: none; }
.l2-center.card { padding: 0; animation: none; }
.l2-panda.card { animation: none; }
.l2-slot { border: none; border-left: 4px solid var(--pc, var(--line-strong)); background: rgba(238, 227, 199, 0.06); }
.l2-bots { border: none; background: transparent; padding-left: 4px; }
.row.car-stage.l2-mycar, .row.car-stage.l2-mycar:hover, .row.car-stage.l2-mycar:focus { border: none; box-shadow: none; border-radius: var(--r); }

/* resultados: la tabla sin panel alrededor; filas sin bordes */
.results-screen .table-wrap.paper::before { display: none; }
.results-screen .table-wrap { padding: 0; }
table.res td { border-top: none; border-bottom: none; }
table.res td:last-child { border-right: none; }
.results-screen { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

/* opciones: el modal es la única caja (las tarjetas de dentro, planas) */
.opts-body .card.paper::before { display: none; }
.opts-body .card { padding: 0; }
@media (max-height: 520px) {
  .setup-screen > .setup { gap: 6px; }
  .setup-screen > .setup > h2.title { font-size: 18px; padding: 0 100px; }
  .setup-simple .n1 .garage { grid-template-columns: minmax(0, 1fr) 250px; gap: 10px; }
  .setup-grid.n2 .garage .car-stage { height: 140px; }
}
@media (min-width: 1200px) and (min-height: 760px) {
  .l2-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(320px, 0.85fr); }
  .row.car-stage.l2-mycar { align-self: center; aspect-ratio: 4 / 3; height: auto; width: 100%; }
}

/* resultados y podio: la barra de botones abajo del todo (◀ izquierda · principal derecha), sin franja */
.screen.results-screen, .screen.podium-screen { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.results-screen > .results { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.results-screen > .results > .btn-row, .podium-screen > .btn-row { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.results-screen > .results > .btn-row > :first-child, .podium-screen > .btn-row > :first-child { justify-self: start; }
.results-screen > .results > .btn-row > :last-child, .podium-screen > .btn-row > :last-child { grid-column: 3; justify-self: end; }
.results-screen .online-row > :nth-child(2), .podium-screen .online-row > :nth-child(2) { grid-column: 3; grid-row: 1; justify-self: end; }
.results-screen .online-row > :nth-child(3), .podium-screen .online-row > :nth-child(3) { grid-column: 2; grid-row: 1; justify-self: center; }
@media (max-height: 520px) { .results-screen .btn-row .btn, .podium-screen .btn-row .btn { min-height: 44px; } }
/* ventana de juego encajada en la web (≈1180x664) y portátiles bajitos: que todo quepa */
@media (min-height: 521px) and (max-height: 760px) {
  .setup-grid.n2 .char-tile { width: 50px; height: 50px; }
  .setup-grid.n2 .garage .car-stage { height: 170px; }
  .setup-grid.n2 .char-info { display: none; }
  .results-screen .quotes { display: none; }
  .results-screen .next-track { margin-top: 8px; }
  .results-screen .next-track .track-blurb { display: none; }
  .podium .say { display: none; }
  .podium .podium-face { width: 76px !important; height: 76px !important; }
  .podium .p1 .podium-face { width: 96px !important; height: 96px !important; }
  .podium .p1 .block { height: 100px; }
  .podium .p2 .block { height: 72px; }
  .podium .p3 .block { height: 50px; }
}
@media (max-height: 520px) { .l2-head { min-height: 52px; } } /* la panda empieza debajo de los iconos de arriba a la derecha */

/* ---- SALA = PARRILLA DE SALIDA: los 6 coches en la línea de salida (3D), pilotos debajo, barra abajo ---- */
.screen.l3-screen { padding: max(8px, 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)); justify-content: stretch; }
.l3 { width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.l3-head { flex: none; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 12px 24px; padding: 0 120px; flex-wrap: wrap; }
.l3-title h2, .l3-title .ransom { font-size: clamp(20px, 2.4vw, 30px); }
.l3-title { font-size: clamp(20px, 2.4vw, 30px); line-height: 1; }
.l3-clock { display: flex; align-items: baseline; gap: 12px; line-height: 1; }
.l3-clock small { font-family: var(--f-num); font-size: 15px; letter-spacing: 2px; color: var(--text-dim); }
.l3-clock b { font-family: var(--f-title); font-size: clamp(44px, 6vw, 84px); color: var(--text); text-shadow: 3px 3px 0 #000; min-width: 1.4em; text-align: center; }
.l3-clock.hot b { color: var(--accent); animation: blink 0.5s steps(2) infinite; }
.l3-circuit { flex: none; text-align: center; font-family: var(--f-num); font-size: 16px; letter-spacing: 1px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l3-circuit b { color: var(--text-dim); }
.l3-circuit b.first { color: var(--text); }
.l3-circuit .ico { color: var(--focus); }
.l3-stage { position: relative; flex: 1; min-height: 0; border-radius: var(--r); overflow: hidden; outline: none; background: #17121b; }
.l3-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.grid-showroom, .grid-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.grid-canvas { cursor: pointer; }
.l3-tags { position: absolute; inset: 0; pointer-events: none; }
.l3-tag { position: absolute; top: 0; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: 15.5%; min-width: 120px; padding: 4px 10px 4px 4px; background: rgba(20, 17, 23, 0.86); color: var(--text); border: 1px solid var(--line); border-bottom: 3px solid var(--pc, var(--line-strong)); border-radius: var(--r); box-shadow: var(--sh-panel); }
.l3-tag.me { border-color: var(--accent); border-bottom-color: var(--accent); }
.l3-tag.ghost { background: rgba(20, 17, 23, 0.5); border-style: dashed; border-bottom-width: 1px; color: var(--text-dim); animation: l3pulse 1.6s ease-in-out infinite; }
.l3-tag.enter { animation: l3in 0.35s cubic-bezier(.2, .8, .2, 1) both; }
.l3-tag.away { opacity: 0.6; }
@keyframes l3in { from { transform: translateX(-140%); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes l3pulse { 50% { opacity: 0.55; } }
.l3-face { flex: none; line-height: 0; }
.l3-face .portrait { border: 2px solid var(--line-strong); border-radius: 4px; background: var(--ink); }
.l3-face.empty { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-dim); border: 1px dashed var(--line-strong); border-radius: 4px; }
.l3-who { min-width: 0; }
.l3-name { font-family: var(--f-marker); font-size: 18px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l3-name .crown { color: var(--warn); margin-right: 3px; }
.l3-sub { font-family: var(--f-num); font-size: 12px; letter-spacing: 1px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l3-sub b { color: var(--accent); }
.l3-ready { flex: none; margin-left: auto; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; background: var(--focus); color: var(--text-on-accent); border-radius: 50%; font-size: 13px; }
.l3-emote { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--text); color: var(--ink); border-radius: 50%; box-shadow: var(--sh-panel); animation: emotePop 0.3s steps(3) both; }
.l3-arrow, .l3-arrow.prev, .l3-arrow.next { position: absolute; top: 42%; transform: translate(-50%, -50%); z-index: 3; width: 48px; height: 48px; }
.l3-arrow:active { transform: translate(-50%, calc(-50% + 3px)); }
.l3-faces { display: flex; gap: 6px; }
.l3-mini { width: 40px; height: 40px; line-height: 0; border: 2px solid var(--line-strong); border-radius: 4px; overflow: hidden; background: var(--ink); }
.l3-mini .portrait { width: 36px !important; height: 36px !important; }
.l3-mini.me { border-color: var(--accent); }
.l3-mini.ready { box-shadow: 0 0 0 2px var(--focus); }
.l3-mini.empty { display: flex; align-items: center; justify-content: center; color: var(--text-dim); border-style: dashed; font-size: 20px; animation: l3pulse 1.6s ease-in-out infinite; }
.l3-mid-btn { min-width: 0; min-height: 48px; padding: 6px 16px; font-size: 18px; gap: 8px; }
.l3-mid-btn .emote-ico { font-size: 24px; }
.l3-mid-btn.on { box-shadow: var(--sh-btn), var(--ring); }
.l3-next { min-width: 0; }
@media (max-height: 520px) {
  .l3 { gap: 4px; }
  .l3-head { min-height: 46px; padding: 0 104px 0 0; justify-content: flex-start; gap: 10px; flex-wrap: nowrap; }
  .l3-head .l2-room { font-size: 12px; padding: 2px 4px 2px 8px; gap: 6px; }
  .l3-head .l2-code .code-ransom { font-size: 18px; }
  .l3-head .l2-copy.btn.small { font-size: 12px; padding: 2px 8px; min-height: 34px; }
  .l3-title { font-size: 16px; }
  .l3-title * { font-size: inherit !important; }
  .l3-quick .l3-head { justify-content: center; padding: 0 104px; }
  .l3-clock small { font-size: 12px; }
  .l3-clock b { font-size: 38px; }
  .l3-faces { gap: 4px; }
  .l3-mini { width: 36px; height: 36px; }
  .l3-mini .portrait { width: 32px !important; height: 32px !important; }
  .l3-circuit { font-size: 12px; }
  .l3-tag { max-width: 31%; min-width: 0; padding: 2px 8px 2px 2px; gap: 6px; }
  .l3-face .portrait { width: 30px !important; height: 30px !important; }
  .l3-face.empty { width: 30px; height: 30px; font-size: 16px; }
  .l3-name { font-size: 14px; }
  .l3-arrow, .l3-arrow.prev, .l3-arrow.next { width: 44px; height: 44px; }
  .l3-mid-btn { min-height: 44px; font-size: 14px; padding: 4px 10px; }
  .l3-compact .l3-mid-btn:not(.l3-small):not(.l3-keep) span { display: none; }
}
.grid-real { position: absolute; inset: 0; }
.grid-real canvas { width: 100% !important; height: 100% !important; display: block; cursor: pointer; }
.l3-arrow, .l3-arrow.prev, .l3-arrow.next { top: 45%; }
.l3-tag { max-width: 22%; }
/* parrilla (especificación definitiva): cabecera fija, etiquetas flotantes sobre cada coche */
.l3-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 112px 0 0; min-height: 56px; }
.l3-head > .l3-title { justify-self: start; font-family: var(--f-title); font-size: 24px; line-height: 1; color: var(--text); text-shadow: 2px 2px 0 #000; white-space: nowrap; }
.l3-head > :nth-child(2) { justify-self: center; }
.l3-clock { flex-direction: column; align-items: center; gap: 0; }
.l3-clock small { font-size: 12px; }
.l3-clock b { font-size: 64px; line-height: 0.95; }
.l3-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.l3-tag, .l3-tag.enter { position: absolute; left: 0; top: 0; max-width: none; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; white-space: nowrap; border-bottom-width: 2px; animation: none; will-change: transform; }
.l3-tag.enter { animation: l3fade 0.15s ease-out both; }
@keyframes l3fade { from { opacity: 0; } to { opacity: 1; } }
.l3-tag.me { background: var(--accent); border-color: #000; color: #fff; }
.l3-tag.ghost { padding: 4px 10px; animation: l3pulse 1.6s ease-in-out infinite; }
.l3-tag .l3-name { font-family: var(--f-num); font-size: 16px; letter-spacing: 0.5px; }
.l3-tag .l3-face .portrait { border-width: 1px; }
.l3-ready { width: 20px; height: 20px; margin-left: 0; font-family: var(--f-num); font-size: 14px; font-weight: bold; }
.l3-ping { font-family: var(--f-num); font-size: 12px; color: var(--text-dim); }
.l3-tag.me .l3-ping { color: rgba(255, 255, 255, 0.8); }
.l3-ping.bad { color: var(--warn); }
.l3-tag .l3-emote { bottom: calc(100% + 6px); }
.l3-stats { position: absolute; left: 0; top: 0; padding: 8px 10px; min-width: 190px; background: var(--surface-1); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--sh-panel); animation: l3fade 0.15s ease-out both; }
.l3-stats[hidden] { display: none; }
.l3-stats-name { font-family: var(--f-title); font-size: 18px; margin-bottom: 4px; }
.l3-stats .stats { font-size: 12px; gap: 2px 8px; }
.l3-stats .statbar i.on { background: var(--text); border-color: var(--text); }
.l3-small { font-size: 14px; padding: 4px 12px; }
@media (max-height: 520px) {
  .l3-head { min-height: 46px; padding: 0 104px 0 0; }
  .l3-head > .l3-title { font-size: 16px; }
  .l3-clock b { font-size: 40px; }
  .l3-clock small { font-size: 11px; }
  .l3-tag .l3-name { font-size: 13px; }
  .l3-tag, .l3-tag.enter { padding: 2px 7px 2px 2px; gap: 4px; }
  .l3-ready { width: 16px; height: 16px; font-size: 12px; }
  .l3-stats { min-width: 150px; padding: 6px 8px; }
  .l3-stats .stats { font-size: 11px; }
  .l3-small { font-size: 12px; }
}
.l3-tag.ghost.icon { padding: 2px 6px; font-size: 16px; line-height: 1; background: rgba(20, 17, 23, 0.6); }
.l3-tag.ghost.none { display: none; }
/* mini tarjeta del circuito sobre la escena de la parrilla (arriba-izquierda, sin tapar coches) */
.l3-trackcard { position: absolute; left: 10px; top: 10px; z-index: 2; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: rgba(20, 17, 23, 0.78); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--sh-panel); color: var(--text); pointer-events: auto; }
.l3-trackcard.pick { cursor: pointer; }
.l3-trackcard.pick:hover { box-shadow: var(--sh-panel), var(--ring); }
.l3-tc-maps { display: flex; gap: 6px; align-items: flex-end; }
.l3-tc-main { line-height: 0; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; background: #000; }
.l3-tc-main canvas { width: 140px !important; height: 140px !important; }
.l3-tc-next { display: flex; flex-direction: column; gap: 4px; }
.l3-tc-mini { line-height: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: #000; opacity: 0.85; }
.l3-tc-mini canvas { width: 40px !important; height: 40px !important; }
.l3-tc-name { font-family: var(--f-title); font-size: 15px; line-height: 1.1; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.l3-tc-name small { font-family: var(--f-num); font-size: 12px; color: var(--text-dim); }
.l3-tc-chev { line-height: 0; color: var(--focus); }
@media (max-height: 520px) {
  .l3-trackcard { left: 6px; top: 6px; padding: 4px; gap: 2px; }
  .l3-tc-main canvas { width: 70px !important; height: 70px !important; }
  .l3-tc-mini canvas { width: 22px !important; height: 22px !important; }
  .l3-tc-next { gap: 2px; }
  .l3-tc-name { font-size: 12px; max-width: 110px; }
}
@media (max-height: 520px) { .l3-trackcard { max-width: 120px; } .l3-tc-name { max-width: 100%; display: block; } .l3-tc-name small, .l3-tc-chev { display: none; } }
.l3-trackcard { max-width: 240px; }
.l3-tc-name { max-width: 100%; }

/* Resultados de carrera: sin el aviso del ganador; la próxima parrilla es una línea suelta y la tabla manda */
.results-screen .next-grid { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; color: var(--text); }
.results-screen .next-grid-lbl { font-family: var(--f-num); letter-spacing: 1.5px; text-transform: uppercase; font-size: 13px; color: var(--text-dim); }
.results-screen .next-grid .grid-list { margin-top: 0; }
.results-screen > .results > .table-wrap { flex: 0 1 auto; }
@media (max-height: 520px) {
  table.res { font-size: 15px; border-spacing: 0 3px; }
  table.res th { font-size: 11px; }
  table.res td { padding: 4px 8px; }
  table.res td:first-child { font-size: 20px; width: 48px; }
  table.res td.who .nm { font-size: 17px; }
  table.res .res-face { width: 30px !important; height: 30px !important; }
  .pts-plus { font-size: 18px; }
  .levelup { font-size: 11px; }
  .results-screen .next-grid { margin-top: 6px; }
  .results-screen .next-grid-lbl { font-size: 11px; }
  .results-screen .grid-list { font-size: 12px; }
  .results-screen .grid-list span { margin: 0 2px; padding: 1px 6px; }
}
@media (max-height: 520px) {
  table.res td { padding: 2px 8px; }
  table.res .res-face { width: 26px !important; height: 26px !important; }
  .results-screen .next-grid { margin-top: 4px; }
  .results-screen .btn-row { margin-top: 6px; }
}

/* ===== PORTADA (abogado del diablo): nombre arriba-izq · iconos arriba-dcha · logo centrado grande · coche 3D · JUGAR gordo en medio ===== */
.title-screen.simple { padding-right: 0 !important; justify-content: flex-start; }
.screen.title-screen > .profile-chip { top: 14px !important; left: 14px !important; transform: none !important; box-shadow: var(--sh-btn); }
.title-screen > .title-car { position: absolute; left: 50%; top: 18%; width: min(900px, 80vw); height: 66%; transform: translateX(-50%); z-index: 0; pointer-events: none; }
.title-screen > .title-car .showroom, .title-screen > .title-car canvas { width: 100%; height: 100%; display: block; }
.title-screen.simple > .logo { position: relative; z-index: 1; margin-top: 6vh; }
.title-screen.simple > .btn-col { position: relative; z-index: 1; margin-top: auto !important; margin-bottom: 2vh; }
.title-screen.simple .mode-row { align-items: flex-end; }
.title-screen.simple .mode-row .btn.mode-btn[data-id="solo"] { transform: scale(1.18); transform-origin: bottom center; margin: 0 14px; z-index: 1; }
/* iconos secundarios: fila arriba a la derecha, a la izquierda de pantalla completa / sonido */
.screen.title-screen > .more-row {
  top: 14px !important; right: 128px !important; width: auto !important; flex-direction: row !important; align-items: center !important; gap: 8px !important;
}
.screen.title-screen > .more-row .btn.small-link { width: auto !important; min-height: 44px; min-width: 44px; justify-content: center; padding: 6px 10px; }
.screen.title-screen > .more-row .code-slot { flex-wrap: nowrap !important; width: auto !important; }
.screen.title-screen > .more-row .code-mini { width: 5.2em !important; }
.screen.title-screen > .more-row .gear { font-size: 18px; line-height: 1; }
@media (max-height: 520px) {
  .title-screen.simple .logo { zoom: 0.72; margin-top: 46px; }
  .title-screen > .title-car { top: 26%; height: 62%; }
  .title-screen.simple .mode-row .btn.mode-btn[data-id="solo"] { transform: scale(1.14); margin: 0 10px; }
  .screen.title-screen > .more-row { top: 8px !important; right: 116px !important; gap: 6px !important; }
  .screen.title-screen > .more-row .lbl { display: none; }
  .screen.title-screen > .more-row .btn.small-link { min-height: 40px; min-width: 40px; padding: 4px; }
  .screen.title-screen > .profile-chip { top: 8px !important; left: 12px !important; }
}
/* portada: el coche va detrás (fuera del flujo), entre el logo y los botones; proporción 2:1 = la de la peana */
.screen.title-screen > .title-car { position: absolute; z-index: 0; left: 50%; transform: translateX(-50%); top: 36vh; height: 50vh; width: 100vh; max-width: 96vw; }
.title-screen.simple > .logo { margin-top: 4vh; }
@media (max-height: 520px) {
  .screen.title-screen > .title-car { top: 34vh; }
  .title-screen.simple .logo { margin-top: 0; }
  body:has(.title-screen) .now-playing { display: none; }
}
.screen.title-screen > .title-car { background: radial-gradient(ellipse 30% 9% at 50% 76%, rgba(0,0,0,.55), rgba(0,0,0,0) 100%); }

/* Títulos de pantalla sobrios (dueño: las letras de nota de rescate, tan cartoon, solo en el logo y el código de sala) */
h1.title, h2.title { transform: none; }
h1.title .ransom, h2.title .ransom { gap: 0; }
h1.title .ransom .rs, h2.title .ransom .rs {
  background: none !important; border: none !important; box-shadow: none !important; transform: none !important;
  color: var(--text, #eee3c7) !important; font-family: var(--f-num) !important; font-style: normal !important; font-weight: normal !important;
  padding: 0; letter-spacing: 0.06em; text-transform: uppercase;
}
h1.title .ransom .rs-gap, h2.title .ransom .rs-gap { width: 0.35em; }

/* ===============================================================================================================
   CRÍTICA 3 (pantallas de entrada): garaje, circuito, sala, opciones, tutorial y portada
   =============================================================================================================== */
/* --- GARAJE: flechas neutras (no gritan más que ¡JUGAR!) */
.cs-arrow, .cs-arrow.prev, .cs-arrow.next { background: var(--surface-3); color: var(--text); border: 2px solid #000; }
.cs-arrow:hover, .cs-arrow:focus-visible { box-shadow: var(--sh-btn), var(--ring); outline: none; }
/* nombre del coche GRANDE sobre la escena, abajo a la izquierda */
.cs-title { position: absolute; left: 18px; bottom: 14px; z-index: 2; display: flex; align-items: baseline; gap: 10px; max-width: calc(100% - 36px); pointer-events: none; }
.cs-title-name { font-family: var(--f-title); font-size: clamp(30px, 4.4vw, 68px); line-height: 0.95; color: var(--text); text-shadow: 3px 3px 0 #000, 0 0 20px rgba(0, 0, 0, 0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cs-title-count { flex: none; font-family: var(--f-num); font-size: 16px; letter-spacing: 1px; color: var(--text-dim); text-shadow: 2px 2px 0 #000; }
.setup-grid.n2 .cs-title-name { font-size: 28px; }
/* columna derecha: ficha (frase + stats) y, justo debajo, el circuito; sin hueco en medio */
.setup-simple .n1 .garage-side > .garage-trackpick { margin-top: 0; }
.garage .car-info .car-desc { display: block; }
.garage-trackpick .track-map-wrap { background: transparent; border: none; }
/* PC: la escena más ancha que alta -> el dibujo a 86 % del alto, arriba; debajo, suelo oscuro: la peana ya no toca el borde
   (carShowroom.js lee --bg-s / --bg-y y coloca la cámara igual que este background) */
@media (min-height: 521px) {
  .setup-simple .n1 .garage { container-type: size; }
  .setup-simple .n1 .garage .row.car-stage, .setup-simple .n1 .garage .row.car-stage:focus, .setup-simple .n1 .garage .row.car-stage:hover, .setup-simple .n1 .garage .row.car-stage:focus-visible {
    --bg-s: 0.86; --bg-y: 0;
    background: linear-gradient(to bottom, rgba(23, 19, 27, 0) 79%, #17131b 86%) no-repeat,
      #17131b url(/img/taller.jpg) center 0 / max(100%, calc(var(--bg-s) * 200cqh)) auto no-repeat;
  }
  .setup-simple .n1 .garage-side { gap: 14px; }
  .setup-simple .n1 .garage .car-info { padding: 14px 16px; gap: 12px; }
  .setup-simple .n1 .garage .car-info .car-desc { font-size: 16px; line-height: 1.4; }
  .setup-simple .n1 .garage .stats { row-gap: 10px; }
  .setup-simple .n1 .garage .stats span { font-size: 17px; }
  .setup-simple .n1 .garage-trackpick .track-card { padding: 10px 34px 10px 10px; gap: 12px; }
  .setup-simple .n1 .garage-trackpick .track-name { font-size: 19px; white-space: normal; }
  .setup-simple .n1 .garage-trackpick .track-fav { font-size: 14px; }
}
@media (max-height: 520px) {
  .garage .car-info .car-desc { font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .cs-title { left: 12px; bottom: 8px; }
  .cs-title-name { font-size: 30px; }
  .cs-title-count { font-size: 13px; }
}

/* --- CIRCUITO: una caja por tarjeta. El trazado a sangre sobre la tarjeta (sin cuadro negro ni recuadro punteado),
   el nombre y "Le va a" en una franja oscura abajo. Tocar = elegir y volver (no hay LISTO). */
.setup-track .track-opt .track-card, .setup-track .track-opt.rot .track-card {
  position: relative; padding: 0; gap: 0; overflow: hidden; justify-content: space-between; align-items: stretch;
  background: radial-gradient(ellipse 70% 60% at 50% 42%, color-mix(in srgb, var(--tc, #8a7f70) 26%, #17131b) 0%, #120f15 100%);
}
.setup-track .track-opt .track-map-wrap { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 0; overflow: visible; }
.setup-track .track-opt .track-map-wrap canvas { width: min(230px, 92%) !important; height: auto !important; aspect-ratio: 1; max-height: 100%; object-fit: contain; }
.setup-track .rot-card .rot-ico, .setup-track .track-opt .rot-card .rot-ico { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; border: none; border-radius: 0; display: flex; align-items: center; justify-content: center; }
.setup-track .rot-card .rot-ico .ico { width: 84px; height: 84px; }
.setup-track .track-opt .track-text { flex: none; width: 100%; padding: 10px 10px 12px; background: rgba(8, 6, 10, 0.72); text-align: center; }
.setup-track .track-opt .track-name { font-size: 20px; line-height: 1.1; }
.setup-track .track-opt .track-fav { display: block; font-size: 14px; line-height: 1.3; margin-top: 4px; }
.setup-track .track-picker { align-items: stretch; }
.setup-track .track-opt, .setup-track .track-opt.rot { height: min(420px, calc(100vh - 260px)); }
@media (max-height: 520px) {
  .setup-track .track-opt, .setup-track .track-opt.rot { height: min(280px, calc(100vh - 116px)); }
  .setup-track .track-opt .track-map-wrap canvas { width: min(120px, 90%) !important; }
  .setup-track .rot-card .rot-ico .ico { width: 48px; height: 48px; }
  .setup-track .track-opt .track-text { padding: 5px 5px 6px; }
  .setup-track .track-opt .track-name { font-size: 13px; }
  .setup-track .track-opt .track-fav { display: block; font-size: 11px; line-height: 1.25; margin-top: 2px; }
  .setup-track .track-opt .track-fav .ico { display: none; }
}
/* sin LISTO: ATRÁS solo, abajo a la izquierda */
.setup-track > .btn-row { justify-content: flex-start; }

/* ===== SISTEMA TIPOGRÁFICO (abogado del diablo): cómic punk adulto, nada de letras de dibujos =====
   Rubik Dirt: solo logo y golpes gigantes de 1 s (GO!, ELIMINADO, pintadas). Anton: títulos, botones, nombres, números, datos.
   Special Elite: solo texto con voz (radio, citas, frases). Permanent Marker: fuera. La suciedad va en fondos y marcos, no en letras. */
:root {
  --f-dirt: 'Rubik Dirt', Impact, sans-serif;
  --f-title: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --f-marker: 'Anton', Impact, 'Arial Narrow', sans-serif;
}
.rally-word, .deco .spray, .countdown span.go, .big-msg span, .flag.dead { font-family: var(--f-dirt); }
.btn.primary { letter-spacing: 0.04em; }
table.res td, .grid-list span, .next-grid { font-family: var(--f-num); letter-spacing: 0.03em; }
table.res td.who .nm { letter-spacing: 0.05em; text-transform: uppercase; text-shadow: 2px 2px 0 #000; }
table.res tr.me td.who .nm::after { font-family: var(--f-num); }
/* nombres y botón principal: Anton inclinado con sombra dura (cómic de acción adulto) */
table.res td.who .nm, .btn.primary .mode-main, .btn.primary { font-style: normal; }
table.res td.who .nm { display: inline-block; transform: skewX(-8deg); }
.btn.primary { text-shadow: 2px 2px 0 #000; }
.setup-track > .btn-row > [data-id="back"] { margin-left: 0; margin-right: auto; }
.setup-track .track-opt.sel .track-card { outline: 3px solid var(--focus); outline-offset: -3px; }
.setup-track .track-opt:focus-visible .track-card { outline: 3px solid var(--focus); outline-offset: -3px; }
/* garaje PC: la tarjeta del circuito en vertical (dibujo grande arriba), llena la columna */
@media (min-height: 521px) {
  .setup-simple .n1 .garage-trackpick .track-card { flex-direction: column; align-items: center; text-align: center; padding: 14px 34px 14px 14px; }
  .setup-simple .n1 .garage-trackpick .track-map-wrap canvas { width: min(150px, 18vh) !important; height: min(150px, 18vh) !important; }
  .setup-simple .n1 .garage-trackpick .rot-ico .ico { width: 64px; height: 64px; }
}

/* --- PORTADA: manda el COCHE. Taller a pantalla completa (oscuro y desenfocado), tu coche en su peana 3D (nítida),
   logo pequeño arriba en el centro, iconos iguales que ⛶ / altavoz, JUGAR grande en el centro de abajo. */
.screen.title-screen > .title-car { position: absolute; inset: 0; left: 0; top: 0; width: 100%; height: 100%; max-width: none; transform: none; z-index: 0; pointer-events: none; background: #0d0a0f; overflow: hidden; }
.screen.title-screen > .title-car::before { content: ''; position: absolute; inset: 0; background: url(/img/taller.jpg) center / cover no-repeat; filter: blur(5px) brightness(0.45) saturate(0.85); }
.screen.title-screen > .title-car .showroom { position: absolute; inset: 0; z-index: 1; }
.title-car-hit { position: absolute; z-index: 1; left: 50%; top: 56%; width: min(64vw, 100vh); height: 34vh; transform: translate(-50%, -50%); padding: 0; background: transparent; border: none; cursor: pointer; }
.title-car-hit:focus-visible { outline: 3px dashed var(--focus); outline-offset: 4px; }
.screen.title-screen > .subtitle { display: none; }
.screen.title-screen.simple > .logo { position: relative; z-index: 2; zoom: 0.52; margin: 10px auto 0; animation: none; }
body:has(.title-screen) .now-playing { display: none !important; }
/* iconos de arriba a la derecha: todos como ⛶ y el altavoz (cuadrado gris, borde negro, sombra abajo), sin texto */
.screen.title-screen > .more-row { top: 14px !important; right: 118px !important; gap: 8px !important; z-index: 3; }
.screen.title-screen > .more-row .lbl { display: none; }
.screen.title-screen > .more-row .btn.small-link, .screen.title-screen > .more-row .btn.small-link:nth-child(2n) {
  width: 44px !important; height: 44px; min-width: 44px; min-height: 44px; padding: 0; justify-content: center;
  background: var(--surface-3); color: var(--text); border: 2px solid #000; border-radius: var(--r); box-shadow: var(--sh-btn); font-size: 18px;
}
.screen.title-screen > .more-row .btn.small-link .ico { width: 20px; height: 20px; }
.screen.title-screen > .more-row .code-slot .code-mini + .btn.small-link { width: auto !important; padding: 0 10px; }
.screen.title-screen > .profile-chip { z-index: 3; }
.title-screen.simple > .btn-col { z-index: 2; }
@media (max-height: 520px) {
  .screen.title-screen.simple > .logo { zoom: 0.4; margin-top: 4px; }
  .screen.title-screen > .more-row { top: 14px !important; right: 118px !important; gap: 6px !important; }
  .title-car-hit { top: 54%; width: 56vw; height: 38vh; }
}
/* portada: el taller detrás, ampliado sobre la pared (su peana dibujada queda fuera) y fundido a suelo oscuro abajo;
   la peana 3D la coloca carShowroom.js con --plate-cy / --plate-hw */
.screen.title-screen > .title-car { --plate-cy: 0.6; --plate-hw: 0.3; }
.screen.title-screen > .title-car::before { background: linear-gradient(to bottom, rgba(13, 10, 15, 0) 45%, #0d0a0f 78%), url(/img/taller.jpg) center 0 / auto 225% no-repeat; }
@media (max-height: 520px) {
  .screen.title-screen > .title-car { --plate-cy: 0.63; --plate-hw: 0.26; }
}
.screen.title-screen > .title-car-hit { position: absolute; margin: 0; }
.screen.title-screen > .title-car::before { filter: blur(9px) brightness(0.36) saturate(0.8); }

/* --- SALA (parrilla): barra GESTOS · TALLER · CIRCUITO, todos con icono y texto (también en móvil) */
.l3-mid .l3-mid-btn span, .l3-compact .l3-mid-btn:not(.l3-small):not(.l3-keep) span { display: inline; }
.l3-mid-btn { display: inline-flex; align-items: center; gap: 8px; }
.l3-mid-btn .ico, .l3-mid-btn .emote-ico { width: 22px; height: 22px; font-size: 22px; }
@media (max-height: 520px) { .l3-mid-btn { gap: 6px; } .l3-mid-btn .ico, .l3-mid-btn .emote-ico { width: 18px; height: 18px; font-size: 18px; } }
/* plazas libres: "+BOT" con borde discontinuo, como la silueta 3D */
.l3-tag.ghost { background: rgba(20, 17, 23, 0.55); border: 1px dashed rgba(238, 227, 199, 0.6); color: var(--text); }
.l3-tag.ghost .l3-name { font-family: var(--f-num); letter-spacing: 1px; font-size: 14px; }
@media (max-height: 520px) { .l3-tag.ghost { padding: 1px 6px; } .l3-tag.ghost .l3-name { font-size: 11px; } }
/* minimapa: una sola caja (sin cuadros negros dentro) */
.l3-trackcard { background: rgba(14, 11, 16, 0.84); }
.l3-tc-main, .l3-tc-mini { background: transparent; border: none; border-radius: 0; opacity: 1; }
.l3-tc-mini { opacity: 0.8; }
/* portada: botones secundarios en dos columnas cortas con texto (bajo el perfil · bajo ⛶ / altavoz), estilo ⛶ */
.screen.title-screen > .more-col { position: absolute; z-index: 3; top: 72px; display: flex; flex-direction: column; gap: 8px; }
.screen.title-screen > .more-col.left { left: 14px; align-items: flex-start; }
.screen.title-screen > .more-col.right { right: 14px; align-items: flex-end; }
.screen.title-screen > .more-col .btn.small-link, .screen.title-screen > .more-col .btn.small-link:nth-child(2n) {
  min-height: 44px; min-width: 0; width: auto; padding: 0 14px 0 11px; gap: 8px; justify-content: flex-start;
  font-family: var(--f-num); font-size: 16px; letter-spacing: 1px; text-transform: uppercase;
  background: var(--surface-3); color: var(--text); border: 2px solid #000; border-radius: var(--r); box-shadow: var(--sh-btn);
}
.screen.title-screen > .more-col .btn.small-link .ico { width: 20px; height: 20px; }
.screen.title-screen > .more-col .gear { font-size: 18px; line-height: 1; }
.screen.title-screen > .more-col .code-slot { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.screen.title-screen > .more-col .code-mini { width: 5.2em; min-height: 44px; font-size: 18px; }
@media (max-height: 520px) {
  .screen.title-screen > .more-col { top: 64px; gap: 6px; }
  .screen.title-screen > .more-col.left { left: 12px; }
  .screen.title-screen > .more-col .btn.small-link, .screen.title-screen > .more-col .btn.small-link:nth-child(2n) { min-height: 40px; font-size: 14px; padding: 0 11px 0 9px; }
  .screen.title-screen > .more-col .btn.small-link .ico { width: 18px; height: 18px; }
  .screen.title-screen > .more-col .code-mini { min-height: 40px; font-size: 16px; }
}
.screen.title-screen.simple > .logo { zoom: 0.56; margin-top: 6px; }
@media (max-height: 520px) {
  .screen.title-screen.simple > .logo { zoom: 0.58; margin-top: 0; }
  .title-screen.simple { padding-top: 6px; }
  .screen.title-screen > .more-col { top: 68px; }
}
.screen.title-screen > .more-col.left, .screen.title-screen > .more-col.right { align-items: stretch; }
.screen.title-screen > .more-col.right .code-slot .btn.small-link { flex: 1; }
.screen.title-screen > .title-car::before { filter: blur(14px) brightness(0.32) saturate(0.8); }

/* --- OPCIONES: "Salir a la web" = enlace de texto discreto a la derecha, sin flecha (no parece ATRÁS) */
.opts-foot-web { margin-left: auto; margin-right: 16px; display: flex; align-items: center; }
.opts-web-link { font-family: var(--f-type); font-size: 14px; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; padding: 8px 4px; border-radius: 4px; outline: none; }
.opts-web-link:hover, .opts-web-link:focus-visible { color: var(--text); box-shadow: var(--ring); }
/* Perfil: retrato grande a la izquierda (nombre y frase debajo), rejilla de personajes a la derecha */
.opts-perfil .perfil-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start; padding-top: 6px; }
.opts-perfil .perfil-main .char-info { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin: 0; }
.opts-perfil .perfil-main .char-info .portrait.big { display: block; width: 150px !important; height: 150px !important; }
.opts-perfil .perfil-main .char-name { font-size: 26px; }
.opts-perfil .perfil-main > .row.char-row { margin: 0; padding: 0; display: block; }
.opts-perfil .perfil-main .char-grid { justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
.opts-perfil .perfil-main .char-tile { width: 96px; height: 96px; }
@media (max-height: 520px) {
  .opts-perfil .perfil-main { grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding-top: 2px; }
  .opts-perfil .perfil-main .char-info { gap: 3px; }
  .opts-perfil .perfil-main .char-info .portrait.big { display: block; width: 104px !important; height: 104px !important; }
  .opts-perfil .perfil-main .char-name { font-size: 18px; }
  .opts-perfil .perfil-main .char-tag { font-size: 11px; line-height: 1.25; }
  .opts-perfil .perfil-main .char-grid { gap: 8px; }
  .opts-perfil .perfil-main .char-tile { width: 76px; height: 76px; }
  .opts-web-link { font-size: 12px; }
}

/* --- "¿PRIMERA VEZ?": una caja gris, una línea y dos botones (sin papel, sin párrafo rojo, sin ATRÁS: Esc) */
.screen.tuto-offer { justify-content: center; align-items: center; background: rgba(10, 8, 12, 0.72); }
.tuto-offer-box { position: relative; z-index: 1; width: min(640px, 100%); padding: 22px 26px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; background: var(--surface-1); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--sh-panel); }
.tuto-offer-box h2.title { margin: 0; font-size: clamp(24px, 3vw, 34px); }
.tuto-offer-line { font-family: var(--f-type); font-size: 16px; line-height: 1.3; color: var(--text); }
.tuto-offer-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: nowrap; margin-top: 4px; }
.tuto-offer-btns .btn { min-width: 0; font-size: 20px; padding: 10px 20px; }
@media (max-height: 520px) {
  .tuto-offer-box { padding: 14px 18px 16px; gap: 10px; }
  .tuto-offer-line { font-size: 14px; }
  .tuto-offer-btns .btn { font-size: 17px; min-height: 48px; padding: 6px 16px; }
}

/* --- Tutorial en móvil: la chuleta no tapa la munición (se aparta a la derecha) y, durante la cuenta atrás, baja al
   centro de la mitad de abajo (no tapa los números) */
body.touch-ui .tuto-box { margin-left: 26px; }
body.racing.touch-ui .tuto-box.dim { top: calc(75% - 40px); margin-left: 0; }
body.racing.touch-ui:has(.countdown span) .tuto-box { top: calc(75% - 40px); margin-left: 0; }
/* FRENO: pedal grande y algo inclinado, como visto desde el asiento */
.tc-brake .ico { font-size: calc(var(--s) * 0.56); transform: perspective(60px) rotateX(18deg); margin-bottom: -2px; }
/* FRENO con forma de pedal (no botón redondo): ancho, inclinado, se hunde al pisarlo */
.tc-btn.tc-brake {
  width: calc(var(--s) * 1.1); height: calc(var(--s) * 1.08); border: none; border-radius: 0; background: none;
  box-shadow: none; filter: drop-shadow(4px 4px 0 #000); opacity: 0.9;
  transform: perspective(300px) rotateX(14deg) rotate(-4deg);
}
.tc-btn.tc-brake .pedal { width: 100%; height: 100%; display: block; }
.tc-btn.tc-brake.on { transform: perspective(300px) rotateX(26deg) rotate(-4deg) translateY(4px) scale(0.95); filter: drop-shadow(1px 1px 0 #000) drop-shadow(0 0 6px var(--acid)); box-shadow: none; opacity: 1; }
.tc-turbo { right: calc(max(16px, env(safe-area-inset-right)) + clamp(78px, 21vmin, 120px) * 1.1 + 14px); }
.tc-item { bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(78px, 21vmin, 120px) * 1.08 + 12px); right: calc(max(16px, env(safe-area-inset-right)) + 18px); }

/* Táctil: más aire entre FRENO, TURBO y OBJETO (que no se pisen con el pulgar) */
.tc-turbo { right: calc(max(16px, env(safe-area-inset-right)) + clamp(78px, 21vmin, 120px) * 1.1 + 34px); }
.tc-item { bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(78px, 21vmin, 120px) * 1.08 + 30px); right: calc(max(16px, env(safe-area-inset-right)) + 8px); }

/* Táctil: el "Fin en X s" no va arriba al centro (ahí están pausa y pantalla completa): a la izquierda, bajo la vuelta */
body.racing.touch-ui .finish-timer { top: calc(max(14px, env(safe-area-inset-top)) + 104px); left: max(18px, env(safe-area-inset-left)); transform: rotate(-1deg); font-size: 17px; padding: 2px 10px 0; }

/* Táctil: OBJETO más hacia dentro (no pegado a la esquina) */
.tc-item { right: calc(max(16px, env(safe-area-inset-right)) + clamp(78px, 21vmin, 120px) * 0.45); bottom: calc(max(18px, env(safe-area-inset-bottom)) + clamp(78px, 21vmin, 120px) * 1.08 + 26px); }
.tc-item { --s: clamp(60px, 15.5vmin, 88px); right: calc(max(16px, env(safe-area-inset-right)) + clamp(78px, 21vmin, 120px) * 0.32); }
