/* VTRSIM v0.17.1 — visual hotfix for races and race detail.
   CSS only: no change to schedule, enrollment, Steam auth, PIN or Race Gate.
   Must be loaded after css/vtr-ui-v017.css. */

/* 1. Calendar artwork: previous generic >span rule forced the rating badge to
   top:10px, exactly on top of DAILY/FUN/COMPETITIVE label. Give every label its
   own place and keep the title away from the bottom-right rating. */
body.vtr17[data-page="races"] .premium-calendar-art {
  min-height:162px!important;
  height:162px!important;
  isolation:isolate;
}
body.vtr17[data-page="races"] .premium-calendar-art > .premium-calendar-kind {
  position:absolute!important;
  top:11px!important;
  left:11px!important;
  right:auto!important;
  bottom:auto!important;
  z-index:2!important;
  max-width:60%!important;
  white-space:normal!important;
  line-height:1.2!important;
}
body.vtr17[data-page="races"] .premium-calendar-art > b {
  position:absolute!important;
  top:11px!important;
  right:11px!important;
  left:auto!important;
  bottom:auto!important;
  z-index:2!important;
  max-width:48%!important;
  text-align:center!important;
  line-height:1.2!important;
  white-space:normal!important;
}
body.vtr17[data-page="races"] .premium-calendar-art > .vtr-rating-badge {
  position:absolute!important;
  top:auto!important;
  bottom:11px!important;
  left:auto!important;
  right:11px!important;
  z-index:3!important;
  display:inline-flex!important;
  width:max-content!important;
  max-width:110px!important;
  min-height:23px!important;
  padding:4px 8px!important;
  line-height:1.2!important;
  font-size:10px!important;
  transform:none!important;
  pointer-events:none;
}
body.vtr17[data-page="races"] .premium-calendar-art > strong {
  max-width:calc(100% - 110px)!important;
  min-width:0!important;
  z-index:2!important;
  line-height:1.15!important;
  text-wrap:pretty;
}

/* 2. The old v0.15.8 declaration unconditionally makes every text span inside
   a disclosure action white !important; v0.17.0 changed its background to
   white but omitted a counter-rule for child spans. Cover closed/open/hover. */
body.vtr17[data-page="races"] .premium-calendar-settings > summary .vtr-disclosure-action,
body.vtr17[data-page="races"] .premium-calendar-settings > summary .vtr-disclosure-action :is(span,i),
body.vtr17[data-page="races"] .premium-calendar-settings[open] > summary .vtr-disclosure-action,
body.vtr17[data-page="races"] .premium-calendar-settings[open] > summary .vtr-disclosure-action :is(span,i),
body.vtr17[data-page="races"] .premium-calendar-settings > summary:hover .vtr-disclosure-action,
body.vtr17[data-page="races"] .premium-calendar-settings > summary:hover .vtr-disclosure-action :is(span,i) {
  color:#0755b9!important;
  text-shadow:none!important;
}
body.vtr17[data-page="races"] .premium-calendar-settings > summary .vtr-disclosure-action {
  background:#fff!important;
  border:1px solid #aac9f7!important;
  min-width:118px!important;
  max-width:48%!important;
  opacity:1!important;
}
body.vtr17[data-page="races"] .premium-calendar-settings > summary:hover .vtr-disclosure-action {
  background:#e6f1ff!important;
  border-color:#79aaf0!important;
}
body.vtr17[data-page="races"] .premium-calendar-settings > summary .vtr-disclosure-copy,
body.vtr17[data-page="races"] .premium-calendar-settings > summary .vtr-disclosure-copy :is(strong,small) {
  color:#16324c!important;
}
body.vtr17[data-page="races"] .premium-calendar-settings > summary .vtr-disclosure-copy small {
  color:#496783!important;
}

/* 3. Live card and action legibility: no white-on-white text on ghost buttons. */
body.vtr17[data-page="races"] .race-live-list-v117 .premium-calendar-actions a.premium-calendar-briefing,
body.vtr17[data-page="races"] .premium-calendar-actions a.premium-calendar-briefing {
  color:#134779!important;
  background:#f4f9ff!important;
  border-color:#bdd7fa!important;
  text-shadow:none!important;
  opacity:1!important;
}
body.vtr17[data-page="races"] .premium-calendar-actions a.premium-calendar-briefing:is(:hover,:focus-visible) {
  color:#0750ac!important;
  background:#e6f1ff!important;
}
body.vtr17[data-page="races"] .premium-calendar-actions a.btn {
  color:#fff!important;
  opacity:1!important;
  text-shadow:none!important;
}
body.vtr17[data-page="races"] .premium-calendar-actions a.btn:is(:hover,:focus-visible){
  color:#fff!important;
  background:#0755bf!important;
}
body.vtr17[data-page="races"] .premium-calendar-actions button.vtr-copy-direct-v1,
body.vtr17[data-page="races"] .premium-calendar-actions button.vtr-copy-direct-v1:is(:hover,:focus-visible){
  color:#0756b7!important;
  background:#fff!important;
}
body.vtr17[data-page="races"] .premium-calendar-actions button.vtr-join-direct-v1,
body.vtr17[data-page="races"] .premium-calendar-actions button.vtr-join-direct-v1:is(:hover,:focus-visible){
  color:#fff!important;
  background:#058453!important;
}

/* 4. Race detail: this is an enrollment notice, not the 44px countdown PIN.
   Explicitly override .command-countdown-v7 strong and preserve separate real
   PIN styling when a registered pilot's access becomes available. */
body.vtr17[data-page="race"] .vtr-command-lobby-v159.vtr-v16-timing-not-authorized {
  padding:14px 15px!important;
  margin:13px 0!important;
  border:1px solid #eddbb9!important;
  border-left:4px solid #db9b3b!important;
  border-radius:9px!important;
  background:linear-gradient(130deg,#fffaf1,#fff6e9)!important;
  box-shadow:none!important;
  min-width:0!important;
}
body.vtr17[data-page="race"] .vtr-v16-timing-not-authorized .vtr-v16-private-notice {
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  min-width:0!important;
  text-align:left!important;
  color:#483b2b!important;
}
body.vtr17[data-page="race"] .vtr-v16-timing-not-authorized .vtr-v16-private-notice::before {
  content:"ACCÈS PERSONNEL";
  display:block!important;
  color:#8b5b20!important;
  font-size:10px!important;
  font-weight:850!important;
  letter-spacing:.13em!important;
  line-height:1.2!important;
}
body.vtr17[data-page="race"] .vtr-v16-timing-not-authorized .vtr-v16-private-notice > strong {
  display:block!important;
  margin:0!important;
  padding:0!important;
  font-size:clamp(14px,1vw,16px)!important;
  font-weight:820!important;
  letter-spacing:normal!important;
  line-height:1.36!important;
  color:#51391b!important;
  text-transform:none!important;
  text-shadow:none!important;
  font-style:normal!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}
body.vtr17[data-page="race"] .vtr-v16-timing-not-authorized .vtr-v16-private-notice > small {
  display:block!important;
  margin:0!important;
  font-size:11px!important;
  font-weight:650!important;
  line-height:1.45!important;
  color:#806647!important;
  text-shadow:none!important;
}

@media(max-width:700px){
  body.vtr17[data-page="races"] .premium-calendar-art {
    height:158px!important;
    min-height:158px!important;
  }
  body.vtr17[data-page="races"] .premium-calendar-art > strong {
    max-width:calc(100% - 92px)!important;
    font-size:18px!important;
  }
  body.vtr17[data-page="races"] .premium-calendar-settings > summary .vtr-disclosure-action {
    min-width:110px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  body.vtr17[data-page="races"] .premium-calendar-art *{transition:none!important}
}
