/* ============================================
   RURAL PREMIUM DESIGN SYSTEM
   Clip Shearing Portal — Refined Woolshed Theme
   ============================================ */

/* ============================================
   1. DESIGN TOKENS
   ============================================ */
:root {
  /* === RURAL PREMIUM PALETTE === */
  --bg-primary:        #1a1a2e;
  --bg-surface:        #16213e;
  --bg-elevated:       #0f3460;
  --bg-overlay:        rgba(26, 26, 46, 0.95);
  --bg-inset:          rgba(0, 0, 0, 0.2);

  --accent-gold:       #b8965a;
  --accent-gold-hover: #cba76a;
  --accent-gold-muted: rgba(184, 150, 90, 0.2);
  --accent-gold-subtle: rgba(184, 150, 90, 0.08);

  --text-primary:      #f5f0e8;
  --text-secondary:    rgba(245, 240, 232, 0.85);
  --text-muted:        rgba(245, 240, 232, 0.6);
  --text-dark:         #1a1a2e;
  --text-link:         #6CA0DC;
  --text-link-hover:   #87CEEB;

  --border-color:      rgba(201, 168, 76, 0.2);
  --border-subtle:     rgba(245, 240, 232, 0.1);

  --success:           #4ade80;
  --warning:           #fbbf24;
  --error:             #f87171;
  --info:              #60a5fa;

  /* Status Colors (draw) */
  --status-paid:       rgba(74, 222, 128, 0.9);
  --status-arrived:    rgba(251, 191, 36, 0.9);
  --status-unpaid:     rgba(248, 113, 113, 0.9);

  /* Position badges */
  --gold:              #FFD700;
  --silver:            #C0C0C0;
  --bronze:            #CD7F32;

  /* === FLUID TYPOGRAPHY === */
  --font-size-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --font-size-sm:   clamp(0.875rem, 0.825rem + 0.25vw, 1rem);
  --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --font-size-lg:   clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
  --font-size-xl:   clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --font-size-2xl:  clamp(1.5rem, 1.35rem + 0.75vw, 2rem);
  --font-size-3xl:  clamp(2rem, 1.75rem + 1.25vw, 3rem);

  --line-height-tight:   1.25;
  --line-height-normal:  1.5;
  --line-height-relaxed: 1.75;

  --font-family-heading: 'Bebas Neue', 'Impact', sans-serif;
  --font-family-body:    'Roboto', 'Arial', sans-serif;
  --font-family-mono:    'Courier New', monospace;

  /* === RESPONSIVE SPACING === */
  --space-xs:  clamp(0.25rem, 0.5vw, 0.5rem);
  --space-sm:  clamp(0.5rem, 1vw, 0.75rem);
  --space-md:  clamp(0.75rem, 2vw, 1rem);
  --space-lg:  clamp(1rem, 2.5vw, 1.5rem);
  --space-xl:  clamp(1.5rem, 3vw, 2rem);
  --space-2xl: clamp(2rem, 4vw, 3rem);
  --space-3xl: clamp(3rem, 6vw, 4rem);

  --container-padding:   clamp(0.75rem, 3vw, 2rem);
  --container-max-width: 100%;

  /* === TOUCH TARGETS === */
  --touch-target-min:         44px;
  --touch-target-comfortable: 48px;
  --touch-target-large:       56px;

  /* === BORDER RADIUS === */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* === SHADOWS === */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);

  /* === TRANSITIONS === */
  --transition-fast:   150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow:   350ms ease-in-out;

  /* === Z-INDEX SCALE === */
  --z-dropdown:       1000;
  --z-sticky:         1020;
  --z-fixed:          1030;
  --z-modal-backdrop: 1040;
  --z-modal:          1050;
  --z-popover:        1060;
  --z-tooltip:        1070;

  /* === BACKWARDS COMPAT ALIASES (remove after full migration) === */
  --background-primary:   var(--bg-primary);
  --background-secondary: var(--bg-surface);
  --background-tertiary:  var(--bg-elevated);
  --background-overlay:   var(--bg-overlay);
  --wool-white:           var(--text-primary);
  --wool-cream:           var(--accent-gold);
  --wood-dark:            var(--bg-primary);
  --wood-medium:          var(--bg-elevated);
  --wood-light:           var(--accent-gold);
  --wood-lighter:         var(--accent-gold-hover);
  --primary-text:         var(--text-primary);
  --secondary-text:       var(--text-secondary);
  --status-success:       var(--success);
  --status-warning:       var(--warning);
  --status-error:         var(--error);
  --heading-font:         var(--font-family-heading);
  --content-font:         var(--font-family-body);
  --decorative-font:      var(--font-family-heading);
  --background-color:     var(--bg-primary);
}

/* Desktop breakpoints */
@media (min-width: 768px)  { :root { --container-max-width: 720px; } }
@media (min-width: 992px)  { :root { --container-max-width: 960px; } }
@media (min-width: 1200px) { :root { --container-max-width: 1140px; } }
@media (min-width: 1400px) { :root { --container-max-width: 1320px; } }


/* ============================================
   2. BASE STYLES
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-family: var(--font-family-heading);
  font-weight: 400;
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}
h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover, a:focus { color: var(--text-link-hover); text-decoration: underline; }
a:focus { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

img { max-width: 100%; height: auto; display: block; }

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

ul, ol { margin-top: 0; margin-bottom: var(--space-md); padding-left: var(--space-xl); }
li { margin-bottom: var(--space-xs); }

table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-lg); }
th, td { padding: var(--space-sm); text-align: left; border-bottom: 1px solid var(--border-subtle); }
th { font-weight: 500; color: var(--text-primary); background-color: var(--bg-surface); }


/* ============================================
   3. UTILITY CLASSES
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Spacing */
.mt-0 { margin-top: 0 !important; }
.mt-xs { margin-top: var(--space-xs) !important; }
.mt-sm { margin-top: var(--space-sm) !important; }
.mt-md { margin-top: var(--space-md) !important; }
.mt-lg { margin-top: var(--space-lg) !important; }
.mt-xl { margin-top: var(--space-xl) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-xs { margin-bottom: var(--space-xs) !important; }
.mb-sm { margin-bottom: var(--space-sm) !important; }
.mb-md { margin-bottom: var(--space-md) !important; }
.mb-lg { margin-bottom: var(--space-lg) !important; }
.mb-xl { margin-bottom: var(--space-xl) !important; }
.p-0 { padding: 0 !important; }
.p-xs { padding: var(--space-xs) !important; }
.p-sm { padding: var(--space-sm) !important; }
.p-md { padding: var(--space-md) !important; }
.p-lg { padding: var(--space-lg) !important; }
.p-xl { padding: var(--space-xl) !important; }

/* Text */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-heading { font-family: var(--font-family-heading) !important; }
.font-body { font-family: var(--font-family-body) !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.align-start { align-items: flex-start !important; }
.align-center { align-items: center !important; }
.align-end { align-items: flex-end !important; }

.gap-xs { gap: var(--space-xs) !important; }
.gap-sm { gap: var(--space-sm) !important; }
.gap-md { gap: var(--space-md) !important; }
.gap-lg { gap: var(--space-lg) !important; }
.gap-xl { gap: var(--space-xl) !important; }

/* Responsive display */
@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
  .d-md-grid { display: grid !important; }
}
@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
  .d-lg-grid { display: grid !important; }
}

/* Touch targets */
.touch-target {
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.touch-target-comfortable {
  min-width: var(--touch-target-comfortable);
  min-height: var(--touch-target-comfortable);
}
.touch-target-large {
  min-width: var(--touch-target-large);
  min-height: var(--touch-target-large);
}


/* ============================================
   4. BUTTON SYSTEM
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch-target-comfortable);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: var(--line-height-normal);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — gold fill (use sparingly for main CTAs) */
.btn-primary {
  color: var(--text-dark);
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--accent-gold-hover);
  border-color: var(--accent-gold-hover);
  text-decoration: none;
  color: var(--text-dark);
}

/* Secondary — outlined gold */
.btn-secondary {
  color: var(--accent-gold);
  background-color: transparent;
  border-color: var(--accent-gold);
}
.btn-secondary:hover, .btn-secondary:focus {
  color: var(--text-dark);
  background-color: var(--accent-gold);
  text-decoration: none;
}

/* Ghost — subtle outline */
.btn-ghost {
  color: var(--text-secondary);
  background-color: transparent;
  border-color: var(--border-subtle);
}
.btn-ghost:hover, .btn-ghost:focus {
  color: var(--text-primary);
  background-color: rgba(245, 240, 232, 0.1);
  border-color: var(--text-muted);
  text-decoration: none;
}

/* Button sizes */
.btn-sm {
  min-height: var(--touch-target-min);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
}
.btn-lg {
  min-height: var(--touch-target-large);
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--font-size-lg);
}

/* Icon button (SVG inside) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-target-comfortable);
  min-height: var(--touch-target-comfortable);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.icon-btn:hover {
  color: var(--text-primary);
  background: rgba(245, 240, 232, 0.1);
}
.icon-btn:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}
.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Button icon (inside .btn) */
.button-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
.button-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button-text {
  font-size: var(--font-size-sm);
  letter-spacing: 0.3px;
  vertical-align: middle;
}

/* Export buttons — ghost variant */
.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-md);
  background: rgba(245, 240, 232, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: var(--touch-target-min);
}
.export-button:hover {
  background: rgba(245, 240, 232, 0.15);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Upsell button */
.upsell-button {
  background: var(--accent-gold);
  color: var(--text-dark);
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.upsell-button:hover { background: var(--accent-gold-hover); }

/* Link button */
.link-button {
  background: none;
  border: none;
  color: var(--text-link);
  font-size: var(--font-size-sm);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast);
}
.link-button:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

/* Old rustic button variant aliases — action buttons use ghost style */
.rustic-button,
.draw-button,
.nav-draw-button,
.results-button,
.nav-results-button,
.story-button,
.video-button,
.nav-news-button,
.nav-home-button,
.nav-back-button,
.retry-button,
.competition-button {
  color: var(--text-secondary);
  background-color: rgba(245, 240, 232, 0.06);
  border: 1.5px solid var(--border-subtle);
  font-weight: 500;
}
.rustic-button:hover,
.draw-button:hover,
.nav-draw-button:hover,
.results-button:hover,
.nav-results-button:hover,
.story-button:hover,
.video-button:hover,
.nav-news-button:hover,
.nav-home-button:hover,
.nav-back-button:hover,
.retry-button:hover,
.competition-button:hover {
  color: var(--text-primary);
  background-color: rgba(245, 240, 232, 0.12);
  border-color: var(--text-muted);
}

/* CTA buttons — outlined gold, not solid fill */
.live-stream-button,
.competitor-entry-button,
.ticket-buy-button,
.admin-button {
  color: var(--accent-gold);
  background-color: transparent;
  border: 1.5px solid var(--accent-gold);
  font-weight: 600;
}
.live-stream-button:hover,
.competitor-entry-button:hover,
.ticket-buy-button:hover,
.admin-button:hover {
  color: var(--text-dark);
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
}


/* ============================================
   5. CARD SYSTEM
   ============================================ */
.card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.card-header {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
}
.card-body { padding: var(--space-lg); flex: 1; }
.card-footer {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--bg-elevated);
  border-top: 1px solid var(--border-color);
}
.card-title {
  margin: 0;
  font-size: var(--font-size-xl);
  font-family: var(--font-family-heading);
  color: var(--text-primary);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge--success { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.badge--warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge--error   { background: rgba(248, 113, 113, 0.15); color: var(--error); }
.badge--info    { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge--gold    { background: var(--accent-gold-muted); color: var(--accent-gold); }


/* ============================================
   6. GRID SYSTEM
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 768px) {
  .grid-md-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-md-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .grid-lg-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-lg-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-lg-4 { grid-template-columns: repeat(4, 1fr); }
}
.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}


/* ============================================
   7. PAGE LAYOUT
   ============================================ */

/* WASM app layout — only activates when .page-header is present (WASM routes) */
#app:has(.page-header) {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-shell {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.app-content {
  min-height: 0;
}

/* Page header — stays pinned at top of #app flex column */
.page-header {
  flex-shrink: 0;
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 56px;
  padding: 0 var(--container-padding);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

/* Server page header — sticky variant for server-rendered pages */
.server-page-header {
  position: sticky;
  top: 0;
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 56px;
  padding: 0 var(--container-padding);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}
.server-page-title {
  flex: 1;
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}
.page-title {
  flex: 1;
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Common page containers (compat with existing markup) */
.portal-container,
.shearing-shed {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}
.event-list {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}
@media (max-width: 576px) {
  .portal-container, .shearing-shed, .event-list {
    padding: 0.25rem;
  }
  .blackboard-frame {
    border-radius: 0;
    padding: 0.75rem;
    border-left: none;
    border-right: none;
  }
}
.blackboard-frame {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}


/* ============================================
   8. MOBILE NAVIGATION
   ============================================ */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 var(--container-padding);
  z-index: var(--z-fixed);
}

.nav-toggle {
  width: var(--touch-target-comfortable);
  height: var(--touch-target-comfortable);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}
.nav-toggle:hover, .nav-toggle:focus {
  background-color: rgba(245, 240, 232, 0.1);
}
.nav-toggle:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.hamburger-icon {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  position: relative;
  transition: background-color var(--transition-fast);
}
.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  left: 0;
  transition: transform var(--transition-normal);
}
.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { bottom: -8px; }

/* Nav overlay — only visible when menu is open (rendered conditionally in Blazor) */
.nav-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal-backdrop);
}

/* Slide-out menu */
.nav-menu {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: min(80%, 320px);
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  padding: var(--space-lg);
  z-index: var(--z-modal);
  overflow-y: auto;
  animation: slideIn var(--transition-normal);
  box-shadow: var(--shadow-xl);
}
.nav-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: var(--touch-target-comfortable);
  height: var(--touch-target-comfortable);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-2xl);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}
.nav-close:hover, .nav-close:focus {
  background-color: rgba(245, 240, 232, 0.1);
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: var(--space-xl) 0 0 0;
}
.nav-links li { margin-bottom: var(--space-sm); }
.nav-links a {
  display: flex;
  align-items: center;
  padding: var(--space-md);
  font-size: var(--font-size-lg);
  font-family: var(--font-family-heading);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  min-height: var(--touch-target-comfortable);
}
.nav-links a:hover, .nav-links a:focus {
  background-color: rgba(245, 240, 232, 0.1);
  text-decoration: none;
}
.nav-links a.active {
  background-color: var(--bg-elevated);
  color: var(--accent-gold);
}

/* Nav sections (session groupings) */
.nav-section { margin-bottom: var(--space-lg); }
.nav-section-title {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-subsection { list-style: none; padding: 0; margin: 0; }
.nav-subsection li { margin-bottom: var(--space-xs); }
.nav-subsection a { padding-left: var(--space-xl); font-size: var(--font-size-base); }

/* Nav divider */
.nav-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: var(--space-lg) 0;
  list-style: none;
}

/* Nav link buttons (for full-page navigation) */
.nav-link-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-md);
  font-size: var(--font-size-lg);
  font-family: var(--font-family-heading);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  min-height: var(--touch-target-comfortable);
  background: none;
  border: none;
  cursor: pointer;
  gap: 0.5rem;
  text-align: left;
}
.nav-link-btn:hover, .nav-link-btn:focus {
  background-color: rgba(245, 240, 232, 0.1);
}

/* Nav account section (signed in state) */
.nav-account-section {
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  background: rgba(245, 240, 232, 0.05);
  border-radius: var(--radius-md);
  list-style: none;
}
.nav-account-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.nav-account-name svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.nav-account-sub {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--accent-gold);
  font-weight: 500;
  padding-left: 1.75rem;
}
.nav-account-sub--none {
  color: var(--text-muted);
}

/* Sign out link */
.nav-signout {
  color: var(--text-muted) !important;
}
.nav-signout:hover {
  color: var(--error) !important;
}

/* Sign in link in nav */
.nav-signin {
  color: var(--text-primary) !important;
}
.nav-link-btn .button-icon {
  width: 20px;
  height: 20px;
}

/* Subscribe link in nav — gold accent */
.nav-subscribe {
  color: var(--accent-gold) !important;
  font-weight: 600;
  gap: 0.5rem;
}
.nav-subscribe:hover, .nav-subscribe:focus {
  background-color: var(--accent-gold-muted) !important;
  color: var(--accent-gold) !important;
}
.nav-subscribe .button-icon {
  width: 20px;
  height: 20px;
}

@media (min-width: 992px) {
  .mobile-nav { display: none; }
}

/* Navigation bar (in-page) */
.navigation-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}
/* Breadcrumb buttons — high contrast on dark body */
.navigation-bar .rustic-button,
.navigation-bar .btn {
  color: var(--text-primary);
  background: rgba(245, 240, 232, 0.1);
  border-color: rgba(245, 240, 232, 0.25);
}
.navigation-bar .rustic-button:hover,
.navigation-bar .btn:hover {
  color: var(--accent-gold);
  background: var(--accent-gold-muted);
  border-color: var(--accent-gold);
}
.nav-buttons {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Event actions row */
.event-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: flex-start;
}
.event-actions .btn,
.event-actions .rustic-button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-size: var(--font-size-sm);
  flex-direction: column;
  text-align: center;
  gap: 0.2rem;
}
.event-actions .button-icon {
  display: block;
  margin: 0 auto;
}
.event-actions .button-text {
  display: block;
  font-size: var(--font-size-xs);
}
.card-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}


/* ============================================
   9. MODAL SYSTEM
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: var(--z-modal-backdrop);
  animation: fadeIn var(--transition-fast);
}
.modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  z-index: var(--z-modal);
  overflow-y: auto;
  max-height: 90vh;
  max-width: 90vw;
  animation: scaleIn var(--transition-normal);
  box-shadow: var(--shadow-xl);
}
.modal-panel--photo {
  padding: 1.5rem;
  text-align: center;
  min-width: 200px;
}
.modal-panel--photo img {
  max-width: 400px;
  max-height: 400px;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: contain;
  margin: 0 auto;
}
.modal-panel--photo p {
  margin-top: 1rem;
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}
.modal-panel--newspaper {
  width: min(90vw, 900px);
  max-height: 90vh;
  padding: 0;
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1;
  transition: background var(--transition-fast);
}
.modal-close:hover { background: rgba(0, 0, 0, 0.5); }


/* ============================================
   10. COMPETITION & EVENT CARDS
   ============================================ */

/* Competition header */
.competition-header,
.shed-title-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
}
.portal-logo,
.competition-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.portal-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-3xl);
  color: var(--text-primary);
  margin: 0;
}
.competition-name,
.competition-head {
  font-family: var(--font-family-heading);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin: 0;
  color: var(--text-primary);
}
.competition-date {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin: 0;
}
.competition-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Events grid */
.events-grid,
.card-container {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Competition card */
.competition-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.competition-card:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

/* Event card */
.event-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.event-card:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.event-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.event-name {
  font-size: var(--font-size-base);
  margin: 0;
  font-weight: 500;
  color: var(--text-primary);
}
.event-headline {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0.5rem 0;
  cursor: pointer;
  font-style: italic;
}
.sponsor-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Venue info */
.venue-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  padding: 0.25rem 0.5rem;
  background: rgba(245, 240, 232, 0.05);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.venue-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.7;
}
.venue-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* Headline button */
.headline-button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  padding: 0.625rem 0.75rem;
  margin: 0.5rem 0;
  font-weight: normal;
  border-radius: var(--radius-md);
  background: rgba(245, 240, 232, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.headline-button:hover {
  background: rgba(245, 240, 232, 0.1);
}
.headline-text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-sm);
  line-height: 1.3;
}

/* Video play button icon */
.video-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 24px;
  color: var(--text-primary);
  background: var(--accent-gold-muted);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}
.video-action-button:hover .video-btn-icon {
  background: rgba(201, 168, 76, 0.4);
}

/* Session styles */
.session {
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.session-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
}
/* Session live stream players — max 3 across on desktop */
.session-streams {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 992px) {
  .session-streams { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .session-streams { grid-template-columns: 1fr; }
}
.session-stream-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}
.stream-title {
  padding: 0.5rem 0.75rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.15);
}
/* Upsell overlay for non-subscribers */
.stream-upsell {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-elevated) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stream-upsell-inner {
  text-align: center;
  padding: 1.5rem;
  max-width: 320px;
}
.stream-upsell-inner h4 {
  color: var(--accent-gold);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  margin: 0 0 0.5rem;
}
.stream-upsell-inner p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin: 0 0 1rem;
}
.stream-upsell-options {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  justify-content: center;
}
.stream-upsell-option {
  padding: 0.5rem 0.75rem;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  flex: 1;
}
.stream-upsell-option strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  margin-bottom: 0.2rem;
}
.stream-upsell-option span {
  display: block;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}
.btn-subscribe-stream {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--accent-gold);
  color: var(--text-dark);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.btn-subscribe-stream:hover {
  background: var(--accent-gold-hover);
}
.stream-signin-hint {
  margin-top: 0.75rem;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.stream-signin-hint .link-button {
  font-size: var(--font-size-xs);
}
/* Thumbnail with play overlay */
.stream-thumbnail {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.stream-thumbnail img {
  transition: transform var(--transition-normal);
}
.stream-thumbnail:hover img {
  transform: scale(1.03);
}
.stream-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  transition: background var(--transition-fast);
}
.stream-thumbnail:hover .stream-play-overlay {
  background: rgba(0, 0, 0, 0.5);
}
.stream-play-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.stream-thumbnail:hover .stream-play-icon {
  transform: scale(1.1);
  background: rgba(184, 150, 90, 0.8);
  border-color: var(--accent-gold);
}
.stream-play-text {
  margin-top: 0.5rem;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

@media (max-width: 480px) {
  .session-streams {
    grid-template-columns: 1fr;
  }
  .stream-upsell-options {
    flex-direction: column;
    gap: 0.5rem;
  }
}

.sessions-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Loading state */
.loading-state {
  text-align: center;
  padding: 2rem;
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
}

/* Action buttons (legacy PNG icon) */
.action-button,
.custom-draw-button,
.nav-button {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-button:hover,
.custom-draw-button:hover,
.nav-button:hover {
  transform: scale(1.1);
}
.action-button img,
.custom-draw-button img,
.nav-button img {
  width: 44px;
  height: 44px;
}

/* Admin icon */
.admin-icon-wrapper {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-sticky);
}
.admin-icon { width: 48px; height: 48px; cursor: pointer; }


/* ============================================
   11. RESULT CARD
   ============================================ */
.result-card {
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: transform var(--transition-fast);
}

.result-card.qualified {
  border-left: 4px solid var(--success);
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.08), rgba(245, 240, 232, 0.04) 20%);
}
.result-card.qualified .position { color: var(--success); }

.result-card.disqualified,
.result-card.dnf {
  border: 1px solid rgba(248, 113, 113, 0.2);
  opacity: 0.8;
}

.result-header {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1rem;
  min-height: 100px;
}
.identity-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}
.position {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-gold);
}
.competitor-photo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border-subtle);
  transition: transform var(--transition-fast);
}
.competitor-photo:hover { transform: scale(1.1); }
.country-flag {
  width: 60px;
  border-radius: 2px;
}
.details-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.name-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.name-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.name-qualification {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Competitor name as clickable link */
.competitor-name-button {
  background: none;
  border: none;
  color: var(--text-link);
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  padding: 2px 4px;
  margin: -2px -4px;
  text-decoration: underline;
  text-decoration-color: rgba(108, 160, 220, 0.4);
  transition: all var(--transition-fast);
  font-family: inherit;
  border-radius: 3px;
}
.competitor-name-button:hover {
  color: var(--text-link-hover);
  text-decoration-color: var(--text-link-hover);
  background-color: rgba(108, 160, 220, 0.1);
}
.competitor-name-button:focus {
  outline: 2px solid var(--text-link);
  outline-offset: 2px;
}
.competitor-name-button::after {
  content: "\2197";
  font-size: 0.8em;
  margin-left: 4px;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}
.competitor-name-button:hover::after { opacity: 1; }

.qualified-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background-color: var(--success);
  color: var(--text-dark);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
}
.competitor-location {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.time-total-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}
.result-play-button {
  background: var(--accent-gold-muted);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.result-play-button:hover {
  background: rgba(201, 168, 76, 0.35);
  color: var(--text-primary);
}
.time {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.total-value {
  font-weight: bold;
  font-size: 1.1rem;
}
.total-value.pending { color: var(--info); }
.total-value.error { color: var(--error); }
.pending { color: var(--info); }
.error { color: var(--error); }

.points-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}
.point-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  min-height: 44px;
}
.point-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.point-value {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}
.quality-total {
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-subtle);
}
.quality-total .point-label { color: var(--accent-gold); font-weight: 600; }
.quality-total .point-value { color: var(--accent-gold); font-weight: bold; font-size: 1.1rem; }

/* Mobile total (hidden on desktop) */
.mobile-total { display: none; }
.desktop-total { display: inline; }

/* Results section */
.results-section {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
}
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
}
.results-toolbar h3 {
  margin: 0;
  font-size: var(--font-size-xl);
  color: var(--text-primary);
}
.export-buttons {
  display: flex;
  gap: 0.5rem;
}
.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Results video player */
.results-video-section {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}
.results-video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}
.results-video-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.results-video-close:hover { color: var(--text-primary); }

/* Video upsell overlay */
.video-upsell-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: var(--text-primary);
  text-align: center;
  padding: 1rem;
  gap: 0.4rem;
  overflow-y: auto;
}
.video-upsell-overlay h3 {
  font-size: clamp(0.9rem, 3vw, 1.25rem);
  margin: 0;
  color: var(--accent-gold);
}
.video-upsell-overlay p {
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  margin: 0;
  color: var(--text-secondary);
}
.video-upsell-overlay .upsell-button {
  padding: 0.4rem 1.2rem;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
}
.video-upsell-overlay .upsell-divider {
  font-size: clamp(0.65rem, 2vw, 0.8rem);
  margin: 0.2rem 0;
}
.video-upsell-overlay .upsell-signin-row {
  max-width: 220px;
}
.video-upsell-overlay .upsell-code-input {
  padding: 0.35rem 0.4rem;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  letter-spacing: 2px;
}

/* Photo modal (legacy Syncfusion compat) */
.photo-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}
.enlarged-photo {
  max-width: 300px;
  max-height: 300px;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: contain;
}
.photo-caption {
  font-size: 1.2rem;
  color: var(--text-dark);
  text-align: center;
  font-family: var(--font-family-body);
}

/* Mobile result card */
@media (max-width: 768px) {
  .result-card { padding: 0.75rem; }
  .result-header {
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    min-height: auto;
  }
  .identity-column { min-width: 60px; }
  .name-section { flex-direction: column; gap: 0.5rem; }
  .time-total-section { flex-direction: column; gap: 0.25rem; }
  .position { font-size: 1.8rem; }
  .competitor-photo { width: 45px; height: 45px; }
  .country-flag { width: 45px; }
  .competitor-name-button { font-size: 1rem; font-weight: 600; word-break: break-word; }
  .competitor-name-button::after { font-size: 0.75em; }
  .qualified-badge { font-size: 0.65rem; padding: 0.1rem 0.3rem; }
  .competitor-location { font-size: 0.8rem; }
  .time { font-size: 0.8rem; }
  .total-value { font-size: 0.95rem; }
  .desktop-total { display: none; }
  .mobile-total {
    display: block;
    margin-top: 1rem;
    padding: 0.5rem;
    background: var(--bg-inset);
    border-radius: var(--radius-sm);
    text-align: center;
  }
  .points-section { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border-subtle); }
  .points-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .point-item { padding: 0.6rem 0.75rem; min-height: 40px; }

  .results-toolbar { flex-direction: column; gap: 0.75rem; }
  .export-buttons { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
  .result-card { padding: 0.6rem; }
  .result-header { gap: 0.6rem; }
  .position { font-size: 1.6rem; }
  .competitor-photo { width: 40px; height: 40px; }
  .country-flag { width: 40px; }
  .competitor-name-button { font-size: 0.95rem; }
}


/* ============================================
   12. LIVE SCORES
   ============================================ */
.live-scores-container {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
}
.event-info {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
}
.info-item {
  display: flex;
  gap: 0.5rem;
}
.info-item .label { font-weight: bold; color: var(--text-secondary); }
.info-item .value { color: var(--text-primary); }

.scores-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 640px) {
  .scores-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .scores-grid { grid-template-columns: repeat(3, 1fr); }
}

.score-card {
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-normal);
}
.score-card.green {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
}
.score-card.yellow {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}
.score-card.red {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}

.stand-header {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent-gold);
}
.competitor-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.flag-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: clamp(40px, 5vw, 80px);
}
.competitor-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.score-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.score-item {
  background: var(--bg-inset);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: var(--font-size-sm);
}
.score-item.time {
  background: rgba(0, 0, 0, 0.25);
  font-weight: 500;
  grid-column: span 2;
}
.total-score {
  grid-column: 1 / -1;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
}

/* Live scores page variant */
.scores-header {
  margin-bottom: 2rem;
  text-align: center;
}
.scores-title {
  font-family: var(--font-family-heading);
  font-size: clamp(24px, 4vw, 36px);
  color: var(--text-primary);
  margin: 0;
}
.scores-subtitle {
  font-family: var(--font-family-body);
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-secondary);
  margin: 0.5rem 0;
}
.scores-notice {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem auto;
  max-width: 600px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* Competitor card (ALiveScores page) */
.competitor-card {
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast);
}
.competitor-card:hover { transform: translateY(-2px); }
.competitor-card .card-header {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
}
.competitor-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.score-row:last-child { border-bottom: none; }
.score-label {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}
.score-value {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .event-info { flex-direction: column; gap: 0.5rem; }
  .live-scores-container { padding: 0.75rem; margin: 0.5rem; }
}


/* ============================================
   13. DRAW
   ============================================ */
.draw-container {
  background: rgba(245, 240, 232, 0.04);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1rem;
}
.draw-header { margin-bottom: 2rem; }
.draw-title {
  font-family: var(--font-family-heading);
  font-size: clamp(24px, 4vw, 36px);
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}
.sealed-time {
  font-family: var(--font-family-body);
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-secondary);
  margin: 1rem 0;
}
.draw-notice {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}
.draw-notice p { margin: 0.5rem 0; font-size: var(--font-size-sm); color: var(--text-secondary); }

/* Desktop grid */
.draw-grid {
  overflow-x: auto;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  padding: 1px;
}
.grid-header {
  display: grid;
  grid-template-columns: 80px repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.round-header {
  background: var(--bg-elevated);
  padding: 12px;
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  text-align: center;
}
.grid-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.grid-row {
  display: grid;
  grid-template-columns: 80px repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: rgba(0, 0, 0, 0.15);
}
.round-cell {
  background: rgba(245, 240, 232, 0.92);
  padding: 12px;
  color: var(--text-dark);
  font-size: var(--font-size-sm);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.competitor-cell {
  padding: 12px;
  font-size: var(--font-size-sm);
  text-align: center;
  background: rgba(245, 240, 232, 0.92);
  color: var(--text-dark);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Status colors for draw */
.competitor-cell.paid,
.competitor-info.paid { background-color: var(--status-paid); }
.competitor-cell.arrived,
.competitor-info.arrived { background-color: var(--status-arrived); }
.competitor-cell.unpaid,
.competitor-info.unpaid { background-color: var(--status-unpaid); }

/* Mobile card view */
.draw-cards {
  display: none;
  flex-direction: column;
  gap: 1rem;
}
.round-card {
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.round-card-header {
  background: var(--bg-elevated);
  padding: 12px;
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--text-primary);
  text-align: center;
}
.round-card-content {
  padding: 1px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.stand-row {
  display: flex;
  background: rgba(245, 240, 232, 0.92);
  min-height: 48px;
}
.stand-number {
  width: 80px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-dark);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop/mobile toggle */
.desktop-view { display: block; }
.mobile-view { display: none; }

@media (max-width: 768px) {
  .desktop-view { display: none; }
  .mobile-view { display: flex; }
  .draw-container { padding: 0.5rem; margin: 0.5rem; }
  .draw-header { margin-bottom: 1rem; }
}


/* ============================================
   14. VIDEO PAGE
   ============================================ */
.video-rounds-section { margin-top: 1rem; }
.rounds-heading {
  font-family: var(--font-family-heading);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.video-error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  text-align: center;
}
.rounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.round-card.playing { border-color: var(--accent-gold); }
.round-card.no-video { opacity: 0.5; padding: 1rem; }
.round-label {
  padding: 0.5rem 0.75rem;
  font-size: var(--font-size-base);
  font-weight: bold;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  container-type: inline-size;
}
@container (max-width: 300px) { .round-label { font-size: 0.8rem; } }
@container (max-width: 220px) { .round-label { font-size: 0.65rem; } }

.round-no-video-card {
  padding: 1rem;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-style: italic;
}
.video-player-wrapper { position: relative; width: 100%; }

/* Thumbnails */
.round-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  cursor: pointer;
}
.round-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}
.round-thumbnail:hover img { transform: scale(1.03); }
.round-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-size: 3rem;
  transition: background var(--transition-fast);
}
.round-thumbnail:hover .round-play-overlay { background: rgba(0, 0, 0, 0.45); }

.force-end-btn {
  padding: 0.6rem 1.5rem;
  background: var(--accent-gold);
  color: var(--text-dark);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.force-end-btn:hover { background: var(--accent-gold-hover); }

.round-cta-btn {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.4rem;
  background: var(--accent-gold-muted);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.round-cta-btn:hover { background: rgba(201, 168, 76, 0.3); }

/* Upsell sign-in */
.upsell-divider { font-size: var(--font-size-xs); color: var(--text-muted); margin: 0; }
.upsell-signin-row { display: flex; gap: 0.4rem; width: 100%; max-width: 260px; }
.upsell-code-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  background: rgba(245, 240, 232, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  letter-spacing: 2px;
  text-align: center;
}
.upsell-code-input::placeholder { color: var(--text-muted); letter-spacing: normal; }
.upsell-error { color: var(--error); font-size: var(--font-size-xs); margin: 0; }

@media (max-width: 768px) {
  .rounds-grid { grid-template-columns: 1fr; }
  .competition-header { flex-direction: column; text-align: center; padding: 1rem; }
  .competition-logo { width: 80px; height: 80px; margin: 0 auto; }
}


/* ============================================
   15. LEADERBOARD
   ============================================ */

/* Header (leaderboard variant) */
.leaderboard .competition-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
}
.header-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 200px;
}
.header-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
}
.detail-item {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.detail-item:before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--accent-gold-muted);
  border-radius: var(--radius-full);
}
.venue-item { display: flex; align-items: center; gap: 0.5rem; }
.venue-item:before { display: none; }

.event-notice {
  background: rgba(0, 0, 0, 0.15);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-gold-muted);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* Cycling results banner */
.cycling-results-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--accent-gold-subtle);
  border: 1px solid var(--accent-gold-muted);
  border-radius: var(--radius-md);
  margin: 1rem 0;
}
.cycling-info { display: flex; flex-direction: column; gap: 0.25rem; }
.cycling-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
  font-weight: 600;
}
.cycling-class-name { font-size: 1.1rem; font-weight: 500; color: var(--text-primary); }
.cycling-dots { display: flex; gap: 0.5rem; align-items: center; }
.cycling-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(245, 240, 232, 0.15);
  transition: background var(--transition-normal), transform var(--transition-normal);
}
.cycling-dot.active { background: var(--accent-gold); transform: scale(1.3); }

/* No results / pending / empty states */
.no-results {
  text-align: center;
  padding: 2rem;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}
.no-results p { margin: 0; color: var(--text-secondary); font-size: 1.1rem; }

.pending-results,
.empty-results,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 2rem;
  background: var(--accent-gold-subtle);
  border: 2px dashed var(--accent-gold-muted);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: center;
}
.pending-icon,
.empty-icon,
.error-icon {
  font-size: 48px;
  opacity: 0.7;
}
.empty-subtitle { font-size: var(--font-size-sm); opacity: 0.8; margin-top: 0.5rem; }

/* Loading content */
.loading-content,
.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 2rem;
  background: var(--accent-gold-subtle);
  border: 2px dashed var(--accent-gold-muted);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: center;
}
.rustic-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--accent-gold-muted);
  border-left-color: var(--accent-gold);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}
.error-state { text-align: center; padding: 2rem; }

/* Newspaper content (in modal) */
.newspaper-content {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-md);
  max-height: calc(90vh - 4rem);
  overflow-y: auto;
}

@media (max-width: 768px) {
  .leaderboard .competition-header { grid-template-columns: 1fr; gap: 1.5rem; }
  .header-left { max-width: 100%; align-items: center; }
  .header-content { text-align: center; }
}


/* ============================================
   16. PERSON RESULTS
   ============================================ */
.person-results-page {
  min-height: 100vh;
  padding: 1rem;
  color: var(--text-primary);
}
.person-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-inset);
  border-radius: var(--radius-lg);
  gap: 1rem;
}
.person-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
  flex: 1;
}
.person-photo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--border-subtle);
}
.person-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.person-name {
  font-family: var(--font-family-heading);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.person-location {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}
.summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.stat-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stat-value { font-size: 2rem; font-weight: bold; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: 0.25rem; }

/* Results timeline */
.results-timeline { display: flex; flex-direction: column; gap: 2rem; }
.competition-group {
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.competition-info { flex: 1; min-width: 0; overflow: hidden; }
.competition-title {
  font-family: var(--font-family-heading);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  word-wrap: break-word;
}
.competition-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}
.summary-text { opacity: 0.8; }

/* Class result card */
.class-results { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.class-result-card {
  background: rgba(245, 240, 232, 0.04);
  border-radius: var(--radius-md);
  padding: 1rem;
  border-left: 4px solid var(--border-subtle);
  transition: transform var(--transition-fast);
}
.class-result-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.class-result-card.top-finish {
  border-left-color: var(--gold);
  background: rgba(255, 215, 0, 0.04);
}
.class-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.class-name {
  font-family: var(--font-family-heading);
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}
.placement { display: flex; align-items: center; }
.position-badge {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-weight: bold;
  font-size: var(--font-size-sm);
  text-align: center;
  min-width: 50px;
}
.position-badge.first {
  background: linear-gradient(145deg, var(--gold), #FFA500);
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}
.position-badge.second {
  background: linear-gradient(145deg, var(--silver), #A0A0A0);
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3);
}
.position-badge.third {
  background: linear-gradient(145deg, var(--bronze), #B8860B);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}
.position-badge.top-ten {
  background: linear-gradient(145deg, var(--success), #2d8a00);
  color: var(--text-primary);
}
.position-badge.other {
  background: rgba(245, 240, 232, 0.15);
  color: var(--text-primary);
}
.status-badge {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-weight: bold;
  font-size: var(--font-size-sm);
  text-align: center;
  min-width: 50px;
}
.status-badge.disqualified {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.status-badge.dnf {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.result-details { display: flex; flex-direction: column; gap: 0.75rem; }
.score-section { display: flex; flex-wrap: wrap; gap: 1rem; }
.score-section .score-item { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.score-section .score-item.total-score { margin-left: auto; }
.score-section .score-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.score-section .score-value { font-weight: bold; font-size: var(--font-size-base); color: var(--text-primary); }
.total-score .score-value { font-size: 1.2rem; color: var(--accent-gold); }

.points-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}
.view-results-link {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  text-align: right;
}
.status-section { display: flex; justify-content: center; padding: 1rem; }
.status-message { font-size: var(--font-size-base); color: var(--text-secondary); opacity: 0.8; }

@media (max-width: 768px) {
  .person-results-page { padding: 0.5rem; }
  .person-header { flex-direction: column; gap: 1.5rem; text-align: center; }
  .person-info { flex-direction: column; text-align: center; }
  .summary-stats { width: 100%; justify-content: space-around; }
  .class-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .score-section { justify-content: space-around; }
  .score-section .score-item.total-score { margin-left: 0; }
  .points-breakdown { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .person-photo { width: 60px; height: 60px; }
  .stat-value { font-size: 1.5rem; }
}


/* ============================================
   17. TIMER DISPLAY
   ============================================ */
.results-timer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-normal);
}
.results-timer.active {
  background: rgba(74, 222, 128, 0.1);
  border-left: 4px solid var(--success);
  color: var(--success);
}
.results-timer.warning {
  background: rgba(251, 191, 36, 0.1);
  border-left: 4px solid var(--warning);
  color: var(--warning);
}
.results-timer.urgent {
  background: rgba(248, 113, 113, 0.1);
  border-left: 4px solid var(--error);
  color: var(--error);
  animation: pulse 2s infinite;
}
.results-timer.expired {
  background: rgba(245, 240, 232, 0.05);
  border-left: 4px solid var(--text-muted);
  color: var(--text-muted);
}
.timer-title { font-weight: 600; }
.timer-value { font-family: var(--font-family-mono); font-size: var(--font-size-lg); }


/* ============================================
   18. CONNECTION STATUS
   ============================================ */
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}
.status-dot.connected { background: var(--success); }
.status-dot.fallback  { background: var(--warning); }
.status-dot.reconnecting { background: var(--warning); animation: pulse 2s infinite; }
.status-dot.disconnected { background: var(--error); }

.retry-btn {
  background: rgba(245, 240, 232, 0.15);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  padding: 2px 10px;
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.retry-btn:hover {
  background: rgba(245, 240, 232, 0.25);
  color: var(--text-primary);
}


/* ============================================
   19. SUBSCRIBER MENU
   ============================================ */
.subscriber-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}
.subscriber-toggle:hover { border-color: var(--accent-gold); }

.subscriber-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-gold);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-sm);
}

.subscriber-dropdown {
  position: fixed;
  width: 320px;
  top: 64px;
  right: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1100;
  overflow: hidden;
  animation: scaleIn var(--transition-fast);
}
.subscriber-overlay {
  position: fixed;
  inset: 0;
  z-index: 1099;
  background: transparent;
}

/* Subscriber form styles */
.subscriber-form {
  padding: 1.25rem;
}
.subscriber-input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(245, 240, 232, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast);
}
.subscriber-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: rgba(245, 240, 232, 0.12);
}
.subscriber-input::placeholder { color: var(--text-muted); }
.subscriber-submit {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent-gold);
  color: var(--text-dark);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: var(--touch-target-comfortable);
}
.subscriber-submit:hover { background: var(--accent-gold-hover); }
.subscriber-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tabs */
.subscriber-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}
.subscriber-tab {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}
.subscriber-tab.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}
.subscriber-tab:hover { color: var(--text-primary); }

/* Account info */
.subscriber-account-info {
  padding: 1.25rem;
}
.subscriber-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.subscriber-tier {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: var(--accent-gold-muted);
  color: var(--accent-gold);
}


/* ============================================
   20. NEWS ARTICLE CARD
   ============================================ */
.news-article-card {
  background: var(--text-primary);
  border: 2px solid var(--accent-gold-muted);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
}
.news-article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.news-article-card:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}
.news-article-card.featured {
  border-color: var(--accent-gold);
  border-width: 3px;
}
.article-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #d4c5a9;
}
.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(15%);
  transition: transform var(--transition-normal);
}
.news-article-card:hover .article-image img { transform: scale(1.05); }
.article-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.article-category {
  background: var(--bg-primary);
  color: var(--accent-gold);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: bold;
  letter-spacing: 0.3px;
}
.article-date {
  color: #555;
  font-size: var(--font-size-sm);
  font-style: italic;
  font-family: 'Georgia', serif;
}
.article-title {
  font-family: 'Georgia', serif;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.article-summary {
  color: #3a3a3a;
  line-height: 1.6;
  font-family: 'Georgia', serif;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-summary p { margin-bottom: 0.75rem; }
.article-summary p:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
  .article-image { height: 150px; }
  .article-content { padding: 1rem; }
  .article-title { font-size: 1.25rem; }
}

/* News grid */
.news-section {
  margin-top: 3rem;
  padding: 2rem 1rem;
  background: var(--accent-gold-subtle);
  border-radius: var(--radius-lg);
}
.news-header { text-align: center; margin-bottom: 2rem; }
.news-title {
  font-family: 'Georgia', serif;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}
.news-divider {
  width: 120px;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--accent-gold), transparent);
  margin: 0 auto;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}
.news-grid .news-article-card.featured { grid-column: span 2; }
.no-news {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-family: 'Georgia', serif;
}
.no-news-icon { font-size: 4rem; display: block; margin-bottom: 1rem; opacity: 0.5; }
.no-news p { font-size: 1.125rem; font-style: italic; }

@media (max-width: 1200px) {
  .news-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
  .news-grid .news-article-card.featured { grid-column: span 1; }
}
@media (max-width: 768px) {
  .news-section { margin-top: 2rem; padding: 1.5rem 0.5rem; }
  .news-title { font-size: 2rem; }
  .news-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 480px) {
  .news-title { font-size: 1.75rem; }
  .news-grid { gap: 1rem; }
}


/* ============================================
   20b. EVENT LIST FILTERS
   ============================================ */
.filter-container { margin-bottom: 2rem; }
.filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 240, 232, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  transition: background var(--transition-fast);
  touch-action: manipulation;
  user-select: none;
}
.filter-toggle:hover { background: rgba(245, 240, 232, 0.12); }
.active-filters { font-size: 0.9em; font-weight: normal; color: var(--accent-gold); margin-left: 0.5rem; }
.filter-toggle svg { transition: transform var(--transition-normal); stroke: var(--text-primary); }
.filter-toggle .rotate-180 { transform: rotate(180deg); }
.filter-panel {
  background: rgba(245, 240, 232, 0.04);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1.5rem;
  margin-top: 0.25rem;
  display: none;
  animation: slideDown var(--transition-normal) forwards;
  touch-action: pan-y;
}
.filter-panel.open { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.filter-groups { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 1.5rem; }
.filter-group { flex: 1; min-width: 200px; }
.filter-group h3 { font-family: var(--font-family-heading); font-size: 18px; margin: 0 0 0.75rem 0; color: var(--text-primary); }
.filter-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-chip {
  background: rgba(245, 240, 232, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--font-size-sm);
  max-width: 200px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  touch-action: manipulation;
  user-select: none;
}
.filter-chip:hover { background: rgba(245, 240, 232, 0.15); transform: translateY(-2px); }
.filter-chip.active {
  background: var(--accent-gold);
  color: var(--text-dark);
  border-color: var(--accent-gold);
  font-weight: bold;
}
.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}
.reset-button {
  background: var(--accent-gold);
  border: none;
  color: var(--text-dark);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}
.reset-button:hover { background: var(--accent-gold-hover); }
.event-count { font-size: var(--font-size-sm); color: var(--text-secondary); }

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.top-button {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-gold);
  color: var(--text-dark);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: var(--font-size-sm);
  font-weight: 600;
}
.top-button:hover { background: var(--accent-gold-hover); }
.day-label {
  font-weight: bold;
  color: var(--text-primary);
  margin: 0.5rem 0 0.25rem 0;
  font-size: var(--font-size-sm);
  opacity: 0.8;
}
.competition-dates { display: flex; align-items: center; margin: 0.5rem 0; }
.date-info {
  background: rgba(245, 240, 232, 0.08);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border: 1px solid var(--border-subtle);
}
.competition-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

@media (max-width: 768px) {
  .filter-groups { flex-direction: column; gap: 1.5rem; }
  .filter-chip { max-width: 150px; padding: 0.4rem 0.8rem; font-size: 0.8rem; }
  .reset-button { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
  .top-button { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
}
@media (max-width: 480px) {
  .filter-chip { max-width: 120px; padding: 0.3rem 0.6rem; font-size: 0.75rem; }
  .reset-button { font-size: 0.7rem; padding: 0.3rem 0.6rem; }
  .top-button { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
  .competition-links { flex-direction: column; align-items: center; }
  .date-info { font-size: 0.85rem; padding: 0.4rem 0.8rem; }
}


/* ============================================
   20d. LIVE DASHBOARD
   ============================================ */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}
.dashboard-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.dashboard-comp-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}
.dashboard-comp-name {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-2xl);
  margin: 0;
  color: var(--text-primary);
}
.dashboard-comp-date {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.dashboard-live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: #ef4444;
  animation: livePulse 1.5s ease-in-out infinite;
  display: inline-block;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Dashboard sections */
.dashboard-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}
.dashboard-section-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  color: var(--text-primary);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.dashboard-meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.dashboard-round-badge {
  font-size: var(--font-size-xs);
  font-family: var(--font-family-body);
  background: var(--accent-gold-muted);
  color: var(--accent-gold);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Live scoring grid */
.dashboard-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.dashboard-stand-card {
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.dashboard-stand-card.green { border-color: rgba(74, 222, 128, 0.3); }
.dashboard-stand-card.yellow { border-color: rgba(251, 191, 36, 0.3); }
.dashboard-stand-card.red { border-color: rgba(248, 113, 113, 0.3); }
.dashboard-stand-header {
  padding: 0.4rem 0.75rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dashboard-stand-round {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
}
.dashboard-competitor {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.dashboard-comp-flag {
  width: 24px;
  height: auto;
  border-radius: 2px;
  flex-shrink: 0;
}
.dashboard-comp-photo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}
.dashboard-comp-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dashboard-comp-name-text {
  font-weight: 600;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-comp-loc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.dashboard-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 0.25rem;
}
.dashboard-score-item {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  font-size: var(--font-size-xs);
  background: var(--bg-inset);
  border-radius: 3px;
}
.dashboard-score-item.time {
  grid-column: span 2;
  background: rgba(0, 0, 0, 0.2);
}
.dashboard-score-total {
  grid-column: span 2;
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  font-weight: 700;
  font-size: var(--font-size-sm);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Recent results */
.dashboard-result-card {
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  animation: dashFadeIn 0.4s ease-out;
}
@keyframes dashFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.dashboard-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.dashboard-result-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}
.dashboard-result-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.dashboard-result-podium {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dashboard-result-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
}
.dashboard-result-row.top-1 { background: rgba(255, 215, 0, 0.08); border-left: 3px solid #FFD700; }
.dashboard-result-row.top-2 { background: rgba(192, 192, 192, 0.08); border-left: 3px solid #C0C0C0; }
.dashboard-result-row.top-3 { background: rgba(205, 127, 50, 0.08); border-left: 3px solid #CD7F32; }
.dashboard-pos {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--accent-gold);
  min-width: 28px;
  text-align: center;
}
.dashboard-result-photo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
}
.dashboard-result-name {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}
.dashboard-result-total {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* Results table */
.dashboard-results-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.75rem;
}
.dashboard-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.dashboard-results-table th {
  text-align: left;
  padding: 0.5rem 0.4rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.dashboard-results-table td {
  padding: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}
.dashboard-results-table .col-pos {
  width: 36px;
  text-align: center;
  font-weight: 700;
  color: var(--accent-gold);
}
.dashboard-results-table .col-name {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dashboard-results-table .col-name img {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}
.dashboard-results-table .col-loc {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}
.dashboard-results-table .col-pts {
  text-align: right;
  white-space: nowrap;
}
.dashboard-results-table .col-time {
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
}
.dashboard-results-table .col-total {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}
.dashboard-results-table tr.top-1 td { background: rgba(255, 215, 0, 0.06); }
.dashboard-results-table tr.top-2 td { background: rgba(192, 192, 192, 0.06); }
.dashboard-results-table tr.top-3 td { background: rgba(205, 127, 50, 0.06); }
.dashboard-results-table tr.top-1 .col-pos { color: #FFD700; }
.dashboard-results-table tr.top-2 .col-pos { color: #C0C0C0; }
.dashboard-results-table tr.top-3 .col-pos { color: #CD7F32; }
.dashboard-results-table tr.dq td,
.dashboard-results-table tr.dnf td { opacity: 0.5; }

/* Coming up */
.dashboard-upcoming {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dashboard-upcoming-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
}
.dashboard-upcoming-name {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}
.dashboard-upcoming-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Empty state */
.dashboard-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}
.dashboard-empty h2 { color: var(--text-primary); margin-bottom: 0.5rem; }
.dashboard-empty p { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 992px) {
  .dashboard-scores-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dashboard { padding: 0.25rem; }
  .dashboard-header { padding: 0.75rem; margin-bottom: 0.75rem; border-radius: var(--radius-md); }
  .dashboard-section { padding: 0.75rem; margin-bottom: 0.75rem; border-radius: var(--radius-md); }
  .dashboard-scores-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}
@media (max-width: 576px) {
  .dashboard { padding: 0; }
  .dashboard-header { border-radius: 0; margin-bottom: 0.5rem; flex-direction: column; gap: 0.5rem; text-align: center; }
  .dashboard-header-info { flex-direction: column; }
  .dashboard-section { border-radius: 0; margin-bottom: 0.5rem; padding: 0.75rem; }
  .dashboard-scores-grid { grid-template-columns: 1fr; }
  .dashboard-result-card { padding: 0.75rem; }
}


/* ============================================
   21. FOOTER
   ============================================ */
.footer {
  width: 100%;
  padding: clamp(0.3rem, 1vw, 1rem) 0;
  background: transparent;
  margin-top: auto;
  position: relative;
}
.footer-plate {
  position: relative;
  max-width: clamp(200px, 60vw, 500px);
  margin: 0 auto;
  height: 100%;
}
.plate-image {
  width: 100%;
  height: auto;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}
.footer-content {
  position: relative;
  z-index: 2;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  text-align: center;
  font-family: var(--font-family-mono);
  font-size: clamp(0.5rem, 1.2vw, 1rem);
  color: rgba(0, 0, 0, 0.7);
  text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.3);
}
.developer-link,
.contact-link {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
.developer-link:hover,
.contact-link:hover { opacity: 0.8; text-decoration: none; }


/* Site footer */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
  background: var(--bg-primary);
}
.site-footer p { margin: 0.5rem 0 0; }
.footer-subscribe-link {
  display: inline-block;
  color: var(--accent-gold);
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-family: var(--font-family-body);
}
.footer-subscribe-link:hover {
  color: var(--accent-gold-hover);
  text-decoration: underline;
}

/* ============================================
   22. ACCESSIBILITY
   ============================================ */
.focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background-color: var(--accent-gold);
  color: var(--text-dark);
  padding: var(--space-md);
  text-decoration: none;
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}
.skip-link:focus { top: 0; }


/* ============================================
   23. LOADING & ERROR STATES
   ============================================ */
.loading {
  text-align: center;
  padding: var(--space-2xl);
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-gold);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}


/* ============================================
   24. PRINT STYLES
   ============================================ */
@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  a, a:visited { text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; }
  img { page-break-inside: avoid; }
  p, h2, h3 { orphans: 3; widows: 3; }
  h2, h3 { page-break-after: avoid; }
  .mobile-nav, .nav-toggle, .btn, .page-header, .subscriber-toggle { display: none !important; }
}


/* ============================================
   25. SYNCFUSION GRID OVERRIDES
   ============================================ */
.e-grid {
  background-color: var(--bg-primary);
  font-family: var(--font-family-body);
  color: var(--text-primary);
  font-size: clamp(10px, 2vw, 18px);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.e-headertext,
.e-grid .e-headertext,
.e-grid .e-headercell {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-family-heading);
  font-size: clamp(18px, 2vw, 35px);
  padding: clamp(1px, 1vw, 10px);
}
.e-grid .e-headercell { font-size: 2.5vw; }
.e-grid .e-rowcell {
  background-color: var(--bg-surface) !important;
  color: var(--text-primary);
  font-size: clamp(18px, 2vw, 22px);
  border-bottom: 1px solid var(--border-subtle);
}
.e-grid .e-altrow { background-color: var(--bg-surface) !important; }
.e-grid .e-focus { background-color: var(--bg-elevated) !important; }
.e-grid .e-templatecell {
  background-color: var(--bg-elevated) !important;
  color: var(--text-primary);
  font-size: clamp(16px, 2vw, 30px) !important;
}
.e-rowcell.e-templatecell::before {
  background-color: var(--bg-elevated) !important;
  color: var(--text-primary);
  font-family: var(--font-family-heading);
  border: hidden;
}
.e-pager {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}


/* ============================================
   26. ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}


/* ============================================
   27. RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  .blackboard-frame { padding: 1rem; }
  .events-grid, .card-container { grid-template-columns: 1fr; }
  .competition-header, .shed-title-header { padding: 0.75rem; gap: 1rem; }
  .portal-logo, .competition-logo { height: 60px; }
  .portal-title { font-size: 2rem; }
  .action-button img, .custom-draw-button img, .nav-button img { width: 36px; height: 36px; }
  .video-btn-icon { width: 36px; height: 36px; font-size: 20px; }
  .sponsor-logo { width: 50px; height: 50px; }
  .competition-name, .competition-head { font-size: 1.2rem; }

  .event-actions { flex-wrap: wrap; }
  .event-actions .btn, .event-actions .rustic-button { font-size: var(--font-size-xs); padding: 0.4rem 0.6rem; }
  .venue-info { font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .competition-header, .shed-title-header { flex-direction: column; text-align: center; }
  .portal-logo, .competition-logo { height: 50px; }
  .portal-title { font-size: 1.5rem; }
  .event-name { font-size: var(--font-size-sm); }

  .event-actions { flex-direction: column; gap: 4px; }
  .event-actions .btn, .event-actions .rustic-button { flex: none; width: 100%; }
  .venue-info { font-size: 0.75rem; gap: 0.25rem; }
  .venue-name { max-width: 150px; }

  /* Hide hero banner on small mobile — header already shows site name */
  .portal-container > .event-list > .blackboard-frame > .competition-header { display: none; }
}

@media (max-width: 768px) {
  .btn { font-size: var(--font-size-sm); padding: 0.5rem 0.75rem; }
  .icon-btn svg { width: 20px; height: 20px; }
  .button-icon { font-size: 14px; }
  .button-icon svg { width: 18px; height: 18px; }
}
