/* Offline Tailwind CSS Fallbacks & Custom Theme Styles for Bumi Khayangan Trail Run 2026 */
*, ::before, ::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: #334155; }
html, body { margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: #060d1a; color: #f8fafc; min-height: 100vh; overflow-x: hidden; }

/* Utilities fallback when Tailwind CDN is offline */
.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.w-screen { width: 100vw; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-7xl { max-width: 80rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-xl { max-width: 36rem; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Grid Columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
  .md\:text-5xl { font-size: 3rem; line-height: 1; }
  .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
  .md\:text-7xl { font-size: 4.5rem; line-height: 1; }
  .md\:p-6 { padding: 1.5rem; }
  .md\:p-8 { padding: 2rem; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-8 { grid-column: span 8 / span 8; }
  .lg\:col-span-7 { grid-column: span 7 / span 7; }
  .lg\:col-span-5 { grid-column: span 5 / span 5; }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
}

/* Spacing */
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* Typography */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.font-sans { font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-7xl { font-size: 4.5rem; line-height: 1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.tracking-tight { letter-spacing: -0.025em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Colors & Backgrounds */
.text-white { color: #ffffff; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-emerald-300 { color: #6ee7b7; }
.text-emerald-400 { color: #34d399; }
.text-emerald-500 { color: #10b981; }
.text-amber-300 { color: #fcd34d; }
.text-amber-400 { color: #fbbf24; }
.text-cyan-300 { color: #67e8f9; }
.text-cyan-400 { color: #22d3ee; }
.text-rose-300 { color: #fda4af; }
.text-rose-400 { color: #fb7185; }
.text-pink-400 { color: #f472b6; }
.text-sky-400 { color: #38bdf8; }

.bg-slate-950 { background-color: #020617; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-900\/80 { background-color: rgba(15, 23, 42, 0.8); }
.bg-slate-900\/60 { background-color: rgba(15, 23, 42, 0.6); }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-800\/80 { background-color: rgba(30, 41, 59, 0.8); }
.bg-slate-800\/50 { background-color: rgba(30, 41, 59, 0.5); }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2); }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.2); }
.bg-rose-500 { background-color: #f43f5e; }
.bg-rose-600 { background-color: #e11d48; }
.bg-rose-500\/10 { background-color: rgba(244, 63, 94, 0.1); }
.bg-rose-500\/20 { background-color: rgba(244, 63, 94, 0.2); }
.bg-cyan-500\/10 { background-color: rgba(6, 182, 212, 0.1); }
.bg-cyan-500\/20 { background-color: rgba(6, 182, 212, 0.2); }

/* Borders & Radius */
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-slate-700 { border-color: #334155; }
.border-slate-700\/60 { border-color: rgba(51, 65, 85, 0.6); }
.border-slate-800 { border-color: #1e293b; }
.border-emerald-500 { border-color: #10b981; }
.border-emerald-500\/30 { border-color: rgba(16, 185, 129, 0.3); }
.border-emerald-500\/40 { border-color: rgba(16, 185, 129, 0.4); }
.border-amber-500\/30 { border-color: rgba(245, 158, 11, 0.3); }
.border-amber-500\/40 { border-color: rgba(245, 158, 11, 0.4); }
.border-rose-500\/30 { border-color: rgba(244, 63, 94, 0.3); }
.border-cyan-500\/30 { border-color: rgba(6, 182, 212, 0.3); }

/* Layout & Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }
.object-cover { object-fit: cover; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.pointer-events-none { pointer-events: none; }
.transition-all { transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); }

/* Custom Trail Run Theme Components */
.trail-bg {
  background: radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.14), transparent 40%),
              radial-gradient(circle at 85% 20%, rgba(6, 182, 212, 0.12), transparent 40%),
              radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.08), transparent 45%),
              linear-gradient(180deg, #040914 0%, #091326 50%, #050b16 100%);
}

.glass-panel {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.glass-card {
  background: rgba(30, 41, 59, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Slot Machine Digit Drums */
.digit-slot {
  position: relative;
  width: 4.5rem;
  height: 6rem;
  background: linear-gradient(180deg, #060d1a 0%, #0f172a 50%, #060d1a 100%);
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 3.25rem;
  font-weight: 900;
  color: #f8fafc;
  box-shadow: inset 0 6px 14px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@media (min-width: 768px) {
  .digit-slot {
    width: 6rem;
    height: 7.75rem;
    font-size: 4.25rem;
    border-radius: 1.25rem;
  }
}

.digit-slot.led-size {
  width: clamp(5.5rem, 11vw, 10rem);
  height: clamp(7rem, 15vw, 13.5rem);
  font-size: clamp(3.75rem, 8.5vw, 7.5rem);
  border-radius: 1.5rem;
  border-width: 3px;
}

.digit-slot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.digit-slot.spinning {
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35), inset 0 4px 12px rgba(0,0,0,0.7);
  animation: slotBounce 0.14s infinite alternate ease-in-out;
}

.digit-slot.slowing {
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.45), inset 0 4px 12px rgba(0,0,0,0.7);
  transform: scale(1.04);
}

.digit-slot.locked {
  border-color: #22d3ee;
  color: #ffffff;
  background: linear-gradient(180deg, #082f49 0%, #0f172a 50%, #064e3b 100%);
  box-shadow: 0 0 35px rgba(34, 211, 238, 0.5), inset 0 2px 10px rgba(255,255,255,0.15);
  animation: popLock 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slot-match-box {
  position: relative;
  border: 3px solid #22d3ee;
  background: linear-gradient(180deg, #082f49 0%, #0f172a 50%, #064e3b 100%);
  box-shadow: 0 0 35px rgba(34, 211, 238, 0.5), inset 0 2px 10px rgba(255,255,255,0.15);
  overflow: hidden;
}

.slot-match-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

@keyframes slotBounce {
  0% { transform: translateY(-2px) scale(0.99); }
  100% { transform: translateY(2px) scale(1.01); }
}

@keyframes popLock {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* BIB Grid Box */
.bib-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.5rem;
}

.bib-chip {
  position: relative;
  padding: 0.45rem 0.25rem;
  border-radius: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.bib-chip:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

.bib-chip.cat-5k {
  border-bottom: 2px solid rgba(56, 189, 248, 0.55);
}

.bib-chip.cat-12k {
  border-bottom: 2px solid rgba(251, 191, 36, 0.55);
}

.bib-chip.drawn {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #6ee7b7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.bib-chip.voided {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
  text-decoration: line-through;
  opacity: 0.65;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.5); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.45); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.7); }

/* Button Glow Effects */
.btn-glow-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 8px 25px -4px rgba(16, 185, 129, 0.5);
}
.btn-glow-emerald:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -4px rgba(16, 185, 129, 0.7);
}

.btn-glow-rose {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
  box-shadow: 0 8px 25px -4px rgba(244, 63, 94, 0.55);
}
.btn-glow-rose:hover:not(:disabled) {
  background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
  transform: translateY(-2px);
}

.cat-pill {
  padding: 0.6rem 1.2rem;
  border-radius: 0.85rem;
  font-weight: 700;
  font-size: 0.875rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-pill:hover {
  border-color: rgba(52, 211, 153, 0.4);
  color: #e2e8f0;
}

.cat-pill.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.2));
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}
