* { box-sizing: border-box; }

:root {
  --bg: #fffafd;
  --bg-2: #f5efff;
  --panel: rgba(255,255,255,.72);
  --text: #2d2638;
  --muted: #7b7188;
  --line: rgba(105,77,133,.14);
  --pink: #f5bedf;
  --purple: #cdbaff;
  --blue: #c8ddff;
  --accent: #9c7ddd;
  --gradient: linear-gradient(135deg,#f6c2e2 0%,#d7c5ff 55%,#c4dcff 100%);
  --max: 1180px;
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg,var(--bg),var(--bg-2));
  font-family: Inter, Arial, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button,input { font: inherit; }

.orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(35px);
  opacity: .5;
}
.orb-one { width: 390px; height: 390px; right: -100px; top: 80px; background: var(--pink); }
.orb-two { width: 450px; height: 450px; left: -160px; top: 620px; background: var(--purple); }
.orb-three { width: 300px; height: 300px; right: 12%; bottom: 30px; background: var(--blue); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px max(24px,calc((100vw - var(--max))/2));
  border-bottom: 1px solid var(--line);
  background: rgba(255,250,253,.75);
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: white;
  border-radius: 15px 6px 15px 6px;
  background: var(--gradient);
  font-family: Outfit,sans-serif;
  font-weight: 800;
}
.brand strong,.brand small { display: block; }
.brand strong { font-family: Outfit,sans-serif; }
.brand small { color: var(--muted); font-size: .7rem; margin-top: 2px; }
.site-header nav { display: flex; gap: 7px; }
.site-header nav a { padding: 10px 12px; color: var(--muted); border-radius: 11px; font-weight: 700; font-size: .9rem; }
.site-header nav a:hover { background: rgba(255,255,255,.65); color: var(--text); }
.nav-admin { border: 1px solid var(--line); }

.section { width: min(var(--max),calc(100% - 40px)); margin: auto; padding: 92px 0; }
.hero { min-height: 82vh; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 70px; }
.eyebrow { color: var(--accent); font-size: .73rem; font-weight: 800; letter-spacing: .15em; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin: 18px 0 24px; font: 800 clamp(3.5rem,7vw,7rem)/.92 Outfit,sans-serif; letter-spacing: -.055em; }
h1 span { background: var(--gradient); background-clip: text; -webkit-background-clip: text; color: transparent; }
h2 { margin: 8px 0 0; font: 800 clamp(2.1rem,4vw,3.3rem)/1 Outfit,sans-serif; letter-spacing: -.035em; }
.hero p { color: var(--muted); line-height: 1.8; max-width: 620px; }
.hero-actions,.card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions { margin-top: 32px; }

.button {
  min-height: 45px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
}
.button.primary { color: white; background: var(--gradient); border-color: transparent; box-shadow: 0 12px 28px rgba(160,125,205,.2); }
.button.secondary { background: rgba(255,255,255,.68); }
.button.full { width: 100%; }

.glass,.content-card,.schedule-card,.ranking-wrap {
  border: 1px solid rgba(255,255,255,.78);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 55px rgba(125,95,150,.1);
}
.hero-panel { padding: 25px; border-radius: 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 20px; }
.stat-grid article { padding: 18px 12px; border-radius: 17px; background: rgba(255,255,255,.6); text-align: center; }
.stat-grid strong,.stat-grid span { display: block; }
.stat-grid strong { font: 800 1.6rem Outfit,sans-serif; }
.stat-grid span { color: var(--muted); font-size: .75rem; margin-top: 4px; }
.connection-status { margin: 18px 0 0; color: var(--muted); font-size: .85rem; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.section-heading.split input,#leagueSearch {
  width: min(300px,100%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: rgba(255,255,255,.68);
}
.card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.content-card { min-height: 275px; padding: 22px; border-radius: 22px; display: flex; flex-direction: column; }
.content-card h3 { margin: 10px 0 8px; }
.content-card p { color: var(--muted); line-height: 1.65; flex: 1; }
.logo-frame {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-bottom: 20px;
  padding: 11px;
  border-radius: 21px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 10px 25px rgba(125,95,150,.09);
  font: 800 .8rem Outfit,sans-serif;
}
.logo-frame img { width: 100%; height: 100%; object-fit: contain; }
.live-card { border-color: rgba(239,93,137,.25); }
.live-pill { align-self: flex-start; padding: 6px 9px; color: white; background: #ef5d89; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .08em; }

.schedule-list { display: grid; gap: 13px; }
.schedule-card { display: grid; grid-template-columns: 180px 1fr auto; align-items: center; gap: 22px; padding: 20px; border-radius: 19px; }
.schedule-card > div:first-child { border-right: 1px solid var(--line); }
.schedule-card strong,.schedule-card span { display: block; }
.schedule-card span,.schedule-card p { color: var(--muted); font-size: .84rem; }
.schedule-card p { margin: 5px 0 0; }

.ranking-wrap { border-radius: 20px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th,td { padding: 17px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border-bottom: 0; }

.empty-state { padding: 36px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; background: rgba(255,255,255,.42); }
.hidden { display: none !important; }

footer { padding: 35px max(24px,calc((100vw - var(--max))/2)); border-top: 1px solid var(--line); color: var(--muted); }
footer strong { color: var(--text); margin-right: 12px; font-family: Outfit,sans-serif; }

.admin-body { display: grid; place-items: center; }
.admin-shell { width: min(1250px,calc(100% - 32px)); min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(470px,100%); padding: 30px; border-radius: 28px; }
.admin-brand { margin-bottom: 42px; }
.login-copy h1 { font-size: 3.5rem; margin-bottom: 12px; }
.login-copy p { color: var(--muted); line-height: 1.65; }
.admin-form label { display: block; margin-bottom: 15px; font-size: .82rem; font-weight: 700; }
.admin-form input { width: 100%; margin-top: 7px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: rgba(255,255,255,.72); }
.form-message { color: #bd4d70; margin: 14px 0 0; font-size: .85rem; }

.dashboard { width: 100%; min-height: 92vh; display: grid; grid-template-columns: 250px 1fr; gap: 20px; padding: 20px 0; }
.admin-sidebar { border-radius: 24px; padding: 22px; display: flex; flex-direction: column; }
.admin-nav { display: grid; gap: 8px; margin: 38px 0 auto; }
.admin-nav button { text-align: left; padding: 13px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 700; }
.admin-nav button.active { color: white; background: var(--gradient); }
.admin-nav span { float: right; font-size: .65rem; opacity: .75; }
.admin-main { padding: 24px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.admin-email { color: var(--muted); font-size: .83rem; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.dashboard-stats article { padding: 22px; border-radius: 19px; }
.dashboard-stats strong,.dashboard-stats span { display: block; }
.dashboard-stats strong { font: 800 1.8rem Outfit,sans-serif; }
.dashboard-stats span { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.dashboard-panel { margin-top: 20px; padding: 27px; border-radius: 22px; }
.dashboard-panel h3 { font-size: 1.5rem; margin: 10px 0; }
.dashboard-panel p { max-width: 700px; color: var(--muted); line-height: 1.7; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 65px; }
  .card-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard { grid-template-columns: 1fr; }
  .admin-sidebar { min-height: auto; }
  .admin-nav { margin: 25px 0; }
  .dashboard-stats { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 680px) {
  .site-header nav a:not(.nav-admin) { display: none; }
  .section { width: min(var(--max),calc(100% - 28px)); padding: 72px 0; }
  h1 { font-size: clamp(3.2rem,17vw,5rem); }
  .stat-grid,.card-grid,.dashboard-stats { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .schedule-card { grid-template-columns: 1fr; }
  .schedule-card > div:first-child { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .admin-main { padding: 8px; }
  .admin-topbar { align-items: start; flex-direction: column; }
}


/* PHASE 2 */
.button.danger { color:#b74769; background:rgba(239,93,137,.08); border-color:rgba(239,93,137,.22); }
.admin-tab { animation: fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
.management-layout { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr); gap:18px; align-items:start; }
.management-form,.management-list { padding:24px; border-radius:22px; }
.form-heading { display:flex; align-items:end; justify-content:space-between; gap:14px; margin-bottom:22px; }
.form-heading h3 { margin:7px 0 0; font-size:1.45rem; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-grid label { display:block; font-size:.8rem; font-weight:750; }
.form-grid input,.form-grid textarea { width:100%; margin-top:7px; padding:12px 13px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.72); outline:0; resize:vertical; }
.form-grid input:focus,.form-grid textarea:focus { border-color:rgba(156,125,221,.5); box-shadow:0 0 0 3px rgba(205,186,255,.18); }
.full-span { grid-column:1/-1; }
.checkbox-label { display:flex !important; align-items:center; gap:9px; padding:8px 0; }
.checkbox-label input { width:auto; margin:0; }
.asset-preview { display:flex; gap:10px; flex-wrap:wrap; margin:14px 0; }
.asset-preview img { width:110px; height:75px; object-fit:contain; padding:7px; border-radius:12px; background:rgba(255,255,255,.7); border:1px solid var(--line); }
.admin-list-row { display:grid; grid-template-columns:54px 1fr auto; align-items:center; gap:12px; padding:13px 0; border-bottom:1px solid var(--line); }
.admin-list-row:last-child { border-bottom:0; }
.admin-list-logo { display:grid; place-items:center; width:52px; height:52px; border-radius:13px; background:rgba(255,255,255,.74); font:800 .7rem Outfit,sans-serif; overflow:hidden; }
.admin-list-logo img { width:100%; height:100%; object-fit:contain; padding:5px; }
.admin-list-copy strong,.admin-list-copy span { display:block; }
.admin-list-copy span { color:var(--muted); font-size:.76rem; margin-top:3px; }
.admin-row-actions { display:flex; gap:7px; }
.admin-row-actions .button { min-height:37px; padding:0 12px; font-size:.78rem; }

.league-page { padding-top:55px; }
.league-hero { position:relative; min-height:400px; overflow:hidden; padding:34px; border-radius:30px; background-image:linear-gradient(110deg,rgba(255,250,253,.94),rgba(255,250,253,.66)),var(--league-banner); background-size:cover; background-position:center; }
.league-hero-overlay { position:absolute; inset:0; background:linear-gradient(135deg,rgba(247,194,226,.17),rgba(196,220,255,.16)); }
.league-hero-content { position:relative; z-index:1; display:grid; grid-template-columns:150px 1fr; align-items:center; gap:30px; min-height:330px; }
.league-page-logo { display:grid; place-items:center; width:145px; height:145px; padding:15px; border-radius:28px; background:rgba(255,255,255,.78); box-shadow:0 20px 45px rgba(125,95,150,.14); font:800 1.1rem Outfit,sans-serif; }
.league-page-logo img { width:100%; height:100%; object-fit:contain; }
.league-hero h1 { font-size:clamp(3rem,7vw,6rem); margin:12px 0 15px; }
.league-hero p { max-width:690px; color:var(--muted); line-height:1.7; }
.league-detail-grid { display:grid; grid-template-columns:.7fr 1.3fr; gap:18px; margin-top:18px; }
.detail-panel { padding:24px; border-radius:22px; }
.large-position { margin:15px 0; font:800 4rem Outfit,sans-serif; }
.mini-stats { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.mini-stats span { padding:12px; border-radius:13px; background:rgba(255,255,255,.55); color:var(--muted); font-size:.75rem; }
.mini-stats strong { display:block; color:var(--text); font-size:1.1rem; margin-bottom:2px; }
.league-race-list { margin-top:13px; }
.league-race-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:13px 0; border-bottom:1px solid var(--line); }
.league-race-row:last-child { border-bottom:0; }
.league-race-row strong,.league-race-row small { display:block; }
.league-race-row small,.muted { color:var(--muted); margin-top:4px; }

@media(max-width:950px){.management-layout,.league-detail-grid{grid-template-columns:1fr}.league-hero-content{grid-template-columns:1fr}.league-page-logo{width:115px;height:115px}}
@media(max-width:680px){.form-grid{grid-template-columns:1fr}.full-span{grid-column:auto}.admin-list-row{grid-template-columns:48px 1fr}.admin-row-actions{grid-column:2}.league-hero{padding:22px}.league-hero-content{min-height:300px}.league-race-row{align-items:flex-start;flex-direction:column}}


/* PHASE 3 */
.form-grid select {
  width: 100%;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: var(--text);
  outline: 0;
}

.race-admin-row {
  grid-template-columns: 74px 1fr auto;
}

.race-date-badge {
  display: grid;
  place-items: center;
  width: 70px;
  min-height: 56px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(216,198,255,.28);
  text-align: center;
}

.race-date-badge strong,
.race-date-badge span {
  display: block;
}

.race-date-badge strong {
  font-family: Outfit, sans-serif;
  font-size: .86rem;
}

.race-date-badge span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .67rem;
}

.race-admin-row .live-pill {
  display: inline-block;
  margin-right: 6px;
  vertical-align: 1px;
}

@media (max-width: 760px) {
  .race-admin-row {
    grid-template-columns: 64px 1fr;
  }

  .race-admin-row .admin-row-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }
}


/* AUTOMATIC TIMEZONE + MOTION UPGRADE */
body {
  animation: pageFade .55s ease both;
}

@keyframes pageFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.orb-one {
  animation: orbDriftOne 13s ease-in-out infinite alternate;
}

.orb-two {
  animation: orbDriftTwo 16s ease-in-out infinite alternate;
}

.orb-three {
  animation: orbDriftThree 19s ease-in-out infinite alternate;
}

@keyframes orbDriftOne {
  to { transform: translate(-45px, 35px) scale(1.08); }
}

@keyframes orbDriftTwo {
  to { transform: translate(60px, -35px) scale(.94); }
}

@keyframes orbDriftThree {
  to { transform: translate(-30px, -45px) scale(1.1); }
}

.hero > div:first-child {
  animation: heroCopyIn .75s cubic-bezier(.2,.8,.2,1) both;
}

.hero-panel {
  animation: heroPanelIn .85s .08s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes heroCopyIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes heroPanelIn {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.content-card,
.schedule-card,
.detail-panel,
.ranking-wrap,
.stat-grid article {
  transition:
    transform .28s cubic-bezier(.2,.8,.2,1),
    box-shadow .28s ease,
    border-color .28s ease;
}

.content-card:hover,
.schedule-card:hover,
.detail-panel:hover,
.stat-grid article:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 65px rgba(125,95,150,.16);
  border-color: rgba(205,186,255,.72);
}

.button {
  position: relative;
  overflow: hidden;
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    filter .2s ease;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-115%);
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.38), transparent 70%);
  transition: transform .55s ease;
}

.button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

.button:hover::after {
  transform: translateX(115%);
}

.logo-frame img,
.league-page-logo img {
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}

.content-card:hover .logo-frame img {
  transform: scale(1.08) rotate(-2deg);
}

.reveal-card,
.section-heading,
.reveal-row {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity .58s ease var(--reveal-delay, 0ms),
    transform .58s cubic-bezier(.2,.8,.2,1) var(--reveal-delay, 0ms);
}

.reveal-card.is-visible,
.section-heading.is-visible,
.reveal-row.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-row {
  transition-delay: var(--row-delay, 0ms);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 rgba(255,255,255,.5);
  animation: livePulse 1.5s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); }
  70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.local-time-line,
.viewer-zone-note {
  margin: 8px 0 16px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 750;
}

.original-time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .72rem;
}

.hero-reveal {
  opacity: 0;
  transform: translateY(20px) scale(.985);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}

.hero-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.logo-float {
  animation: logoFloat 4.8s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(-1deg); }
}

.admin-sidebar {
  animation: sidebarIn .55s ease both;
}

.admin-main {
  animation: adminMainIn .65s .05s ease both;
}

@keyframes sidebarIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: none; }
}

@keyframes adminMainIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* PHASE 4 — RANKINGS + CINEMATIC SCROLL */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 4px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #f3a9d4, #b99cf6, #9fc8ff);
  box-shadow: 0 2px 14px rgba(174, 132, 225, .45);
  pointer-events: none;
}

.site-header nav a {
  position: relative;
}

.site-header nav a::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  border-radius: 99px;
  background: var(--gradient);
  transition: transform .3s ease;
}

.site-header nav a.active-section::before {
  transform: scaleX(1);
}

.scroll-scene {
  position: relative;
  transition:
    filter .8s ease,
    transform .8s cubic-bezier(.2,.8,.2,1),
    opacity .8s ease;
}

.scroll-scene:not(.scene-active) {
  opacity: .72;
  transform: scale(.985);
  filter: saturate(.86);
}

.scroll-scene.scene-active {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1);
}

.scroll-scene::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  right: -170px;
  top: 12%;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(216,198,255,.28), transparent 68%);
  transform: translateY(80px) scale(.75);
  transition:
    opacity .9s ease,
    transform 1.1s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.scroll-scene.scene-active::before {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.section-heading h2 {
  overflow: hidden;
}

.section-heading h2::after {
  content: "";
  display: block;
  width: 70px;
  height: 4px;
  margin-top: 12px;
  border-radius: 99px;
  background: var(--gradient);
  transform: translateX(-120%);
  transition: transform .7s .12s cubic-bezier(.2,.8,.2,1);
}

.section-heading.is-visible h2::after,
.scroll-scene.scene-active .section-heading h2::after {
  transform: translateX(0);
}

.content-card,
.schedule-card,
.detail-panel {
  transform-style: preserve-3d;
}

.content-card:hover,
.schedule-card:hover,
.detail-panel:hover {
  transform: translateY(-7px) perspective(900px) rotateX(1.5deg);
}

.ranking-admin-row {
  grid-template-columns: 64px 1fr auto;
}

.ranking-position-badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  color: white;
  background: var(--gradient);
  font: 800 1rem Outfit, sans-serif;
  box-shadow: 0 10px 24px rgba(156,125,221,.18);
}

.ranking-wrap tbody tr {
  transition:
    background .2s ease,
    transform .2s ease;
}

.ranking-wrap tbody tr:hover {
  background: rgba(216,198,255,.15);
  transform: translateX(4px);
}

.ranking-wrap tbody tr:nth-child(1) td:first-child strong {
  color: #b68a00;
}

.ranking-wrap tbody tr:nth-child(2) td:first-child strong {
  color: #7d8796;
}

.ranking-wrap tbody tr:nth-child(3) td:first-child strong {
  color: #a86845;
}

@media (max-width: 760px) {
  .ranking-admin-row {
    grid-template-columns: 58px 1fr;
  }

  .ranking-admin-row .admin-row-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .scroll-scene:not(.scene-active) {
    transform: none;
    opacity: .9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-scene,
  .scroll-scene::before {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}


/* PHASE 5 — TIER RANKINGS */
.ranking-wrap {
  overflow: hidden;
}

.ranking-wrap table {
  border-collapse: separate;
  border-spacing: 0 10px;
  padding: 10px;
}

.ranking-wrap thead th {
  border-bottom: 0;
}

.ranking-row td {
  border-top: 1px solid rgba(255,255,255,.74);
  border-bottom: 1px solid rgba(255,255,255,.74);
  background: rgba(255,255,255,.54);
}

.ranking-row td:first-child {
  border-left: 1px solid rgba(255,255,255,.74);
  border-radius: 18px 0 0 18px;
}

.ranking-row td:last-child {
  border-right: 1px solid rgba(255,255,255,.74);
  border-radius: 0 18px 18px 0;
}

.ranking-position-cell {
  width: 90px;
  text-align: center;
}

.ranking-position-cell strong {
  font: 800 1.3rem Outfit, sans-serif;
}

.ranking-league-cell {
  position: relative;
  min-width: 380px;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.93), rgba(255,255,255,.72)),
    var(--ranking-banner);
  background-size: cover;
  background-position: center;
}

.ranking-league-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(246,194,226,.16), rgba(196,220,255,.12)),
    linear-gradient(90deg, rgba(255,255,255,.32), transparent);
  pointer-events: none;
}

.ranking-league-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ranking-league-logo {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 15px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 8px 22px rgba(125,95,150,.12);
  overflow: hidden;
  font: 800 .72rem Outfit, sans-serif;
}

.ranking-league-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ranking-league-content strong,
.ranking-league-content small {
  display: block;
}

.ranking-league-content strong {
  font-size: 1rem;
}

.ranking-league-content small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .72rem;
}

.ranking-tier-cell {
  width: 150px;
  text-align: center;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 800 .76rem Outfit, sans-serif;
  letter-spacing: .04em;
  box-shadow: 0 8px 20px rgba(125,95,150,.1);
}

.tier-s {
  color: #fff;
  background: linear-gradient(135deg, #f09bc9, #9c7ddd);
  border-color: rgba(156,125,221,.28);
}

.tier-a {
  color: #5d3d79;
  background: linear-gradient(135deg, #efd6ff, #d6c3ff);
  border-color: rgba(156,125,221,.2);
}

.tier-b {
  color: #3e5f84;
  background: linear-gradient(135deg, #dbeaff, #bdd8ff);
  border-color: rgba(111,156,211,.2);
}

.tier-c {
  color: #725768;
  background: linear-gradient(135deg, #f6e1ec, #ead9e7);
  border-color: rgba(160,119,145,.18);
}

.ranking-row:hover .ranking-league-logo {
  transform: scale(1.06) rotate(-1deg);
}

.ranking-league-logo {
  transition: transform .25s ease;
}

.league-tier-display {
  margin-top: 15px;
}

.league-tier-display .tier-badge {
  min-width: 120px;
  padding: 11px 18px;
  font-size: .9rem;
}

@media (max-width: 760px) {
  .ranking-league-cell {
    min-width: 250px;
  }

  .ranking-league-logo {
    width: 50px;
    height: 50px;
  }

  .ranking-tier-cell {
    width: 120px;
  }
}


/* PHASE 6 — RICH LEAGUE PAGES */
.league-page {
  padding-top: 55px;
}

.league-profile-hero {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  padding: 36px;
  border-radius: 34px;
  background-image:
    linear-gradient(110deg, rgba(255,250,253,.96), rgba(255,250,253,.70)),
    var(--league-banner);
  background-size: cover;
  background-position: center;
  box-shadow:
    0 32px 80px rgba(125,95,150,.16),
    inset 0 1px 0 rgba(255,255,255,.8);
}

.league-profile-shade,
.league-profile-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.league-profile-shade {
  background:
    linear-gradient(115deg, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(0deg, rgba(255,255,255,.18), transparent 42%);
}

.league-profile-glow {
  width: 460px;
  height: 460px;
  inset: auto -140px -190px auto;
  border-radius: 50%;
  background: var(--gradient);
  opacity: .28;
  filter: blur(4px);
  animation: profileGlow 9s ease-in-out infinite alternate;
}

@keyframes profileGlow {
  to {
    transform: translate(-45px, -35px) scale(1.13);
  }
}

.league-profile-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  min-height: 390px;
}

.league-profile-copy {
  max-width: 760px;
}

.league-profile-copy h1 {
  margin: 13px 0 18px;
  font-size: clamp(3.8rem, 8vw, 7rem);
}

.league-profile-copy p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.02rem;
}

.league-profile-labels {
  display: flex;
  align-items: center;
  gap: 10px;
}

.featured-pill {
  display: inline-flex;
  padding: 6px 9px;
  border: 1px solid rgba(156,125,221,.18);
  border-radius: 999px;
  color: #7756ae;
  background: rgba(216,198,255,.35);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.league-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.league-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}

.league-social-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255,255,255,.56);
  font-size: .75rem;
  font-weight: 750;
  transition: transform .2s ease, background .2s ease;
}

.league-social-links a:hover {
  transform: translateY(-2px);
  color: var(--text);
  background: rgba(255,255,255,.82);
}

.league-social-links a span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #fff;
  background: var(--gradient);
  font: 800 .58rem Outfit, sans-serif;
}

.league-page-logo {
  width: 160px;
  height: 160px;
  border-radius: 32px;
}

.league-summary-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.league-summary-grid article {
  padding: 17px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 17px;
  background: rgba(255,255,255,.58);
  backdrop-filter: blur(16px);
}

.league-summary-grid span,
.league-summary-grid strong {
  display: block;
}

.league-summary-grid span {
  color: var(--muted);
  font-size: .72rem;
}

.league-summary-grid strong {
  margin-top: 4px;
  font: 800 1.45rem Outfit, sans-serif;
}

.summary-tier {
  display: inline-flex !important;
  width: fit-content;
  min-width: 47px;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
}

.league-live-section,
.league-events-section,
.league-overview-grid {
  margin-top: 85px;
}

.league-live-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px;
}

.league-live-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(238,93,137,.22);
  border-radius: 23px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.76), rgba(255,240,247,.70));
  box-shadow: 0 22px 55px rgba(202,97,139,.11);
}

.league-live-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -80px;
  bottom: -100px;
  border-radius: 50%;
  background: #f29bc3;
  opacity: .18;
}

.live-card-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: .74rem;
}

.league-live-card h3,
.league-live-card p,
.live-card-actions {
  position: relative;
  z-index: 1;
}

.league-live-card h3 {
  margin: 26px 0 7px;
  font-size: 1.55rem;
}

.league-live-card p {
  color: var(--muted);
}

.live-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 21px;
}

.league-overview-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 18px;
}

.league-info-panel,
.next-event-panel {
  min-height: 390px;
  padding: 27px;
  border-radius: 24px;
}

.league-info-panel h2,
.next-event-panel h2 {
  margin-top: 12px;
}

.league-tier-showcase {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: fit-content;
  margin: 24px 0;
  padding: 15px 20px;
  border-radius: 18px;
}

.league-tier-showcase span {
  font: 800 3rem Outfit, sans-serif;
}

.league-tier-showcase strong {
  font: 800 1rem Outfit, sans-serif;
}

.league-information-list {
  display: grid;
  gap: 8px;
  margin-top: 23px;
}

.league-information-list div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.league-information-list div:last-child {
  border-bottom: 0;
}

.league-information-list span {
  color: var(--muted);
  font-size: .78rem;
}

.league-information-list strong {
  font-size: .82rem;
}

.next-event-date {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 22px 0;
  border-radius: 20px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 14px 32px rgba(156,125,221,.2);
}

.next-event-date strong,
.next-event-date span {
  display: block;
}

.next-event-date strong {
  font: 800 2rem Outfit, sans-serif;
  line-height: .9;
}

.next-event-date span {
  margin-top: 3px;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.next-event-panel > p {
  color: var(--muted);
}

.event-countdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 23px 0;
}

.event-countdown div {
  padding: 13px 8px;
  border-radius: 14px;
  background: rgba(216,198,255,.25);
  text-align: center;
}

.event-countdown strong,
.event-countdown span {
  display: block;
}

.event-countdown strong {
  font: 800 1.25rem Outfit, sans-serif;
}

.event-countdown span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .64rem;
  text-transform: uppercase;
}

.viewer-timezone-chip {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.55);
  font-size: .72rem;
  font-weight: 750;
}

.league-event-timeline {
  position: relative;
  display: grid;
}

.league-event-timeline::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 22px;
  width: 2px;
  background: linear-gradient(var(--pink), var(--purple), var(--blue));
  opacity: .6;
}

.league-event-row {
  position: relative;
  display: grid;
  grid-template-columns: 45px 78px 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 130px;
  padding: 16px 20px 16px 0;
  border-bottom: 1px solid var(--line);
  transition-delay: var(--timeline-delay, 0ms);
}

.league-event-row:last-child {
  border-bottom: 0;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.timeline-marker span {
  width: 14px;
  height: 14px;
  border: 4px solid rgba(255,255,255,.85);
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 4px rgba(203,186,255,.22);
}

.timeline-date {
  text-align: center;
}

.timeline-date strong,
.timeline-date span {
  display: block;
}

.timeline-date strong {
  font: 800 1.75rem Outfit, sans-serif;
}

.timeline-date span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline-content h3 {
  margin: 7px 0 5px;
}

.timeline-content p {
  margin-bottom: 4px;
  color: var(--muted);
}

.timeline-content small {
  color: var(--muted);
  font-size: .7rem;
}

.compact-empty {
  padding: 23px;
}

.league-page .scroll-scene {
  transform:
    translateY(calc((1 - var(--scene-progress, .8)) * 16px))
    scale(calc(.985 + var(--scene-progress, .8) * .015));
}

@media (max-width: 950px) {
  .league-profile-main {
    grid-template-columns: 1fr;
  }

  .league-page-logo {
    width: 125px;
    height: 125px;
  }

  .league-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .league-live-grid,
  .league-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .league-profile-hero {
    min-height: 620px;
    padding: 23px;
  }

  .league-profile-copy h1 {
    font-size: clamp(3rem, 16vw, 4.7rem);
  }

  .league-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .league-event-row {
    grid-template-columns: 34px 60px 1fr;
    gap: 10px;
    padding-right: 0;
  }

  .league-event-row > .button {
    grid-column: 3;
    width: fit-content;
  }

  .league-event-timeline::before {
    left: 16px;
  }

  .timeline-date strong {
    font-size: 1.4rem;
  }

  .viewer-timezone-chip {
    width: fit-content;
  }
}


/* PHASE 7 — SESSION HISTORY + COUNTDOWN FOR EVERY RACE */
.league-history-section {
  margin-top: 95px;
}

.history-count {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.55);
  font-size: .72rem;
  font-weight: 750;
}

.inline-race-countdown {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.inline-race-countdown span {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  min-width: 49px;
  padding: 7px 9px;
  border: 1px solid rgba(156,125,221,.13);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(216,198,255,.20);
  font-size: .67rem;
}

.inline-race-countdown strong {
  color: var(--text);
  font: 800 .83rem Outfit, sans-serif;
}

.countdown-complete {
  opacity: .65;
}

.league-history-list {
  display: grid;
  gap: 12px;
}

.history-race-card {
  display: grid;
  grid-template-columns: 105px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 20px;
  background: rgba(255,255,255,.66);
  backdrop-filter: blur(18px);
  box-shadow: 0 15px 38px rgba(125,95,150,.08);
  transition-delay: var(--history-delay, 0ms);
}

.history-race-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 23px 52px rgba(125,95,150,.14);
}

.history-race-date {
  padding-right: 18px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.history-race-date strong,
.history-race-date span {
  display: block;
}

.history-race-date strong {
  font: 800 2rem Outfit, sans-serif;
}

.history-race-date span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.history-race-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.session-complete-pill {
  padding: 5px 8px;
  border: 1px solid rgba(112,150,126,.18);
  border-radius: 999px;
  color: #557761;
  background: rgba(202,231,211,.35);
  font-size: .62rem;
  font-weight: 800;
}

.history-race-main h3 {
  margin: 9px 0 5px;
}

.history-race-main p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

.history-race-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.event-countdown {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 820px) {
  .history-race-card {
    grid-template-columns: 82px 1fr;
  }

  .history-race-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .history-race-card {
    grid-template-columns: 1fr;
  }

  .history-race-date {
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .history-race-date strong,
  .history-race-date span {
    display: inline-block;
  }

  .history-race-date span {
    margin: 0 0 0 6px;
  }

  .history-race-actions {
    grid-column: 1;
  }

  .event-countdown {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* PHASE 8 — ADMIN DASHBOARD 2.0 */
.admin-sidebar-actions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.phase-eight-stats {
  grid-template-columns: repeat(4, 1fr);
}

.admin-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.46);
}

.admin-toolbar input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: rgba(255,255,255,.78);
}

.admin-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-filter-button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.62);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
  transition:
    transform .18s ease,
    background .18s ease,
    color .18s ease;
}

.admin-filter-button:hover {
  transform: translateY(-1px);
}

.admin-filter-button.active {
  color: #fff;
  border-color: transparent;
  background: var(--gradient);
}

.race-status-label {
  display: inline-flex !important;
  width: fit-content;
  margin-top: 6px !important;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: .62rem !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.status-upcoming {
  color: #6b54a0 !important;
  background: rgba(216,198,255,.34);
}

.status-live {
  color: #b34168 !important;
  background: rgba(247,181,211,.34);
}

.status-completed {
  color: #557761 !important;
  background: rgba(202,231,211,.38);
}

.status-archived {
  color: #6d6873 !important;
  background: rgba(211,206,216,.45);
}

.archived-race-row {
  opacity: .76;
  background: rgba(238,235,242,.35);
}

.race-row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 500;
  transform: translateY(90px);
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg,#efacd3,#aa8be7);
  box-shadow: 0 16px 38px rgba(125,95,150,.24);
  font-size: .82rem;
  font-weight: 800;
  opacity: 0;
  transition:
    opacity .25s ease,
    transform .25s cubic-bezier(.2,.8,.2,1);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1050px) {
  .phase-eight-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .phase-eight-stats {
    grid-template-columns: 1fr;
  }

  .race-row-actions {
    justify-content: flex-start;
  }
}


/* PHASE 9 — HOMEPAGE REDESIGN */
.homepage-body {
  background:
    radial-gradient(circle at 80% 3%, rgba(246,190,222,.22), transparent 28%),
    radial-gradient(circle at 12% 28%, rgba(203,186,255,.20), transparent 32%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.homepage-hero {
  min-height: 88vh;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  gap: 60px;
  padding-top: 70px;
}

.homepage-hero-copy {
  animation: heroCopyIn .8s cubic-bezier(.2,.8,.2,1) both;
}

.homepage-hero-copy h1 {
  font-size: clamp(4rem, 8vw, 7.6rem);
}

.homepage-hero-copy > p {
  max-width: 650px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.04rem;
}

.homepage-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  max-width: 650px;
  margin-top: 29px;
}

.homepage-stat-strip article {
  padding: 15px 12px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(16px);
  transition: transform .25s ease, box-shadow .25s ease;
}

.homepage-stat-strip article:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(125,95,150,.11);
}

.homepage-stat-strip strong,
.homepage-stat-strip span {
  display: block;
}

.homepage-stat-strip strong {
  font: 800 1.55rem Outfit, sans-serif;
}

.homepage-stat-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .7rem;
}

.hero-spotlight {
  min-height: 545px;
  overflow: hidden;
  border-radius: 30px;
  animation: heroPanelIn .9s .08s cubic-bezier(.2,.8,.2,1) both;
}

.spotlight-card {
  position: relative;
  min-height: 545px;
  overflow: hidden;
  padding: 27px;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,250,253,.93)),
    var(--spotlight-banner);
  background-size: cover;
  background-position: center;
}

.spotlight-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(247,194,226,.12), rgba(196,220,255,.14)),
    linear-gradient(0deg, rgba(255,255,255,.20), transparent 50%);
}

.spotlight-topline,
.spotlight-content,
.spotlight-actions {
  position: relative;
  z-index: 1;
}

.spotlight-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.spotlight-label {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  color: #6e558e;
  background: rgba(255,255,255,.70);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.spotlight-content {
  display: grid;
  grid-template-columns: 115px 1fr;
  gap: 22px;
  align-items: center;
  margin-top: 185px;
}

.spotlight-logo {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 25px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 17px 40px rgba(125,95,150,.14);
  font: 800 .9rem Outfit, sans-serif;
}

.spotlight-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.spotlight-content h2 {
  margin: 7px 0 9px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.spotlight-content p {
  color: var(--muted);
  line-height: 1.6;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.compact-home-section {
  padding-top: 25px;
  padding-bottom: 30px;
}

.next-race-feature {
  display: grid;
  grid-template-columns: 1.15fr .85fr auto;
  align-items: center;
  gap: 25px;
  padding: 25px;
  border-radius: 24px;
}

.next-race-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.next-race-logo {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.70);
  font: 800 .7rem Outfit, sans-serif;
}

.next-race-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.next-race-identity h2 {
  margin: 0 0 4px;
  font-size: 1.55rem;
}

.next-race-identity p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.next-race-time {
  margin-top: 14px;
  color: var(--text);
  font-size: .82rem;
  font-weight: 750;
}

.next-race-time span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 500;
}

.homepage-countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.homepage-countdown div {
  min-width: 68px;
  padding: 13px 8px;
  border-radius: 14px;
  background: rgba(216,198,255,.25);
  text-align: center;
}

.homepage-countdown strong,
.homepage-countdown span {
  display: block;
}

.homepage-countdown strong {
  font: 800 1.25rem Outfit, sans-serif;
}

.homepage-countdown span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .61rem;
  text-transform: uppercase;
}

.next-race-actions {
  display: grid;
  gap: 8px;
}

.section-note {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.homepage-live-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.homepage-live-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 24px;
  background: rgba(255,255,255,.68);
  box-shadow: 0 20px 50px rgba(125,95,150,.11);
  transition-delay: var(--live-delay, 0ms);
}

.homepage-live-visual {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--gradient);
}

.homepage-live-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s ease;
}

.homepage-live-card:hover .homepage-live-visual img {
  transform: scale(1.06);
}

.homepage-live-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(45,38,56,.48), transparent 65%);
}

.homepage-live-visual .live-pill {
  position: absolute;
  left: 18px;
  bottom: 16px;
}

.homepage-live-content {
  padding: 20px;
}

.homepage-live-league {
  display: flex;
  align-items: center;
  gap: 12px;
}

.homepage-live-logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 7px;
  border-radius: 14px;
  background: rgba(255,255,255,.75);
  font: 800 .65rem Outfit, sans-serif;
}

.homepage-live-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.homepage-live-league small {
  color: var(--muted);
  font-size: .68rem;
}

.homepage-live-league h3 {
  margin: 4px 0 0;
}

.homepage-live-content > p {
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: .8rem;
}

.carousel-controls {
  display: flex;
  gap: 7px;
}

.carousel-controls button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255,255,255,.68);
  cursor: pointer;
  font-size: 1rem;
  transition: transform .2s ease, background .2s ease;
}

.carousel-controls button:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.9);
}

.featured-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(330px, 410px);
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.featured-slide {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 24px;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,250,253,.93)),
    var(--featured-banner);
  background-size: cover;
  background-position: center;
  scroll-snap-align: start;
  box-shadow: 0 18px 45px rgba(125,95,150,.10);
  transition-delay: var(--featured-delay, 0ms);
}

.featured-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(247,194,226,.10), rgba(196,220,255,.12));
}

.featured-slide-top,
.featured-slide-content {
  position: relative;
  z-index: 1;
}

.featured-slide-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.featured-slide-logo {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  font: 800 .75rem Outfit, sans-serif;
}

.featured-slide-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.featured-slide-content {
  margin-top: 130px;
}

.featured-slide-content h3 {
  margin: 8px 0;
  font-size: 1.5rem;
}

.featured-slide-content p {
  min-height: 72px;
  color: var(--muted);
  line-height: 1.55;
  font-size: .82rem;
}

.schedule-toolbar {
  display: flex;
  gap: 8px;
  width: min(520px, 100%);
}

.schedule-toolbar input,
.schedule-toolbar select {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255,255,255,.68);
  outline: 0;
}

.homepage-schedule-list {
  display: grid;
  gap: 11px;
}

.homepage-schedule-card {
  display: grid;
  grid-template-columns: 72px 58px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 19px;
  background: rgba(255,255,255,.66);
  backdrop-filter: blur(17px);
  box-shadow: 0 14px 36px rgba(125,95,150,.08);
  transition-delay: var(--schedule-delay, 0ms);
}

.homepage-schedule-date {
  text-align: center;
}

.homepage-schedule-date strong,
.homepage-schedule-date span {
  display: block;
}

.homepage-schedule-date strong {
  font: 800 1.65rem Outfit, sans-serif;
}

.homepage-schedule-date span {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.homepage-schedule-logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 7px;
  border-radius: 14px;
  background: rgba(255,255,255,.74);
  font: 800 .62rem Outfit, sans-serif;
}

.homepage-schedule-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.homepage-schedule-main h3 {
  margin: 6px 0 4px;
}

.homepage-schedule-main p,
.homepage-schedule-main small {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.homepage-schedule-main small {
  display: block;
  margin-top: 4px;
}

.schedule-mini-countdown {
  display: flex;
  gap: 5px;
}

.schedule-mini-countdown span {
  min-width: 41px;
  padding: 7px 8px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(216,198,255,.22);
  font-size: .62rem;
  text-align: center;
}

.schedule-mini-countdown strong {
  color: var(--text);
  font: 800 .77rem Outfit, sans-serif;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

footer div strong,
footer div span {
  display: block;
}

footer div span {
  margin-top: 4px;
}

@media (max-width: 1000px) {
  .homepage-hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .homepage-hero-copy {
    padding-top: 40px;
  }

  .next-race-feature {
    grid-template-columns: 1fr;
  }

  .next-race-actions {
    grid-template-columns: repeat(2, minmax(0, 160px));
  }

  .homepage-live-grid {
    grid-template-columns: 1fr;
  }

  .homepage-schedule-card {
    grid-template-columns: 65px 52px 1fr auto;
  }

  .homepage-schedule-card > .button {
    grid-column: 3;
    width: fit-content;
  }
}

@media (max-width: 760px) {
  .menu-button {
    display: block;
  }

  #mainNavigation {
    display: none;
    position: absolute;
    top: 76px;
    right: 14px;
    left: 14px;
    flex-direction: column;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,250,253,.96);
    box-shadow: 0 20px 50px rgba(125,95,150,.14);
  }

  #mainNavigation.open {
    display: flex;
  }

  .homepage-stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .spotlight-content {
    grid-template-columns: 1fr;
    margin-top: 140px;
  }

  .spotlight-logo {
    width: 88px;
    height: 88px;
  }

  .homepage-countdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .schedule-toolbar {
    flex-direction: column;
  }

  .homepage-schedule-card {
    grid-template-columns: 58px 1fr;
    align-items: start;
  }

  .homepage-schedule-logo {
    grid-column: 1;
    grid-row: 2;
  }

  .homepage-schedule-main {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .schedule-mini-countdown,
  .homepage-schedule-card > .button {
    grid-column: 2;
  }

  .featured-carousel {
    grid-auto-columns: minmax(285px, 88vw);
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .homepage-hero-copy h1 {
    font-size: clamp(3.4rem, 18vw, 5rem);
  }

  .homepage-stat-strip {
    grid-template-columns: 1fr 1fr;
  }

  .hero-spotlight,
  .spotlight-card {
    min-height: 590px;
  }

  .spotlight-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .next-race-actions {
    grid-template-columns: 1fr;
  }
}
