/* =========================================================================
   Sporty layer -- the new, brand-forward components that sit on top of the
   base design system in style.css (tokens, cards, buttons, tables, ...).

   Same look as the Speedup online registration site: Speedup green +
   pickleball yellow, Barlow Condensed italic display caps, green hero bands
   with a faint court-line texture, big-number stat tiles.

   Sections: page hero · stat tiles · login · public pages
   ========================================================================= */

/* ---------------------------- Page hero band ---------------------------- */
/* The green "scoreboard" header at the top of a page (see the page_hero
   macro in _macros.html). Court-line stripes, a soft yellow glow, and a
   pair of slanted racing stripes give it the broadcast-graphic feel. */
.page-hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
  padding: 1.75rem 2rem;
  overflow: hidden;
  border-radius: 20px;
  background: var(--brand-hero-striped);
  color: #fff;
  box-shadow: 0 18px 40px -22px rgba(13, 74, 35, 0.8);
}
.page-hero::before,
.page-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
/* Racing stripes: one wide translucent yellow, one thin white. */
.page-hero::before {
  top: -10%;
  bottom: -10%;
  right: 11%;
  width: 3.4rem;
  background: linear-gradient(
    180deg,
    rgba(245, 207, 30, 0.3) 0%,
    rgba(245, 207, 30, 0.06) 100%
  );
  box-shadow: 4.2rem 0 0 -1.35rem rgba(255, 255, 255, 0.14);
  transform: skewX(-20deg);
}
/* Yellow glow bleeding in from the top-right corner. */
.page-hero::after {
  top: -5rem;
  right: -4rem;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(245, 207, 30, 0.28) 0%,
    rgba(245, 207, 30, 0) 65%
  );
}
.page-hero > * {
  position: relative;
  z-index: 1;
}
.page-hero-main {
  display: flex;
  flex: 1 1 22rem;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.page-hero .page-title {
  margin: 0;
  color: #fff;
}
/* Speedup logo lockup at the top of spectator-page heroes (no sidebar there). */
.page-hero-brand {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}
.page-hero-brand img {
  display: block;
  width: auto;
  height: 42px;
}
.page-hero-brand .brand-font {
  color: #fff;
  font-size: 1.7rem;
}

/* Back pill + eyebrow share one row (wrapping on narrow screens). */
.page-hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.6rem;
  max-width: 100%;
  margin-bottom: 0.9rem;
}
.page-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  padding: 0.3rem 0.85rem 0.3rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}
.page-hero-eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 207, 30, 0.25);
}
.page-hero-sub {
  max-width: 40rem;
  margin: 0.85rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.95rem;
}
.page-hero-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
/* A back pill on a green band: glass, then solid white on hover. */
.page-hero .category-back-link {
  margin: 0;
  border-color: rgba(255, 255, 255, 0.32);
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.page-hero .category-back-link:hover,
.page-hero .category-back-link:focus-visible {
  border-color: #fff;
  background-color: #fff;
  color: var(--primary) !important;
}

/* Buttons re-coloured for the green band: the primary action goes pickleball
   yellow, everything else becomes a glass outline. */
.page-hero .btn-success,
.page-hero .btn-primary {
  border-color: var(--accent);
  background-color: var(--accent) !important;
  color: var(--accent-ink) !important;
  box-shadow: 0 10px 22px -10px rgba(245, 207, 30, 0.7);
}
.page-hero .btn-success:hover,
.page-hero .btn-success:active,
.page-hero .btn-primary:hover,
.page-hero .btn-primary:active,
.page-hero .btn-primary:focus {
  border-color: #ffdc36 !important;
  background-color: #ffdc36 !important;
  color: var(--accent-ink) !important;
}
.page-hero .btn-outline-primary,
.page-hero .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.45);
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.page-hero .btn-outline-primary:hover,
.page-hero .btn-outline-secondary:hover,
.page-hero .btn-outline-primary:focus-visible,
.page-hero .btn-outline-secondary:focus-visible {
  border-color: #fff;
  background-color: #fff;
  color: var(--primary);
}
/* Destructive action on the green band (e.g. Reset Bracket): red glass. */
.page-hero .btn-outline-danger {
  border-color: rgba(255, 255, 255, 0.5);
  background-color: rgba(230, 72, 63, 0.3);
  color: #fff;
}
.page-hero .btn-outline-danger:hover,
.page-hero .btn-outline-danger:focus-visible {
  border-color: var(--danger);
  background-color: var(--danger);
  color: #fff;
}
.page-hero .btn.disabled,
.page-hero .btn:disabled {
  border-color: rgba(255, 255, 255, 0.25) !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  opacity: 1;
  box-shadow: none;
}
/* The check-in counter chip and similar status pills read as white tags. */
.page-hero .badge {
  background-color: #fff !important;
  color: var(--primary) !important;
  border: 0 !important;
}

/* Compact: the working screens (Teams, Pool Play, Bracket, ...) keep the
   same band but tighter, so scoring stays close to the top of the screen. */
.page-hero--compact {
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 1.2rem 1.6rem;
  border-radius: 18px;
}
.page-hero--compact .page-title {
  font-size: clamp(1.9rem, 1.4rem + 1.5vw, 2.5rem);
}
.page-hero--compact .page-title::after {
  margin-top: 0.5rem;
}
.page-hero--compact .page-hero-kicker {
  margin-bottom: 0.7rem;
}
.page-hero--compact .category-back-link {
  min-height: 32px;
  padding: 0.25rem 0.8rem;
  font-size: 0.82rem;
}
.page-hero--compact::after {
  top: -6rem;
  right: -5rem;
  width: 14rem;
  height: 14rem;
}
@media (max-width: 767.98px) {
  .page-hero {
    padding: 1.25rem 1.2rem;
    border-radius: 16px;
  }
  .page-hero::before {
    display: none;
  }
  .page-hero::after {
    top: -7rem;
    right: -7rem;
    opacity: 0.8;
  }
  .page-hero--compact {
    padding: 1rem 1.1rem;
  }
  .page-hero-actions {
    width: 100%;
  }
  .page-hero-actions > .btn,
  .page-hero-actions > form,
  .page-hero-actions > form > .btn {
    flex: 1 1 auto;
  }
  /* ...but a small utility button (Refresh, Export CSV) keeps its own width. */
  .page-hero-actions > .btn-sm,
  .page-hero-actions > form > .btn-sm {
    flex: 0 0 auto;
  }
}

/* ------------------------------ Stat tiles ------------------------------ */
/* Big-number KPI tiles: white card, coloured left edge, condensed display
   numeral. --tone / --tone-bg pick the colour family per tile. */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-tile {
  --tone: var(--primary);
  --tone-bg: var(--primary-50);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.05rem 1.2rem 1.15rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--tone);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-pop);
}
.stat-tile--live {
  --tone: var(--warning);
  --tone-bg: var(--warning-light);
}
.stat-tile--done {
  --tone: var(--success);
  --tone-bg: var(--success-light);
}
.stat-tile--info {
  --tone: #2f6fdd;
  --tone-bg: #eaf1fd;
}
.stat-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.stat-tile-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--tone-bg);
  color: var(--tone);
  font-size: 1.05rem;
}
.stat-tile-value {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
}
.stat-tile-note {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ----------------------------- Form panels ------------------------------ */
/* The New/Edit Tournament and Category forms (Bootstrap's bg-white / rounded
   / shadow-sm utilities are !important, hence the !important here). */
.form-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card) !important;
}

/* ---------------------------------- Login --------------------------------- */
/* Split-screen sign-in (auth/login.html): court-photo brand panel on the
   left, the form card on the right. Fixed to the viewport so it escapes the
   page container's padding; scrolls itself on short screens. */
.auth {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  overflow-y: auto;
  background: var(--canvas);
}
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.25rem 2.75rem;
  overflow: hidden;
  color: #fff;
  background-color: #08301a;
  background-image:
    linear-gradient(
      160deg,
      rgba(5, 34, 18, 0.9) 0%,
      rgba(8, 48, 26, 0.7) 55%,
      rgba(5, 34, 18, 0.92) 100%
    ),
    var(--auth-image, none);
  background-size: cover;
  background-position: center;
}
.auth-visual::after {
  content: "";
  position: absolute;
  right: -6rem;
  bottom: -8rem;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(245, 207, 30, 0.22) 0%,
    rgba(245, 207, 30, 0) 65%
  );
  pointer-events: none;
}
.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.auth-brand img {
  width: auto;
  height: 88px;
}
.auth-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.auth-brand-name {
  color: #fff;
  font-size: 2rem;
}
.auth-brand-sub {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}
.auth-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 30rem;
}
.auth-tagline {
  margin: 0 0 0.9rem;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4.6vw, 4rem);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.005em;
  line-height: 0.95;
  text-transform: uppercase;
}
.auth-tagline span {
  display: block;
  color: var(--accent);
}
.auth-visual-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}
.auth-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.auth-points li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 700;
}
.auth-points .bi {
  color: var(--accent);
}
.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem 1.25rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.auth-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 1.6rem;
  background: var(--brand-hero-striped);
  color: #fff;
}
.auth-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.35rem;
}
.auth-card-header h2 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
}
.auth-card-header p {
  margin: 0.3rem 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.88rem;
}
.auth-card-body {
  margin: 0;
  padding: 1.6rem;
}
/* Field with a leading icon that lights up on focus. */
.auth-input {
  position: relative;
}
.auth-input > .bi {
  position: absolute;
  top: 50%;
  left: 0.95rem;
  color: var(--subtle);
  font-size: 1.05rem;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 0.15s var(--ease);
}
.auth-input > .form-control {
  min-height: 46px;
  padding-left: 2.75rem;
}
.auth-input:focus-within > .bi {
  color: var(--primary);
}
.auth-submit {
  min-height: 50px;
  gap: 0.55rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.auth-powered {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.auth-powered .brand-font {
  font-size: 1.15rem;
}
@media (max-width: 900px) {
  .auth {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .auth-visual {
    padding: 1.25rem 1.25rem 1.5rem;
  }
  .auth-visual-copy,
  .auth-points {
    display: none;
  }
  .auth-brand img {
    height: 48px;
  }
  .auth-brand-name {
    font-size: 1.6rem;
  }
  .auth-panel {
    justify-content: flex-start;
    padding-top: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .stat-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .stat-tile {
    gap: 0.35rem;
    padding: 0.85rem 0.9rem 0.95rem;
  }
  .stat-tile-icon {
    width: 30px;
    height: 30px;
  }
  .stat-tile-value {
    font-size: 2.2rem;
  }
}

/* ------------------------------ Error pages ------------------------------ */
/* Big condensed italic status code (404, 500, ...) above the page title. */
.error-code {
  margin-bottom: 0.25rem;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 9rem);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 0.9;
  background: linear-gradient(135deg, var(--primary) 30%, var(--primary-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* A centred page title centres its yellow bar too. */
.text-center .page-title::after {
  margin-right: auto;
  margin-left: auto;
}
