:root {
  --f1-red: #ff1e2d;
  --f1-bg: #08090c;
  --f1-card: #15171d;
  --f1-line: #2b2e37;
  --f1-text: #f6f7f8;
  --f1-muted: #9ca2af;
  --f1-green: #27d17f;
  --f1-yellow: #ffd43b;
}
.f1rd-app {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    sans-serif;
  background: radial-gradient(circle at 80% 0, #261016 0, #08090c 45%);
  color: var(--f1-text);
  min-height: 720px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}
.f1rd-app * {
  box-sizing: border-box;
}
.f1rd-app button,
.f1rd-app input,
.f1rd-app select {
  font: inherit;
}
.f1rd-app button {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.f1rd-shell {
  max-width: 1500px;
  margin: auto;
  padding: 26px;
}
.f1rd-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.f1rd-brand {
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.04em;
  font-size: 25px;
}
.f1rd-brand b {
  color: var(--f1-red);
}
.f1rd-app button.f1rd-btn {
  border: 1px solid var(--f1-line);
  background: #1d2028 !important;
  color: #fff !important;
  border-radius: 12px;
  padding: 12px 17px;
  font-weight: 750;
  cursor: pointer;
  transition: 0.2s;
}
.f1rd-btn:hover {
  transform: translateY(-1px);
  border-color: #666;
}
.f1rd-app button.f1rd-btn.primary {
  background: var(--f1-red) !important;
  border-color: var(--f1-red);
}
.f1rd-btn.go {
  font-size: 32px;
  background: var(--f1-green);
  color: #06160f;
  width: min(360px, 90vw);
  padding: 20px;
}
.f1rd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.f1rd-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 20px;
}
.f1rd-card {
  background: rgba(21, 23, 29, 0.94);
  border: 1px solid var(--f1-line);
  border-radius: 18px;
  padding: 20px;
}
.f1rd-card h2,
.f1rd-card h3 {
  margin: 0 0 14px;
}
.f1rd-muted {
  color: var(--f1-muted);
}
.f1rd-menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.f1rd-tile {
  min-height: 180px;
  text-align: left;
  padding: 22px;
  background: linear-gradient(145deg, #1d2028, #111319);
  border: 1px solid var(--f1-line);
  border-radius: 18px;
  color: #fff;
  cursor: pointer;
}
.f1rd-tile:hover {
  border-color: var(--f1-red);
}
.f1rd-tile strong {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
}
.f1rd-track {
  position: relative;
  height: 430px;
  background: linear-gradient(#15171d, #101117);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--f1-line);
}
.f1rd-track-svg {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
  overflow: visible;
}
.f1rd-track-svg .asphalt {
  fill: none;
  stroke: #30333b;
  stroke-width: 38;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.f1rd-track-svg .edge {
  fill: none;
  stroke: #737780;
  stroke-width: 42;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.f1rd-track-svg .line {
  fill: none;
  stroke: #e7e7e7;
  stroke-width: 2;
  stroke-dasharray: 7 10;
  opacity: 0.6;
}
.f1rd-car {
  position: absolute;
  width: 38px;
  height: 15px;
  border-radius: 4px 12px 4px 4px;
  transition: all 0.7s ease;
  box-shadow: 0 2px 6px #000;
  transform: translate(-50%, -50%);
}
.f1rd-car:after {
  content: "";
  position: absolute;
  inset: 4px 7px;
  background: #111;
  border-radius: 4px;
}
.f1rd-car.me {
  outline: 3px solid #fff;
  z-index: 5;
}
.f1rd-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.f1rd-stat {
  background: #111319;
  border: 1px solid var(--f1-line);
  border-radius: 12px;
  padding: 11px;
}
.f1rd-stat small {
  display: block;
  color: var(--f1-muted);
  font-size: 11px;
  text-transform: uppercase;
}
.f1rd-stat strong {
  font-size: 22px;
}
.f1rd-weather-stat strong {
  font-size: 30px;
  line-height: 1;
  overflow: visible;
}
.f1rd-weather-stat > span {
  display: block;
  margin-top: 4px;
  color: var(--f1-muted);
  font-size: 10px;
  white-space: nowrap;
}
.f1rd-weather-icon {
  display: block;
  margin: 3px 0;
  font-size: 24px;
  font-style: normal;
}
.f1rd-race-weather-plan {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 15px;
  padding: 10px 12px;
  background: #101217;
  border: 1px solid var(--f1-line);
  border-radius: 10px;
}
.f1rd-race-weather-plan span {
  color: var(--f1-muted);
  font-size: 12px;
}
.f1rd-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.f1rd-action {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--f1-line);
  background: #1a1d24;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.f1rd-action.active {
  border-color: var(--f1-red);
  box-shadow: inset 3px 0 var(--f1-red);
}
.f1rd-action strong,
.f1rd-action span {
  display: block;
}
.f1rd-action span {
  font-size: 12px;
  color: var(--f1-muted);
  margin-top: 4px;
}
.f1rd-bar {
  height: 9px;
  background: #292c34;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 7px;
}
.f1rd-bar i {
  display: block;
  height: 100%;
  background: var(--f1-green);
}
.f1rd-lights-wrap {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 6, 0.95);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 35px;
}
.f1rd-lights {
  display: flex;
  gap: 18px;
  background: #181a20;
  border: 8px solid #2b2d33;
  padding: 24px;
  border-radius: 25px;
}
.f1rd-light {
  width: 70px;
  height: 70px;
  background: #2c0d11;
  border-radius: 50%;
  box-shadow: inset 0 0 16px #000;
}
.f1rd-light.on {
  background: #ff2638;
  box-shadow: 0 0 30px #ff2638;
}
.f1rd-light.off {
  background: #15171b;
}
.f1rd-result {
  font-size: 32px;
  font-weight: 850;
}
.f1rd-lobby input {
  width: 100%;
  background: #0f1116;
  border: 1px solid var(--f1-line);
  color: #fff;
  border-radius: 10px;
  padding: 13px;
  margin: 6px 0 12px;
}
.f1rd-code {
  font-size: 42px;
  letter-spacing: 0.16em;
  font-weight: 900;
  color: var(--f1-yellow);
}
.f1rd-table {
  width: 100%;
  border-collapse: collapse;
}
.f1rd-table td,
.f1rd-table th {
  padding: 9px;
  border-bottom: 1px solid var(--f1-line);
  text-align: left;
}
.f1rd-toast {
  position: absolute;
  top: 75px;
  right: 25px;
  background: #fff;
  color: #111;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  z-index: 20;
}
.f1rd-app:fullscreen {
  border-radius: 0;
  min-height: 100vh;
  overflow: auto;
}
.f1rd-app:fullscreen .f1rd-shell {
  max-width: none;
}
.f1rd-app:fullscreen .f1rd-track {
  height: 58vh;
}
@media (max-width: 850px) {
  .f1rd-shell {
    padding: 15px;
  }
  .f1rd-grid,
  .f1rd-menu {
    grid-template-columns: 1fr;
  }
  .f1rd-hud {
    grid-template-columns: repeat(2, 1fr);
  }
  .f1rd-track {
    height: 330px;
  }
  .f1rd-road {
    border-width: 32px;
  }
  .f1rd-lights {
    gap: 8px;
    padding: 14px;
  }
  .f1rd-light {
    width: 46px;
    height: 46px;
  }
  .f1rd-actions {
    grid-template-columns: 1fr;
  }
}

/* v1.4: ERS, DRS, race control, interactive pit stops and pause */
.f1rd-energy-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}
.f1rd-energy-head h3 {
  margin: 0;
}
.f1rd-ers-bar i {
  background: linear-gradient(90deg, #00a7ff, #7be7ff);
}
.f1rd-ers-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 8px;
}
.f1rd-ers-actions .f1rd-btn {
  padding: 8px 5px;
  font-size: 11px;
}
.f1rd-ers-actions .active {
  border-color: #58dfff;
  background: #123340;
}
.f1rd-drs {
  width: 100%;
  margin-top: 10px;
  background: #2c5d1f;
  border-color: #65e33e;
}
.f1rd-drs:not(:disabled) {
  color: #d9ffce;
  box-shadow: 0 0 16px rgba(101, 227, 62, 0.3);
}
.f1rd-duel-status {
  min-height: 31px;
  margin-top: 7px;
  border-radius: 8px;
  padding: 8px;
  background: #101217;
  color: var(--f1-muted);
  font-size: 11px;
}
.f1rd-control-banner {
  position: absolute;
  z-index: 9;
  right: 16px;
  top: 15px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.f1rd-control-banner.green {
  background: #174b32;
  color: #83ffc0;
}
.f1rd-control-banner.sc {
  background: #ffd43b;
  color: #171200;
}
.f1rd-control-banner.vsc {
  background: #a94dff;
  color: #fff;
}
.f1rd-control-banner.red {
  background: #e80020;
  color: #fff;
  animation: f1rd-red-pulse 0.8s infinite alternate;
}
@keyframes f1rd-red-pulse {
  to {
    box-shadow: 0 0 18px rgba(232, 0, 32, 0.85);
  }
}
.f1rd-car {
  transition:
    left 0.24s linear,
    top 0.24s linear,
    transform 0.24s linear;
}
.f1rd-wheel-game {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 15px;
  margin: 20px auto;
  max-width: 390px;
}
.f1rd-wheel-game button {
  height: 100px;
  border-radius: 22px;
  border: 5px solid #08090c;
  background: #30333b;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px #777;
}
.f1rd-wheel-game button.done {
  background: #20b96d;
  box-shadow: 0 0 18px rgba(32, 185, 109, 0.7);
}
.f1rd-wheel-game.locked {
  pointer-events: none;
  opacity: 0.55;
}
.f1rd-pit-clock {
  display: grid;
  text-align: center;
  min-height: 66px;
  font-size: 22px;
  font-weight: 900;
}
.f1rd-pit-clock b {
  font-size: 36px;
}
.f1rd-pit-clock span {
  color: var(--f1-green);
  font-size: 12px;
  letter-spacing: 0.15em;
}
.f1rd-pause .f1rd-modal-card {
  text-align: center;
  max-width: 520px;
}
.f1rd-pause-actions {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}
.f1rd-save-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.f1rd-save-card span {
  display: block;
  margin-top: 4px;
  color: var(--f1-muted);
}
@media (max-width: 850px) {
  .f1rd-ers-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .f1rd-control-banner {
    top: 55px;
  }
  .f1rd-save-card {
    align-items: stretch;
    flex-direction: column;
  }
}

/* v1.1: 2026 field, qualifying and formula-car rendering */
.f1rd-brand small {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--f1-muted);
}
.f1rd-kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 850;
  color: var(--f1-red);
}
.f1rd-team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}
.f1rd-team {
  border-left: 5px solid var(--team);
  padding: 12px;
  background: #101217;
  border-radius: 10px;
}
.f1rd-team h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.f1rd-team h3 > span {
  flex: 1;
}
.f1rd-team-logo {
  width: 74px;
  height: 28px;
  object-fit: contain;
  object-position: left center;
}
.f1rd-team h3 small {
  font-size: 11px;
  color: var(--f1-muted);
}
.f1rd-driver {
  width: 100%;
  display: grid;
  grid-template-columns: 50px 52px 1fr auto;
  align-items: center;
  text-align: left;
  background: #1a1d24;
  color: #fff;
  border: 1px solid var(--f1-line);
  padding: 10px;
  margin-top: 7px;
  border-radius: 9px;
  cursor: pointer;
}
.f1rd-driver > img {
  align-self: end;
  width: 46px;
  height: 55px;
  margin: -9px 2px -10px -5px;
  object-fit: cover;
  object-position: top center;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(145deg, #292d36, #111319);
}
.f1rd-driver:hover {
  border-color: var(--team);
}
.f1rd-driver b {
  font-size: 17px;
}
.f1rd-driver span {
  font-weight: 700;
}
.f1rd-driver em {
  font-size: 11px;
  color: var(--f1-muted);
  font-style: normal;
}
.f1rd-driver-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  align-items: end;
  min-height: 210px;
  overflow: hidden;
  border-top: 6px solid var(--team);
  padding-top: 16px;
}
.f1rd-driver-copy {
  position: relative;
  z-index: 2;
  padding: 18px 12px 18px 0;
}
.f1rd-driver-copy > b {
  font-size: 44px;
  color: var(--team);
}
.f1rd-driver-portrait {
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
  object-position: top center;
  background: linear-gradient(145deg, #292d36, #101217);
}
.f1rd-weekend-logo {
  position: absolute;
  z-index: 3;
  top: 15px;
  right: 12px;
  width: min(120px, 35%);
  height: 38px;
  object-fit: contain;
  object-position: right center;
}
.f1rd-rating {
  background: #101217;
  padding: 11px;
  border-radius: 9px;
  margin: 15px 0;
}
.f1rd-preview {
  width: 100%;
  height: 260px;
}
.f1rd-preview path {
  fill: none;
  stroke: #e7e7e7;
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.f1rd-scroll {
  max-height: 610px;
  overflow: auto;
}
.f1rd-table td i {
  display: inline-block;
  width: 4px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
}
.f1rd-table td small {
  display: block;
  color: var(--f1-muted);
  margin-left: 15px;
}
.f1rd-table tr.mine {
  background: rgba(255, 30, 45, 0.16);
  font-weight: 800;
}
.f1rd-sector-light {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #391317;
  border: 9px solid #24262d;
  box-shadow: inset 0 0 25px #000;
}
.f1rd-sector-light.green {
  background: #26e07f;
  box-shadow: 0 0 45px #26e07f;
}
.f1rd-track-name {
  position: absolute;
  left: 18px;
  top: 15px;
  color: #fff;
  font-weight: 800;
  z-index: 2;
}
.f1rd-car {
  width: 35px;
  height: 18px;
  border-radius: 0;
  background: none !important;
  box-shadow: none;
  filter: drop-shadow(0 2px 2px #000);
}
.f1rd-car:after {
  content: none;
}
.f1rd-car i {
  position: absolute;
  display: block;
}
.f1rd-car .body {
  left: 7px;
  top: 5px;
  width: 22px;
  height: 8px;
  background: var(--car);
  border-radius: 2px 9px 9px 2px;
  clip-path: polygon(0 8%, 70% 8%, 100% 50%, 70% 92%, 0 92%);
}
.f1rd-car .cockpit {
  left: 14px;
  top: 6px;
  width: 7px;
  height: 6px;
  background: #101217;
  border-radius: 50%;
}
.f1rd-car .wing {
  background: var(--car);
  height: 2px;
}
.f1rd-car .front {
  right: 0;
  top: 8px;
  width: 9px;
}
.f1rd-car .rear {
  left: 0;
  top: 7px;
  width: 8px;
  height: 4px;
}
.f1rd-car .wheel {
  width: 6px;
  height: 4px;
  background: #050505;
  border-radius: 1px;
}
.f1rd-car .wl1 {
  left: 8px;
  top: 1px;
}
.f1rd-car .wr1 {
  left: 8px;
  bottom: 1px;
}
.f1rd-car .wl2 {
  right: 7px;
  top: 2px;
}
.f1rd-car .wr2 {
  right: 7px;
  bottom: 2px;
}
.f1rd-car.me {
  outline: none;
  z-index: 6;
}
.f1rd-car.me:after {
  content: "";
  position: absolute;
  display: block;
  inset: -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: none;
}
@media (max-width: 850px) {
  .f1rd-team-grid {
    grid-template-columns: 1fr;
  }
  .f1rd-driver {
    grid-template-columns: 50px 52px 1fr;
  }
  .f1rd-driver em {
    display: none;
  }
}

/* v1.2: collision-safe typography, real tracks, grid and pit strategy */
.f1rd-card h1,
.f1rd-card h2,
.f1rd-card h3 {
  overflow-wrap: anywhere;
  line-height: 1.08;
}
.f1rd-card h1 {
  font-size: clamp(28px, 4vw, 54px);
  margin: 0.22em 0;
}
.f1rd-grid {
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
}
.f1rd-inline-team {
  display: block;
  font-size: 14px;
  color: var(--f1-muted);
  font-weight: 600;
  margin-top: 8px;
}
.f1rd-driver-card h2 {
  margin-top: 8px;
}
.f1rd-driver-card p {
  margin: 4px 0 12px;
}
.f1rd-team h3 {
  gap: 10px;
  align-items: flex-start;
}
.f1rd-team h3 small {
  flex: none;
  white-space: nowrap;
}
.f1rd-track-svg {
  inset: 0;
  width: 100%;
  height: 100%;
}
.f1rd-track-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(8, 9, 12, 0.78);
  padding: 7px 10px;
  border-radius: 8px;
  max-width: calc(100% - 36px);
}
.f1rd-track-name b {
  white-space: normal;
  line-height: 1.1;
}
.f1rd-track-name small {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--f1-muted);
}
.f1rd-car {
  transition:
    left 0.52s linear,
    top 0.52s linear,
    transform 0.52s linear;
}
.f1rd-car.overtaking {
  z-index: 7;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.75));
}
.f1rd-car.retired {
  display: none;
}
.f1rd-safety-car {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 22px;
  z-index: 12;
  border: 2px solid #1a1a12;
  border-radius: 6px 17px 7px 6px;
  background: linear-gradient(
    180deg,
    #fff19a 0 18%,
    #ffd43b 20% 62%,
    #dba900 64% 100%
  );
  color: #15120a;
  box-shadow:
    0 2px 4px #000,
    0 0 16px rgba(255, 212, 59, 0.9);
  transition:
    left 0.52s linear,
    top 0.52s linear,
    transform 0.52s linear;
  pointer-events: none;
}
.f1rd-safety-car.visible {
  display: flex;
}
.f1rd-safety-car b {
  position: absolute;
  left: 5px;
  top: 6px;
  font-size: 8px;
  line-height: 1;
}
.f1rd-sc-cabin {
  position: absolute;
  left: 20px;
  top: 3px;
  width: 21px;
  height: 15px;
  border-radius: 7px 10px 5px 4px;
  background: #b99205;
}
.f1rd-sc-window {
  position: absolute;
  left: 26px;
  top: 5px;
  width: 12px;
  height: 7px;
  border-radius: 3px 7px 2px 2px;
  background: linear-gradient(135deg, #bdeaff, #17222c 75%);
}
.f1rd-sc-wheel {
  position: absolute;
  bottom: -3px;
  width: 9px;
  height: 7px;
  border: 2px solid #777;
  border-radius: 50%;
  background: #050506;
}
.f1rd-sc-wheel.w1 {
  left: 8px;
}
.f1rd-sc-wheel.w2 {
  right: 8px;
}
.f1rd-sc-lightbar {
  position: absolute;
  display: flex;
  gap: 1px;
  left: 23px;
  top: -5px;
  padding: 1px 2px;
  border-radius: 2px;
  background: #171717;
}
.f1rd-sc-lightbar > i {
  width: 4px;
  height: 3px;
  border-radius: 50%;
  background: #ffc400;
  animation: f1rd-sc-flash 0.48s infinite alternate;
}
.f1rd-sc-lightbar > i:nth-child(2) {
  animation-delay: 0.16s;
}
.f1rd-sc-lightbar > i:nth-child(3) {
  animation-delay: 0.32s;
}
@keyframes f1rd-sc-flash {
  from {
    opacity: 0.2;
    box-shadow: none;
  }
  to {
    opacity: 1;
    box-shadow: 0 0 7px 2px #ffd43b;
  }
}
.f1rd-table tr.retired {
  opacity: 0.48;
}
.f1rd-pit-title {
  margin-top: 20px !important;
}
.f1rd-tyre-stock {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.f1rd-tyre-stock span {
  min-width: 54px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 9px;
  background: #101217;
  border: 1px solid var(--f1-line);
  font-weight: 900;
}
.f1rd-tyre-stock .soft {
  color: #ff4d5d;
}
.f1rd-tyre-stock .medium {
  color: #ffd43b;
}
.f1rd-tyre-stock .hard {
  color: #f5f5f5;
}
.f1rd-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(3, 4, 6, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.f1rd-modal-card {
  width: min(560px, 100%);
  background: #15171d;
  border: 1px solid var(--f1-line);
  border-radius: 18px;
  padding: 24px;
}
.f1rd-pit-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.f1rd-pit-window {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 12px;
}
.f1rd-pit-window span {
  text-align: right;
  font-size: 12px;
}
.f1rd-pit-window.clear {
  color: #55e39a;
  background: rgba(39, 209, 127, 0.1);
  border-color: #27d17f;
}
.f1rd-pit-window.traffic {
  color: #ffd43b;
  background: rgba(255, 212, 59, 0.1);
  border-color: #ffd43b;
}
.f1rd-strategy-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}
.f1rd-strategy-plan {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 105px;
  padding: 13px;
  text-align: left;
  color: #fff;
  background: #101217;
  border: 1px solid var(--f1-line);
  border-radius: 12px;
}
.f1rd-strategy-plan.active {
  border-color: var(--f1-red);
  box-shadow: inset 4px 0 var(--f1-red);
}
.f1rd-strategy-plan span {
  color: var(--f1-yellow);
  font-weight: 900;
}
.f1rd-strategy-plan em {
  color: var(--f1-muted);
  font-size: 11px;
  font-style: normal;
}
.f1rd-strategy-plan small {
  color: var(--f1-muted);
  font-size: 10px;
}
.f1rd-grid-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.f1rd-distance-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  color: #fff;
  background: #101217;
  border: 1px solid var(--f1-line);
  border-radius: 10px;
}
.f1rd-distance-badge b {
  color: var(--f1-red);
  font-size: 27px;
  line-height: 1;
}
.f1rd-distance-badge span {
  max-width: 55px;
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: 0.12em;
}
.f1rd-strategy-center {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(280px, 1.3fr) minmax(
      240px,
      1fr
    );
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: #111319;
  border: 1px solid var(--f1-line);
  border-radius: 14px;
}
.f1rd-strategy-center small,
.f1rd-strategy-center > div:first-child b {
  display: block;
}
.f1rd-strategy-center small {
  color: var(--f1-red);
  font-size: 9px;
  letter-spacing: 0.14em;
  font-weight: 900;
}
.f1rd-penalty-badge {
  display: none;
  margin-top: 5px;
  width: max-content;
  padding: 3px 7px;
  color: #fff;
  background: #c5162e;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}
.f1rd-penalty-badge.active {
  display: inline-block;
}
.f1rd-finish-penalty {
  padding: 10px 12px;
  border-left: 4px solid #c5162e;
  background: #29171b;
}
.f1rd-strategy-timeline {
  display: grid;
  grid-template-columns: repeat(var(--race-laps, 12), minmax(22px, 1fr));
  gap: 3px;
}
.f1rd-strategy-timeline span {
  display: grid;
  place-items: center;
  min-height: 29px;
  color: var(--f1-muted);
  background: #1c1f27;
  border-radius: 5px;
  font-size: 9px;
}
.f1rd-strategy-timeline span.stop {
  color: #fff;
  background: #71303a;
}
.f1rd-strategy-timeline span.current {
  outline: 2px solid #fff;
}
.f1rd-engineer {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border-left: 4px solid #777;
  background: #1a1d24;
  border-radius: 8px;
}
.f1rd-engineer span {
  color: var(--f1-muted);
  font-size: 11px;
}
.f1rd-engineer.box {
  border-color: var(--f1-green);
}
.f1rd-engineer.hold {
  border-color: var(--f1-yellow);
}
.f1rd-engineer.weather {
  border-color: #4f7cff;
}
.f1rd-engineer-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.f1rd-pit-anytime {
  grid-column: 1 / -1;
  color: var(--f1-muted) !important;
  text-align: center;
  letter-spacing: 0 !important;
  text-transform: none;
}
.f1rd-pit-option {
  border: 1px solid var(--f1-line);
  background: #101217;
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
}
.f1rd-pit-option b {
  display: block;
  font-size: 28px;
}
.f1rd-pit-option span {
  font-size: 11px;
}
.f1rd-pit-option.soft b {
  color: #ff4d5d;
}
.f1rd-pit-option.medium b {
  color: #ffd43b;
}
.f1rd-pit-option.hard b {
  color: #fff;
}
.f1rd-pit-option:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}
@media (max-width: 850px) {
  .f1rd-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .f1rd-top {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .f1rd-top > div:last-child {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
  }
  .f1rd-brand {
    max-width: 52%;
    line-height: 1;
  }
  .f1rd-btn {
    padding: 10px 12px;
  }
  .f1rd-pit-options {
    grid-template-columns: 1fr;
  }
  .f1rd-track-name {
    font-size: 12px;
  }
}

/* v1.3: persistent tyre sets, weather and live timing */
.f1rd-forecast {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 10px 0 16px;
}
.f1rd-forecast span {
  background: #101217;
  border: 1px solid var(--f1-line);
  padding: 9px;
  border-radius: 9px;
  font-size: 11px;
}
.f1rd-forecast b {
  display: block;
  color: var(--f1-muted);
  margin-bottom: 3px;
}
.f1rd-weather-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px;
  padding: 11px 13px;
  margin: 12px 0;
  border-left: 5px solid;
}
.f1rd-weather-banner.dry {
  background: #362f0e;
  border-color: #ffd43b;
}
.f1rd-weather-banner.damp {
  background: #0d2936;
  border-color: #31a8ff;
}
.f1rd-weather-banner.wet {
  background: #15203f;
  border-color: #657cff;
}
.f1rd-weather-banner span {
  font-size: 12px;
  color: var(--f1-muted);
}
.f1rd-set-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(105px, 1fr));
  gap: 8px;
}
.f1rd-app button.f1rd-set-card {
  appearance: none;
  -webkit-appearance: none;
  background: #101217 !important;
  color: #fff !important;
  border: 1px solid var(--f1-line);
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.f1rd-set-card b,
.f1rd-set-card span,
.f1rd-set-card em {
  display: block;
}
.f1rd-set-card b {
  font-size: 19px;
}
.f1rd-set-card span {
  font-size: 11px;
  font-weight: 750;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f1rd-set-card em {
  font-size: 10px;
  color: var(--f1-muted);
  font-style: normal;
  margin-top: 5px;
}
.f1rd-set-card.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #fff;
}
.f1rd-set-card.soft b {
  color: #ff4d5d;
}
.f1rd-set-card.medium b {
  color: #ffd43b;
}
.f1rd-set-card.hard b {
  color: #fff;
}
.f1rd-set-card.inter b {
  color: #43d17d;
}
.f1rd-set-card.wet b {
  color: #4f7cff;
}
.f1rd-set-card:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.f1rd-hud {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.f1rd-stat strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f1rd-live {
  margin-top: 12px;
  padding: 12px;
}
.f1rd-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.f1rd-live-head h3 {
  margin: 0;
}
.f1rd-live-head span {
  font-size: 10px;
  color: var(--f1-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.f1rd-live-scroll {
  max-height: 290px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.f1rd-live .f1rd-table {
  min-width: 660px;
}
.f1rd-live .f1rd-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #15171d;
  white-space: nowrap;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--f1-muted);
}
.f1rd-live tr.fastest .f1rd-bestlap {
  color: #c77dff;
  font-weight: 900;
}
.f1rd-live tr.fastest .f1rd-bestlap::first-letter {
  color: #b14cff;
}
.f1rd-stops {
  text-align: center;
  font-weight: 900;
}
.f1rd-bestlap {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.f1rd-live .f1rd-table td {
  padding: 6px 8px;
  font-size: 12px;
}
.f1rd-live .f1rd-table td:nth-child(1) {
  width: 28px;
}
.f1rd-live .f1rd-table td:nth-child(3) {
  white-space: nowrap;
}
.f1rd-live .f1rd-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.f1rd-live .f1rd-table small {
  display: block;
  margin-left: 12px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f1rd-live-driver {
  position: relative;
  min-width: 150px;
  padding-left: 39px !important;
}
.f1rd-live-driver > img {
  position: absolute;
  left: 5px;
  bottom: 0;
  width: 31px;
  height: 38px;
  object-fit: cover;
  object-position: top center;
  border-radius: 5px 5px 0 0;
}
.f1rd-mini-tyre {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 5px;
  background: #222;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border: 2px solid;
}
.f1rd-mini-tyre.soft {
  border-color: #ff4d5d;
}
.f1rd-mini-tyre.medium {
  border-color: #ffd43b;
}
.f1rd-mini-tyre.hard {
  border-color: #fff;
}
.f1rd-mini-tyre.inter {
  border-color: #43d17d;
}
.f1rd-mini-tyre.wet {
  border-color: #4f7cff;
}
.f1rd-tyre-stock {
  display: grid;
  gap: 6px;
}
.f1rd-tyre-stock span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  text-align: right;
  font-size: 10px;
}
.f1rd-tyre-stock span b {
  font-size: 13px;
}
.f1rd-tyre-stock .inter {
  color: #43d17d;
}
.f1rd-tyre-stock .wet {
  color: #4f7cff;
}
.f1rd-modal-card {
  max-height: min(760px, 90vh);
  overflow: auto;
}
.f1rd-pit-options {
  grid-template-columns: repeat(3, 1fr);
}
.f1rd-pit-option.inter b {
  color: #43d17d;
}
.f1rd-pit-option.wet b {
  color: #4f7cff;
}
@media (max-width: 1000px) {
  .f1rd-set-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 850px) {
  .f1rd-forecast {
    grid-template-columns: repeat(2, 1fr);
  }
  .f1rd-set-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .f1rd-hud {
    grid-template-columns: repeat(2, 1fr);
  }
  .f1rd-pit-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* v1.5: mobile race cockpit */
@media (max-width: 700px) {
  .f1rd-app {
    min-height: 100svh;
    border-radius: 0;
  }
  .f1rd-shell {
    padding: 10px;
  }
  .f1rd-top {
    align-items: flex-start;
    margin-bottom: 12px;
  }
  .f1rd-top > div:last-child {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }
  .f1rd-brand {
    font-size: 18px;
    padding-top: 9px;
  }
  .f1rd-app button {
    min-height: 46px;
  }
  .f1rd-top .f1rd-btn {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .f1rd-card {
    padding: 13px;
    border-radius: 14px;
  }
  .f1rd-strategy-plans {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .f1rd-strategy-plan {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  .f1rd-strategy-center {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .f1rd-strategy-timeline {
    grid-template-columns: repeat(var(--race-laps, 12), 28px);
    overflow-x: auto;
    padding: 2px;
  }
  .f1rd-engineer-actions {
    grid-column: auto;
  }
  .f1rd-engineer-actions .f1rd-btn {
    min-height: 52px;
    padding: 8px 5px;
    font-size: 11px;
  }
  .f1rd-driver {
    grid-template-columns: 46px 44px 1fr;
  }
  .f1rd-driver em {
    display: none;
  }
  .f1rd-driver-card {
    grid-template-columns: 42% 1fr;
    min-height: 185px;
  }
  .f1rd-driver-portrait {
    min-height: 175px;
  }
  .f1rd-driver-copy > b {
    font-size: 32px;
  }
  .f1rd-race-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .f1rd-track {
    height: clamp(270px, 72vw, 390px);
  }
  .f1rd-car {
    width: 42px;
    height: 18px;
  }
  .f1rd-hud {
    gap: 6px;
    margin-bottom: 8px;
  }
  .f1rd-stat {
    padding: 8px 9px;
  }
  .f1rd-stat strong {
    font-size: 18px;
  }
  .f1rd-live {
    padding: 10px 0 0;
  }
  .f1rd-live-head {
    padding: 0 10px 8px;
  }
  .f1rd-live-head span {
    max-width: 150px;
    text-align: right;
  }
  .f1rd-live-scroll {
    max-height: 255px;
  }
  .f1rd-live .f1rd-table {
    min-width: 625px;
  }
  .f1rd-actions,
  .f1rd-ers-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .f1rd-action,
  .f1rd-ers-actions .f1rd-btn {
    min-height: 58px;
    padding: 9px;
  }
  .f1rd-drs,
  #pit {
    width: 100%;
    min-height: 54px;
  }
  .f1rd-set-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(135px, 42vw);
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 3px 3px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .f1rd-set-card {
    scroll-snap-align: start;
    min-height: 92px !important;
  }
  .f1rd-modal {
    position: fixed;
    padding: 8px;
  }
  .f1rd-modal-card {
    max-height: 94svh;
    padding: 15px;
  }
  .f1rd-wheel-game button {
    height: 82px;
  }
}
.f1rd-retire {
  width: 100%;
  margin-top: 8px;
  color: #ff6b76 !important;
  background: rgba(232, 0, 32, 0.08) !important;
  border-color: rgba(255, 77, 93, 0.55) !important;
}
.f1rd-retire:hover {
  color: #fff !important;
  background: #b90019 !important;
}
.f1rd-dnf {
  border-top: 7px solid var(--f1-red);
  text-align: center;
}

/* v1.7.4: compact race cockpit */
@media (min-width: 701px) {
  .f1rd-shell {
    padding: 16px;
  }
  .f1rd-top {
    margin-bottom: 14px;
  }
  .f1rd-card {
    padding: 14px;
  }
  .f1rd-hud {
    gap: 7px;
    margin-bottom: 8px;
  }
  .f1rd-stat {
    padding: 8px 10px;
  }
  .f1rd-stat strong {
    font-size: 19px;
  }
  .f1rd-weather-stat strong {
    font-size: 25px;
  }
  .f1rd-strategy-center {
    grid-template-columns: 150px minmax(270px, 1.2fr) minmax(230px, 0.9fr) 230px;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 10px;
  }
  .f1rd-engineer-actions {
    grid-column: auto;
    grid-template-columns: repeat(3, 1fr);
  }
  .f1rd-engineer-actions .f1rd-btn {
    min-height: 42px;
    padding: 7px 6px;
    font-size: 10px;
  }
  .f1rd-pit-anytime {
    display: none;
  }
  .f1rd-race-grid {
    grid-template-columns: minmax(0, 2fr) minmax(265px, 0.8fr);
    gap: 12px;
  }
  .f1rd-track {
    height: 360px;
  }
  .f1rd-live {
    margin-top: 8px;
  }
  .f1rd-live-scroll {
    max-height: 230px;
  }
  .f1rd-race-controls h3 {
    margin-bottom: 8px;
  }
  .f1rd-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .f1rd-action {
    padding: 9px;
  }
  .f1rd-energy-head {
    margin-top: 10px;
  }
  .f1rd-ers-actions {
    gap: 5px;
  }
  .f1rd-ers-actions .f1rd-btn {
    padding: 8px 5px;
    font-size: 10px;
  }
  .f1rd-pit-title {
    margin-top: 12px !important;
  }
  .f1rd-tyre-stock {
    gap: 3px;
  }
  .f1rd-tyre-stock span {
    padding: 5px 7px;
  }
}

@media (max-width: 700px) {
  .f1rd-shell {
    padding: 7px;
  }
  .f1rd-top {
    margin-bottom: 7px;
  }
  .f1rd-card {
    padding: 10px;
  }
  .f1rd-hud {
    gap: 4px;
    margin-bottom: 6px;
  }
  .f1rd-stat {
    padding: 6px 7px;
  }
  .f1rd-stat strong {
    font-size: 16px;
  }
  .f1rd-weather-stat strong {
    font-size: 23px;
  }
  .f1rd-weather-stat > span {
    font-size: 9px;
  }
  .f1rd-strategy-center {
    gap: 5px;
    margin-bottom: 6px;
    padding: 7px;
  }
  .f1rd-strategy-timeline span {
    min-height: 24px;
  }
  .f1rd-engineer {
    padding: 7px 9px;
  }
  .f1rd-engineer-actions .f1rd-btn {
    min-height: 44px;
  }
  .f1rd-pit-anytime {
    display: none;
  }
  .f1rd-track {
    height: clamp(230px, 62vw, 300px);
  }
  .f1rd-live {
    margin-top: 6px;
  }
  .f1rd-live-scroll {
    max-height: 205px;
  }
  .f1rd-race-controls {
    padding: 9px;
  }
  .f1rd-race-controls h3 {
    margin-bottom: 7px;
  }
  .f1rd-action,
  .f1rd-ers-actions .f1rd-btn {
    min-height: 48px;
    padding: 7px;
  }
  .f1rd-pit-title {
    margin-top: 11px !important;
  }
  .f1rd-tyre-stock {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
  }
  .f1rd-tyre-stock span {
    flex: 0 0 auto;
    min-width: 118px;
    padding: 5px 7px;
  }
}
