/* ============================================================
   HORSERACE — Main Stylesheet
   Theme: Dark luxury / race track atmosphere
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@400;600;700&family=Rajdhani:wght@400;500;600;700&family=Exo+2:wght@300;400;500;600&display=swap');

/* ---- CSS Variables ---- */
:root {
  --color-bg:         #0a0b0e;
  --color-bg2:        #0f1117;
  --color-surface:    #141720;
  --color-surface2:   #1c2030;
  --color-border:     #2a3048;
  --color-gold:       #d4a017;
  --color-gold2:      #f0c040;
  --color-gold3:      #ffe066;
  --color-green:      #1a5c2e;
  --color-green2:     #22803f;
  --color-green3:     #34c464;
  --color-red:        #c0392b;
  --color-red2:       #e74c3c;
  --color-blue:       #1a3a6b;
  --color-blue2:      #2563eb;
  --color-white:      #f0ead6;
  --color-muted:      #8892a4;
  --color-accent:     #e8b84b;
  --color-track:      #8b5e3c;
  --color-track2:     #a0723a;
  --color-grass:      #2d6a2d;

  --font-display:     'Cinzel Decorative', serif;
  --font-heading:     'Cinzel', serif;
  --font-body:        'Rajdhani', sans-serif;
  --font-ui:          'Exo 2', sans-serif;

  --nav-height:       64px;
  --radius:           8px;
  --radius-lg:        16px;
  --shadow-gold:      0 0 24px rgba(212,160,23,0.3);
  --shadow-card:      0 4px 24px rgba(0,0,0,0.6);
  --transition:       0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-white);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--color-gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-gold3); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); border: none; }
input, textarea { font-family: var(--font-ui); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; background: var(--color-bg2); }
::-webkit-scrollbar-thumb { background: var(--color-gold); border-radius: 3px; }

/* ============================
   NAVIGATION BAR
   ============================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: linear-gradient(90deg, #060810 0%, #0d1018 50%, #060810 100%);
  border-bottom: 2px solid var(--color-gold);
  box-shadow: 0 2px 32px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
}
.navbar::before {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold2), transparent);
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}
.navbar-logo img {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-gold);
  object-fit: cover;
}
.navbar-logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-gold2);
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(212,160,23,0.5);
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.navbar-links a {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.navbar-links a:hover, .navbar-links a.active {
  color: var(--color-gold2);
  background: rgba(212,160,23,0.1);
}
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}
.btn-nav {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 18px;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn-nav-outline {
  background: transparent;
  border: 1.5px solid var(--color-gold);
  color: var(--color-gold);
}
.btn-nav-outline:hover {
  background: rgba(212,160,23,0.15);
  box-shadow: var(--shadow-gold);
}
.btn-nav-primary {
  background: linear-gradient(135deg, var(--color-gold), #b8860b);
  color: #0a0b0e;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(212,160,23,0.4);
}
.btn-nav-primary:hover {
  background: linear-gradient(135deg, var(--color-gold3), var(--color-gold));
  box-shadow: 0 4px 20px rgba(212,160,23,0.6);
  transform: translateY(-1px);
}
.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.navbar-user-name {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-gold2);
  font-weight: 600;
}
.navbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  margin-left: 12px;
}
.navbar-hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============================
   HERO / BANNER
   ============================ */
.hero {
  margin-top: var(--nav-height);
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-banner {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.5;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10,11,14,0.3) 0%,
    rgba(10,11,14,0.6) 60%,
    rgba(10,11,14,1) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  padding: 60px 24px 40px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 5rem);
  color: var(--color-gold2);
  text-shadow: 0 0 40px rgba(212,160,23,0.6), 0 4px 24px rgba(0,0,0,0.8);
  letter-spacing: 2px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: var(--color-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.hero-ca {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212,160,23,0.1);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius);
  padding: 8px 18px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-gold2);
  cursor: pointer;
  transition: all var(--transition);
  margin: 0 auto 24px;
}
.hero-ca:hover { background: rgba(212,160,23,0.2); box-shadow: var(--shadow-gold); }
.hero-ca .ca-label { color: var(--color-muted); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-hero {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 14px 32px;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
}
.btn-hero-primary {
  background: linear-gradient(135deg, var(--color-gold), #b8860b);
  color: #060810;
  border: none;
  box-shadow: 0 4px 24px rgba(212,160,23,0.4);
}
.btn-hero-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(212,160,23,0.6);
}
.btn-hero-outline {
  background: transparent;
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
}
.btn-hero-outline:hover {
  background: rgba(212,160,23,0.1);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

/* ============================
   STATS BAR
   ============================ */
.stats-bar {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
}
.stats-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  align-items: stretch;
  flex-wrap: wrap;
}
.stat-item {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 8px 16px;
  border-right: 1px solid var(--color-border);
}
.stat-item:last-child { border-right: none; }
.stat-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-muted);
  margin-bottom: 4px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-gold2);
  text-shadow: 0 0 12px rgba(212,160,23,0.3);
}

/* ============================
   MAIN LAYOUT
   ============================ */
.main-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 20px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ============================
   CARDS / PANELS
   ============================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-header {
  background: linear-gradient(135deg, var(--color-surface2), var(--color-surface));
  border-bottom: 1px solid var(--color-border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-gold2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .icon { font-size: 1rem; }
.card-body { padding: 20px; }

/* ============================
   LIVE RACE TRACK
   ============================ */
.race-track-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.race-track-header {
  background: linear-gradient(135deg, #0d1407, #0f1710);
  border-bottom: 2px solid var(--color-gold);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.race-track-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-gold2);
  letter-spacing: 1px;
}
.race-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.race-status-badge.waiting {
  background: rgba(212,160,23,0.15);
  border: 1px solid var(--color-gold);
  color: var(--color-gold2);
}
.race-status-badge.racing {
  background: rgba(52,196,100,0.15);
  border: 1px solid var(--color-green3);
  color: var(--color-green3);
}
.race-status-badge.waiting::before,
.race-status-badge.racing::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 1.2s infinite;
}
.race-status-badge.waiting::before { background: var(--color-gold2); }
.race-status-badge.racing::before { background: var(--color-green3); }
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Track Canvas */
#raceCanvas {
  width: 100%;
  background: linear-gradient(180deg,
    #1a3a0a 0%, #1a3a0a 8%,
    #8b5e3c 8%, #a0723a 15%,
    #8b5e3c 15%, #8b5e3c 85%,
    #a0723a 85%, #8b5e3c 92%,
    #1a3a0a 92%, #1a3a0a 100%);
  display: block;
}
.race-info-bar {
  background: var(--color-bg2);
  border-top: 1px solid var(--color-border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.race-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-muted);
}
.race-info-item strong { color: var(--color-white); }
.race-timer {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-gold2);
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(212,160,23,0.4);
  margin-left: auto;
}

/* Horse List */
.horse-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.horse-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-bg2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.horse-entry::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--jockey-color, var(--color-gold));
}
.horse-entry:hover { border-color: var(--color-gold); background: var(--color-surface); }
.horse-number {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--jockey-color, var(--color-gold));
  color: #060810;
  flex-shrink: 0;
}
.horse-info { flex: 1; min-width: 0; }
.horse-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.horse-player {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--color-muted);
}
.horse-boost-bar {
  width: 60px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}
.horse-boost-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold3));
  border-radius: 2px;
  transition: width 0.5s ease;
}
.horse-position-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}
.horse-position-badge.pos-1 { background: var(--color-gold); color: #060810; }
.horse-position-badge.pos-2 { background: #b0b0b0; color: #060810; }
.horse-position-badge.pos-3 { background: #cd7f32; color: #fff; }
.horse-position-badge.pos-other { background: var(--color-surface2); color: var(--color-muted); }

/* ============================
   BOOST PANEL
   ============================ */
.boost-panel {
  background: linear-gradient(135deg, var(--color-surface), #1a1e2e);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-gold);
}
.boost-panel .card-header {
  background: linear-gradient(135deg, rgba(212,160,23,0.15), rgba(212,160,23,0.05));
  border-bottom-color: rgba(212,160,23,0.3);
}
.boost-timer {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-gold2);
  text-align: center;
  text-shadow: 0 0 16px rgba(212,160,23,0.5);
  margin: 12px 0;
}
.boost-timer.closed {
  color: var(--color-red2);
  text-shadow: 0 0 16px rgba(231,76,60,0.5);
}
.boost-address {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--color-muted);
  word-break: break-all;
  margin: 8px 0;
  cursor: pointer;
  transition: all var(--transition);
}
.boost-address:hover { border-color: var(--color-gold); color: var(--color-gold2); }
.boost-tiers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.boost-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-bg2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.75rem;
}
.boost-tier-label { color: var(--color-muted); }
.boost-tier-effect { color: var(--color-gold2); font-weight: 600; }

/* ============================
   LOBBY JOIN PANEL
   ============================ */
.join-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.lobby-countdown {
  text-align: center;
  margin: 16px 0;
}
.lobby-countdown-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-muted);
  margin-bottom: 6px;
}
.lobby-countdown-time {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-gold2);
  text-shadow: 0 0 20px rgba(212,160,23,0.4);
}
.lobby-progress {
  margin: 12px 0;
}
.lobby-progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-muted);
  margin-bottom: 6px;
}
.progress-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold3));
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ============================
   FORMS (Auth)
   ============================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6,8,16,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.auth-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.auth-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 60px rgba(0,0,0,0.8), var(--shadow-gold);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform var(--transition);
}
.auth-overlay.active .auth-modal { transform: translateY(0); }
.auth-modal-header {
  background: linear-gradient(135deg, rgba(212,160,23,0.15), rgba(212,160,23,0.05));
  border-bottom: 1px solid rgba(212,160,23,0.3);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-gold2);
  letter-spacing: 1px;
}
.auth-modal-close {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
  padding: 0;
}
.auth-modal-close:hover { color: var(--color-white); }
.auth-modal-body { padding: 28px 24px; }
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-muted);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--color-white);
  font-size: 0.9rem;
  font-family: var(--font-ui);
  transition: all var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.12);
}
.form-input::placeholder { color: var(--color-muted); opacity: 0.7; }
.form-hint {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--color-muted);
  margin-top: 5px;
  line-height: 1.4;
}
.form-error {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-red2);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-form {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  border: none;
  margin-top: 8px;
  transition: all var(--transition);
}
.btn-form-primary {
  background: linear-gradient(135deg, var(--color-gold), #b8860b);
  color: #060810;
  box-shadow: 0 4px 16px rgba(212,160,23,0.3);
}
.btn-form-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212,160,23,0.5);
}
.btn-form-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-muted);
}
.auth-switch a { color: var(--color-gold2); font-weight: 600; }

/* ============================
   RECENT WINNERS
   ============================ */
.winners-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}
.winner-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-bg2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.winner-entry:hover { border-color: var(--color-gold); }
.winner-rank {
  font-family: var(--font-display);
  font-size: 1rem;
  width: 32px;
  text-align: center;
}
.winner-rank.gold { color: var(--color-gold2); }
.winner-info { flex: 1; min-width: 0; }
.winner-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-white);
}
.winner-time {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--color-muted);
}
.winner-payout {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-green3);
  white-space: nowrap;
}

/* ============================
   LIVE CHAT
   ============================ */
.chat-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  height: 460px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-message {
  display: flex;
  gap: 8px;
  animation: fadeSlideIn 0.2s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-surface2);
  border: 1.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-gold2);
  flex-shrink: 0;
  font-size: 0.65rem;
}
.chat-msg-content { flex: 1; min-width: 0; }
.chat-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}
.chat-msg-user {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-gold2);
}
.chat-msg-time {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--color-muted);
}
.chat-msg-text {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-white);
  line-height: 1.4;
  word-break: break-word;
}
.chat-input-area {
  border-top: 1px solid var(--color-border);
  padding: 12px;
  display: flex;
  gap: 8px;
  background: var(--color-bg2);
}
.chat-input {
  flex: 1;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--color-white);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--color-gold); }
.chat-send-btn {
  background: linear-gradient(135deg, var(--color-gold), #b8860b);
  color: #060810;
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition);
}
.chat-send-btn:hover { box-shadow: var(--shadow-gold); transform: translateY(-1px); }
.chat-login-notice {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-muted);
  text-align: center;
}

/* ============================
   FOOTER / SOCIAL BAR
   ============================ */
.footer {
  background: var(--color-bg2);
  border-top: 2px solid var(--color-gold);
  padding: 40px 24px 20px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-logo img { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--color-gold); }
.footer-logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-gold2);
}
.footer-socials {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-white);
}
.btn-social:hover {
  border-color: var(--color-gold);
  color: var(--color-gold2);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}
.btn-social.x-btn { border-color: #333; }
.btn-social.community-btn { border-color: var(--color-blue2); color: #93c5fd; }
.btn-social.community-btn:hover { border-color: var(--color-gold); color: var(--color-gold2); }
.footer-ca-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.footer-ca-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-muted);
  white-space: nowrap;
}
.footer-ca-value {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-gold2);
  word-break: break-all;
  flex: 1;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-muted);
}
.footer-credit {
  color: var(--color-gold);
  font-weight: 600;
}

/* ============================
   TOAST NOTIFICATIONS
   ============================ */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  border-left: 4px solid var(--color-gold);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastIn 0.3s ease;
  pointer-events: all;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.success { background: #0d1a10; border-color: var(--color-green3); color: #a7f3c0; }
.toast.error   { background: #1a0d0d; border-color: var(--color-red2); color: #fca5a5; }
.toast.info    { background: var(--color-surface); border-color: var(--color-gold); color: var(--color-white); }
.toast-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.2; }

/* ============================
   SECTION TITLES
   ============================ */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--color-gold2);
  text-shadow: 0 0 24px rgba(212,160,23,0.3);
  margin-bottom: 6px;
}
.section-subtitle {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 24px;
}
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  margin: 40px 0;
}

/* ============================
   JOIN BUTTON / RACE ACTION
   ============================ */
.btn-join {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--color-green2), var(--color-green));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(34,128,63,0.3);
  margin-bottom: 10px;
}
.btn-join:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52,196,100,0.4);
}
.btn-join:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-leave {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--color-red2);
  border: 1.5px solid var(--color-red2);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-leave:hover { background: rgba(231,76,60,0.1); }

/* ============================
   WINNER OVERLAY
   ============================ */
.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.winner-overlay.active { opacity: 1; pointer-events: all; }
.winner-modal {
  background: var(--color-surface);
  border: 2px solid var(--color-gold);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 0 80px rgba(212,160,23,0.4);
  max-width: 480px;
  width: 100%;
  transform: scale(0.85);
  transition: transform 0.4s cubic-bezier(0.2,1.4,0.4,1);
}
.winner-overlay.active .winner-modal { transform: scale(1); }
.winner-trophy { font-size: 4rem; margin-bottom: 12px; }
.winner-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-gold2);
  text-shadow: var(--shadow-gold);
  margin-bottom: 8px;
}
.winner-horse-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-white);
  margin-bottom: 4px;
}
.winner-payout-amount {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-green3);
  text-shadow: 0 0 20px rgba(52,196,100,0.4);
  margin: 16px 0;
}
.winner-sub { font-family: var(--font-ui); font-size: 0.82rem; color: var(--color-muted); }

/* ============================
   ABOUT PAGE
   ============================ */
.about-hero {
  background: linear-gradient(135deg, #0a0f08, #0d1204);
  padding: 80px 24px 48px;
  text-align: center;
  border-bottom: 2px solid var(--color-gold);
}
.about-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px;
}
.about-section { margin-bottom: 48px; }
.about-section h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-gold2);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.about-section p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: #c8d0dc;
  line-height: 1.8;
  margin-bottom: 12px;
}
.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rules-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: #c8d0dc;
  line-height: 1.6;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.rules-list li::before {
  content: attr(data-num);
  min-width: 26px; height: 26px;
  background: var(--color-gold);
  color: #060810;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .navbar-links, .navbar-actions { display: none; }
  .navbar-hamburger { display: flex; }
  .navbar.menu-open .navbar-links,
  .navbar.menu-open .navbar-actions {
    display: flex;
    position: fixed;
    top: var(--nav-height); left: 0; right: 0;
    flex-direction: column;
    background: var(--color-bg2);
    border-bottom: 1px solid var(--color-gold);
    padding: 16px;
    gap: 8px;
    z-index: 999;
  }
  .navbar.menu-open .navbar-actions { top: auto; position: static; margin-top: 0; }
  .three-col { grid-template-columns: 1fr; }
  .main-container { padding: 20px 14px; }
  .stat-item { min-width: 120px; padding: 8px 10px; }
  .stat-value { font-size: 1rem; }
  .hero { min-height: 320px; }
  .auth-modal { max-width: 100%; }
  .winner-modal { padding: 28px 20px; }
}
@media (max-width: 480px) {
  .navbar-logo-text { display: none; }
  .hero-title { font-size: 1.8rem; }
  .stats-bar-inner { flex-wrap: wrap; }
  .stat-item { min-width: 50%; border-right: none; border-bottom: 1px solid var(--color-border); }
  .footer-top { flex-direction: column; }
  .footer-ca-section { flex-direction: column; align-items: flex-start; }
}

/* ============================
   LOADING SPINNER
   ============================ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(212,160,23,0.2);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Horse color classes */
.jockey-red     { --jockey-color: #e74c3c; }
.jockey-blue    { --jockey-color: #3498db; }
.jockey-green   { --jockey-color: #27ae60; }
.jockey-yellow  { --jockey-color: #f1c40f; }
.jockey-purple  { --jockey-color: #9b59b6; }
.jockey-orange  { --jockey-color: #e67e22; }
.jockey-pink    { --jockey-color: #e91e8c; }
.jockey-teal    { --jockey-color: #1abc9c; }
.jockey-white   { --jockey-color: #ecf0f1; }
.jockey-maroon  { --jockey-color: #8b0000; }
.jockey-navy    { --jockey-color: #001f5b; }
.jockey-lime    { --jockey-color: #bada55; }
.jockey-brown   { --jockey-color: #795548; }
.jockey-cyan    { --jockey-color: #00bcd4; }
.jockey-magenta { --jockey-color: #e040fb; }
.jockey-silver  { --jockey-color: #9e9e9e; }
.jockey-gold    { --jockey-color: #ffd700; }
.jockey-indigo  { --jockey-color: #3f51b5; }
.jockey-coral   { --jockey-color: #ff6b6b; }
.jockey-mint    { --jockey-color: #98ff98; }
.jockey-crimson { --jockey-color: #dc143c; }
.jockey-sky     { --jockey-color: #87ceeb; }
.jockey-amber   { --jockey-color: #ffbf00; }
.jockey-forest  { --jockey-color: #228b22; }
.jockey-violet  { --jockey-color: #ee82ee; }
