/*
 * CorsaHub public interface
 * A compact, dependency-free design system for the championship dashboard.
 */

@layer reset, tokens, base, layout, components, utilities, responsive;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body,
  h1,
  h2,
  h3,
  h4,
  p,
  figure,
  blockquote,
  dl,
  dd {
    margin: 0;
  }

  ul,
  ol {
    margin: 0;
    padding: 0;
  }

  img,
  picture {
    display: block;
    max-width: 100%;
  }

  button,
  input,
  select,
  textarea {
    color: inherit;
    font: inherit;
  }
}

/* 2026 muted-crimson refresh: calm, spacious, and content-first. */
@layer tokens {
  :root {
    --ink-strong: #fffaf7;
    --ink: #eee9e6;
    --ink-muted: #aaa3a0;
    --ink-faint: #817a78;
    --canvas: #0a090a;
    --canvas-raised: #100e0f;
    --surface: #151213;
    --surface-raised: #1c1819;
    --surface-soft: #252021;
    --line: #30292b;
    --line-strong: #473b3e;
    --red: #c7353e;
    --red-deep: #8f242c;
    --orange: #c7353e;
    --orange-soft: #e2767d;
    --championship-primary: #c7353e;
    --championship-accent: #c7353e;
    --radius-sm: 0.65rem;
    --radius: 1rem;
    --radius-lg: 1.35rem;
    --content: 72rem;
    --header-height: 4.5rem;
    --shadow-sm: 0 12px 32px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.28);
  }
}

@layer base {
  body {
    background: radial-gradient(circle at 82% 0%, rgba(199, 53, 62, 0.09), transparent 28rem), var(--canvas);
  }

  body::before { display: none; }
  a { text-decoration-color: rgba(199, 53, 62, 0.7); }
  a:hover { text-decoration-color: #e2767d; }
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: #e2767d; }

  h1, h2, h3, h4 {
    font-family: var(--font-body);
    font-stretch: normal;
    letter-spacing: -0.035em;
  }

  h1 { font-size: clamp(2.35rem, 6vw, 4.85rem); }
}

@layer layout {
  .page-section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
  .page-section + .page-section { padding-top: 0; }
  .section-heading { gap: 1.5rem; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
  .dashboard-grid, .card-grid { gap: clamp(1rem, 2vw, 1.5rem); }
}

@layer components {
  .site-header {
    border-color: rgba(255,255,255,.06);
    background: rgba(10, 9, 10, 0.86);
  }

  .wordmark--image { width: auto; padding: 0; }
  .wordmark--image img { width: auto; height: 1.8rem; object-fit: contain; }
  .wordmark--image.wordmark-small img { height: 1.35rem; }

  .site-nav { gap: .4rem; }
  .site-nav a, .site-nav__link, .nav-link-button { padding-inline: 1rem; font-weight: 650; }
  .site-nav a[aria-current="page"], .site-nav__link[aria-current="page"] { box-shadow: none; color: #fffaf7; }

  .hero, .page-hero { border-bottom-color: rgba(255,255,255,.06); }
  .hero::after, .page-hero::after { display: none; }
  .hero__inner {
    min-height: min(43rem, calc(100vh - var(--header-height)));
    padding-block: clamp(4.5rem, 10vw, 8rem);
    grid-template-columns: minmax(0, 1.25fr) minmax(17rem, .75fr);
    gap: clamp(3rem, 8vw, 7.5rem);
  }
  .hero__copy { margin-top: 1.5rem; line-height: 1.7; }
  .hero__actions { margin-top: 2.25rem; }
  .hero__panel, .card, .panel, .table-wrap, .empty-state {
    border-color: rgba(255,255,255,.075);
    background: rgba(21,18,19,.78);
    box-shadow: var(--shadow-sm);
  }
  .hero__panel { padding: clamp(1.35rem, 3vw, 2rem); }
  .hero__panel::before { background: var(--championship-primary); opacity: .8; }
  .page-hero__inner { padding-block: clamp(3.5rem, 8vw, 6rem); }
  .eyebrow { color: var(--championship-primary); letter-spacing: .11em; }
  .eyebrow::before { width: 1.25rem; }

  .button, .btn {
    min-height: 3rem;
    padding-inline: 1.2rem;
    border-color: #c7353e;
    background: #c7353e;
    box-shadow: none;
    font-weight: 720;
  }
  .button:hover, .btn:hover { filter: brightness(1.1); }
  .button--secondary, .btn--secondary, .button--ghost, .btn--ghost {
    border-color: var(--line-strong);
    background: transparent;
  }
  .button--danger { border-color: #d64d55; background: #982832; }

  .podium { gap: 1rem; margin-bottom: 2rem; }
  .podium-card { min-height: 12rem; padding: 1.35rem; }
  .podium-card--first, .podium-card[data-rank="1"] { transform: none; border-color: rgba(199,53,62,.55); }
  .podium__rank, .podium-rank { color: rgba(199,53,62,.16); }

  .data-table th, .data-table td, .standings-table th, .standings-table td { padding: 1rem 1.15rem; }
  .data-table tbody tr:hover, .standings-table tbody tr:hover { background: rgba(199,53,62,.045); }
  .site-footer { padding-block: 3rem; border-color: rgba(255,255,255,.06); }
}

@layer utilities {
  html.page-entering .site-main, html.page-entering .admin-main { opacity: 0; transform: translateY(5px); }
  .site-main, .admin-main { opacity: 1; transform: none; transition: opacity 360ms ease, transform 360ms ease; }
}

@layer responsive {
  @media (max-width: 56.25rem) {
    .hero__inner { min-height: auto; gap: 2.25rem; }
  }
  @media (max-width: 43.75rem) {
    .page-section { padding-block: 3.25rem; }
    .hero__inner { padding-block: 3.75rem; }
    .site-header__inner, .hero__inner, .page-hero__inner, .container, .site-footer__inner { width: min(100% - 1.5rem, var(--content)); }
    .table-wrap { border-radius: .8rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    html.page-entering .site-main, html.page-entering .admin-main { opacity: 1; transform: none; }
    .site-main, .admin-main { transition: none; }
  }
}

@layer tokens {
  :root {
    color-scheme: dark;
    --font-display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
    --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ink-strong: #fff;
    --ink: #eef0f3;
    --ink-muted: #a7abb4;
    --ink-faint: #818691;
    --canvas: #07080a;
    --canvas-raised: #0d0f13;
    --surface: #12151a;
    --surface-raised: #181c22;
    --surface-soft: #20252d;
    --line: #292e37;
    --line-strong: #3b414d;
    --red: #ed2f36;
    --red-deep: #a81720;
    --orange: #ff7a1a;
    --orange-soft: #ffad42;
    --green: #45d483;
    --yellow: #f9c74f;
    --blue: #57a8ff;
    --danger: #ff5e63;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.38);
    --radius-sm: 0.5rem;
    --radius: 0.85rem;
    --radius-lg: 1.25rem;
    --content: 76rem;
    --content-narrow: 54rem;
    --header-height: 4.75rem;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --championship-primary: var(--red);
    --championship-accent: var(--orange);
  }
}

@layer base {
  html {
    min-width: 20rem;
    scroll-behavior: smooth;
    scrollbar-color: var(--line-strong) var(--canvas);
  }

  body {
    min-height: 100vh;
    background:
      radial-gradient(circle at 78% 8%, rgba(237, 47, 54, 0.1), transparent 24rem),
      radial-gradient(circle at 12% 48%, rgba(255, 122, 26, 0.045), transparent 30rem),
      var(--canvas);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    overflow-wrap: break-word;
  }

  body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 4rem 4rem;
    content: "";
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 72%);
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
  }

  a {
    color: inherit;
    text-decoration-color: rgba(255, 122, 26, 0.65);
    text-underline-offset: 0.22em;
  }

  a:hover {
    text-decoration-color: var(--orange);
  }

  button,
  a {
    -webkit-tap-highlight-color: transparent;
  }

  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    border-radius: 0.25rem;
    outline: 0.2rem solid var(--orange-soft);
    outline-offset: 0.2rem;
  }

  ::selection {
    background: var(--red);
    color: #fff;
  }

  h1,
  h2,
  h3,
  h4 {
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-stretch: condensed;
    font-weight: 850;
    line-height: 1.08;
    text-wrap: balance;
  }

  h1 {
    font-size: clamp(2.4rem, 7vw, 5.6rem);
    letter-spacing: -0.055em;
  }

  h2 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    letter-spacing: -0.035em;
  }

  h3 {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    letter-spacing: -0.02em;
  }

  button {
    border: 0;
  }

  time,
  .number,
  [data-number] {
    font-variant-numeric: tabular-nums;
  }
}

@layer layout {
  .site-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }

  .site-main {
    flex: 1;
  }

  .container,
  .page-shell {
    width: min(100% - 2rem, var(--content));
    margin-inline: auto;
  }

  .container--narrow,
  .page-shell--narrow {
    width: min(100% - 2rem, var(--content-narrow));
    margin-inline: auto;
  }

  .page-section {
    padding-block: clamp(3rem, 7vw, 6rem);
  }

  .page-section + .page-section {
    padding-top: 0;
  }

  .section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .section-heading__copy {
    max-width: 42rem;
  }

  .section-heading__copy > :last-child:not(:first-child) {
    margin-top: 0.55rem;
  }

  .dashboard-grid,
  .card-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
  }

  .dashboard-grid > *,
  .card-grid > * {
    grid-column: span 4;
  }

  .span-4 {
    grid-column: span 4;
  }

  .span-5 {
    grid-column: span 5;
  }

  .span-6 {
    grid-column: span 6;
  }

  .span-7 {
    grid-column: span 7;
  }

  .span-8 {
    grid-column: span 8;
  }

  .span-12 {
    grid-column: 1 / -1;
  }
}

@layer components {
  .skip-link {
    position: fixed;
    z-index: 1000;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.75rem 1rem;
    transform: translateY(-180%);
    border-radius: var(--radius-sm);
    background: #fff;
    color: #111;
    font-weight: 800;
    transition: transform 160ms var(--ease);
  }

  .skip-link:focus {
    transform: translateY(0);
  }

  .site-header {
    position: sticky;
    z-index: 100;
    top: 0;
    min-height: var(--header-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 8, 10, 0.9);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  .site-header__inner,
  .header-inner {
    display: flex;
    width: min(100% - 2rem, var(--content));
    min-height: var(--header-height);
    margin-inline: auto;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }

  .brand {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-decoration: none;
    text-transform: uppercase;
  }

  .wordmark {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 900;
    letter-spacing: -0.055em;
    text-decoration: none;
    text-transform: uppercase;
  }

  .wordmark span {
    color: var(--championship-accent);
  }

  .wordmark-small {
    min-height: auto;
    font-size: 1rem;
  }

  .brand__mark,
  .brand-mark {
    position: relative;
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    overflow: hidden;
    transform: skewX(-8deg);
    border-radius: 0.45rem;
    background: linear-gradient(135deg, var(--championship-primary), var(--championship-accent));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 8px 24px rgba(237, 47, 54, 0.22);
    color: #fff;
    font-size: 0.84rem;
    font-style: normal;
    letter-spacing: -0.06em;
  }

  .brand__mark::after,
  .brand-mark::after {
    position: absolute;
    right: -0.3rem;
    bottom: 0.3rem;
    width: 1.35rem;
    height: 0.2rem;
    transform: rotate(-35deg);
    background: rgba(255, 255, 255, 0.55);
    content: "";
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .site-nav a,
  .site-nav__link {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    padding-inline: 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    font-size: 0.9rem;
    font-weight: 750;
    text-decoration: none;
    transition: background-color 160ms var(--ease), color 160ms var(--ease);
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"],
  .site-nav__link:hover,
  .site-nav__link[aria-current="page"] {
    background: var(--surface-raised);
    color: #fff;
  }

  .site-nav a[aria-current="page"],
  .site-nav__link[aria-current="page"] {
    box-shadow: inset 0 -2px var(--championship-accent);
  }

  .nav-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    cursor: pointer;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: #fff;
  }

  .nav-toggle:not(:has(.nav-toggle__icon)) {
    width: auto;
    padding-inline: 0.75rem;
    font-size: 0.75rem;
    font-weight: 820;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .nav-form {
    display: inline-flex;
    margin: 0;
  }

  .nav-link-button {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    padding-inline: 0.85rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.9rem;
    font-weight: 750;
  }

  .nav-link-button:hover {
    background: var(--surface-raised);
    color: #fff;
  }

  .nav-toggle__icon,
  .nav-toggle__icon::before,
  .nav-toggle__icon::after {
    display: block;
    width: 1.15rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    transition: transform 180ms var(--ease), opacity 180ms var(--ease);
  }

  .nav-toggle__icon::before {
    transform: translateY(-0.38rem);
  }

  .nav-toggle__icon::after {
    transform: translateY(0.26rem);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__icon {
    background: transparent;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
    transform: translateY(0) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
    transform: translateY(-2px) rotate(-45deg);
  }

  .hero,
  .page-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
  }

  .hero::after,
  .page-hero::after {
    position: absolute;
    top: -16rem;
    right: max(-9rem, calc((100vw - var(--content)) / 2 - 10rem));
    width: 34rem;
    height: 34rem;
    transform: rotate(18deg);
    border: 5rem solid rgba(237, 47, 54, 0.055);
    border-radius: 50%;
    content: "";
    pointer-events: none;
  }

  .hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100% - 2rem, var(--content));
    min-height: clamp(31rem, 72vh, 47rem);
    margin-inline: auto;
    padding-block: clamp(4rem, 9vw, 8rem);
    align-items: center;
    grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.65fr);
    gap: clamp(2.5rem, 7vw, 7rem);
  }

  .hero__content {
    max-width: 48rem;
  }

  .hero__title em {
    color: var(--championship-accent);
    font-style: normal;
  }

  .hero__copy {
    max-width: 39rem;
    margin-top: 1.4rem;
    color: var(--ink-muted);
    font-size: clamp(1.02rem, 2vw, 1.22rem);
    text-wrap: pretty;
  }

  .hero__actions {
    display: flex;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .hero__panel {
    position: relative;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
    box-shadow: var(--shadow-lg);
  }

  .hero__panel::before {
    position: absolute;
    inset: -1px -1px auto;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(90deg, var(--championship-primary), var(--championship-accent), transparent 80%);
    content: "";
  }

  .page-hero__inner {
    position: relative;
    z-index: 1;
    width: min(100% - 2rem, var(--content));
    margin-inline: auto;
    padding-block: clamp(3rem, 7vw, 5.5rem);
  }

  .page-hero__copy {
    max-width: 44rem;
    margin-top: 1rem;
    color: var(--ink-muted);
    font-size: 1.08rem;
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    color: var(--championship-accent);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .eyebrow::before {
    width: 1.8rem;
    height: 2px;
    background: currentColor;
    content: "";
  }

  .button,
  .btn {
    display: inline-flex;
    min-height: 2.85rem;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.68rem 1.05rem;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    border-color: color-mix(in srgb, var(--championship-primary) 48%, #fff);
    background: linear-gradient(135deg, #b21f27, #7f1016);
    box-shadow: 0 8px 24px rgba(237, 47, 54, 0.17);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 820;
    line-height: 1.1;
    text-decoration: none;
    transition: transform 160ms var(--ease), filter 160ms var(--ease), border-color 160ms var(--ease),
      background-color 160ms var(--ease);
  }

  .button:hover,
  .btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
  }

  .button:active,
  .btn:active {
    transform: translateY(0);
  }

  .button--secondary,
  .btn--secondary,
  .button--ghost,
  .btn--ghost {
    border-color: var(--line-strong);
    background: var(--surface);
    box-shadow: none;
    color: var(--ink);
  }

  .button--ghost,
  .btn--ghost {
    background: transparent;
  }

  .button--small,
  .btn--small {
    min-height: 2.75rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .button:disabled,
  .btn:disabled,
  [aria-disabled="true"] {
    cursor: not-allowed;
    filter: grayscale(0.7);
    opacity: 0.55;
  }

  .card,
  .panel {
    position: relative;
    overflow: hidden;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent), var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .card--interactive {
    transition: transform 180ms var(--ease), border-color 180ms var(--ease), background-color 180ms var(--ease);
  }

  .card--interactive:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background-color: var(--surface-raised);
  }

  .card__header,
  .panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .card__footer,
  .panel__footer {
    margin: 1.25rem calc(clamp(1rem, 2.5vw, 1.5rem) * -1) calc(clamp(1rem, 2.5vw, 1.5rem) * -1);
    padding: 0.9rem clamp(1rem, 2.5vw, 1.5rem);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.018);
  }

  .stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .stat-card,
  .stat {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.025);
  }

  .stat__label,
  .stat-card__label {
    display: block;
    color: var(--ink-muted);
    font-size: 0.72rem;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .stat__value,
  .stat-card__value {
    display: block;
    margin-top: 0.25rem;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1;
  }

  .race-card__topline,
  .race-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .race-card__round {
    color: var(--ink-muted);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .race-card__title {
    margin-top: 1rem;
  }

  .race-card__date {
    display: block;
    margin-top: 0.6rem;
    color: var(--ink-muted);
    font-size: 0.9rem;
  }

  .status,
  .badge {
    display: inline-flex;
    min-height: 1.65rem;
    align-items: center;
    gap: 0.38rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--ink-muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .status::before,
  .badge--dot::before {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: currentColor;
    content: "";
    box-shadow: 0 0 0 0.18rem rgba(255, 255, 255, 0.05);
  }

  .status--live,
  .status[data-status="live"],
  .badge--live {
    border-color: rgba(237, 47, 54, 0.38);
    background: rgba(237, 47, 54, 0.11);
    color: #ff7075;
  }

  .status--live::before,
  .status[data-status="live"]::before,
  .badge--live::before {
    animation: status-pulse 1.8s infinite;
  }

  .status--completed,
  .status--published,
  .status[data-status="completed"],
  .status[data-status="published"],
  .badge--success {
    border-color: rgba(69, 212, 131, 0.32);
    background: rgba(69, 212, 131, 0.1);
    color: var(--green);
  }

  .status--postponed,
  .status--draft,
  .status[data-status="postponed"],
  .status[data-status="draft"],
  .badge--warning {
    border-color: rgba(249, 199, 79, 0.34);
    background: rgba(249, 199, 79, 0.1);
    color: var(--yellow);
  }

  .status--cancelled,
  .status--dsq,
  .status[data-status="cancelled"],
  .status[data-status="dsq"],
  .badge--danger {
    border-color: rgba(255, 94, 99, 0.34);
    background: rgba(255, 94, 99, 0.09);
    color: var(--danger);
  }

  @keyframes status-pulse {
    50% {
      box-shadow: 0 0 0 0.32rem rgba(237, 47, 54, 0.12);
    }
  }

  .tabs,
  .leaderboard-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    padding: 0.28rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: var(--canvas-raised);
    scrollbar-width: thin;
  }

  .tabs a,
  .tab-link,
  .leaderboard-tabs a {
    display: inline-flex;
    min-width: 7rem;
    min-height: 2.65rem;
    align-items: center;
    justify-content: center;
    padding-inline: 1rem;
    border-radius: 0.48rem;
    color: var(--ink-muted);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
  }

  .tabs a[aria-current="page"],
  .tabs a[aria-selected="true"],
  .tab-link[aria-current="page"],
  .tab-link[aria-selected="true"],
  .leaderboard-tabs a[aria-current="page"] {
    background: var(--surface-soft);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    color: #fff;
  }

  .leaderboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .podium {
    display: grid;
    margin-block: 2rem;
    align-items: end;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .podium__item,
  .podium-card {
    position: relative;
    min-width: 0;
    padding: 1.4rem 1rem 1.2rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), transparent 55%), var(--surface);
    text-align: center;
  }

  .podium__item--first,
  .podium-card--first,
  .podium-card[data-rank="1"] {
    min-height: 14rem;
    padding-top: 2rem;
    border-color: rgba(255, 173, 66, 0.45);
    background: linear-gradient(160deg, rgba(255, 122, 26, 0.14), transparent 58%), var(--surface-raised);
    box-shadow: 0 20px 50px rgba(255, 122, 26, 0.08);
    order: 2;
  }

  .podium__item--second,
  .podium-card--second,
  .podium-card[data-rank="2"] {
    order: 1;
  }

  .podium__item--third,
  .podium-card--third,
  .podium-card[data-rank="3"] {
    order: 3;
  }

  .podium__rank,
  .podium-rank {
    position: absolute;
    top: -0.2rem;
    right: 0.65rem;
    color: rgba(255, 255, 255, 0.07);
    font-family: var(--font-display);
    font-size: 5rem;
    font-style: italic;
    font-weight: 950;
    line-height: 1;
    pointer-events: none;
  }

  .podium__identity {
    position: relative;
    z-index: 1;
  }

  .podium__name {
    margin-top: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .podium__team {
    margin-top: 0.25rem;
    overflow: hidden;
    color: var(--ink-muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .podium__points {
    display: block;
    margin-top: 1rem;
    color: var(--championship-accent);
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 900;
  }

  .avatar,
  .monogram {
    display: inline-grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--surface-soft), var(--canvas-raised));
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
  }

  .avatar--large,
  .monogram--large {
    width: 4.25rem;
    height: 4.25rem;
    box-shadow: 0 0 0 0.3rem rgba(255, 255, 255, 0.035);
    font-size: 1.15rem;
  }

  .avatar img,
  .monogram img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .identity {
    display: flex;
    min-width: 10rem;
    align-items: center;
    gap: 0.75rem;
  }

  .identity__copy {
    min-width: 0;
  }

  .identity__name {
    display: block;
    overflow: hidden;
    color: #fff;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .identity__meta {
    display: block;
    margin-top: 0.1rem;
    overflow: hidden;
    color: var(--ink-muted);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .team-swatch {
    display: inline-block;
    width: 0.3rem;
    height: 1.75rem;
    flex: 0 0 auto;
    border-radius: 99px;
    background: var(--team-color, var(--championship-accent));
    box-shadow: 0 0 0.8rem color-mix(in srgb, var(--team-color, var(--championship-accent)) 25%, transparent);
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    scrollbar-color: var(--line-strong) var(--surface);
  }

  .data-table,
  .standings-table {
    width: 100%;
    min-width: 40rem;
    border-collapse: collapse;
    font-size: 0.9rem;
  }

  .data-table caption,
  .standings-table caption {
    padding: 1rem;
    color: var(--ink-muted);
    text-align: left;
  }

  .data-table th,
  .standings-table th {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--line-strong);
    background: var(--canvas-raised);
    color: var(--ink-muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.09em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .data-table td,
  .standings-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
  }

  .data-table tbody tr:last-child td,
  .standings-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .data-table tbody tr,
  .standings-table tbody tr {
    transition: background-color 140ms var(--ease);
  }

  .data-table tbody tr:hover,
  .standings-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
  }

  .data-table .cell-rank,
  .standings-table .cell-rank {
    width: 4.5rem;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 900;
  }

  .data-table .cell-points,
  .standings-table .cell-points {
    color: #fff;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
  }

  .table-note {
    margin-top: 0.75rem;
    color: var(--ink-muted);
    font-size: 0.78rem;
  }

  .alert {
    display: grid;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line-strong);
    border-left: 0.25rem solid var(--blue);
    border-radius: var(--radius-sm);
    background: rgba(87, 168, 255, 0.08);
    color: var(--ink);
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
  }

  .alert--success {
    border-left-color: var(--green);
    background: rgba(69, 212, 131, 0.08);
  }

  .alert-success {
    border-left-color: var(--green);
    background: rgba(69, 212, 131, 0.08);
  }

  .alert--warning {
    border-left-color: var(--yellow);
    background: rgba(249, 199, 79, 0.08);
  }

  .alert-warning {
    border-left-color: var(--yellow);
    background: rgba(249, 199, 79, 0.08);
  }

  .alert--danger,
  .alert--error {
    border-left-color: var(--danger);
    background: rgba(255, 94, 99, 0.08);
  }

  .alert-error,
  .alert-danger {
    border-left-color: var(--danger);
    background: rgba(255, 94, 99, 0.08);
  }

  .flash-wrap {
    width: min(100% - 2rem, var(--content));
    margin: 1rem auto 0;
  }

  .flash-wrap .alert {
    grid-template-columns: minmax(0, 1fr);
  }

  .alert__title {
    color: #fff;
    font-weight: 800;
  }

  .alert__message,
  .alert p {
    color: var(--ink-muted);
    font-size: 0.9rem;
  }

  .alert__dismiss {
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-muted);
  }

  .empty-state {
    display: grid;
    min-height: 15rem;
    padding: clamp(2rem, 6vw, 4rem) 1.25rem;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.015);
    text-align: center;
  }

  .empty-state__inner {
    max-width: 30rem;
  }

  .empty-state__mark {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--championship-accent);
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 900;
  }

  .empty-state p {
    margin-top: 0.6rem;
    color: var(--ink-muted);
  }

  .empty-state .button,
  .empty-state .btn {
    margin-top: 1.25rem;
  }

  .meta-list {
    display: grid;
    gap: 0.75rem;
  }

  .meta-list > div {
    display: grid;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
    grid-template-columns: minmax(7rem, 0.65fr) minmax(0, 1.35fr);
    gap: 1rem;
  }

  .meta-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .meta-list dt {
    color: var(--ink-muted);
    font-size: 0.78rem;
  }

  .meta-list dd {
    color: #fff;
    font-weight: 720;
  }

  .site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: var(--canvas-raised);
  }

  .site-footer__inner {
    display: flex;
    width: min(100% - 2rem, var(--content));
    min-height: 7rem;
    margin-inline: auto;
    padding-block: 1.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .site-footer__copy {
    color: var(--ink-faint);
    font-size: 0.78rem;
  }

  .site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .site-footer__inner > nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .site-footer__links a {
    color: var(--ink-muted);
    font-size: 0.8rem;
    font-weight: 700;
  }

  .site-footer__inner > nav a {
    color: var(--ink-muted);
    font-size: 0.8rem;
    font-weight: 700;
  }

  .site-footer__inner > div p,
  .site-footer__inner > p {
    color: var(--ink-faint);
    font-size: 0.78rem;
  }

  .breadcrumbs {
    display: flex;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    color: var(--ink-muted);
    font-size: 0.78rem;
  }

  .breadcrumbs > * + *::before {
    margin-right: 0.45rem;
    color: var(--ink-faint);
    content: "/";
  }

  .pagination {
    display: flex;
    margin-top: 1.25rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .pagination a,
  .pagination span {
    display: grid;
    min-width: 2.65rem;
    min-height: 2.65rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    font-size: 0.82rem;
    font-weight: 760;
    text-decoration: none;
  }

  .pagination [aria-current="page"] {
    border-color: var(--championship-primary);
    background: rgba(237, 47, 54, 0.11);
    color: #fff;
  }

  .noscript-banner {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(249, 199, 79, 0.3);
    background: rgba(249, 199, 79, 0.09);
    color: #ffe19a;
    font-size: 0.82rem;
    text-align: center;
  }

  .auth-shell,
  .error-page {
    display: grid;
    width: min(100% - 2rem, 36rem);
    min-height: calc(100vh - var(--header-height) - 10rem);
    margin-inline: auto;
    padding-block: clamp(2rem, 8vw, 5rem);
    place-items: center;
  }

  .auth-card,
  .error-card {
    width: 100%;
    padding: clamp(1.4rem, 5vw, 2.25rem);
  }

  .auth-card h1,
  .error-card h1 {
    margin-bottom: 0.75rem;
  }

  .section-copy,
  .help-text {
    color: var(--ink-muted);
    font-size: 0.86rem;
  }

  .form-stack {
    display: grid;
    margin-top: 1.4rem;
    gap: 1rem;
  }

  .form-field label {
    display: inline-block;
    margin-bottom: 0.38rem;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 760;
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    display: block;
    width: 100%;
    min-height: 2.85rem;
    padding: 0.65rem 0.78rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--canvas-raised);
    color: #fff;
  }

  .form-field input:focus,
  .form-field select:focus,
  .form-field textarea:focus {
    border-color: var(--championship-accent);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(255, 173, 66, 0.17);
  }

  .form-field input[aria-invalid="true"] {
    border-color: var(--danger);
  }

  .field-error {
    margin-top: 0.35rem;
    color: #ff9b9e;
    font-size: 0.76rem;
    font-weight: 700;
  }

  .button-block {
    width: 100%;
  }

  .error-card .button {
    margin-top: 1.25rem;
  }

  .error-card .help-text {
    margin-top: 1rem;
  }
}

@layer utilities {
  .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .muted {
    color: var(--ink-muted);
  }

  .text-accent {
    color: var(--championship-accent);
  }

  .text-danger {
    color: var(--danger);
  }

  .text-right {
    text-align: right;
  }

  .nowrap {
    white-space: nowrap;
  }

  .stack {
    display: flex;
    flex-direction: column;
    gap: var(--stack-gap, 1rem);
  }

  .cluster {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--cluster-gap, 0.75rem);
  }

  [hidden] {
    display: none !important;
  }
}

@layer responsive {
  @media (max-width: 64rem) {
    .hero__inner {
      grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
      gap: 2.5rem;
    }

    .dashboard-grid > *,
    .card-grid > * {
      grid-column: span 6;
    }

    .dashboard-grid > .span-12,
    .card-grid > .span-12 {
      grid-column: 1 / -1;
    }
  }

  @media (max-width: 56.25rem) {
    .js .nav-toggle {
      display: grid;
    }

    .js .site-nav {
      position: fixed;
      z-index: 99;
      top: var(--header-height);
      right: 0;
      left: 0;
      display: grid;
      max-height: calc(100dvh - var(--header-height));
      padding: 0.85rem 1rem max(1.2rem, env(safe-area-inset-bottom));
      overflow-y: auto;
      transform: translateY(-0.75rem);
      border-bottom: 1px solid var(--line);
      background: rgba(7, 8, 10, 0.98);
      box-shadow: var(--shadow-lg);
      opacity: 0;
      pointer-events: none;
      visibility: hidden;
      transition: transform 180ms var(--ease), opacity 180ms var(--ease), visibility 180ms;
    }

    .js .site-nav[data-open="true"],
    .js .site-nav.is-open {
      transform: translateY(0);
      opacity: 1;
      pointer-events: auto;
      visibility: visible;
    }

    .site-nav a,
    .site-nav__link {
      min-height: 3.25rem;
      justify-content: space-between;
      padding-inline: 1rem;
      border-bottom: 1px solid var(--line);
      border-radius: 0;
      font-size: 1rem;
    }

    .nav-form,
    .nav-link-button {
      width: 100%;
    }

    .nav-link-button {
      min-height: 3.25rem;
      padding-inline: 1rem;
      border-bottom: 1px solid var(--line);
      border-radius: 0;
      font-size: 1rem;
    }

    .site-nav a[aria-current="page"],
    .site-nav__link[aria-current="page"] {
      box-shadow: inset 3px 0 var(--championship-accent);
    }

    body.nav-open {
      overflow: hidden;
    }

    .hero__inner {
      min-height: auto;
      grid-template-columns: 1fr;
    }

    .hero__panel {
      max-width: 34rem;
    }
  }

  @media (max-width: 43.75rem) {
    .container,
    .page-shell,
    .container--narrow,
    .page-shell--narrow,
    .site-header__inner,
    .header-inner,
    .hero__inner,
    .page-hero__inner,
    .site-footer__inner {
      width: min(100% - 1.25rem, var(--content));
    }

    .section-heading,
    .leaderboard-toolbar,
    .site-footer__inner {
      align-items: flex-start;
      flex-direction: column;
    }

    .dashboard-grid,
    .card-grid {
      grid-template-columns: 1fr;
    }

    .dashboard-grid > *,
    .card-grid > *,
    .dashboard-grid > [class*="span-"],
    .card-grid > [class*="span-"] {
      grid-column: 1;
    }

    .podium {
      align-items: stretch;
      grid-template-columns: 1fr;
    }

    .podium__item,
    .podium-card,
    .podium__item--first,
    .podium-card--first,
    .podium-card[data-rank="1"],
    .podium__item--second,
    .podium-card--second,
    .podium-card[data-rank="2"],
    .podium__item--third,
    .podium-card--third,
    .podium-card[data-rank="3"] {
      min-height: 0;
      padding: 1rem;
      order: initial;
      text-align: left;
    }

    .podium__identity {
      display: grid;
      align-items: center;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 0.8rem;
    }

    .podium__name,
    .podium__team,
    .podium__points {
      margin-top: 0;
    }

    .podium__rank,
    .podium-rank {
      top: 50%;
      right: 0.85rem;
      transform: translateY(-50%);
      font-size: 3rem;
    }

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

    .meta-list > div {
      grid-template-columns: 1fr;
      gap: 0.15rem;
    }

    .tabs,
    .leaderboard-tabs {
      width: 100%;
    }

    .tabs a,
    .tab-link,
    .leaderboard-tabs a {
      min-width: 50%;
      flex: 1;
    }
  }

  @media (max-width: 30rem) {
    .hero__actions,
    .hero__actions .button,
    .hero__actions .btn {
      width: 100%;
    }

    .brand__wordmark {
      font-size: 1.05rem;
    }

    .alert {
      grid-template-columns: minmax(0, 1fr) auto;
    }

    .alert__icon {
      display: none;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }

  @media (forced-colors: active) {
    .brand__mark,
    .brand-mark,
    .button,
    .btn,
    .team-swatch {
      forced-color-adjust: none;
    }

    .card,
    .panel,
    .table-wrap,
    .alert,
    .empty-state {
      border-color: CanvasText;
    }
  }

  @media print {
    :root {
      color-scheme: light;
    }

    body {
      background: #fff;
      color: #111;
    }

    body::before,
    .site-header,
    .site-footer,
    .hero::after,
    .page-hero::after,
    .button,
    .btn {
      display: none !important;
    }

    .card,
    .panel,
    .table-wrap {
      border-color: #bbb;
      background: #fff;
      box-shadow: none;
    }

    h1,
    h2,
    h3,
    .identity__name,
    .data-table .cell-points,
    .standings-table .cell-points {
      color: #111;
    }
  }
}
