/* ============================================================
   SHUTTLE v2 — Badminton App Design System
   HTMX-ready | Dark/Light mode | Zero dependencies
   Author: Pentana AI  |  March 2026
   ============================================================ */

/* ────────────────────────────────────────────────
   1. DESIGN TOKENS (CSS Custom Properties)
   ──────────────────────────────────────────────── */
:root {
  /* Brand Palette */
  --c-navy:        #0B1F3A;
  --c-navy-mid:    #122847;
  --c-navy-light:  #1C3A61;
  --c-lime:        #C8F135;
  --c-lime-dim:    #a8cc22;
  --c-lime-pale:   #e8f9a8;
  --c-white:       #F5F7FA;
  --c-offwhite:    #EEF1F7;
  --c-slate:       #8599B2;
  --c-slate-light: #B8C8DA;
  --c-danger:      #FF4D6D;
  --c-warning:     #FFB347;
  --c-success:     #36D399;
  --c-info:        #3BC4F2;
  --c-purple:      #7C3AED;

  /* Semantic Surface Tokens — LIGHT MODE */
  --bg-page:        var(--c-offwhite);
  --bg-card:        #FFFFFF;
  --bg-card-hover:  #F0F4FA;
  --bg-nav:         var(--c-navy);
  --bg-nav-scroll:  rgba(11, 31, 58, 0.95);
  --bg-input:       #FFFFFF;
  --bg-overlay:     rgba(11, 31, 58, 0.55);

  --text-primary:   var(--c-navy);
  --text-secondary: #4A6080;
  --text-muted:     var(--c-slate);
  --text-inverse:   var(--c-white);
  --text-on-lime:   var(--c-navy);
  --text-nav:       rgba(245,247,250,0.85);

  --border-color:   #D6E0EE;
  --border-focus:   var(--c-lime);
  --border-radius:  8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Shadows */
  --shadow-sm:   0 1px 4px rgba(11,31,58,0.08);
  --shadow-md:   0 4px 16px rgba(11,31,58,0.12);
  --shadow-lg:   0 8px 32px rgba(11,31,58,0.18);
  --shadow-lime: 0 0 0 3px rgba(200,241,53,0.35);

  /* Spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px;

  /* Typography */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --dur-fast:    150ms;
  --dur-base:    250ms;
  --dur-slow:    400ms;

  /* Layout */
  --nav-height: 64px;
  --container-max: 1280px;
  --sidebar-width: 260px;
}

/* ────────────────────────────────────────────────
   2. DARK MODE TOKENS
   ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-page:        #080F1A;
  --bg-card:        #0F1E32;
  --bg-card-hover:  #172845;
  --bg-nav:         #060D16;
  --bg-nav-scroll:  rgba(6, 13, 22, 0.97);
  --bg-input:       #0F1E32;
  --bg-overlay:     rgba(0, 0, 0, 0.7);

  --text-primary:   #E8EEF7;
  --text-secondary: #9BAEC8;
  --text-muted:     #5C7A99;
  --text-inverse:   var(--c-navy);
  --text-nav:       rgba(232,238,247,0.85);

  --border-color:   rgba(255,255,255,0.08);
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.45);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
}

/* ────────────────────────────────────────────────
   3. RESET & BASE
   ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--dur-slow) var(--ease-out),
              color var(--dur-slow) var(--ease-out);
  min-height: 100vh;
}

img, video { max-width: 100%; display: block; }
a { color: var(--c-lime-dim); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ────────────────────────────────────────────────
   4. HTMX LIFECYCLE HOOKS
   ──────────────────────────────────────────────── */

/* 4a. Request in-flight — element that triggered */
.htmx-request {
  opacity: 0.6;
  pointer-events: none;
}

/* 4b. Loading indicator — hidden by default, shown during request */
.htmx-indicator {
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* 4c. Target while old content is swapping out */
.htmx-swapping {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity var(--dur-fast) var(--ease-in),
              transform var(--dur-fast) var(--ease-in);
}

/* 4d. Newly settled content — entry animation */
.htmx-settling {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

/* 4e. Each newly added element — staggered slide in */
.htmx-added {
  animation: htmxSlideIn var(--dur-slow) var(--ease-spring) both;
}

@keyframes htmxSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* 4f. Global spinner bar (top of page) */
#htmx-loader {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--c-lime), var(--c-lime-dim));
  z-index: 9999;
  transition: width 0.4s var(--ease-out), opacity 0.3s;
  opacity: 0;
  box-shadow: 0 0 10px var(--c-lime);
}
#htmx-loader.active {
  opacity: 1;
  width: 85%;
  animation: loaderPulse 1.2s ease-in-out infinite alternate;
}
#htmx-loader.complete {
  width: 100%;
  opacity: 0;
  transition: width 0.2s, opacity 0.4s 0.2s;
}
@keyframes loaderPulse {
  from { box-shadow: 0 0 6px var(--c-lime); }
  to   { box-shadow: 0 0 18px var(--c-lime), 0 0 30px rgba(200,241,53,0.4); }
}

/* ────────────────────────────────────────────────
   5. LAYOUT HELPERS
   ──────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
.container-sm { max-width: 720px; margin-inline: auto; padding-inline: var(--sp-6); }
.container-lg { max-width: 1440px; margin-inline: auto; padding-inline: var(--sp-6); }

.grid     { display: grid; }
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }

.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); } .gap-8 { gap: var(--sp-8); }

.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }

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

.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }

/* ────────────────────────────────────────────────
   6. NAVIGATION
   ──────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-nav);
  border-bottom: 1px solid rgba(200,241,53,0.1);
  transition: background var(--dur-base), box-shadow var(--dur-base),
              backdrop-filter var(--dur-base);
}
.nav.scrolled {
  background: var(--bg-nav-scroll);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--c-white);
  text-decoration: none;
}
.nav-brand-icon {
  width: 36px; height: 36px;
  background: var(--c-lime);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--c-navy);
  animation: shuttleSpin 8s linear infinite paused;
  transition: transform var(--dur-base) var(--ease-spring);
}
.nav-brand:hover .nav-brand-icon {
  animation-play-state: running;
  transform: rotate(15deg);
}
@keyframes shuttleSpin {
  to { transform: rotate(360deg); }
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.nav-link {
  position: relative;
  padding: var(--sp-2) var(--sp-4);
  color: var(--text-nav);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: color var(--dur-fast), background var(--dur-fast);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  width: 0; height: 2px;
  background: var(--c-lime);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width var(--dur-base) var(--ease-spring);
}
.nav-link:hover { color: var(--c-white); text-decoration: none; }
.nav-link:hover::after,
.nav-link.active::after { width: 70%; }
.nav-link.active { color: var(--c-lime); }

.nav-actions { display: flex; align-items: center; gap: var(--sp-3); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--sp-2);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--c-white);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-spring),
              opacity var(--dur-fast);
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: var(--bg-nav);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp-6);
    gap: var(--sp-2);
    overflow-y: auto;
    animation: mobileMenuIn var(--dur-base) var(--ease-out);
  }
  .nav-links.open { display: flex; }
  .nav-link { width: 100%; font-size: var(--text-base); padding: var(--sp-3) var(--sp-4); }
  .nav-toggle { display: flex; }
}
@keyframes mobileMenuIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ────────────────────────────────────────────────
   7. TYPOGRAPHY
   ──────────────────────────────────────────────── */
.display-1 { font-size: clamp(2.5rem, 6vw, var(--text-5xl)); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.display-2 { font-size: clamp(2rem, 4.5vw, var(--text-4xl)); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.heading-1 { font-size: var(--text-3xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
.heading-2 { font-size: var(--text-2xl); font-weight: 600; line-height: 1.3; }
.heading-3 { font-size: var(--text-xl); font-weight: 600; line-height: 1.4; }
.heading-4 { font-size: var(--text-lg); font-weight: 600; line-height: 1.4; }

.text-gradient {
  background: linear-gradient(135deg, var(--c-lime) 0%, #88e01a 50%, var(--c-lime-pale) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-muted    { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-lime     { color: var(--c-lime); }
.text-danger   { color: var(--c-danger); }
.text-success  { color: var(--c-success); }

/* ────────────────────────────────────────────────
   8. BUTTONS
   ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--border-radius);
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast),
              opacity var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  text-decoration: none;
}
.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}
.btn:disabled, .btn.htmx-request {
  opacity: 0.55;
  pointer-events: none;
  transform: none;
}

/* Ripple */
.btn::before {
  content: '';
  position: absolute;
  width: 120%; height: 120%;
  top: 50%; left: 50%;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s var(--ease-out), opacity 0.5s;
  opacity: 0;
}
.btn:active::before {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition: 0s;
}

/* Variants */
.btn-primary {
  background: var(--c-lime);
  color: var(--c-navy);
  border-color: var(--c-lime);
}
.btn-primary:hover:not(:disabled) {
  background: var(--c-lime-dim);
  box-shadow: 0 6px 20px rgba(200,241,53,0.4);
  color: var(--c-navy);
}

.btn-navy {
  background: var(--c-navy);
  color: var(--c-white);
  border-color: var(--c-navy);
}
.btn-navy:hover:not(:disabled) {
  background: var(--c-navy-light);
  box-shadow: var(--shadow-lg);
  color: var(--c-white);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--c-lime);
  color: var(--c-lime);
  background: rgba(200,241,53,0.06);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--c-danger);
  color: #fff;
  border-color: var(--c-danger);
}
.btn-danger:hover:not(:disabled) {
  background: #e0364d;
  box-shadow: 0 6px 20px rgba(255,77,109,0.35);
}

/* Sizes */
.btn-sm { padding: 6px var(--sp-3); font-size: var(--text-xs); }
.btn-lg { padding: 14px var(--sp-8); font-size: var(--text-base); }
.btn-xl { padding: 18px var(--sp-10); font-size: var(--text-lg); border-radius: var(--border-radius-lg); }

/* Loading state */
.btn-loading { gap: var(--sp-3); }
.btn-loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* HTMX request state on buttons */
.btn.htmx-request::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* ────────────────────────────────────────────────
   9. CARDS
   ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-fast);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(200,241,53,0.3);
}
.card-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.card-body  { padding: var(--sp-6); }
.card-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-hover);
}

/* Player card variant */
.player-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.player-card-cover {
  height: 80px;
  background: linear-gradient(135deg, var(--c-navy-light), var(--c-navy));
  position: relative;
  overflow: hidden;
}
.player-card-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(200,241,53,0.04) 0,
    rgba(200,241,53,0.04) 1px,
    transparent 0,
    transparent 50%
  );
  background-size: 12px 12px;
}
.player-card-cover::after {
  content: '🏸';
  position: absolute;
  right: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  opacity: 0.15;
  transition: opacity var(--dur-slow), transform var(--dur-slow) var(--ease-spring);
}
.player-card:hover .player-card-cover::after {
  opacity: 0.35;
  transform: translateY(-50%) scale(1.2) rotate(-15deg);
}
.player-card-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  background: var(--c-navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-lime);
  margin: -32px 0 0 var(--sp-5);
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--dur-base), transform var(--dur-base) var(--ease-spring);
}
.player-card:hover .player-card-avatar {
  box-shadow: 0 0 0 4px rgba(200,241,53,0.3), var(--shadow-md);
  transform: scale(1.05);
}

/* Stat card */
.stat-card {
  text-align: center;
  padding: var(--sp-6);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-card-active {
  border-color: var(--c-lime);
  box-shadow: 0 0 0 2px rgba(200,241,53,.25);
}
.stat-value {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--c-lime);
  line-height: 1;
  margin-bottom: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-delta {
  font-size: var(--text-xs);
  margin-top: var(--sp-2);
  font-weight: 600;
}
.stat-delta.up   { color: var(--c-success); }
.stat-delta.down { color: var(--c-danger); }

/* ────────────────────────────────────────────────
   10. SCOREBOARD
   ──────────────────────────────────────────────── */
.scoreboard {
  background: var(--c-navy);
  border-radius: var(--border-radius-xl);
  padding: var(--sp-6);
  color: var(--c-white);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(200,241,53,0.15);
}
.scoreboard::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(200,241,53,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.scoreboard-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-4);
  position: relative;
}
.scoreboard-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.scoreboard-team.right { align-items: center; }
.team-name {
  font-size: var(--text-sm);
  font-weight: 600;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.team-score {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s var(--ease-spring), color 0.3s;
}
.team-score.scored {
  animation: scorePop 0.5s var(--ease-spring);
  color: var(--c-lime);
}
@keyframes scorePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.scoreboard-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.scoreboard-sep {
  font-size: 2.5rem;
  font-weight: 300;
  opacity: 0.3;
  line-height: 1;
}
.scoreboard-set {
  font-size: var(--text-xs);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.scoreboard-meta {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.set-dots {
  display: flex;
  gap: var(--sp-2);
}
.set-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background var(--dur-base), transform var(--dur-base) var(--ease-spring);
}
.set-dot.won {
  background: var(--c-lime);
  transform: scale(1.25);
}

/* ────────────────────────────────────────────────
   11. BADGES & CHIPS
   ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-lime    { background: rgba(200,241,53,0.15); color: var(--c-lime-dim); border: 1px solid rgba(200,241,53,0.3); }
.badge-navy    { background: var(--c-navy); color: var(--c-white); }
.badge-success { background: rgba(54,211,153,0.12); color: var(--c-success); border: 1px solid rgba(54,211,153,0.3); }
.badge-danger  { background: rgba(255,77,109,0.12); color: var(--c-danger); border: 1px solid rgba(255,77,109,0.3); }
.badge-warning { background: rgba(255,179,71,0.12); color: var(--c-warning); border: 1px solid rgba(255,179,71,0.3); }
.badge-info    { background: rgba(59,196,242,0.12); color: var(--c-info); border: 1px solid rgba(59,196,242,0.3); }
.badge-ghost   { background: var(--bg-card-hover); color: var(--text-muted); border: 1px solid var(--border-color); }

.badge-pulse::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

/* ────────────────────────────────────────────────
   12. FORMS
   ──────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}
.form-label.required::after {
  content: ' *';
  color: var(--c-danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px var(--sp-4);
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--dur-fast),
              box-shadow var(--dur-fast),
              background var(--dur-fast);
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-lime);
  box-shadow: var(--shadow-lime);
  background: var(--bg-input);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(255,77,109,0.2);
}

.form-hint  { font-size: var(--text-xs); color: var(--text-muted); }
.form-error { font-size: var(--text-xs); color: var(--c-danger); font-weight: 500; }

/* Search input */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-group .input-icon {
  position: absolute;
  left: var(--sp-3);
  color: var(--text-muted);
  pointer-events: none;
  font-size: var(--text-lg);
}
.input-group .form-input { padding-left: var(--sp-10); }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 44px; height: 24px;
  background: var(--border-color);
  border-radius: 999px;
  position: relative;
  transition: background var(--dur-base);
  flex-shrink: 0;
}
.toggle-input:checked + .toggle-track { background: var(--c-lime); }
.toggle-thumb {
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-spring);
}
.toggle-input:checked ~ .toggle-thumb,
.toggle-input:checked + .toggle-track + .toggle-thumb {
  transform: translateX(20px);
}

/* Range slider */
.form-range {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.form-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--c-lime);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(200,241,53,0.3);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast);
}
.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px rgba(200,241,53,0.35);
}

/* ────────────────────────────────────────────────
   13. PROGRESS BAR
   ──────────────────────────────────────────────── */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}
.progress-track {
  height: 8px;
  background: var(--bg-card-hover);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c-lime-dim), var(--c-lime));
  width: 0%;
  transition: width 0.8s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.8s ease-in-out infinite;
}
@keyframes shimmer {
  to { left: 200%; }
}
.progress-bar.danger  { background: linear-gradient(90deg, #c0364d, var(--c-danger)); }
.progress-bar.warning { background: linear-gradient(90deg, #e09030, var(--c-warning)); }
.progress-bar.success { background: linear-gradient(90deg, #20b080, var(--c-success)); }

/* ────────────────────────────────────────────────
   14. TABS
   ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: var(--sp-3) var(--sp-5);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-fast), border-color var(--dur-base);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--c-lime-dim);
  border-bottom-color: var(--c-lime);
  font-weight: 600;
}

.tab-panel { display: none; animation: tabFadeIn var(--dur-base) var(--ease-out); }
.tab-panel.active { display: block; }
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ────────────────────────────────────────────────
   15. ALERTS & TOASTS
   ──────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--border-radius);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  animation: alertIn var(--dur-base) var(--ease-spring);
}
.alert.dismissing {
  animation: alertOut var(--dur-base) var(--ease-in) forwards;
}
@keyframes alertIn  {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes alertOut {
  from { opacity: 1; max-height: 100px; padding-block: var(--sp-4); }
  to   { opacity: 0; max-height: 0; padding-block: 0; margin: 0; overflow: hidden; }
}
.alert-success { background: rgba(54,211,153,0.1);  border-color: rgba(54,211,153,0.3);  color: var(--c-success); }
.alert-danger  { background: rgba(255,77,109,0.1);  border-color: rgba(255,77,109,0.3);  color: var(--c-danger); }
.alert-warning { background: rgba(255,179,71,0.1);  border-color: rgba(255,179,71,0.3);  color: var(--c-warning); }
.alert-info    { background: rgba(59,196,242,0.1);  border-color: rgba(59,196,242,0.3);  color: var(--c-info); }
.alert-icon    { font-size: 1.25rem; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.alert-close   { margin-left: auto; background: none; border: none; color: currentColor; opacity: 0.6; cursor: pointer; font-size: var(--text-lg); padding: 0; line-height: 1; }

/* Toasts */
#toast-region {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}
.toast {
  pointer-events: all;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: 360px;
  animation: toastIn var(--dur-base) var(--ease-spring);
  border-left: 4px solid var(--c-lime);
}
.toast.dismissing { animation: toastOut var(--dur-slow) var(--ease-in) forwards; }
@keyframes toastIn  {
  from { opacity: 0; transform: translateX(120%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 100px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(120%); max-height: 0; margin-bottom: calc(-1 * var(--sp-3)); }
}
.toast-success { border-left-color: var(--c-success); }
.toast-danger  { border-left-color: var(--c-danger); }
.toast-warning { border-left-color: var(--c-warning); }
.toast-info    { border-left-color: var(--c-info); }

/* ────────────────────────────────────────────────
   16. MODAL
   ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  animation: overlayIn var(--dur-base) var(--ease-out) forwards;
}
.modal-overlay.closing { animation: overlayOut var(--dur-base) var(--ease-in) forwards; }
@keyframes overlayIn  { to { opacity: 1; } }
@keyframes overlayOut { to { opacity: 0; } }

.modal {
  background: var(--bg-card);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  animation: modalIn var(--dur-base) var(--ease-spring) forwards;
}
.modal-overlay.closing .modal { animation: modalOut var(--dur-base) var(--ease-in) forwards; }
@keyframes modalIn  { to { transform: scale(1) translateY(0); } }
@keyframes modalOut { to { transform: scale(0.92) translateY(10px); opacity: 0; } }

.modal-header {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--dur-fast), transform var(--dur-fast);
  padding: var(--sp-1);
  border-radius: var(--border-radius);
}
.modal-close:hover { color: var(--text-primary); transform: rotate(90deg); }
.modal-body   { padding: var(--sp-6); }
.modal-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
}

/* ────────────────────────────────────────────────
   17. TABLE
   ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--border-radius-lg); border: 1px solid var(--border-color); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
thead { background: var(--bg-card-hover); }
th {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: background var(--dur-fast);
}
tr:last-child td { border-bottom: none; }
tbody tr {
  transition: background var(--dur-fast);
}
tbody tr:hover td { background: var(--bg-card-hover); color: var(--text-primary); }

/* Sort indicator */
th[data-sort] { cursor: pointer; }
th[data-sort]::after { content: ' ↕'; opacity: 0.3; font-size: 0.75em; }
th[data-sort="asc"]::after  { content: ' ↑'; opacity: 1; color: var(--c-lime-dim); }
th[data-sort="desc"]::after { content: ' ↓'; opacity: 1; color: var(--c-lime-dim); }

/* ────────────────────────────────────────────────
   18. SKELETON LOADERS
   ──────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-color) 0%,
    var(--bg-card-hover) 40%,
    var(--border-color) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--border-radius);
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text  { height: 16px; border-radius: 4px; margin-bottom: var(--sp-2); }
.skeleton-title { height: 24px; border-radius: 4px; width: 60%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card  { height: 120px; border-radius: var(--border-radius-lg); }
.skeleton-btn   { height: 38px; width: 120px; border-radius: var(--border-radius); }

/* HTMX-specific: show skeleton while request is in flight */
.htmx-request ~ .loading-skeleton,
[hx-indicator].htmx-request .loading-skeleton { display: block !important; }

/* ────────────────────────────────────────────────
   19. COURT DIAGRAM
   ──────────────────────────────────────────────── */
.court {
  background: #1a6b3a;
  border-radius: var(--border-radius-lg);
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border: 3px solid var(--c-navy);
  box-shadow: var(--shadow-lg), inset 0 0 40px rgba(0,0,0,0.3);
}
.court-lines {
  position: absolute;
  inset: 0;
}
.court-line {
  position: absolute;
  background: rgba(255,255,255,0.6);
}
/* Outer boundary */
.court-line.top    { top: 8%; left: 5%; right: 5%; height: 1.5px; }
.court-line.bottom { bottom: 8%; left: 5%; right: 5%; height: 1.5px; }
.court-line.left   { left: 5%; top: 8%; bottom: 8%; width: 1.5px; }
.court-line.right  { right: 5%; top: 8%; bottom: 8%; width: 1.5px; }
/* Net */
.court-line.net    { left: 50%; top: 8%; bottom: 8%; width: 2px; background: rgba(255,255,255,0.9); }
/* Service lines */
.court-line.svc-l1 { left: 5%; top: 8%; bottom: 8%; width: 1px; left: 18%; background: rgba(255,255,255,0.35); }
.court-line.svc-r1 { right: 18%; top: 8%; bottom: 8%; width: 1px; background: rgba(255,255,255,0.35); }
.court-line.svc-h  { left: 5%; right: 5%; top: 50%; height: 1px; background: rgba(255,255,255,0.35); }

.court-player {
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--c-lime);
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: var(--c-navy);
  box-shadow: 0 0 8px rgba(200,241,53,0.6);
  animation: playerPulse 2s ease-in-out infinite;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring);
}
.court-player:hover { transform: scale(1.3); }
.court-player.blue {
  background: var(--c-info);
  color: white;
  box-shadow: 0 0 8px rgba(59,196,242,0.6);
}
@keyframes playerPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(200,241,53,0.5); }
  50%       { box-shadow: 0 0 16px rgba(200,241,53,0.9); }
}

.shuttle-dot {
  position: absolute;
  width: 12px; height: 12px;
  background: white;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  animation: shuttleFloat 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shuttleFloat {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(80px, -30px) scale(0.8); }
  50%  { transform: translate(160px, 10px) scale(1); }
  75%  { transform: translate(80px, -20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ────────────────────────────────────────────────
   20. DARK MODE TOGGLE BUTTON
   ──────────────────────────────────────────────── */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform var(--dur-base) var(--ease-spring),
              background var(--dur-base),
              border-color var(--dur-fast),
              box-shadow var(--dur-fast);
  color: var(--text-primary);
}
.theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
  border-color: var(--c-lime);
  box-shadow: var(--shadow-lime);
}

/* ────────────────────────────────────────────────
   21. TIMELINE
   ──────────────────────────────────────────────── */
.timeline { position: relative; padding-left: var(--sp-8); }
.timeline::before {
  content: '';
  position: absolute;
  left: 11px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--c-lime), var(--border-color));
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  padding-bottom: var(--sp-6);
  animation: timelineIn var(--dur-slow) var(--ease-out) both;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-8) + 5px);
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--c-lime);
  border: 2px solid var(--bg-page);
  box-shadow: 0 0 0 3px rgba(200,241,53,0.3);
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base);
}
.timeline-item:hover::before {
  transform: scale(1.4);
  box-shadow: 0 0 0 5px rgba(200,241,53,0.4);
}
@keyframes timelineIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.timeline-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}
.timeline-content { font-size: var(--text-sm); color: var(--text-secondary); }

/* ────────────────────────────────────────────────
   22. HERO SECTION
   ──────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--c-navy);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(200,241,53,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 10% 80%, rgba(59,196,242,0.05) 0%, transparent 60%),
    linear-gradient(160deg, var(--c-navy) 60%, #0d2a50 100%);
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.hero-orb-1 {
  width: 400px; height: 400px;
  background: rgba(200,241,53,0.08);
  top: -100px; right: 10%;
  animation: orbFloat1 8s ease-in-out infinite;
}
.hero-orb-2 {
  width: 300px; height: 300px;
  background: rgba(59,196,242,0.06);
  bottom: -50px; left: 5%;
  animation: orbFloat2 11s ease-in-out infinite;
}
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(-30px, 30px) scale(1.1); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(20px, -20px) scale(0.95); }
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: var(--sp-16) 0;
  color: var(--c-white);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(200,241,53,0.12);
  border: 1px solid rgba(200,241,53,0.25);
  color: var(--c-lime);
  padding: 6px var(--sp-4);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-6);
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-5);
}
.hero-subtitle {
  font-size: var(--text-lg);
  color: rgba(245,247,250,0.7);
  max-width: 540px;
  margin-bottom: var(--sp-8);
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* ────────────────────────────────────────────────
   23. SECTION & UTILITY CLASSES
   ──────────────────────────────────────────────── */
.section { padding-block: var(--sp-16); }
.section-sm { padding-block: var(--sp-10); }
.section-header { margin-bottom: var(--sp-10); }
.section-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-lime-dim);
  margin-bottom: var(--sp-3);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  border: none;
  margin-block: var(--sp-8);
}

.surface {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
}

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* HTMX transition helpers — use on partial swap targets */
.fade-target {
  transition: opacity var(--dur-base) var(--ease-out);
}
.fade-target.htmx-swapping   { opacity: 0; }
.fade-target.htmx-settling   { opacity: 0; }

.slide-target {
  transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-out);
}
.slide-target.htmx-swapping {
  opacity: 0;
  transform: translateY(-8px);
}
.slide-target.htmx-settling {
  opacity: 0;
  transform: translateY(8px);
}

/* ────────────────────────────────────────────────
   24. RESPONSIVE
   ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --nav-height: 56px; }
  .hero { min-height: 70vh; }
}

@media (max-width: 768px) {
  .container { padding-inline: var(--sp-4); }
  .card-body  { padding: var(--sp-4); }
  .card-header { padding: var(--sp-4); }
  .modal { max-width: 100%; margin: var(--sp-4); border-radius: var(--border-radius-lg); }
  #toast-region { left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); }
  .toast { max-width: 100%; }
  .scoreboard-inner { gap: var(--sp-2); }
}

/* ────────────────────────────────────────────────
   25. ANIMATIONS — Reveal on scroll
   ──────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0ms;   opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 60ms;  opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 120ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 180ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 240ms; opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 300ms; opacity: 1; transform: none; }

/* ────────────────────────────────────────────────
   APP-SPECIFIC EXTENSIONS
   Components from the original Tailwind layer that
   are not already covered by SHUTTLE v2 above.
   ──────────────────────────────────────────────── */

/* Page-mode backgrounds */
.app-public {
  background: radial-gradient(circle at top, rgba(11,31,58,0.06) 0%, var(--bg-page) 60%);
}
.app-admin {
  background-color: var(--bg-page);
}
.app-admin main {
  background-image: linear-gradient(to bottom, rgba(11,31,58,0.03), transparent);
}

/* Navbar variants */
.navbar-public {
  background: linear-gradient(90deg, var(--c-navy) 0%, var(--c-navy-light) 100%);
}
.navbar-admin {
  background: linear-gradient(90deg, #060D16 0%, var(--c-navy) 100%);
  border-bottom: 1px solid rgba(200,241,53,0.12);
}

/* Admin dashboard components */
.admin-dashboard-header {
  border-radius: var(--border-radius-lg);
  padding: var(--sp-4);
  background: linear-gradient(135deg, rgba(11,31,58,0.07) 0%, rgba(11,31,58,0.02) 100%);
  border: 1px solid var(--border-color);
}
.admin-stat-card {
  position: relative;
  overflow: hidden;
  border-color: var(--border-color);
}
.admin-stat-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--c-navy), var(--c-navy-light));
}
.admin-empty-state {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-12) var(--sp-8);
  min-height: 220px;
}

/* Score display */
.score-display {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-large  { font-size: clamp(3rem, 8vw, 5rem); }
.score-medium { font-size: clamp(2rem, 5vw, 3rem); }

/* Match card */
.match-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.match-card-header {
  padding: 10px var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--bg-card-hover);
  border-bottom: 1px solid var(--border-color);
}
.match-card-body { padding: var(--sp-4); }

/* Live badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--c-danger);
  color: #fff;
}
.live-badge::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: livePulse 1.2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Badge status variants */
.badge-live      { background: rgba(255,77,109,0.12);  color: var(--c-danger); }
.badge-completed { background: rgba(54,211,153,0.12);  color: var(--c-success); }
.badge-scheduled { background: rgba(59,196,242,0.12);  color: var(--c-info); }
.badge-walkover  { background: rgba(255,179,71,0.12);  color: var(--c-warning); }

/* Team row */
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-color);
}
.team-row:last-child { border-bottom: none; }
.team-row.winner { background: rgba(54,211,153,0.08); }

/* Court display (full-screen scoreboard) */
.court-display {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--c-navy) 0%, #060D16 100%);
}
.court-display .score-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.court-display .team-name {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--sp-4);
}
.court-display .team-points {
  font-size: clamp(6rem, 18vw, 12rem);
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
}

/* Tournament bracket */
.bracket {
  display: flex;
  gap: var(--sp-8);
  overflow-x: auto;
  padding-block: var(--sp-4);
}
.bracket-round {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 250px;
}
.bracket-match {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.bracket-team {
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.bracket-team:last-child { border-bottom: none; }
.bracket-team.winner { background: rgba(54,211,153,0.08); font-weight: 600; }

/* Modal — backward-compat aliases for .modal-backdrop / .modal-content
   (existing templates use these class names) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
@media (max-width: 767px) {
  .modal-backdrop { padding-bottom: 4rem; }
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 42rem;
  width: calc(100% - 2rem);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.modal-header {
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-body {
  padding: var(--sp-6);
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}
@media (max-width: 640px) {
  .modal-footer { flex-direction: column-reverse; }
}

/* Form input extras */
.input-pin {
  text-align: center;
  font-size: var(--text-2xl);
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
}

/* Offline indicator */
#offline-indicator {
  position: fixed;
  bottom: 80px;
  left: var(--sp-4);
  display: none;
  align-items: center;
  gap: var(--sp-2);
  background: var(--c-warning);
  color: var(--c-navy);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 9000;
}

/* Score flash animation */
@keyframes scoreFlash {
  0%   { background: rgba(200,241,53,0.45); }
  100% { background: transparent; }
}
.animate-score-flash { animation: scoreFlash 0.5s ease-out; }

/* Responsive show/hide utilities */
@media (max-width: 767px)  { .hide-on-mobile { display: none !important; } }
@media (min-width: 768px)  { .show-on-mobile { display: none !important; } }

/* Print utilities */
@media print {
  .print-hidden { display: none !important; }
  .print-only   { display: block !important; }
}

/* ── Table row utilities ──────────────────────────────────────── */
.user-row { }
.user-row-expired { background: rgba(255,77,109,.06); }
.tournament-row   { }

/* ── Filter tabs (pill variant) ─────────────────────────────── */
.filter-tab {
  padding: 5px 14px;
  border: none;
  background: transparent;
  border-radius: calc(var(--border-radius-lg) - 3px);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur-base), color var(--dur-base);
  white-space: nowrap;
}
.filter-tab:hover {
  background: rgba(0,0,0,.05);
  color: var(--text-primary);
}
/* Canonical active class — single-dash */
.filter-tab-active,
.filter-tab--active {
  background: var(--c-navy);
  color: var(--c-white);
  font-weight: 600;
}
[data-theme="dark"] .filter-tab-active,
[data-theme="dark"] .filter-tab--active {
  background: var(--c-lime);
  color: var(--text-primary);
}
[data-theme="dark"] .filter-tab:hover:not(.filter-tab-active):not(.filter-tab--active) {
  background: rgba(255,255,255,.08);
  color: var(--c-white);
}

/* ── Timeline component (tl-*) ──────────────────────────────── */
.tl-list { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: var(--sp-4); align-items: flex-start; }
.tl-icon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}
.tl-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.tl-dot-done { background: var(--c-lime); border-color: var(--c-lime); color: var(--text-primary); }
.tl-dot-cur  { border-color: var(--c-lime); border-width: 2px; background: var(--bg-card); }
.tl-dot-end.tl-dot-cur,
.tl-dot-end.tl-dot-done { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.tl-dot-inner { width: 10px; height: 10px; border-radius: 50%; background: var(--c-lime); }
.tl-connector { width: 2px; flex: 1; min-height: 24px; background: var(--border-color); margin: 2px 0; }
.tl-done .tl-connector     { background: var(--c-lime); }
.tl-item-last .tl-connector { display: none; }
.tl-body { flex: 1; padding: var(--sp-1) 0 var(--sp-5); }
.tl-item-last .tl-body { padding-bottom: 0; }
.tl-body-current {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
}
.tl-body-active { border-color: rgba(200,241,53,.45); background: rgba(200,241,53,.04); }
.tl-body-end    { border-color: rgba(255,77,109,.4); background: var(--c-danger); }
.tl-body-end .tl-label,
.tl-body-end .tl-date { color: #fff !important; }
.tl-label { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin: 0 0 2px; }
.tl-future .tl-label { color: var(--text-muted); }
.tl-date { font-size: var(--text-xs); color: var(--text-muted); }
.tl-done .tl-date { color: var(--text-secondary); }
.tl-edit-form { margin-top: var(--sp-3); }

/* ── Score entry (score-btn, serving-dot, point-history) ─────── */
.score-btn {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: none;
  font-size: 2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.score-btn:hover  { transform: scale(1.06); box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.score-btn:active { transform: scale(0.94); }

.serving-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c-warning);
  animation: servePulse 1.5s infinite;
  display: inline-block;
}
@keyframes servePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.point-history { max-height: 220px; overflow-y: auto; }

/* ── Status dot (offline page) ──────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: var(--sp-2);
  background: var(--c-danger);
  vertical-align: middle;
}
.status-dot.online { background: var(--c-success); }
@keyframes syncPulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.syncing { animation: syncPulse 1.5s infinite; }

/* ────────────────────────────────────────────────
   END OF SHUTTLE v2
   ──────────────────────────────────────────────── */
