/* ============================================================
   AS Simuladores – Estilos personalizados
   Paleta: Negro #0d0d0d · Rojo #e60000 · Blanco #ffffff
   ============================================================ */

:root {
  --bg:       #0d0d0d;
  --bg-card:  #1a1a1a;
  --bg-table: #141414;
  --red:      #e60000;
  --red-glow: rgba(230, 0, 0, 0.15);
  --white:    #ffffff;
  --gray:     #888888;
  --gray-lt:  #cccccc;
  --gold:     #ffd700;
  --silver:   #c0c0c0;
  --bronze:   #cd7f32;
  --f-display: 'Orbitron', sans-serif;
  --f-main:    'Rajdhani', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--f-main);
  margin: 0;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 3px; }

/* ---- CAROUSEL ---- */

.carousel-img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center;
}

.carousel-info-slide {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d0d0d 0%, #1a0000 50%, #0d0d0d 100%);
}

.carousel-info-content { text-align: center; padding: 1rem; }

.carousel-eyebrow {
  font-family: var(--f-display);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.carousel-main-title {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 6vw, 3.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.carousel-main-title span { color: var(--red); }

.carousel-sub {
  font-family: var(--f-main);
  font-size: 0.95rem;
  color: var(--gray-lt);
  letter-spacing: 0.08em;
  margin: 0;
}

.carousel-indicators [data-bs-target] {
  background-color: var(--red);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  opacity: 0.45;
  border: none;
}
.carousel-indicators .active { opacity: 1; }

@media (min-width: 768px) {
  .carousel-img { height: 420px; }
  .carousel-info-slide { height: 420px; }
}

@media (min-width: 1200px) {
  .carousel-img { height: 540px; }
  .carousel-info-slide { height: 540px; }
}

/* ---- DIVIDER ---- */

.section-divider {
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--red) 50%, transparent 100%);
}

/* ---- INTRO SECTION ---- */

.intro-section {
  padding: 3rem 0 2.5rem;
}

.intro-header { margin-bottom: 2.5rem; }

.header-line {
  width: 72px;
  height: 3px;
  background: var(--red);
  margin: 0.9rem auto;
  border-radius: 2px;
}

.intro-title {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 900;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.intro-desc {
  font-size: 1rem;
  color: var(--gray-lt);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ---- TORNEO SELECT ---- */

.selector-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.selector-label {
  font-family: var(--f-display);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--red);
  text-transform: uppercase;
}

.torneo-select {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  color: var(--white);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.8rem 2.5rem 0.8rem 1rem;
  font-family: var(--f-main);
  font-size: 1rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23e60000' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  transition: border-color 0.15s ease;
}

.torneo-select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.torneo-select option {
  background: var(--bg-card);
  color: var(--white);
}

/* ---- TOURNAMENT SECTION ---- */

.tournament-section { padding: 2rem 0 4rem; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tournament-section.visible {
  animation: fadeInUp 0.35s ease;
}

.tournament-header { margin-bottom: 2.5rem; }

.tournament-title {
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 4vw, 2.2rem);
  font-weight: 900;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.tournament-subtitle {
  font-size: 1rem;
  color: var(--gray);
  letter-spacing: 0.1em;
  margin: 0;
}

/* ---- SECTION LABEL ---- */

.section-label {
  font-family: var(--f-display);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--red);
  text-transform: uppercase;
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #252525;
}

/* ---- TORNEO INFO ---- */

.info-block {
  background: var(--bg-card);
  border: 1px solid #252525;
  border-radius: 10px;
  padding: 1.25rem;
}

.info-block-title {
  font-family: var(--f-display);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--red);
  text-transform: uppercase;
  padding-bottom: 0.7rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid #252525;
}

.calendario-list { display: flex; flex-direction: column; gap: 0.75rem; }

.cal-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.cal-num {
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--red);
  color: var(--white);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.cal-body { display: flex; flex-direction: column; gap: 0.05rem; }

.cal-date {
  font-family: var(--f-display);
  font-size: 0.62rem;
  color: var(--gray);
  letter-spacing: 0.05em;
}

.cal-circuit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

.cal-apodo {
  font-size: 0.82rem;
  color: var(--gray);
  font-style: italic;
}

.format-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid #1e1e1e;
  font-size: 0.95rem;
}

.format-row:last-of-type { border-bottom: none; }
.format-name { color: var(--gray-lt); }

.format-time {
  font-family: var(--f-display);
  font-size: 0.72rem;
  color: var(--red);
}

.format-total {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--gray);
  text-align: right;
  border-top: 1px solid #1e1e1e;
  padding-top: 0.6rem;
}

.pts-layout { display: flex; gap: 0; }

.pts-col { flex: 1; }

.pts-col + .pts-col {
  border-left: 1px solid #252525;
  padding-left: 1rem;
}

.pts-extra-label {
  font-family: var(--f-display);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--gray);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.pts-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid #1e1e1e;
  font-size: 0.9rem;
  color: var(--gray-lt);
}

.pts-row:last-child { border-bottom: none; }

.pts-val {
  font-family: var(--f-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
}

.pts-val.extra { color: var(--gold); }

/* ---- PILOT CARDS ---- */

.pilot-card {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid #252525;
  overflow: hidden;
  height: 100%;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pilot-card:hover {
  transform: translateY(-4px);
  border-color: var(--red);
  box-shadow: 0 8px 24px var(--red-glow);
}

.pilot-card-top {
  background: linear-gradient(180deg, #200000 0%, #1a1a1a 100%);
  padding: 1.25rem 0.75rem 0.75rem;
  text-align: center;
}

.pilot-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--red);
  overflow: hidden;
  margin: 0 auto 0.65rem;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pilot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pilot-avatar .bi { font-size: 2.5rem; color: #3a3a3a; }

.pilot-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
  line-height: 1.2;
}

.pilot-alias {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--red);
  margin: 0;
}

.pilot-card-body { padding: 0.85rem 0.75rem; }

.pilot-stat {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  color: var(--gray-lt);
  line-height: 1.35;
}

.pilot-stat:last-child { margin-bottom: 0; }
.pilot-stat .stat-icon { color: var(--red); flex-shrink: 0; margin-top: 1px; font-size: 0.8rem; }
.pilot-stat .stat-label { color: var(--gray); margin-right: 0.2rem; }

/* ---- STAGE SELECTOR ---- */

.stage-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stage-btn {
  font-family: var(--f-display);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  background: transparent;
  color: var(--gray);
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stage-btn:hover { color: var(--white); border-color: var(--red); }
.stage-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }

/* ---- TABLE ---- */

.table-wrapper {
  background: var(--bg-table);
  border-radius: 10px;
  border: 1px solid #252525;
  overflow: hidden;
}

.racing-table {
  color: var(--white);
  font-family: var(--f-main);
  margin-bottom: 0;
}

.racing-table thead tr { background: #0a0a0a; }

.racing-table thead th {
  font-family: var(--f-display);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #252525;
  border-top: none;
  white-space: nowrap;
  font-weight: 400;
}

.racing-table tbody tr {
  border-bottom: 1px solid #1e1e1e;
  transition: background 0.12s ease;
}

.racing-table tbody tr:last-child { border-bottom: none; }
.racing-table tbody tr:hover { background: rgba(230, 0, 0, 0.04); }

.racing-table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  font-size: 0.95rem;
  border: none;
  white-space: nowrap;
}

.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 700;
}

.pos-1 { background: var(--gold);   color: #000; }
.pos-2 { background: var(--silver); color: #000; }
.pos-3 { background: var(--bronze); color: #fff; }
.pos-n { background: #252525;       color: var(--gray-lt); }

.pts-cell {
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
}

.diff-cell { color: var(--gray); font-size: 0.9rem; }
.diff-cell.leader { color: var(--red); font-weight: 600; }

/* ---- EXTRAS BADGES (Pole / Vuelta Rápida) ---- */

.badge-extra {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.15em 0.45em;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
  line-height: 1.6;
}

.badge-pole {
  background: var(--gold);
  color: #000;
}

.badge-vr {
  background: var(--red);
  color: #fff;
}

.table-legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.75rem;
  padding-left: 0.25rem;
  font-size: 0.8rem;
  color: var(--gray);
  align-items: center;
}

/* ---- FOOTER ---- */

.site-footer {
  background: #0a0a0a;
  border-top: 1px solid #1c1c1c;
  padding: 1.4rem 1rem;
  font-family: var(--f-main);
  font-size: 0.82rem;
  color: var(--gray);
  letter-spacing: 0.05em;
}

.brand-as {
  font-family: var(--f-display);
  font-weight: 900;
  color: var(--white);
  background: var(--red);
  padding: 0 0.3em;
  border-radius: 3px;
}

.brand-simus {
  font-family: var(--f-display);
  font-weight: 400;
  color: var(--white);
}