/* TimeAttack.kz — Best Time module
   Prefix: bt- to avoid conflicts with the main site styles. */
:root {
  --bt-bg: #070708;
  --bt-panel: rgba(255,255,255,.055);
  --bt-panel-2: rgba(255,255,255,.085);
  --bt-text: #f5f5f5;
  --bt-muted: rgba(245,245,245,.68);
  --bt-soft: rgba(245,245,245,.14);
  --bt-red: #e40712;
  --bt-red-2: #ff323b;
  --bt-gold: #f5c542;
  --bt-radius: 22px;
  --bt-shadow: 0 24px 80px rgba(0,0,0,.38);
}

.ta-best-time {
  color: var(--bt-text);
  background:
    radial-gradient(circle at 12% 12%, rgba(228,7,18,.25), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.11), transparent 28%),
    linear-gradient(135deg, #0a0a0d 0%, #060607 46%, #121215 100%);
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 110px) 0;
}

.ta-best-time::before,
.ta-best-time::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.ta-best-time::before {
  width: 58vw;
  height: 58vw;
  right: -20vw;
  top: -26vw;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: inset 0 0 0 18px rgba(228,7,18,.05), 0 0 120px rgba(228,7,18,.1);
}

.ta-best-time::after {
  left: -10%;
  right: -10%;
  bottom: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(228,7,18,.9), rgba(255,255,255,.35), transparent);
  transform: rotate(-6deg);
}

.bt-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.bt-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--bt-muted);
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 12px;
}

.bt-kicker::before {
  content: "";
  width: 44px;
  height: 2px;
  background: var(--bt-red);
  box-shadow: 0 0 18px rgba(228,7,18,.95);
}

.bt-title {
  margin: 0;
  font-size: clamp(42px, 7.2vw, 92px);
  line-height: .88;
  letter-spacing: -.055em;
  text-transform: uppercase;
  font-weight: 950;
}

.bt-title span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.84);
  text-stroke: 1px rgba(255,255,255,.84);
}

.bt-lead {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--bt-muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

.bt-shell {
  margin-top: 34px;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--bt-soft);
  border-radius: var(--bt-radius);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  box-shadow: var(--bt-shadow);
  backdrop-filter: blur(16px);
}

.bt-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.bt-stat {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
}

.bt-stat small {
  display: block;
  color: var(--bt-muted);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.bt-stat strong {
  display: block;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1;
}

.bt-controls {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr 1.25fr;
  gap: 10px;
  margin: 18px 0 16px;
}

.bt-control {
  min-width: 0;
}

.bt-control label {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--bt-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.bt-control select,
.bt-control input {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  color: var(--bt-text);
  background: rgba(8,8,10,.72);
  padding: 0 14px;
  outline: none;
}

.bt-control select:focus,
.bt-control input:focus {
  border-color: rgba(228,7,18,.9);
  box-shadow: 0 0 0 3px rgba(228,7,18,.18);
}

.bt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.bt-tab {
  appearance: none;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: var(--bt-text);
  background: rgba(255,255,255,.06);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.bt-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.28);
}

.bt-tab.is-active {
  background: linear-gradient(135deg, var(--bt-red), #7b0007);
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 10px 28px rgba(228,7,18,.28);
}

.bt-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.22);
}

.bt-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.bt-table th,
.bt-table td {
  padding: 14px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: middle;
}

.bt-table th {
  color: rgba(255,255,255,.58);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(255,255,255,.045);
  position: sticky;
  top: 0;
  z-index: 1;
}

.bt-table tr:last-child td {
  border-bottom: 0;
}

.bt-pos {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  font-weight: 900;
}

.bt-table tr:nth-child(1) .bt-pos {
  background: var(--bt-gold);
  color: #090909;
}

.bt-time {
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  font-size: 18px;
  color: #fff;
}

.bt-pilot {
  font-weight: 900;
}

.bt-muted {
  display: block;
  color: var(--bt-muted);
  font-size: 12px;
  margin-top: 4px;
}

.bt-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(228,7,18,.14);
  color: #fff;
  border: 1px solid rgba(228,7,18,.3);
  font-weight: 800;
  white-space: nowrap;
}

.bt-note {
  margin: 14px 0 0;
  color: var(--bt-muted);
  font-size: 13px;
  line-height: 1.55;
}

.bt-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.bt-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07);
}

.bt-link.primary {
  background: linear-gradient(135deg, var(--bt-red), #8b0008);
}

.bt-empty,
.bt-error {
  padding: 34px 20px;
  text-align: center;
  color: var(--bt-muted);
}

.bt-error {
  color: #ffb3b8;
}

@media (max-width: 920px) {
  .bt-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bt-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .bt-wrap {
    width: min(100% - 22px, 1180px);
  }
  .bt-stats,
  .bt-controls {
    grid-template-columns: 1fr;
  }
  .bt-shell {
    padding: 12px;
    border-radius: 18px;
  }
  .bt-table th,
  .bt-table td {
    padding: 12px 10px;
  }
}
