/* Midnight & Ice: colour, shared header and the existing race-night layout. */
:root{
  color-scheme:dark;
  --ice-bg:#0c1423;
  --ice-panel:#122239;
  --ice-line:#2c4561;
  --ice-accent:#9fcafa;
  --ice-text:#edf5fc;
  --ice-muted:#b7c7d9;
  --red:var(--ice-accent);
  --red-dark:#729fcf;
  --black:var(--ice-bg);
  --panel:var(--ice-panel);
  --panel-2:#182b44;
  --line:var(--ice-line);
  --white:var(--ice-text);
  --muted:var(--ice-muted);
  --green:#88ddbb;
  --action-red:#365fd1;
  --action-hover:#2b50b6;
  --grid-line:var(--ice-line);
  --grid-muted:var(--ice-muted);
}
body,.page-home{color:var(--ice-text);background:var(--ice-bg)}
body:before,.page-home:before{background:radial-gradient(ellipse at 75% 0%,#24446a35,transparent 48%),linear-gradient(180deg,#0c1423,#0a1322)}
::selection{color:#0c1423;background:#b4d7ff}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline-color:#c7e2ff}
.season-ribbon{color:#d4e6f8;background:linear-gradient(90deg,#172b45,#254568 50%,#172b45)}
.topbar{background:#0c1423f2;border-color:var(--ice-line)}
.brand>span{border-color:var(--ice-line)}
.nav a,.grid-nav>a,.nav-group>summary{color:#d8e5f2}
.nav-group[open]>summary,.nav-group.has-current-page>summary{text-decoration-color:var(--ice-accent)}
.nav-group>summary:after,.nav-dropdown small{color:var(--ice-muted)}
.nav-dropdown{background:#122239;border-color:#365474;box-shadow:0 16px 45px #030a1659}
.nav-dropdown:before{background:var(--ice-accent)}
.nav .nav-dropdown a:hover{background:#203753}
.button{background:#14253c;border-color:#4b6582;color:var(--ice-text)}
.button:hover{border-color:var(--ice-accent)}
.button-primary,.race-card-cta,.header-join,.skip-link,.round-number,
.racecal-filter button,.racecal-download .button-primary,.race-detail .button-primary,.race-detail-topbar .button-primary{color:#fff;background:var(--action-red);border-color:var(--action-red)}
.button-primary:hover,.race-card-cta:hover,.header-join:hover,
.racecal-filter button:hover,.racecal-download .button-primary:hover,.race-detail .button-primary:hover,.race-detail-topbar .button-primary:hover{color:#fff;background:var(--action-hover);border-color:#7eaaf7}
.nav .nav-home,.nav .nav-join,.topbar-home{background:var(--action-red);border-color:#80a9e8;box-shadow:0 5px 18px #365fd12b;animation:none}
.nav .nav-home:hover,.nav .nav-join:hover{background:var(--action-hover)}

/* Original homepage hero: title left, circuit photograph and countdown right. */
.home-hero-section:before{background:linear-gradient(90deg,#0c1423 2%,#0c1423f2 32%,#0c1423ba 57%,#0c1423e8),var(--active-track-image,url('/checkin-banners/generic.webp')) center/cover no-repeat;filter:saturate(.7)}
.home-hero-section:after{background:linear-gradient(180deg,transparent 65%,#0c1423 100%),radial-gradient(circle at 60% 60%,transparent 0,#07101f52 70%)}
.hero-copy h1{text-shadow:0 10px 34px #030b1b80}
.hero-copy h1 small,.hero-kicker{color:#d4e6f8}
.hero-subtitle{color:#c4d3e3}
.hero-live-panel{background:#102037e8;border-color:#3d5876;box-shadow:0 18px 44px #030b1b38}
.race-ticker{background:#101e32;border-color:var(--ice-line)}
.race-ticker-live{background:linear-gradient(135deg,#2c4c75,#365fd1);box-shadow:10px 0 22px #020b1c40}
.race-ticker-item{color:#e2edf8}
.race-ticker-item b{color:var(--ice-accent)}
.hero-stats{border-color:var(--ice-line);background:linear-gradient(90deg,#162940b8,#10213970)}
.hero-stats span{border-color:var(--ice-line)}
.hero-stats small,.hero-manifesto{color:var(--ice-muted)}
.hero-manifesto{border-color:#4b6582}
.race-card{color:var(--ice-text);background:#122239ed;border-color:#476684;box-shadow:0 28px 75px #02091955}
.race-card>header,.race-countdown,.race-facts div{border-color:#314b68}
.race-card-photo{box-shadow:inset 0 -70px 60px #071222c7}
.race-countdown>small,.race-facts dt{color:#afc4dc}
.seats-open i{box-shadow:0 0 12px #88ddbb44}

/* Open editorial sections, video and Essentials links. */
.grid-eyebrow,.grid-video-label h2 span,.grid-night-division,
.grid-section-intro h2 em,.grid-story-copy h2 em,.grid-community h2 em,
.grid-night:hover strong,.grid-inline-link:hover,.grid-media-links a:hover span,
.home-essentials .grid-eyebrow,.home-essentials h2 span,.home-essentials nav span{color:var(--ice-accent)}
.grid-signal-strip,.grid-night-format,.grid-night-footnote,.grid-video-caption,
.grid-media-links a,.home-essentials p{color:var(--ice-muted)}
.grid-section-intro .grid-season-note{color:#c4d4e6!important}
.grid-night-index,.grid-night-arrow{color:#9eb6d0}
.grid-video-label>span{color:#c4d4e6}
.grid-video-player,.grid-video-poster{background:#122239}
.grid-play-icon{background:#365fd1;box-shadow:0 6px 30px #020b1c66}
.grid-video-poster:after{background:linear-gradient(0deg,#061020a6,transparent 50%)}
.grid-race-story{background:#122239}
.grid-story-photo:after{background:linear-gradient(0deg,#07122299,transparent 50%),linear-gradient(90deg,transparent 70%,#122239)}
.home-essentials,.home-essentials nav a{border-color:var(--ice-line)}
.home-essentials nav a:hover{color:#d3e8ff}
.grid-inline-link{border-color:#6f8dac}
.status-dot{background:#88ddbb;box-shadow:0 0 12px #88ddbb40}
.site-footer,.page-home .site-footer{background:linear-gradient(90deg,#101e32,#172c46,#101e32);border-color:var(--ice-line)}

/* Shared content pages and calendars. */
.hero:not(.hero-home):before{background:linear-gradient(90deg,#0c1423 5%,#0c1423ad,#0c1423),url('/checkin-banners/generic.webp') center/cover}
.hero-lead{color:#d4e3f3}
.quick-card,.content-section,.info-panel,.notice,.schedule-card,.faq-grid details{background:linear-gradient(145deg,#15263d,#0f1c30);border-color:var(--ice-line)}
.proof-strip,.benefit-grid article,.steps li,.calendar-facts div,.calendar-jump a,.schedule-card-header{background:#14253c;border-color:var(--ice-line)}
.proof-strip div,.info-panel dl div,.schedule-table td,.schedule-table th{border-color:var(--ice-line)}
.racecal-control{background:radial-gradient(circle at 86% 20%,#7abaff14,transparent 28%),linear-gradient(135deg,#182d47,#101d30);border-color:var(--ice-line);box-shadow:0 22px 55px #030a1633}
.racecal-filter select,.racecal-kpis article,.racecal-next,.racecal-event,.racecal-empty,
.racecal-faq-grid details,.race-detail{background:#122239;border-color:var(--ice-line)}
.racecal-filter select:focus{outline-color:#9fcafa66}
.racecal-next-visual,.racecal-event-visual{background:#192e48}
.racecal-round,.racecal-status{background:#0c1a2de8}
.racecal-meta span{background:#182d47;border-color:#3a5675;color:#c4d4e6}
.racecal-meta .tier{border-color:#6d99c9}
.racecal-event-date{color:var(--ice-accent)}
.racecal-week-grid article{background:linear-gradient(145deg,#182c45,#101f34);border-color:var(--ice-line)}
.racecal-control p,.racecal-filter label,.racecal-kpis small,.racecal-section-head p,
.racecal-week-grid small,.racecal-faq-grid p,.racecal-empty span,.racecal-past>summary span{color:var(--ice-muted)}
.racecal-section-head,.racecal-past,.race-detail-briefing{border-color:var(--ice-line)}
.racecal-event:hover,.racecal-faq-grid details[open]{border-color:#6689b0}
.race-detail-facts dt,.race-detail-footer,.race-detail-briefing p{color:var(--ice-muted)}

/* Widget stylesheet is loaded later, so scope these overrides through its root. */
body .ers-chat{--chat-red:#365fd1;--chat-white:#edf5fc;--chat-muted:#b7c7d9;--chat-panel:#122239;--chat-line:#2c4561}
.ers-chat .ers-chat-launcher{background:#365fd1;border-color:#86a9e8;box-shadow:0 12px 30px #020b1c55}
.ers-chat .ers-chat-launcher:hover{background:#2b50b6}
.ers-chat .ers-chat-panel{border-color:#496887}
.ers-chat .ers-chat-header{background:linear-gradient(145deg,#1a304c,#122239)}
.ers-chat .ers-chat-footer{background:#102037}
.ers-chat .ers-chat-new,.ers-chat .ers-chat-questions button,.ers-chat .ers-chat-composer,
.ers-chat .ers-chat-bubble,.ers-chat .ers-chat-handoff a,.ers-chat .ers-chat-message-links a{background:#1b304c;border-color:#3c5675}
.ers-chat .ers-chat-questions button:hover:not(:disabled),.ers-chat .ers-chat-handoff a:hover{background:#264366;border-color:#7fa7d0}
.ers-chat .ers-chat-message.user .ers-chat-bubble{background:#203d65;border-color:#557da9}
.ers-chat .ers-chat-composer:focus-within{border-color:#9fcafa}
.ers-chat .ers-chat-composer button:disabled{background:#2c405a}

@media(max-width:1120px){.grid-nav{background:#101f34;border-color:var(--ice-line)}.nav-dropdown{background:#192e48}}
@media(max-width:760px){.grid-story-photo:after{background:linear-gradient(0deg,#122239,transparent 50%)}}

/* A centred identity with a slow, soft ice glow. */
.topbar .topbar-inner{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-rows:76px auto;gap:0 24px;min-height:130px}
.topbar .brand{position:relative;left:auto;grid-column:2;grid-row:1;justify-self:center;margin:0;isolation:isolate}
.topbar .brand:before{position:absolute;z-index:-1;inset:3px -20px;content:"";pointer-events:none;border-radius:50%;background:radial-gradient(ellipse,#8fc5ff59 0%,#558cce26 42%,transparent 72%);filter:blur(12px);opacity:.5;animation:ersBrandHalo 6s ease-in-out infinite}
.topbar .brand img{position:relative;width:180px;height:76px;filter:drop-shadow(0 0 7px #afd6ff40) drop-shadow(0 0 18px #71b0fa24);animation:ersBrandGlow 6s ease-in-out infinite}
.topbar .header-join{grid-column:3;grid-row:1;justify-self:end}
.topbar .grid-nav{position:static;grid-column:1/-1;grid-row:2;justify-self:center;justify-content:center;width:auto;margin:0;padding:0 0 9px;gap:24px}
@keyframes ersBrandGlow{0%,100%{filter:drop-shadow(0 0 7px #afd6ff40) drop-shadow(0 0 18px #71b0fa24)}50%{filter:drop-shadow(0 0 10px #c6e3ff80) drop-shadow(0 0 27px #79b8ff55)}}
@keyframes ersBrandHalo{0%,100%{opacity:.38;transform:scale(.94)}50%{opacity:.78;transform:scale(1.08)}}
@media(max-width:1120px){
  .topbar .topbar-inner{grid-template-rows:76px;gap:0 12px;min-height:76px}
  .topbar .brand img{width:142px;height:60px}
  .topbar .nav-toggle{grid-column:1;grid-row:1;justify-self:start;min-width:44px;min-height:44px}
  .topbar .grid-nav{position:absolute;top:100%;left:0;right:0;grid-row:auto;justify-self:stretch;width:100%;padding:20px;gap:0;justify-content:flex-start;max-height:calc(100dvh - 110px)}
  html:not(.js) .topbar .grid-nav{position:static;grid-row:2;max-height:none}
}
@media(max-width:760px){
  .topbar .topbar-inner{grid-template-rows:70px;gap:0 6px;min-height:70px}
  .topbar .brand img{width:122px;height:54px}
  .topbar .brand:before{inset:4px -10px;filter:blur(9px)}
}
@media(max-width:359px){
  .topbar .topbar-inner{width:calc(100% - 24px)}
  .topbar .brand img{width:110px;height:49px}
  .topbar .header-join{padding:10px 8px;font-size:12px;gap:6px;letter-spacing:.3px}
}
@media(prefers-reduced-motion:reduce){.topbar .brand img,.topbar .brand:before{animation:none}}

/* Partner logos and Checkpoint banner above the footer. */
.grid-partners {
  display: grid;
  grid-template-columns: minmax(0, 156px) minmax(0, 100px) minmax(0, 156px);
  justify-content: center;
  justify-items: center;
  min-height: 0;
  gap: 16px clamp(16px, 3vw, 40px);
  padding: 28px 0;
}
.grid-partners .grid-eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  color: #a8bed5;
  font-size: 10px;
  letter-spacing: 2px;
}
.grid-partners .home-affiliate-link{padding:4px;opacity:1}
.grid-partners .home-affiliate-link-paskluis{flex-direction:column;gap:7px;min-width:76px}
.grid-partners .home-affiliate-link-paskluis img{width:48px;height:48px;border-radius:10px;object-fit:contain;filter:drop-shadow(0 4px 10px #020b1c50)}
.grid-partners .partner-name{color:#dce9f7;font:600 13px/1.2 Inter,Arial,sans-serif;letter-spacing:.2px}
.grid-partners .home-affiliate-link-checkpoint {
  flex-direction: column;
  gap: 7px;
}
.checkpoint-partner-icon {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
}
/* Frame the round checkmark in the Checkpoint artwork. */
.checkpoint-partner-icon img {
  position: absolute;
  top: -41%;
  left: -94%;
  width: 575%;
  max-width: none;
  height: auto;
  filter: none;
}
.grid-partners .home-affiliate-link-src{max-width:100%}
.grid-partners .home-affiliate-link-src img{width:140px;max-width:100%;height:48px;max-height:48px;object-fit:contain;filter:none}
.page-home .site-footer{margin-top:0}
@media (max-width: 940px) {
  .grid-partners {
    grid-template-columns: minmax(0, 156px);
    justify-content: center;
  }
  .grid-partners .home-affiliate-link-src img{width:130px;height:44px}
}
@media(max-width:760px){.topbar .header-join{display:none}}

.hero-league-links {
  display: grid;
  width: min(360px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.hero-home .hero-league-links .button {
  min-width: 0;
  padding: 8px 10px;
  text-align: center;
  white-space: normal;
}
.hero-home .hero-league-links .hero-checkpoint-banner {
  gap: 8px;
  border-color: #65864d;
  background: linear-gradient(115deg, #1d331c, #111e22 75%);
}
.hero-home .hero-checkpoint-banner:hover,
.hero-home .hero-checkpoint-banner:focus-visible {
  border-color: #b5ef77;
}
.hero-checkpoint-banner .checkpoint-partner-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}
.hero-checkpoint-copy {
  display: grid;
  gap: 3px;
  text-align: left;
  line-height: 1.1;
}
.hero-checkpoint-copy strong {
  font-size: 1rem;
  letter-spacing: 1px;
}
.hero-checkpoint-copy > span {
  color: #d8e7ca;
  font: 500 .69rem/1.2 Inter, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
@media (max-width: 640px) {
  .hero-actions > .discord-button,
  .hero-league-links {
    grid-column: 1 / -1;
  }
  .hero-league-links {
    width: 100%;
    gap: 8px;
  }
  .hero-checkpoint-copy strong {
    font-size: .88rem;
  }
}
