/* Identidad nueva (v111, paso 1): letra de carrera, paleta propia, formas con cortes en diagonal y sin emojis.
   Va después de style.css y online.css y solo cambia el aspecto. */
:root {
  --fondo: #0d0e11; --panel: #1b1d22; --panel2: #24262c; --borde: #34373f;
  --texto: #f4f4f5; --suave: #a1a1aa; --marca: #d92d20; --marca2: #b8241a; --nitro: #ffb000;
  --titulo: 'Saira Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --cuerpo: 'Saira', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --corte: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
html, body { background: var(--fondo); color: var(--texto); font-family: var(--cuerpo); }
h1, h2, .mm-t, button.big, .hud-box, #countdown, #banner { font-family: var(--titulo); }
.ic-svg { display: inline-block; vertical-align: -4px; flex: none; }

/* botones */
button.big { background: var(--marca); color: #fff; border-radius: 0; clip-path: var(--corte); font-weight: 800; font-style: italic; letter-spacing: .04em; text-transform: uppercase; padding: 10px 40px 10px 30px; }
button.big:active { background: var(--marca2); }
button.big.alt { background: var(--panel2); color: var(--texto); }
button.small { background: rgba(13,14,17,.78); border-radius: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--texto); }
.chip { border-radius: 0; background: var(--panel); }
.chip.sel, .card.sel { border-color: var(--marca); background: var(--panel2); }
.card { border-radius: 0; background: var(--panel); }
.card canvas { border-radius: 0; background: #121317; }
.card .tags span { border-radius: 0; background: var(--panel2); }
.bars i { background: var(--texto); border-radius: 0; }
select, input[type=text] { border-radius: 0; background: var(--panel); border-color: var(--borde); }
.swatch.sel { border-color: var(--marca); }
.col h2 { color: var(--suave); letter-spacing: .14em; font-family: var(--cuerpo); font-weight: 600; }

/* menú principal */
#join { background: radial-gradient(ellipse at 75% 60%, #23252b 0%, var(--fondo) 62%); }
#join .mm-top h1 { font-size: 30px; font-weight: 800; font-style: italic; letter-spacing: .02em; line-height: 1; text-transform: uppercase; }
#join .mm-top h1 b { color: var(--marca); }
.mm-card { border-radius: 0; background: var(--panel); box-shadow: none; border-left: 3px solid var(--borde); }
.mm-card .mm-t { font-size: 20px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.mm-card small { color: var(--suave); }
.mm-card.hero { outline: none; border-left: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }
.mm-card.hero .mm-t { font-size: 30px; font-weight: 800; font-style: italic; }
.mm-card.hero::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--marca); z-index: 2; }
.mm-bar button, .mm-bar a { font-family: var(--cuerpo); display: inline-flex; align-items: center; gap: 6px; }
.mm-auto { border-radius: 0 !important; }

/* paneles y ventanas */
.garage-box { background: #15161a; border-radius: 0; border-top: 4px solid var(--marca); }
.garage-head h2 { font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .03em; }
.gal-3d { border-radius: 0; }

/* HUD en carrera */
.hud-box { background: rgba(13,14,17,.82); border-radius: 0; font-weight: 700; letter-spacing: .02em; }
#hud-pos { background: var(--fondo); font-size: 40px; font-weight: 800; font-style: italic; line-height: 1; padding: 4px 18px 2px 12px; clip-path: var(--corte); }
#hud-pos small { font-size: 18px; color: var(--suave); margin-left: 1px; }
#hud-lap { font-size: 20px; text-transform: uppercase; }
#hud-time { font-family: var(--cuerpo); font-variant-numeric: tabular-nums; }
#hud-speed { font-family: var(--titulo); font-weight: 800; font-style: italic; background: rgba(13,14,17,.82); border-radius: 0; padding: 2px 14px 4px; border-bottom: 3px solid var(--marca); }
#hud-speed b { font-size: 34px; line-height: 1; }
#hud-speed small { font-family: var(--cuerpo); font-style: normal; font-weight: 500; font-size: 11px; letter-spacing: .14em; color: var(--suave); margin-left: 4px; }
#hud-info .nbar, #hud-info .nbar i { border-radius: 0; }
#hud-info .nbar i { background: var(--nitro); }
#countdown { font-weight: 800; font-style: italic; }
#banner { border-radius: 0; font-family: var(--cuerpo); }
.pads button { font-family: var(--titulo); font-weight: 800; letter-spacing: .06em; }
.desafio-noti { border-radius: 0; background: var(--marca); clip-path: var(--corte); font-family: var(--titulo); font-style: italic; letter-spacing: .03em; animation: none; }
.b-badge { border-radius: 0; background: var(--marca); }
.d-lista button.sel { border-color: var(--marca); background: rgba(217,45,32,.18); }
.d-lista button, .b-item, .d-buscar { border-radius: 0; }

/* sala de espera, resultados y paneles del juego online */
#panel .box, #panel > div { border-radius: 0 !important; }
#panel .box { background: #15161a; border-top: 4px solid var(--marca); }
#panel h2 { font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .03em; }
#panel .tag, #panel .chip, .slot, .tc-title + *, .rk-box, .prog, .rec, .vote-opt, .sala-cd { border-radius: 0 !important; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #71717a; margin-right: 4px; vertical-align: 1px; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.moneda { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe08a, #e0a100 70%); box-shadow: inset 0 0 0 1.5px #b37f00; margin-right: 4px; vertical-align: -1px; }

/* barra de abajo y datos del jugador en el menú */
.mm-yo { border-radius: 0; background: var(--panel); }
.mm-yo a { color: #ff8a80; }
.mm-bar button, .mm-bar .mm-bajar { border-radius: 0; background: var(--panel); color: var(--texto); }
.mm-bar .mm-bajar { background: var(--marca); color: #fff; }
#mm-practica, #mm-garaje, #mm-panel, #mm-autos, #mm-desafio { background: var(--panel); }
.mm-card .mm-t { font-size: 19px; white-space: nowrap; }
.mm-auto { background: var(--panel); border-color: var(--borde); }
#join-rules { display: none; } /* las reglas del live se ven en la sala, no en el menú */
#panel *:not(.dot):not(.moneda):not(.swatch), .garage-box *:not(.dot):not(.moneda):not(.swatch):not(input[type=range]) { border-radius: 0 !important; }
#hud-pos { z-index: 2; }
#hud-speed { top: calc(max(8px, env(safe-area-inset-top)) + 58px); }
#hud-info { top: calc(max(8px, env(safe-area-inset-top)) + 108px); border-radius: 0; background: rgba(13,14,17,.7); }
@media (max-height: 420px) { #hud-info { top: calc(max(8px, env(safe-area-inset-top)) + 104px); } }
.mm-card.hero .mm-t { white-space: normal; line-height: .95; font-size: 28px; }
.volver-menu { border-radius: 0; background: var(--panel); display: inline-flex; align-items: center; gap: 6px; }
#minimap { border-radius: 0; }
/* práctica (sin los botones del online): la cámara al lado de pantalla completa */
#hud:not(:has(#garage-btn)) #cam { position: absolute; right: 136px; top: max(8px, env(safe-area-inset-top)); pointer-events: auto; }
#hud:not(:has(#garage-btn)) #camdist { position: absolute; right: 178px; width: auto; padding: 0 10px; top: max(8px, env(safe-area-inset-top)); pointer-events: auto; white-space: nowrap; }
#hud:not(:has(#garage-btn)) #fs { position: absolute; right: 94px; top: max(8px, env(safe-area-inset-top)); pointer-events: auto; }

/* ---------- controles táctiles estilo Rally Fury (v126): íconos, pedales y nitro arriba de las flechas ---------- */
.pads .pad { align-items: flex-end; gap: 12px; }
.pads .pad button { display: grid; place-items: center; padding: 0; color: #f4f4f5; background: rgba(13,14,17,.32);
  border: 2px solid rgba(244,244,245,.42); box-shadow: none; backdrop-filter: none; -webkit-tap-highlight-color: transparent; }
.pads .pad button.on { background: rgba(244,244,245,.28); border-color: #fff; color: #fff; }
.pads .pad button .ic-svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.pads .col-izq { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pads .flechas { display: flex; gap: 12px; }
.pads .pad.left .flechas button { width: 86px; min-width: 86px; height: 86px; border-radius: 50%; }
.pads .pad button.back { width: 54px; min-width: 54px; height: 54px; border-radius: 50%; opacity: .85; }
/* nitro: botón chico redondo; se llena de abajo hacia arriba con la carga del tanque */
.pads .pad button.nitro { width: 58px; min-width: 58px; height: 58px; border-radius: 50%; margin-left: 14px; font-size: 0;
  background: linear-gradient(to top, rgba(217,45,32,.62) var(--carga, 0%), rgba(13,14,17,.32) var(--carga, 0%)); border-color: rgba(255,176,0,.7); }
.pads .pad button.nitro.on { background: rgba(255,176,0,.85); color: #111; border-color: #ffd36b; box-shadow: 0 0 14px rgba(255,176,0,.8); }
.pads .pad button.nitro.low { opacity: .45; }
/* derecha: freno de mano redondo, pedal de freno ancho y acelerador alto */
.pads .pad.right button.hand { width: 72px; min-width: 72px; height: 72px; border-radius: 50%; font-size: 0; }
.pads .pad.right button.pedal { border-radius: 14px; font-size: 0; }
.pads .pad.right button.pedal.freno { width: 104px; min-width: 104px; height: 86px; }
.pads .pad.right button.pedal.acel { width: 82px; min-width: 82px; height: 124px; }
@media (max-height: 460px) {
  .pads .pad.left .flechas button { width: 74px; min-width: 74px; height: 74px; }
  .pads .pad button.nitro { width: 50px; min-width: 50px; height: 50px; }
  .pads .pad.right button.hand { width: 62px; min-width: 62px; height: 62px; }
  .pads .pad.right button.pedal.freno { width: 92px; min-width: 92px; height: 74px; }
  .pads .pad.right button.pedal.acel { width: 72px; min-width: 72px; height: 104px; }
}
/* HUD limpio (v126): para el jugador queda solo la barra de nitro; pista, auto y agarre solo con ?info=si */
body:not(.info-completa) #hud-info .i1, body:not(.info-completa) #hud-info .i2, body:not(.info-completa) #hud-info .i3 { display: none; }
body:not(.info-completa) #hud-info { padding: 6px 8px; background: rgba(13,14,17,.45); }
@media (pointer: coarse) { body:not(.info-completa) #hud-info { display: none; } } /* en el celular la carga se ve en el botón de nitro */
.pads .pad button .ic-svg { width: 52%; height: 52%; }
.pads .pad.left .flechas button .ic-svg { width: 44%; height: 44%; }
.pads .pad.right button.pedal .ic-svg { width: 66%; height: 66%; stroke-width: 1.6; }
.pads .pad button i.ic { display: grid; place-items: center; width: 100%; height: 100%; }
.pads .pad.right button.hand .ic-svg { width: 64%; height: 64%; }
/* barra de posiciones (v126): arriba, entre la posición y la vuelta */
#hud-barra { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 16px); left: 150px; width: min(26vw, 260px); height: 14px; pointer-events: none; z-index: 2; }
#hud-barra .linea { position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: rgba(244,244,245,.55); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
#hud-barra .linea::after { content: ''; position: absolute; right: -1px; top: -5px; width: 3px; height: 12px; background: #f4f4f5; } /* meta */
#hud-barra b { position: absolute; top: 3px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #9aa3b2; box-shadow: 0 0 0 1px rgba(0,0,0,.55); transition: left .2s linear; }
#hud-barra b.yo { top: 1px; width: 12px; height: 12px; margin-left: -6px; background: var(--rojo, #d92d20); box-shadow: 0 0 0 2px #fff; z-index: 2; }
@media (max-width: 700px) { #hud-barra { left: 120px; width: 22vw; } }
.pads .pad button img.ic-img { width: 62%; height: 62%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.pads .pad.right button.pedal img.ic-img { width: 78%; height: 78%; }
/* íconos propios (v127): pedales más grandes dentro del botón; el acelerador ocupa casi todo el alto */
.pads .pad.right button.pedal.acel img.ic-img { width: 90%; height: 90%; }
.pads .pad.right button.pedal.freno img.ic-img { width: 82%; height: 82%; }
.pads .pad.right button.hand img.ic-img { width: 70%; height: 70%; }
.pads .pad button.nitro img.ic-img { width: 80%; height: 80%; }
/* con imagen propia el dibujo ES el botón (como Rally Fury): sin círculo ni marco; al tocar se ilumina */
.pads .pad button.con-img { background: none !important; border: 0 !important; box-shadow: none !important; }
.pads .pad button.con-img img.ic-img { width: 100% !important; height: 100% !important; object-fit: contain; opacity: .9; transition: transform .06s, opacity .06s, filter .06s; }
.pads .pad button.con-img.on img.ic-img, .pads .pad button.con-img.press img.ic-img { transform: scale(.93); opacity: 1; filter: brightness(1.5) drop-shadow(0 0 6px rgba(255,255,255,.6)); }
.pads .pad button.nitro.con-img.on img.ic-img { filter: brightness(1.4) sepia(1) saturate(6) hue-rotate(-15deg) drop-shadow(0 0 10px rgba(255,176,0,.9)); }
.pads .pad button.nitro.con-img.low img.ic-img { opacity: .4; }
.pads .pad button.nitro.con-img { background: conic-gradient(rgba(255,176,0,.75) var(--carga, 0%), transparent 0) !important; border-radius: 50%; padding: 4px; }
.pads .pad.right button.pedal.acel.con-img { width: 78px; min-width: 78px; height: 140px; }
.pads .pad.right button.pedal.freno.con-img { width: 96px; min-width: 96px; height: 100px; }
.pads .pad button.back.con-img { width: 70px; min-width: 70px; height: 44px; }
@media (max-height: 460px) {
  .pads .pad.right button.pedal.acel.con-img { width: 66px; min-width: 66px; height: 118px; }
  .pads .pad.right button.pedal.freno.con-img { width: 84px; min-width: 84px; height: 86px; }
}
.pads .pad button.nitro.con-img { width: 66px; min-width: 66px; height: 66px; }
.pads .pad.right button.hand.con-img { width: 76px; min-width: 76px; height: 76px; }
/* v128: la barra termina antes de la caja de VUELTA (que está centrada) y tiene marcas por vuelta */
#hud-barra { width: auto; left: 150px; right: calc(50% + 120px); max-width: 300px; }
#hud-barra[hidden] { display: none; }
#hud-barra .marca { position: absolute; top: 2px; width: 2px; height: 10px; margin-left: -1px; background: rgba(244,244,245,.8); box-shadow: 0 0 2px rgba(0,0,0,.6); }
@media (max-width: 700px) { #hud-barra { left: 120px; right: calc(50% + 100px); } }

/* ---------- editor de controles (v129) ---------- */
#ed-ctl { position: fixed; inset: 0; z-index: 9999; background: rgba(13,14,17,.55); touch-action: none; user-select: none; -webkit-user-select: none; }
#ed-ctl .ed-barra { position: absolute; left: 50%; top: max(8px, env(safe-area-inset-top)); transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px;
  padding: 8px 12px; background: #1b1d22; border-top: 3px solid var(--rojo, #d92d20); color: #f4f4f5; font-family: var(--cuerpo, sans-serif); max-width: 94vw; z-index: 3; }
#ed-ctl .ed-barra b { font-family: var(--titulo, sans-serif); font-style: italic; font-size: 18px; text-transform: uppercase; }
#ed-ctl .ed-ayuda { font-size: 13px; color: #b9bcc4; }
#ed-ctl .ed-tam { display: flex; align-items: center; gap: 6px; font-size: 13px; }
#ed-ctl .ed-tam span { color: #ffb000; min-width: 90px; }
#ed-ctl .ed-barra button { padding: 7px 12px; background: #2a2d34; color: #f4f4f5; border: 0; font-weight: 700; cursor: pointer; }
#ed-ctl .ed-barra .ed-ok { background: var(--rojo, #d92d20); min-width: 70px; }
#ed-ctl .ed-pads { position: absolute; inset: 0; display: block; }
#ed-ctl .ed-btn { position: absolute; cursor: grab; touch-action: none; }
#ed-ctl .ed-btn > button { width: 100%; height: 100%; min-width: 0 !important; pointer-events: none; margin: 0 !important; }
#ed-ctl .ed-btn::after { content: ''; position: absolute; inset: -6px; border: 2px dashed rgba(244,244,245,.35); border-radius: 12px; pointer-events: none; }
#ed-ctl .ed-btn.sel::after { border-color: #ffb000; border-style: solid; }
#ed-ctl .ed-pad { position: absolute !important; inset: 0 !important; display: block !important; width: auto !important; height: auto !important; padding: 0 !important; }

/* ---------- formas de doblar (v132) ---------- */
#touch button.volante { display: none; }
body.dir-volante #touch .flechas, body.dir-inclinacion #touch .flechas { display: none; }
body.dir-volante #touch button.volante { display: grid; width: 150px; min-width: 150px; height: 150px; border-radius: 50%; touch-action: none; }
body.dir-volante #touch button.volante > * { width: 100% !important; height: 100% !important; transition: none; }
@media (max-height: 460px) { body.dir-volante #touch button.volante { width: 128px; min-width: 128px; height: 128px; } }
