:root {
  /* TougeNation brand palette — canonical 4 colors, mirrored from
     tn-website/public/home/theme.css (see 1-Website/tn-website/public/home/brand-tokens.css).
     Do not substitute lime variants (#C6D92D is TougeCon legacy). */
  --primary:        #B6F109;
  --accent:         #B6F109;
  --bg-primary:     #070B0D;
  --bg-secondary:   #0d1114;
  --bg-tertiary:    #04060a;
  --tan:            #014B43;
  --text:           #F1F5F9;
  --text-secondary: #cbd5e1;
  --text-tertiary:  #9CA3AF;
  --border:         #1c2026;
  --border-strong:  #2d3138;
  --success:        #B6F109;
  --warning:        #F5A623;
  --danger:         #f87171;
  --info:           #5BB3F5;
  --nav-h:          64px;
  --safe-bottom:    env(safe-area-inset-bottom, 0px);
  --safe-top:       env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body {
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

.offline-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 6px 16px;
  padding-top: calc(6px + var(--safe-top));
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  padding-top: calc(10px + var(--safe-top));
}
.header h1 {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  line-height: 1;
}
.header-logo {
  width: 40px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.content { padding: 16px; max-width: 720px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 24px 0 12px;
}

/* ---------- Home tab ---------- */
/* Compact hero: logo + name stay on screen but take as little room as
   possible — the point of Home is the quick links below. */
.home-hero {
  text-align: center;
  padding: 2px 12px 4px;
}
.home-logo {
  width: 84px;
  height: auto;
  margin-bottom: 0;
  filter: drop-shadow(0 0 14px rgba(182, 241, 9, 0.12));
}
.home-hero h2 {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--text);
}
.tagline { color: var(--text-secondary); font-size: 11px; margin-top: 0; }
.home-hero .section-title { margin-top: 10px; }


.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  min-height: 96px;
  transition: transform 0.05s, border-color 0.1s;
}
.quick-tile:active { transform: scale(0.98); }
.quick-icon {
  width: 26px;
  height: 26px;
  fill: var(--primary);
  margin-bottom: 8px;
}
.quick-emergency .quick-icon { fill: var(--danger); }
.quick-label { font-size: 13px; font-weight: 700; }

/* Generic card (routes tips, emergency protocol, medical) */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.todo-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
  text-align: left;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.todo-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}
.todo-icon svg { width: 20px; height: 20px; fill: currentColor; }
.accent-bg { background: rgba(182, 241, 9, 0.12); color: var(--accent); }
.info-bg { background: rgba(91, 179, 245, 0.12); color: var(--info); }
.warning-bg { background: rgba(245, 166, 35, 0.12); color: var(--warning); }
.todo-text { flex: 1; }
.todo-text h3 { font-size: 15px; font-weight: 700; }
.todo-text p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.todo-arrow { color: var(--text-tertiary); font-size: 22px; }
.btn-install, .btn-notif {
  background: var(--primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.btn-notif { background: var(--accent); color: #fff; }

/* ---------- Schedule tab ---------- */
.schedule-loading { display: flex; flex-direction: column; gap: 12px; }
.skeleton-card {
  height: 80px;
  background: linear-gradient(90deg, var(--bg-secondary) 0%, var(--bg-tertiary) 50%, var(--bg-secondary) 100%);
  background-size: 200% 100%;
  border-radius: 12px;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.schedule-error {
  background: var(--bg-secondary);
  border: 1px solid var(--danger);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.btn-retry {
  margin-top: 10px;
  background: var(--primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 800;
  cursor: pointer;
}
.schedule-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
}

.schedule-day {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.day-header-row {
  padding: 14px 16px;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.day-arrow { color: var(--text-tertiary); }
.schedule-day-body { display: none; padding: 0 14px 12px; }
.schedule-day.expanded .schedule-day-body { display: block; }
.schedule-day.expanded .day-arrow { transform: rotate(0deg); }
.day-arrow { display: inline-block; transition: transform 0.2s; }

.schedule-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.schedule-item:first-child { border-top: none; }
.schedule-time { color: var(--primary); font-weight: 800; font-size: 14px; min-width: 80px; }
.schedule-event { font-weight: 700; font-size: 15px; }
.schedule-location {
  display: inline-block;
  font-size: 13px;
  color: var(--info);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: 2px;
}
.schedule-detail { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.pill {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Routes tab ---------- */
.nav-tips-card { margin-bottom: 16px; }
.nav-tips-title {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.tip-row { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.tip-row:last-child { margin-bottom: 0; }
.tip-row strong { color: var(--text); }

.route-card {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: var(--text);
}
.route-accent-0 { border-left-color: var(--primary); }
.route-accent-1 { border-left-color: var(--info); }
.route-accent-2 { border-left-color: var(--warning); }
.route-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.route-name {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.route-open { color: var(--text-tertiary); font-size: 16px; }
.route-session {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(182, 241, 9, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.route-blurb { margin-top: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.route-cta {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.routes-footnote {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.6;
}

/* Placeholder badge — marks links/locations that are stand-ins, not final */
.placeholder-note {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px dashed var(--warning);
  background: rgba(245, 166, 35, 0.08);
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Info tab ---------- */
.info-section { margin-top: 18px; }
.venue-cards { display: flex; flex-direction: column; gap: 10px; }
.venue-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.venue-head { display: flex; align-items: center; gap: 12px; }
.venue-day-chip {
  background: rgba(182, 241, 9, 0.12);
  color: var(--primary);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 8px;
  padding: 8px 10px;
  flex-shrink: 0;
}
.venue-chip-sat { background: rgba(91, 179, 245, 0.12); color: var(--info); }
.venue-name { font-weight: 700; font-size: 14px; }
.venue-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.venue-directions {
  display: inline-block;
  margin-top: 10px;
  margin-left: 52px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after { content: '+'; color: var(--text-tertiary); font-size: 18px; }
.faq-item[open] summary::after { content: '−'; }
.faq-a { padding-top: 8px; color: var(--text-secondary); font-size: 14px; }

.sponsor-tiers { display: flex; flex-direction: column; gap: 10px; }
.sponsor-tier {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.sponsor-tier-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 4px;
}
.sponsor-tier-names { font-size: 14px; color: var(--text); }

.vendor-list { display: flex; flex-direction: column; gap: 8px; }
.vendor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.vendor-name { font-weight: 700; font-size: 14px; }
.vendor-cat { font-size: 12px; color: var(--text-secondary); }
.vendor-booth {
  background: var(--bg-tertiary);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
}

.info-link {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  text-align: center;
}

/* ---------- Announcements tab ---------- */
.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.ann-time {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 700;
}
.ann-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.ann-body { color: var(--text-secondary); font-size: 14px; }

/* ---------- Emergency tab ---------- */
.em-hero { text-align: center; padding: 16px 12px 8px; }
.em-icon { width: 44px; height: 44px; fill: var(--danger); margin-bottom: 8px; }
.em-hero h2 {
  font-family: "Orbitron", "Inter", sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: var(--danger);
}
.em-hero p { color: var(--text-secondary); font-size: 14px; margin-top: 2px; }
.em-protocol {
  border-left: 4px solid var(--danger);
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 12px;
}
.em-protocol strong { color: var(--text); }
.em-note { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.em-note strong { color: var(--text); }
.em-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
}
.em-tile-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.em-tile-icon svg { width: 20px; height: 20px; fill: currentColor; }
.em-danger-bg { background: rgba(248, 113, 113, 0.14); color: var(--danger); }
.em-accent-bg { background: rgba(182, 241, 9, 0.12); color: var(--accent); }
.em-info-bg { background: rgba(91, 179, 245, 0.12); color: var(--info); }
.em-tile-text { flex: 1; }
.em-tile-name { font-weight: 700; font-size: 15px; }
.em-tile-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Roster tab ---------- */
.roster-note {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 2px 14px;
  line-height: 1.6;
}
.roster-note strong { color: var(--primary); font-weight: 800; }
.roster-count { color: var(--primary); font-weight: 800; }
.roster-list { display: flex; flex-direction: column; gap: 8px; }
.roster-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 12px 14px;
}
.roster-car { font-weight: 700; font-size: 14px; }
.roster-driver { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.nav-item {
  background: none;
  border: none;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 8px;
  margin: 0 2px;
  cursor: pointer;
  font-family: inherit;
  flex: 1 1 0;
  min-width: 0;
}
.nav-item svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }
.nav-item.active { color: var(--primary); }

/* Narrow screens: shrink label instead of letting the last tab clip off-screen */
@media (max-width: 360px) {
  .nav-item { font-size: 10px; padding: 8px 4px; letter-spacing: -0.01em; }
  .nav-item svg { width: 20px; height: 20px; }
}
