/* ==========================================================================
   LAST YARD ULTRA — HIGH PERFORMANCE DESIGN SYSTEM (PRO ATHLETIC LUXURY)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600;700;800;900&display=swap');

:root {
  --bg-deep: #05080C;
  --bg-subtle: #090E15;
  --bg-card: rgba(14, 21, 30, 0.72);
  --bg-card-hover: rgba(20, 30, 44, 0.85);
  --bg-glass: rgba(18, 27, 39, 0.6);
  --bg-input: #101722;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-dim: #475569;
  
  /* Vibrant Athletic Accents */
  --accent-trail: #00E676;         /* Laser Jade Green (Active/Pace) */
  --accent-trail-glow: rgba(0, 230, 118, 0.35);
  --accent-corral: #FF6D00;        /* Hazard Corral Orange (Alert/Whistles) */
  --accent-corral-glow: rgba(255, 109, 0, 0.35);
  --accent-danger: #FF334B;        /* Crimson DNF / Emergency SOS */
  --accent-danger-glow: rgba(255, 51, 75, 0.35);
  --accent-cyan: #00F0FF;          /* Telemetry Cyan */
  --accent-gold: #FFD700;
  
  /* Borders & Glass */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(0, 230, 118, 0.6);
  
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-card: 0 16px 36px -10px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-glow: 0 0 30px rgba(0, 230, 118, 0.25);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 230, 118, 0.07) 0%, transparent 60%),
    radial-gradient(circle at 100% 30%, rgba(0, 240, 255, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 0% 70%, rgba(255, 109, 0, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-trail);
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */

.header {
  background: rgba(8, 12, 18, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1.5px solid rgba(0, 230, 118, 0.4);
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.25);
  transition: var(--transition);
}

.logo-group:hover .brand-logo-img {
  transform: scale(1.05);
  border-color: var(--accent-trail);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.5);
}

.logo-badge {
  background: linear-gradient(135deg, var(--accent-trail), #00C853);
  color: #000;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.logo-title {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.lang-btn.active {
  background: var(--accent-trail);
  color: #000;
  font-weight: 800;
}

.nav-legal-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.nav-legal-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-trail);
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-trail);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-trail);
  animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px var(--accent-trail); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* ==========================================================================
   MAIN LAYOUT & HUD CARDS
   ========================================================================== */

.main-content {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 6rem;
  flex: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.card-ambient-glow {
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

/* Timer HUD Card */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: linear-gradient(145deg, rgba(14, 21, 30, 0.85) 0%, rgba(9, 14, 22, 0.95) 100%);
  border: 1px solid rgba(0, 230, 118, 0.25);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(0, 230, 118, 0.2);
}

.yard-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-trail);
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.timer-countdown {
  font-family: var(--font-mono);
  font-size: 4.8rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #fff;
  text-shadow: 0 0 35px rgba(255, 255, 255, 0.25);
  margin: 0.25rem 0;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .timer-countdown {
    font-size: 3.6rem;
  }
}

.timer-subtext {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Whistle Ticks */
.whistle-ticker {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.whistle-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  transition: var(--transition);
}

.whistle-pill.active {
  background: rgba(255, 109, 0, 0.2);
  border-color: var(--accent-corral);
  color: var(--accent-corral);
  box-shadow: 0 0 10px rgba(255, 109, 0, 0.3);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  height: 100%;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: var(--transition);
}

.stat-box:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 0.35rem;
}

/* ==========================================================================
   SEGMENTED CONTROL (TABS)
   ========================================================================== */

.nav-tabs {
  display: flex;
  gap: 0.4rem;
  background: rgba(14, 21, 30, 0.6);
  backdrop-filter: blur(15px);
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   LEADERBOARD TABLE
   ========================================================================== */

.table-container {
  overflow-x: auto;
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.8px;
  border: none;
}

td {
  padding: 1rem;
  background: rgba(20, 29, 41, 0.5);
  border-top: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition);
}

tr td:first-child {
  border-left: 1px solid var(--border-glass);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

tr td:last-child {
  border-right: 1px solid var(--border-glass);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

tr:hover td {
  background: rgba(28, 41, 58, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}

.bib-pill {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.95rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-glass);
}

.runner-name {
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.status-active {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-trail);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.status-finished {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.status-dnf {
  background: rgba(255, 51, 75, 0.15);
  color: var(--accent-danger);
  border: 1px solid rgba(255, 51, 75, 0.3);
}

/* ==========================================================================
   BUTTONS & INPUTS
   ========================================================================== */

.btn-primary {
  background: linear-gradient(135deg, var(--accent-trail), #00C853);
  color: #000;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 230, 118, 0.3);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 230, 118, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Breath Trainer Circle */
.breath-indicator {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.25) 0%, rgba(0, 240, 255, 0.05) 70%);
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.35), inset 0 0 25px rgba(0, 240, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 1s ease-in-out, border-color 0.5s ease;
  user-select: none;
}

.breath-indicator.inhale {
  transform: scale(1.35);
  border-color: var(--accent-trail);
  box-shadow: 0 0 50px rgba(0, 230, 118, 0.5), inset 0 0 30px rgba(0, 230, 118, 0.3);
}

.breath-indicator.hold {
  transform: scale(1.35);
  border-color: var(--accent-gold);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.3);
}

.breath-indicator.exhale {
  transform: scale(0.85);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.35);
}

/* SOS Floating Button */
.sos-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, var(--accent-danger), #D50000);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 0.95rem;
  padding: 0.85rem 1.4rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 30px rgba(255, 51, 75, 0.5);
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.sos-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(255, 51, 75, 0.7);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: rgba(15, 23, 34, 0.95);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  position: relative;
}

/* Athlete Pass & Hologram */
.digital-bib-pass {
  background: linear-gradient(135deg, rgba(20, 30, 45, 0.9), rgba(10, 16, 24, 0.95));
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.digital-bib-pass::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-trail), var(--accent-cyan), transparent);
  animation: hologramSweep 4s infinite linear;
}

@keyframes hologramSweep {
  0% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* Payment Selector Cards */
.pay-option-card {
  background: rgba(16, 24, 35, 0.7);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pay-option-card:hover {
  border-color: rgba(0, 230, 118, 0.5);
  background: rgba(20, 32, 48, 0.85);
  transform: translateY(-2px);
}

.pay-option-card.selected {
  border-color: var(--accent-trail);
  background: rgba(0, 230, 118, 0.08);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.15);
}

/* 54-FZ Fiscal Receipt Styling */
.fiscal-receipt-box {
  background: #0D131C;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  position: relative;
}

.fiscal-receipt-header {
  text-align: center;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.fiscal-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

