:root {
  --bg: #e9edf1;
  --panel: #12161b;
  --row: #20262d;
  --row-alt: #171c22;
  --row-live: #134e8a;
  --text: #f5f7f9;
  --muted: #aeb7c1;
  --line: #313943;
  --accent: #e9b949;
  --accent-2: #1d2732;
  font-family: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  overflow-x: auto;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }

.timing-shell {
  width: min(1128px, 100%);
  margin: 0 auto;
  background: var(--panel);
  min-height: 100vh;
  box-shadow: 0 10px 34px rgba(18, 25, 33, .18);
}
.timing-header { background: #fff; }
.timing-header img { display: block; width: 100%; height: auto; }
.timing-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #0d1116;
  color: var(--muted);
  font-size: .82rem;
}
.back-link { color: #fff; font-weight: 700; text-decoration: none; }
.timing-content { min-width: 980px; overflow: hidden; }
.timing-loading { padding: 40px 20px; text-align: center; color: var(--muted); }


.live-title {
  padding: 2px 18px 0;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
}

.carrera {
  padding: 15px 18px 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.tituloscarrera,
.tituloscrono,
.barratiempos,
.barratiemposimpar,
.barratiemposselect,
.barratiemposcoment {
  display: grid;
  grid-template-columns: 32px 26px minmax(220px, 1.6fr) 100px 88px 110px 88px 52px 112px 48px;
  align-items: center;
  column-gap: 10px;
}

.tituloscarrera,
.tituloscrono {
  width: calc(100% - 28px);
  min-width: 952px;
  height: 27px;
  margin: 0 6px 0 14px;
  padding: 0 12px;
  background: #0c1015;
  border-bottom: 1px solid #424a55;
  color: #aeb7c1;
  font: 700 10px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.tituloscarrera > div,
.tituloscrono > div { white-space: nowrap; }
.th-pos,
.th-tiempo,
.th-dif,
.th-vueltas,
.th-lastlap,
.th-pen { text-align: right; }

.status,
.statusrojo,
.statusfinish {
  float: left;
  width: 6px;
  height: 30px;
  margin-left: 8px;
  background-repeat: no-repeat;
  background-position: center;
}
.status { background-image: url(imagenescrono/statusnegro.png); }
.statusrojo { background-image: url(imagenescrono/statusrojo.png); }
.statusfinish { background-image: url(imagenescrono/statusfinish.png); }

.barratiempos,
.barratiemposimpar,
.barratiemposselect,
.barratiemposcoment {
  float: left;
  width: calc(100% - 28px);
  min-width: 952px;
  min-height: 30px;
  margin: 0 6px 0 6px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.045);
  color: var(--text);
  font-size: 12px;
}
.barratiempos { background: var(--row); }
.barratiemposimpar { background: var(--row-alt); }
.barratiemposselect { background: var(--row-live); }
.barratiemposcoment {
  background: #272d34;
  grid-template-columns: 32px minmax(0, 1fr);
}

.posicion {
  width: auto;
  text-align: right;
  font-weight: 800;
}
.igual,.baja,.sube,.primero,.cuadros,.enpit {
  width: 26px;
  height: 30px;
  background-repeat:no-repeat;
  background-position:center;
}
.igual { background-image:url(imagenescrono/igual.png); }
.baja { background-image:url(imagenescrono/baja.png); }
.sube { background-image:url(imagenescrono/sube.png); }
.primero { background-image:url(imagenescrono/primero.png); }
.cuadros { background-image:url(imagenescrono/cuadros20.png); }
.enpit { background-image:url(imagenescrono/cuadrado20.png); }

.piloto {
  width: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}
.dorsal {
  flex: 0 0 42px;
  width: 42px;
  font-weight: 800;
  color:#fff;
  text-align: left;
}
.nombrepiloto,
.comentariopil {
  min-width: 0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space: nowrap;
}
.comentariopil { font-weight:700; }
.categoria,
.marca {
  width: auto;
  min-width: 0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.tiempo,.tiempomejor,.difprimer,.vueltas,.lastlap,.penalizaciones {
  width: auto;
  text-align:right;
}
.tiempo,.tiempomejor {
  font-weight:800;
}
.tiempomejor { color:var(--accent); }
.penalizaciones { color:#ffd67a; }


/* Jerarquía visual de carrera */
.barratiempos,
.barratiemposimpar,
.barratiemposselect {
  position: relative;
  transition: background .18s ease, box-shadow .18s ease;
}
.barratiemposselect {
  background: linear-gradient(90deg, #15558f 0%, #123f6d 100%);
  box-shadow: inset 4px 0 0 #62b8ff, inset 0 1px 0 rgba(255,255,255,.05);
}
.fila-lider {
  box-shadow: inset 4px 0 0 var(--accent);
}
.barratiemposselect.fila-lider {
  box-shadow: inset 4px 0 0 var(--accent), inset 0 1px 0 rgba(255,255,255,.06);
}
.fila-lider .posicion,
.fila-lider .dorsal,
.fila-lider .tiempo {
  color: #ffd96a;
}

.timing-footer {
  clear: both;
  margin-top: 14px;
  padding: 12px 14px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #11171d 0%, #0c1015 100%);
}
.footer-alert {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(233,185,73,.28);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(233,185,73,.16), rgba(233,185,73,.06));
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.footer-card {
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #18202a 0%, #121821 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.footer-card-highlight {
  border-color: rgba(233,185,73,.35);
  background: linear-gradient(180deg, rgba(233,185,73,.12) 0%, rgba(233,185,73,.04) 100%);
}
.footer-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.footer-card strong,
.footer-alert strong {
  display: block;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}
.footer-card-highlight strong { color: var(--accent); }
.footer-credit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  color: #c8d0d8;
  font-size: 11px;
}
.footer-credit a {
  color: #c8d0d8;
  text-decoration: none;
}

.barrainferiorinfo,
.barrainfgris,
.barrainfizq,
.barrainfcentro,
.barrainfder,
.barrainfmt,
.sectores,.sector,.mejorsector,.split,.diferencia { display:none; }

@media (max-width: 980px) {
  .timing-shell { width: 980px; }
  .timing-header img { width: 980px; max-width: none; }
  .timing-toolbar { width: 980px; }
}
