@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Oswald:wght@400;600;700&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
  --bg-color: #0a0a0a;
  --panel-bg: #111111;
  --text-main: #f0f0f0;
  --text-muted: #777;
  --f1-color: #e10600;
  --f1-glow: rgba(225, 6, 0, 0.15);
  --motogp-color: #0077cc;
  --motogp-glow: rgba(0, 119, 204, 0.15);
  --wsbk-color: #00a651;
  --wsbk-glow: rgba(0, 166, 81, 0.15);
  --iomtt-color: #f5a623;
  --iomtt-glow: rgba(245, 166, 35, 0.15);
  --bsb-color: #7c3aed;
  --bsb-glow: rgba(124, 58, 237, 0.15);
  --row-hover: rgba(255, 255, 255, 0.03);
  --stripe: rgba(255, 255, 255, 0.015);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Rajdhani', 'Oswald', sans-serif;
  background-color: #050505;
  background-image:
    repeating-linear-gradient(0deg, var(--stripe) 0px, var(--stripe) 1px, transparent 1px, transparent 2px),
    repeating-linear-gradient(90deg, var(--stripe) 0px, var(--stripe) 1px, transparent 1px, transparent 2px);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.poster {
  width: 100%;
  max-width: 720px;
  background-color: var(--bg-color);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.header-banner {
  position: relative;
  margin: 0 -20px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Dark red base with diamond crosshatch texture */
  background:
    repeating-linear-gradient(
      45deg,
      rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px,
      transparent 1px, transparent 11px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px,
      transparent 1px, transparent 11px
    ),
    linear-gradient(90deg, #1e0000 0%, #6b0000 28%, #9b0000 50%, #6b0000 72%, #1e0000 100%);
}

/* Gold panel — sized to the narrower bottom width of the trapezoid */
/* border-radius works here because clip-path is NOT on this element */
.banner-gold {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 50%;
  width: calc(76% - 88px);
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    #e0a800 0%,
    #ffd700 25%,
    #ffe340 55%,
    #ffd700 100%
  );
  border-radius: 0 0 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Wider-top trapezoid extension — 30px beyond each side, clipped */
.banner-gold::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 6px;
  left: -30px;
  right: -30px;
  background: linear-gradient(
    180deg,
    #e0a800 0%,
    #ffd700 30%,
    #ffe340 55%,
    #ffd700 100%
  );
  clip-path: polygon(0% 0%, 100% 0%, calc(100% - 30px) 100%, 30px 100%);
  z-index: 0;
}

.header-banner-text {
  position: relative;
  z-index: 1;
  top: 2px;
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  letter-spacing: 3px;
  color: #1a0800;
  text-transform: uppercase;
  margin: 0;
  padding: 0;
}

header {
  text-align: center;
  padding: 0 20px 32px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(12, 12, 12, 0.6) 100%);
  border-bottom: 1px solid transparent;
  position: relative;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #ffd700;
  z-index: 10;
}

header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    #ff0000, #ff8800, #ffee00,
    #00cc55, #0055ff, #aa00ff,
    #ff0055
  );
  animation: rgbFlow 8s linear infinite;
  animation-delay: 0s;
  box-shadow:
    0 0 3px 1px rgba(255, 100, 100, 0.5),
    0 0 8px 3px rgba(100, 100, 255, 0.3);
  opacity: 0.5;
}

.header-logo {
  width: 150px;
  height: auto;
  display: block;
  margin: 60px auto 14px;
  filter: brightness(1.1);
}

.header-year {
  font-family: 'Russo One', sans-serif;
  font-size: 72px;
  font-weight: 400;
  letter-spacing: 8px;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 20%, #555555 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.header-title {
  font-family: 'Russo One', sans-serif;
  font-size: 24px;
  letter-spacing: 6px;
  color: #ffffff;
  margin-top: 2px;
  text-transform: uppercase;
}

.header-title span {
  color: var(--f1-color);
}

.header-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  color: #555;
  letter-spacing: 3px;
  margin-top: 10px;
  margin-bottom: 40px;
  text-transform: uppercase;
  font-weight: 600;
}

/* ========== NEXT RACE PANEL ========== */

.next-race-panel {
  margin: 16px;
  padding: 28px 28px 24px;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.01) 0px, rgba(255,255,255,0.01) 1px, transparent 1px, transparent 9px),
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0) 60%),
    rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.next-race-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.12);
}

.next-race-panel.F1::before     { background: var(--f1-color);     box-shadow: 0 0 14px 4px rgba(225, 6, 0, 0.45); }
.next-race-panel.MotoGP::before { background: var(--motogp-color); box-shadow: 0 0 14px 4px rgba(0, 119, 204, 0.45); }
.next-race-panel.WSBK::before   { background: var(--wsbk-color);   box-shadow: 0 0 14px 4px rgba(0, 166, 81, 0.45); }
.next-race-panel.IOMTT::before  { background: var(--iomtt-color);  box-shadow: 0 0 14px 4px rgba(245, 166, 35, 0.45); }
.next-race-panel.BSB::before    { background: var(--bsb-color);    box-shadow: 0 0 14px 4px rgba(124, 58, 237, 0.45); }
.next-race-panel.multi-series::before {
  background: linear-gradient(90deg, var(--f1-color), var(--motogp-color), var(--wsbk-color));
}

.next-race-panel::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.12);
}

.next-race-panel.F1::after      { background: var(--f1-color);     box-shadow: 0 0 14px 4px rgba(225, 6, 0, 0.45); }
.next-race-panel.MotoGP::after  { background: var(--motogp-color); box-shadow: 0 0 14px 4px rgba(0, 119, 204, 0.45); }
.next-race-panel.WSBK::after    { background: var(--wsbk-color);   box-shadow: 0 0 14px 4px rgba(0, 166, 81, 0.45); }
.next-race-panel.IOMTT::after   { background: var(--iomtt-color);  box-shadow: 0 0 14px 4px rgba(245, 166, 35, 0.45); }
.next-race-panel.BSB::after     { background: var(--bsb-color);    box-shadow: 0 0 14px 4px rgba(124, 58, 237, 0.45); }
.next-race-panel.multi-series::after {
  background: linear-gradient(90deg, var(--f1-color), var(--motogp-color), var(--wsbk-color));
}


.next-race-panel h2 {
  font-family: 'Russo One', sans-serif;
  font-size: 9px;
  color: #c9a84c;
  letter-spacing: 7px;
  margin-bottom: 18px;
  font-weight: 400;
  text-transform: uppercase;
  opacity: 0.85;
}

.next-race-entries {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
}

.next-race-entry {
  flex: 1;
  min-width: 180px;
}

.next-race-divider {
  display: none;
}

.next-race-series {
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 4px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.F1-text    { color: var(--f1-color); }
.MotoGP-text { color: var(--motogp-color); }
.WSBK-text  { color: var(--wsbk-color); }
.IOMTT-text { color: var(--iomtt-color); }
.BSB-text   { color: var(--bsb-color); }

.next-race-name {
  font-family: 'Russo One', sans-serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 5px;
  line-height: 1.1;
  color: #ffffff;
  margin: 4px 0 14px;
  text-shadow: 0 0 40px rgba(255,255,255,0.08);
}

.next-race-date {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  color: #666;
  margin-bottom: 18px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.next-race-countdown {
  display: inline-block;
  padding: 7px 24px;
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

/* ========== FILTER BAR ========== */

.filter-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 12px 12px;
  background: #080808;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.filter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 4px;
  background: #161616;
  border: none;
  border-top: 3px solid #2a2a2a;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  background: #1e1e1e;
}

.filter-icon {
  font-size: 18px;
  line-height: 1;
}

.filter-label {
  font-family: 'Russo One', sans-serif;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #555;
  text-transform: uppercase;
  transition: color 0.15s;
}

.filter-btn.active .filter-label,
.filter-btn:hover .filter-label {
  color: #ccc;
}

.filter-btn.active[data-filter="all"] {
  border-top-color: #ffffff;
  background: #1c1c1c;
}
.filter-btn.active[data-filter="all"] .filter-label { color: #fff; }

.filter-btn.active[data-filter="F1"] {
  border-top-color: var(--f1-color);
  background: #1a0000;
}
.filter-btn.active[data-filter="F1"] .filter-label { color: var(--f1-color); }

.filter-btn.active[data-filter="MotoGP"] {
  border-top-color: var(--motogp-color);
  background: #00101e;
}
.filter-btn.active[data-filter="MotoGP"] .filter-label { color: var(--motogp-color); }

.filter-btn.active[data-filter="WSBK"] {
  border-top-color: var(--wsbk-color);
  background: #001509;
}
.filter-btn.active[data-filter="WSBK"] .filter-label { color: var(--wsbk-color); }

.filter-btn.active[data-filter="IOMTT"] {
  border-top-color: var(--iomtt-color);
  background: #191000;
}
.filter-btn.active[data-filter="IOMTT"] .filter-label { color: var(--iomtt-color); }

.filter-btn.active[data-filter="BSB"] {
  border-top-color: var(--bsb-color);
  background: #0e0820;
}
.filter-btn.active[data-filter="BSB"] .filter-label { color: var(--bsb-color); }

/* ========== SERIES SECTIONS ========== */

.series-block {
  padding: 0 16px 20px;
}

.series-heading {
  font-family: 'Russo One', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  padding: 14px 12px 10px;
  margin-bottom: 0;
  position: relative;
  text-transform: uppercase;
}

.series-heading::after { display: none; }

.f1-heading    { color: var(--f1-color); }
.motogp-heading { color: var(--motogp-color); }
.wsbk-heading  { color: var(--wsbk-color); }
.iomtt-heading { color: var(--iomtt-color); }
.bsb-heading   { color: var(--bsb-color); }

/* ========== RGB DIVIDER ========== */


@keyframes rgbFlow {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.rgb-divider {
  position: relative;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg,
    #ff0000, #ff8800, #ffee00,
    #00cc55, #0055ff, #aa00ff,
    #ff0055
  );
  overflow: visible;
  opacity: 0.5;
}

.rgb-divider::before,
.rgb-divider::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(90deg,
    #ff0000, #ff8800, #ffee00,
    #00cc55, #0055ff, #aa00ff,
    #ff0055
  );
}

.rgb-divider::before {
  top: -2px;
  bottom: -2px;
  filter: blur(3px);
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 35%, black 65%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, black 35%, black 65%, transparent 100%);
}

.rgb-divider::after {
  top: -6px;
  bottom: -6px;
  filter: blur(8px);
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 25%, black 75%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, black 25%, black 75%, transparent 100%);
}

/* ========== PER-SERIES DIVIDER ANIMATIONS ========== */

@keyframes f1Glow {
  0%   { filter: hue-rotate(0deg); }
  33%  { filter: hue-rotate(30deg); }
  66%  { filter: hue-rotate(-30deg); }
  100% { filter: hue-rotate(0deg); }
}
@keyframes motogpGlow {
  0%   { filter: hue-rotate(0deg); }
  33%  { filter: hue-rotate(-84deg); }
  66%  { filter: hue-rotate(66deg); }
  100% { filter: hue-rotate(0deg); }
}
@keyframes wsbkGlow {
  0%   { filter: hue-rotate(0deg); }
  33%  { filter: hue-rotate(62deg); }
  66%  { filter: hue-rotate(122deg); }
  100% { filter: hue-rotate(0deg); }
}
@keyframes iomttGlow {
  0%   { filter: hue-rotate(0deg); }
  33%  { filter: hue-rotate(83deg); }
  66%  { filter: hue-rotate(173deg); }
  100% { filter: hue-rotate(0deg); }
}
@keyframes bsbGlow {
  0%   { filter: hue-rotate(0deg); }
  25%  { filter: hue-rotate(-58deg); }
  50%  { filter: hue-rotate(-148deg); }
  75%  { filter: hue-rotate(62deg); }
  100% { filter: hue-rotate(0deg); }
}

#section-f1 .rgb-divider { background: var(--f1-color); animation: f1Glow 8s ease-in-out infinite; }
#section-f1 .rgb-divider::before,
#section-f1 .rgb-divider::after   { background: var(--f1-color); }

#section-motogp .rgb-divider { background: var(--motogp-color); animation: motogpGlow 8s ease-in-out infinite; }
#section-motogp .rgb-divider::before,
#section-motogp .rgb-divider::after { background: var(--motogp-color); }

#section-wsbk .rgb-divider { background: var(--wsbk-color); animation: wsbkGlow 8s ease-in-out infinite; }
#section-wsbk .rgb-divider::before,
#section-wsbk .rgb-divider::after  { background: var(--wsbk-color); }

#section-iomtt .rgb-divider { background: var(--iomtt-color); animation: iomttGlow 8s ease-in-out infinite; }
#section-iomtt .rgb-divider::before,
#section-iomtt .rgb-divider::after { background: var(--iomtt-color); }

#section-bsb .rgb-divider { background: var(--bsb-color); animation: bsbGlow 8s ease-in-out infinite; }
#section-bsb .rgb-divider::before,
#section-bsb .rgb-divider::after   { background: var(--bsb-color); }

/* ========== RACE LIST ========== */

.race-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.race-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 8px;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.15s;
}

.race-row:hover {
  background-color: var(--row-hover);
}

.race-flag {
  font-size: 15px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.race-date {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #999;
  white-space: nowrap;
  min-width: 50px;
  letter-spacing: 0.5px;
}

.race-circuit {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  flex: 1;
}

/* ========== COUNTDOWN BADGES ========== */

.race-countdown {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.countdown-today {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 180, 0, 0.15));
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.countdown-soon {
  background: linear-gradient(135deg, rgba(255, 210, 0, 0.2), rgba(255, 185, 0, 0.15));
  color: #ffd700;
  border: 1px solid rgba(255, 210, 0, 0.3);
}

.countdown-future {
  background: rgba(255, 255, 255, 0.04);
  color: #555;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.countdown-past {
  background: rgba(225, 6, 0, 0.12);
  color: #e10600;
  border: 1px solid rgba(225, 6, 0, 0.2);
}


/* ========== FOOTER ========== */

footer {
  text-align: center;
  padding: 18px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  color: #444;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 500px) {
  .race-list {
    grid-template-columns: 1fr;
  }

  .header-logo {
    width: 110px;
  }

  .header-year {
    font-size: 52px;
    letter-spacing: 6px;
  }

  .header-title {
    font-size: 18px;
    letter-spacing: 4px;
  }

  .series-heading {
    font-size: 18px;
  }

  .poster {
    border: none;
  }

  body {
    padding: 0;
  }

  .next-race-name {
    font-size: 22px;
  }
}