/* ================================================================
   pages/championship-detail.css — Public Championship Detail page
   Uses --next-* design tokens from next-base.css
   ================================================================ */

/* ------------------------------------------------------------------
   Championship Hero
   ------------------------------------------------------------------ */
.next-champ-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--next-border);
  border-radius: var(--next-radius-xl);
  min-height: 320px;
}

@media (min-width: 768px) {
  .next-champ-hero {
    min-height: 380px;
  }
}

@media (min-width: 1024px) {
  .next-champ-hero {
    min-height: 440px;
  }
}

/* Cover — full-bleed background filling the entire hero */
.next-champ-hero__cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(138, 69, 255, 0.12), rgba(19, 186, 255, 0.08)),
    var(--next-bg-900);
}

.next-champ-hero__cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.next-champ-hero__cover-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(3, 8, 20, 0.82) 0%,
      rgba(3, 8, 20, 0.45) 50%,
      rgba(3, 8, 20, 0.3) 100%
    );
}

/* Desktop: overlay from left */
@media (min-width: 1024px) {
  .next-champ-hero__cover-overlay {
    background:
      linear-gradient(
        90deg,
        rgba(3, 8, 20, 0.88) 0%,
        rgba(3, 8, 20, 0.55) 40%,
        rgba(3, 8, 20, 0.25) 70%,
        rgba(3, 8, 20, 0.15) 100%
      );
  }
}

/* Body — sits on top of cover; defines the hero height */
.next-champ-hero__body {
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--next-space-5);
  z-index: 1;
}

@media (min-width: 768px) {
  .next-champ-hero__body {
    min-height: 380px;
    padding: var(--next-space-8);
  }
}

@media (min-width: 1024px) {
  .next-champ-hero__body {
    min-height: 440px;
    padding: var(--next-space-10);
  }
}

/* Mobile: overlay from bottom */
@media (max-width: 767px) {
  .next-champ-hero__cover-overlay {
    background:
      linear-gradient(
        180deg,
        transparent 20%,
        rgba(3, 8, 20, 0.55) 55%,
        rgba(3, 8, 20, 0.92) 100%
      );
  }
}

/* Badge row */
.next-champ-hero__badge-row {
  margin-bottom: var(--next-space-2);
}

.next-badge--featured {
  background: rgba(255, 191, 36, 0.16);
  color: var(--next-gold);
  border: 1px solid rgba(255, 191, 36, 0.28);
  gap: var(--next-space-1);
}

/* Title */
.next-champ-hero__title {
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--next-text-primary);
  margin: 0 0 var(--next-space-2);
  text-transform: uppercase;
  max-width: 28ch;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

/* Description */
.next-champ-hero__description {
  font-size: var(--next-font-sm);
  color: var(--next-text-secondary);
  margin: 0 0 var(--next-space-4);
  max-width: 52ch;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .next-champ-hero__description {
    font-size: var(--next-font-md);
    margin-bottom: var(--next-space-5);
  }
}

/* Bottom row */
.next-champ-hero__bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--next-space-4);
}

/* Prize pool card */
.next-champ-hero__prize-card {
  display: flex;
  align-items: center;
  gap: var(--next-space-3);
  padding: var(--next-space-3) var(--next-space-4);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--next-radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.next-champ-hero__prize-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(29, 231, 255, 0.1);
  color: var(--next-cyan);
  flex-shrink: 0;
}

.next-champ-hero__prize-info {
  display: flex;
  flex-direction: column;
}

.next-champ-hero__prize-label {
  font-size: var(--next-font-xs);
  font-weight: 700;
  color: var(--next-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.next-champ-hero__prize-amount {
  font-size: var(--next-font-xl);
  font-weight: 800;
  color: var(--next-cyan);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.next-champ-hero__prize-currency {
  font-size: var(--next-font-sm);
  font-weight: 600;
  color: var(--next-text-muted);
  margin-left: 2px;
}

/* Organizer */
.next-champ-hero__organizer {
  display: flex;
  align-items: center;
  gap: var(--next-space-2);
  padding: var(--next-space-2) var(--next-space-3);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--next-radius-pill);
}

.next-champ-hero__org-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
}

.next-champ-hero__org-name {
  font-size: var(--next-font-xs);
  color: var(--next-text-secondary);
  font-weight: 500;
}

/* ------------------------------------------------------------------
   Section container (glass cards)
   ------------------------------------------------------------------ */
.next-champ-section {
  padding: var(--next-space-5);
}

@media (min-width: 640px) {
  .next-champ-section {
    padding: var(--next-space-6);
  }
}

.next-champ-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--next-space-3);
  margin-bottom: var(--next-space-5);
  padding-bottom: var(--next-space-4);
  border-bottom: 1px solid var(--next-border-muted);
}

.next-champ-section__header-left {
  display: flex;
  align-items: center;
  gap: var(--next-space-3);
  color: var(--next-cyan);
}

.next-champ-section__title {
  font-size: var(--next-font-xl);
  font-weight: 800;
  margin: 0;
  color: var(--next-text-primary);
  letter-spacing: -0.01em;
}

.next-champ-section__count {
  font-size: var(--next-font-sm);
  color: var(--next-text-muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 10px;
  border-radius: var(--next-radius-pill);
}

/* ------------------------------------------------------------------
   Calendar
   ------------------------------------------------------------------ */
.next-champ-calendar {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.next-champ-calendar__row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  grid-template-areas:
    "round info info"
    "round meta org"
    "round meta arrow";
  align-items: center;
  gap: var(--next-space-2);
  padding: var(--next-space-3) var(--next-space-3);
  border-radius: var(--next-radius-md);
  text-decoration: none;
  color: var(--next-text-primary);
  transition:
    background var(--next-transition-fast),
    border-color var(--next-transition-fast);
  border: 1px solid transparent;
}

.next-champ-calendar__row:hover {
  background: rgba(19, 186, 255, 0.04);
  border-color: var(--next-border-muted);
}

.next-champ-calendar__row:focus-visible {
  outline: 2px solid var(--next-cyan);
  outline-offset: 2px;
  border-color: var(--next-border-strong);
}

/* Round number */
.next-champ-calendar__round {
  grid-area: round;
  display: flex;
  align-items: center;
  justify-content: center;
}

.next-champ-calendar__round-num {
  font-size: var(--next-font-sm);
  font-weight: 800;
  color: var(--next-cyan);
  background: rgba(19, 186, 255, 0.1);
  border-radius: var(--next-radius-sm);
  padding: 4px 8px;
  letter-spacing: 0.02em;
}

/* Event info */
.next-champ-calendar__info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.next-champ-calendar__name {
  font-size: var(--next-font-md);
  font-weight: 700;
  color: var(--next-text-primary);
  line-height: 1.3;
  /* clamp long names */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.next-champ-calendar__location {
  font-size: var(--next-font-xs);
  color: var(--next-text-muted);
}

/* Organizer logo */
.next-champ-calendar__org {
  grid-area: org;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.next-champ-calendar__org-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--next-border-muted);
}

.next-champ-calendar__org-initials {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--next-font-xs);
  font-weight: 700;
  color: var(--next-text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

/* Meta: date + badge */
.next-champ-calendar__meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: var(--next-space-2);
}

.next-champ-calendar__date {
  font-size: var(--next-font-sm);
  color: var(--next-text-secondary);
  font-weight: 500;
}

/* Arrow */
.next-champ-calendar__arrow {
  grid-area: arrow;
  display: none;
  justify-self: end;
  color: var(--next-text-muted);
  transition: transform var(--next-transition-fast),
              color var(--next-transition-fast);
}

.next-champ-calendar__row:hover .next-champ-calendar__arrow {
  color: var(--next-cyan);
  transform: translateX(3px);
}

/* Desktop layout */
@media (min-width: 768px) {
  .next-champ-calendar__row {
    grid-template-columns: 56px 1fr auto 160px 36px;
    grid-template-areas: "round info org meta arrow";
    gap: var(--next-space-3);
    padding: var(--next-space-3) var(--next-space-4);
  }

  .next-champ-calendar__arrow {
    display: flex;
  }

  .next-champ-calendar__round-num {
    font-size: var(--next-font-md);
    padding: 4px 10px;
  }

  .next-champ-calendar__meta {
    justify-content: flex-end;
  }
}

/* ------------------------------------------------------------------
   Empty state
   ------------------------------------------------------------------ */
.next-champ-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--next-space-8) var(--next-space-4);
}

.next-champ-empty__text {
  color: var(--next-text-secondary);
  font-size: var(--next-font-md);
  margin: 0 0 var(--next-space-4);
}

.next-champ-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--next-space-3);
  justify-content: center;
}

/* ------------------------------------------------------------------
   Class selector
   ------------------------------------------------------------------ */
.next-champ-class-selector {
  margin-bottom: var(--next-space-4);
}

/* Desktop pills */
.next-champ-class-pills {
  display: none;
  gap: var(--next-space-2);
}

@media (min-width: 640px) {
  .next-champ-class-pills {
    display: flex;
  }
}

.next-champ-class-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--next-space-2) var(--next-space-5);
  font-size: var(--next-font-sm);
  font-weight: 700;
  color: var(--next-text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--next-border-muted);
  border-radius: var(--next-radius-pill);
  text-decoration: none;
  transition:
    color var(--next-transition-normal),
    background var(--next-transition-normal),
    border-color var(--next-transition-normal),
    box-shadow var(--next-transition-normal);
  white-space: nowrap;
}

.next-champ-class-pill:hover {
  color: var(--next-text-secondary);
  border-color: var(--next-border);
  background: rgba(255, 255, 255, 0.05);
}

.next-champ-class-pill--active {
  color: var(--next-cyan);
  background: rgba(19, 186, 255, 0.12);
  border-color: var(--next-border-strong);
  box-shadow:
    0 0 16px rgba(29, 231, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.next-champ-class-pill:focus-visible {
  outline: 2px solid var(--next-cyan);
  outline-offset: 2px;
}

/* Mobile select */
.next-champ-class-select-wrap {
  display: block;
}

@media (min-width: 640px) {
  .next-champ-class-select-wrap {
    display: none;
  }
}

.next-champ-class-select {
  width: 100%;
  height: 44px;
  padding: 0 var(--next-space-4);
  background: var(--next-bg-800);
  border: 1px solid var(--next-border-muted);
  border-radius: var(--next-radius-sm);
  color: var(--next-text-primary);
  font-size: var(--next-font-sm);
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23e6eeff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.next-champ-class-select:focus {
  outline: none;
  border-color: var(--next-cyan);
  box-shadow: 0 0 0 3px rgba(29, 231, 255, 0.12);
}

/* ------------------------------------------------------------------
   Standings table
   ------------------------------------------------------------------ */
.next-champ-standings-wrap {
  overflow: hidden;
}

.next-champ-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--next-font-sm);
  font-variant-numeric: tabular-nums;
}

.next-champ-standings-thead {
  border-bottom: 1px solid var(--next-border-strong);
}

.next-champ-standings-thead th {
  padding: var(--next-space-2) var(--next-space-3);
  font-size: var(--next-font-xs);
  font-weight: 600;
  color: var(--next-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.next-champ-standings-thead th:first-child {
  padding-left: var(--next-space-3);
  text-align: center;
  width: 52px;
}

.next-champ-standings-thead th:last-child {
  padding-right: var(--next-space-3);
  text-align: right;
  width: 80px;
}

/* Table rows */
.next-champ-standings-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--next-transition-fast);
}

.next-champ-standings-row:hover {
  background: rgba(19, 186, 255, 0.04);
}

.next-champ-standings-row--highlight {
  background: rgba(19, 186, 255, 0.08);
  border-inline-start: 2px solid var(--next-cyan);
}

.next-champ-standings-row td {
  padding: var(--next-space-2) var(--next-space-3);
  vertical-align: middle;
}

.next-champ-standings-row td:first-child {
  padding-left: var(--next-space-3);
  text-align: center;
}

.next-champ-standings-row td:last-child {
  padding-right: var(--next-space-3);
  text-align: right;
}

/* Position badges */
.next-champ-standings-pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: var(--next-font-sm);
  font-weight: 700;
  color: var(--next-text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.next-champ-standings-pos--gold {
  background: rgba(255, 191, 36, 0.18);
  color: var(--next-gold);
  box-shadow: 0 0 10px rgba(255, 191, 36, 0.2);
}

.next-champ-standings-pos--silver {
  background: rgba(220, 220, 230, 0.14);
  color: #d0d0e0;
  box-shadow: 0 0 8px rgba(200, 200, 220, 0.12);
}

.next-champ-standings-pos--bronze {
  background: rgba(255, 138, 61, 0.16);
  color: var(--next-orange);
  box-shadow: 0 0 8px rgba(255, 138, 61, 0.14);
}

/* Country */
.next-champ-standings-country-code {
  font-size: var(--next-font-xs);
  font-weight: 600;
  color: var(--next-text-muted);
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

/* Pilot cell */
.next-champ-standings-pilot-cell {
  display: flex;
  align-items: center;
  gap: var(--next-space-2);
  min-width: 0;
}

.next-champ-standings-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--next-border-muted);
}

.next-champ-standings-pilot-name {
  font-weight: 600;
  color: var(--next-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Points */
.next-champ-standings-points-value {
  font-weight: 700;
  color: var(--next-cyan);
  font-size: var(--next-font-md);
}

/* Standings table shows the COMPLETE ranking directly on the page.
   Rows scroll within the container on smaller viewports. */

/* Footer: view full standings button */
.next-champ-standings-footer {
  display: flex;
  justify-content: center;
  padding: var(--next-space-4) 0 var(--next-space-1);
  border-top: 1px solid var(--next-border-muted);
  margin-top: var(--next-space-3);
}

.next-champ-standings-full {
  gap: var(--next-space-2);
}

/* ------------------------------------------------------------------
   Overlay — standings table rows reuse next-ranking-dialog classes
   ------------------------------------------------------------------ */

/* Overlay avatar */
#next-champ-standings-dialog-tbody .next-champ-standings-avatar {
  width: 28px;
  height: 28px;
}

/* Overlay pilot cell */
#next-champ-standings-dialog-tbody .next-champ-standings-pilot-cell {
  gap: var(--next-space-2);
}

/* Overlay pilot name */
#next-champ-standings-dialog-tbody .next-champ-standings-pilot-name {
  font-size: var(--next-font-sm);
}

/* Overlay points value */
#next-champ-standings-dialog-tbody .next-champ-standings-points-value {
  font-size: var(--next-font-sm);
}

/* ------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .next-champ-calendar__row,
  .next-champ-class-pill,
  .next-champ-standings-row,
  .next-champ-calendar__arrow,
  .next-ranking-dialog__skeleton-row .next-skeleton__line {
    transition: none;
    animation: none;
  }
}
