/* JDRC_DRIVER_LIVE_RACE_CALL_V1 */
#jdrcLiveRaceCallPanel{position:relative;overflow:hidden}
#jdrcLiveRaceCallPanel .jdrc-live-race-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(220px,.6fr);gap:18px;align-items:stretch}
#jdrcLiveRaceCallPanel .jdrc-live-race-main,#jdrcLiveRaceCallPanel .jdrc-live-race-side{border:1px solid rgba(255,255,255,.12);border-radius:16px;background:rgba(10,10,12,.72);padding:18px;min-width:0}
#jdrcLiveRaceCallPanel .jdrc-live-race-state{font-size:clamp(1.65rem,4vw,3.1rem);line-height:1;font-weight:900;letter-spacing:.035em;text-transform:uppercase;margin:.18rem 0 .6rem}
#jdrcLiveRaceCallPanel .jdrc-live-race-event{font-weight:800;margin:0 0 .35rem}
#jdrcLiveRaceCallPanel .jdrc-live-race-copy{margin:.35rem 0;color:var(--muted,#b9bbc2)}
#jdrcLiveRaceCallPanel .jdrc-live-race-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
#jdrcLiveRaceCallPanel .jdrc-live-race-meta>div{border:1px solid rgba(255,255,255,.09);border-radius:12px;padding:10px 12px;background:rgba(255,255,255,.035)}
#jdrcLiveRaceCallPanel .jdrc-live-race-meta span{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted,#a9abb2)}
#jdrcLiveRaceCallPanel .jdrc-live-race-meta strong{display:block;margin-top:3px;overflow-wrap:anywhere}
#jdrcLiveRaceCallPanel .jdrc-live-race-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
#jdrcLiveRaceCallPanel .jdrc-live-race-alert-state{font-size:.8rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase}
#jdrcLiveRaceCallPanel .jdrc-live-race-side h3{margin:.15rem 0 .7rem}
#jdrcLiveRaceCallPanel .jdrc-live-race-following{margin-top:12px;padding-top:12px;border-top:1px solid rgba(255,255,255,.1)}
#jdrcLiveRaceCallPanel[data-race-state="UP_NEXT"],#jdrcLiveRaceCallPanel[data-race-state="RACE_NOW"]{border-color:var(--accent,#ff7a00)}
#jdrcLiveRaceCallPanel[data-race-state="UP_NEXT"]::before,#jdrcLiveRaceCallPanel[data-race-state="RACE_NOW"]::before{content:"";position:absolute;inset:0;pointer-events:none;border:3px solid var(--accent,#ff7a00);border-radius:inherit;animation:jdrcRaceCallPulse 1s ease-in-out infinite}
#jdrcLiveRaceCallPanel[data-race-state="RACE_NOW"]::before{animation-duration:.55s}
#jdrcLiveRaceCallPanel[data-race-state="THREE_AWAY"] .jdrc-live-race-state,#jdrcLiveRaceCallPanel[data-race-state="TWO_AWAY"] .jdrc-live-race-state{color:#ffd166}
#jdrcLiveRaceCallPanel[data-race-state="UP_NEXT"] .jdrc-live-race-state,#jdrcLiveRaceCallPanel[data-race-state="RACE_NOW"] .jdrc-live-race-state{color:var(--accent,#ff7a00)}
@keyframes jdrcRaceCallPulse{0%,100%{box-shadow:inset 0 0 0 0 rgba(255,122,0,0)}50%{box-shadow:inset 0 0 34px 2px rgba(255,122,0,.22)}}
@media(max-width:760px){#jdrcLiveRaceCallPanel .jdrc-live-race-grid{grid-template-columns:1fr}#jdrcLiveRaceCallPanel .jdrc-live-race-meta{grid-template-columns:1fr 1fr}}
@media(max-width:460px){#jdrcLiveRaceCallPanel .jdrc-live-race-meta{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){#jdrcLiveRaceCallPanel::before{animation:none!important}}


/* JDRC_DRIVER_LIVE_STATS_V1_2 */
#jdrcLiveRaceCallPanel .jdrc-live-driver-stats{margin-top:16px;border:1px solid rgba(255,255,255,.11);border-radius:14px;padding:14px;background:rgba(255,255,255,.03)}
#jdrcLiveRaceCallPanel .jdrc-live-driver-stats.is-live{border-color:rgba(83,214,138,.42);background:rgba(83,214,138,.055)}
#jdrcLiveRaceCallPanel .jdrc-live-stats-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
#jdrcLiveRaceCallPanel .jdrc-live-stats-head>div{min-width:0}
#jdrcLiveRaceCallPanel .jdrc-live-stats-kicker{display:block;font-size:.7rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase;color:var(--muted,#a9abb2);margin-bottom:3px}
#jdrcLiveRaceCallPanel .jdrc-live-stats-head strong{display:block;overflow-wrap:anywhere}
#jdrcLiveRaceCallPanel .jdrc-live-stats-badge{flex:0 0 auto;border:1px solid rgba(255,255,255,.16);border-radius:999px;padding:5px 8px;font-size:.68rem;font-weight:900;letter-spacing:.09em}
#jdrcLiveRaceCallPanel .jdrc-live-driver-stats.is-live .jdrc-live-stats-badge{border-color:rgba(83,214,138,.55);color:#72e59e}
#jdrcLiveRaceCallPanel .jdrc-live-stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#jdrcLiveRaceCallPanel .jdrc-live-stat{min-width:0;border:1px solid rgba(255,255,255,.09);border-radius:11px;padding:9px 10px;background:rgba(0,0,0,.16)}
#jdrcLiveRaceCallPanel .jdrc-live-stat span{display:block;font-size:.66rem;text-transform:uppercase;letter-spacing:.07em;color:var(--muted,#a9abb2)}
#jdrcLiveRaceCallPanel .jdrc-live-stat strong{display:block;margin-top:3px;font-size:1rem;line-height:1.1;overflow-wrap:anywhere}
#jdrcLiveRaceCallPanel .jdrc-live-stat.is-primary strong{font-size:1.45rem}
#jdrcLiveRaceCallPanel .jdrc-live-stats-foot{margin:10px 0 0;color:var(--muted,#a9abb2);font-size:.76rem}
@media(max-width:980px){#jdrcLiveRaceCallPanel .jdrc-live-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:460px){#jdrcLiveRaceCallPanel .jdrc-live-stats-grid{grid-template-columns:1fr 1fr}#jdrcLiveRaceCallPanel .jdrc-live-stat.is-primary strong{font-size:1.25rem}}
/* /JDRC_DRIVER_LIVE_STATS_V1_2 */

/* =========================================================
   JDRC_LIVE_RACE_MOBILE_PANEL_V1
   Mobile/foldable layout correction for Driver Pit Live Race Status.
   Keeps STANDBY/LIVE chip readable and prevents panel compression.
   ========================================================= */

@media (max-width:760px){

  #jdrcLiveRaceCallPanel{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow:visible;
    box-sizing:border-box;
  }

  /* Header: title copy and STANDBY/LIVE indicator get dedicated space. */
  #jdrcLiveRaceCallPanel .panel-title{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:start !important;
    justify-content:stretch !important;
    gap:12px !important;
    width:100%;
  }

  #jdrcLiveRaceCallPanel .panel-title > div{
    min-width:0;
    width:100%;
  }

  #jdrcLiveRaceCallTitle{
    font-size:clamp(28px,8vw,38px) !important;
    line-height:1.05 !important;
    letter-spacing:-.02em !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
    hyphens:none;
  }

  #jdrcLiveRaceCallPanel .panel-title p{
    max-width:100%;
    line-height:1.45;
    overflow-wrap:break-word;
  }

  /* Protect the LED/status pill from the global "compress/wrap" chip rule. */
  #jdrcLiveRaceCallChip{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    flex:0 0 auto !important;
    width:max-content !important;
    min-width:max-content !important;
    max-width:none !important;
    min-height:36px;
    margin:2px 0 0 !important;
    padding:8px 12px !important;
    font-size:12px !important;
    line-height:1 !important;
    letter-spacing:.06em !important;
    white-space:nowrap !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
    hyphens:none !important;
  }

  #jdrcLiveRaceCallChip::before{
    flex:0 0 8px !important;
    width:8px !important;
    height:8px !important;
  }

  /* Force the 2 desktop columns into clean stacked cards. */
  #jdrcLiveRaceCallPanel .jdrc-live-race-grid{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:12px !important;
    width:100%;
    min-width:0;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-main,
  #jdrcLiveRaceCallPanel .jdrc-live-race-side{
    width:100%;
    max-width:100%;
    min-width:0 !important;
    padding:16px !important;
    box-sizing:border-box;
    overflow:visible;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-state{
    max-width:100%;
    font-size:clamp(30px,10vw,46px) !important;
    line-height:1.02 !important;
    letter-spacing:.02em !important;
    white-space:normal;
    word-break:normal !important;
    overflow-wrap:break-word !important;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-event{
    max-width:100%;
    font-size:15px;
    line-height:1.35;
    overflow-wrap:break-word;
    word-break:normal;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-copy{
    max-width:100%;
    line-height:1.5;
    overflow-wrap:break-word;
    word-break:normal;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-side h3{
    font-size:20px;
    line-height:1.2;
  }

  /* Controls become touch-friendly instead of fighting for horizontal room. */
  #jdrcLiveRaceCallPanel .jdrc-live-race-actions{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:9px !important;
    width:100%;
    min-width:0;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-actions > .button,
  #jdrcLiveRaceCallPanel .jdrc-live-race-actions > button,
  #jdrcLiveRaceCallPanel .jdrc-live-race-actions > a{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100% !important;
    max-width:100%;
    min-width:0;
    min-height:44px;
    margin:0 !important;
    padding:10px 12px !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
    text-align:center;
    line-height:1.2 !important;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-meta{
    width:100%;
    min-width:0;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-meta > div{
    min-width:0;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-meta strong{
    word-break:normal !important;
    overflow-wrap:break-word !important;
  }

  /* Racer stats header gets the same anti-squeeze treatment. */
  #jdrcLiveRaceCallPanel .jdrc-live-stats-head{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:start !important;
    gap:10px !important;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-stats-head > div{
    min-width:0;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-stats-badge{
    width:max-content !important;
    min-width:max-content !important;
    max-width:none !important;
    white-space:nowrap !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
  }
}

@media (max-width:460px){

  #jdrcLiveRaceCallPanel{
    padding-left:14px !important;
    padding-right:14px !important;
  }

  #jdrcLiveRaceCallPanel .panel-title{
    grid-template-columns:1fr !important;
    gap:9px !important;
  }

  #jdrcLiveRaceCallChip{
    justify-self:start;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-main,
  #jdrcLiveRaceCallPanel .jdrc-live-race-side{
    padding:14px !important;
    border-radius:14px;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-race-meta{
    grid-template-columns:1fr !important;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-stats-head{
    grid-template-columns:1fr !important;
  }

  #jdrcLiveRaceCallPanel .jdrc-live-stats-badge{
    justify-self:start;
  }
}

/* =========================================================
   JDRC_LIVE_RACE_STANDBY_PILL_V1
   Prevent STANDBY/LIVE race-call indicator from being squeezed
   into a narrow circular badge on foldable/tablet widths.
   ========================================================= */

#jdrcLiveRaceCallPanel #jdrcLiveRaceCallChip{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;

  flex:0 0 auto !important;
  flex-shrink:0 !important;

  width:auto !important;
  min-width:112px !important;
  max-width:none !important;

  height:auto !important;
  min-height:42px !important;
  max-height:none !important;

  aspect-ratio:auto !important;

  padding:10px 14px !important;
  margin:0 !important;

  border-radius:999px !important;

  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;

  line-height:1 !important;
  text-align:center !important;
}

#jdrcLiveRaceCallPanel #jdrcLiveRaceCallChip::before{
  content:"" !important;
  display:block !important;
  flex:0 0 8px !important;
  width:8px !important;
  min-width:8px !important;
  height:8px !important;
  min-height:8px !important;
  border-radius:50% !important;
}

/* Give the indicator a protected column at phone, foldable and tablet widths. */
@media (max-width:1280px){
  #jdrcLiveRaceCallPanel .panel-title{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:start !important;
    gap:16px !important;
  }

  #jdrcLiveRaceCallPanel .panel-title > div{
    min-width:0 !important;
  }

  #jdrcLiveRaceCallPanel #jdrcLiveRaceCallChip{
    justify-self:end !important;
    align-self:start !important;
  }
}

/* On very narrow phones, put the badge below the title copy. */
@media (max-width:460px){
  #jdrcLiveRaceCallPanel .panel-title{
    grid-template-columns:1fr !important;
  }

  #jdrcLiveRaceCallPanel #jdrcLiveRaceCallChip{
    justify-self:start !important;
  }
}
