* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #121212;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: clip;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  color: #e50914;
  margin: 10px 0 16px 0;
  font-size: 28px;
  letter-spacing: 1px;
}

.disclaimer-banner {
  background: rgba(229, 9, 20, 0.08);
  border-left: 4px solid #e50914;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.5;
  color: #bbb;
}

.disclaimer-banner strong {
  color: #fff;
}

/* Quick Filter Pills */
.pill-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px 2px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pill-bar::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 20px;
  background: #1e1e1e;
  color: #aaa;
  border: 1px solid #333;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.pill-btn:hover {
  background: #2a2a2a;
  color: #fff;
}

.pill-btn.active {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
}

#ppvSelect {
  display: none;
}

/* Filter Controls */
.controls {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr 1.2fr;
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .controls {
    grid-template-columns: 1fr;
  }
}

select, input {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1e1e1e;
  color: #fff;
  font-size: 14px;
  width: 100%;
  outline: none;
}

select:focus, input:focus {
  border-color: #e50914;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-wrapper input {
  padding-right: 36px;
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #333;
  color: #bbb;
  border: none;
  font-size: 13px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.clear-search-btn:hover {
  background: #e50914;
  color: #fff;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e1e1e;
  border: 1px solid #333;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
}

.badge strong {
  color: #e50914;
  font-size: 13px;
}

/* Year Divider */
.year-divider {
  position: -webkit-sticky;
  position: sticky;
  top: 0px;
  z-index: 90;
  background: #121212;
  padding: 8px 0;
  margin: 16px 0 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.year-badge {
  background: #e50914;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.year-line {
  flex-grow: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

/* Event Subheading */
.event-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 18px 0 10px 4px;
  padding-left: 8px;
  border-left: 3px solid #e50914;
}

.event-date-pill {
  font-size: 0.8rem;
  font-weight: 500;
  color: #aaa;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Match Cards */
.card {
  background: #1e1e1e;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #2a2a2a;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: #444;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.event-tag {
  font-size: 12px;
  font-weight: 700;
  color: #e50914;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

.pos-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: #2a2a2a;
  color: #aaa;
  border: 1px solid #3a3a3a;
  white-space: nowrap;
}

.pos-badge.main-event {
  background: rgba(255, 193, 7, 0.15);
  color: #ffd026;
  border-color: rgba(255, 193, 7, 0.4);
  box-shadow: 0 0 10px rgba(255, 208, 38, 0.2);
}

.pos-badge.opener {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  border-color: #444;
}

.match-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.3;
}

/* Playback Buttons */
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #2a2a2a;
  border: 1px solid #444;
  transition: background 0.15s ease;
}

.btn:hover {
  background: #383838;
}

.btn.primary {
  background: #e50914;
  border-color: #e50914;
}

.btn.primary:hover {
  background: #b80710;
}

.btn.disabled {
  opacity: 0.25;
  pointer-events: none;
  border-color: #222;
}

#statusMessage {
  text-align: center;
  color: #aaa;
  margin: 40px 0;
}

footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #222;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
}

/* Floating Back to Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e50914;
  color: #fff;
  border: none;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: #b80710;
}

.back-to-top-btn:active {
  transform: scale(0.92);
}