/* ============================================================
   TIER 8C FEATURES CSS — First Out App
   Features: Commute Autopilot, Race the Tube, Buggy / Pram Mode

   Integration:
     1. Add <link rel="stylesheet" href="/tier8c-features.css"> to <head>
     2. Add <script src="/tier8c-features.js" defer></script> before </body>
     3. The JS will inject HTML as needed — no manual HTML insertion required.
     4. CSS variables from the main app (--bg, --accent, etc.) are used.
   ============================================================ */


/* ============================================================
   18. COMMUTE AUTOPILOT — "GET ME HOME"
   Setup card, home button, autopilot overlay, history modal.
   ============================================================ */

/* --- Autopilot Section on Home Screen --- */

.t8c-autopilot-section {
  padding: 16px;
  margin-bottom: 8px;
}

/* --- Setup Card (first-time) --- */

.t8c-setup-card {
  background: var(--bg-card, #141829);
  border: 1px dashed rgba(76, 154, 255, 0.3);
  border-radius: var(--radius, 14px);
  padding: 28px 24px;
  text-align: center;
}

.t8c-setup-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.t8c-setup-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin: 0 0 8px;
}

.t8c-setup-desc {
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
  margin: 0 0 20px;
  line-height: 1.5;
}

.t8c-setup-btn {
  background: linear-gradient(135deg, #4C9AFF 0%, #2E7BFF 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: var(--radius-sm, 10px);
  padding: 12px 32px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-setup-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(76, 154, 255, 0.35);
}

.t8c-setup-btn:active {
  transform: scale(0.97);
}

/* --- GET ME HOME Button --- */

.t8c-get-me-home-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: linear-gradient(135deg, #4C9AFF 0%, #2E7BFF 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius, 14px);
  padding: 20px 24px;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 20px rgba(76, 154, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  animation: t8c-pulse-glow 2s ease-in-out infinite;
}

@keyframes t8c-pulse-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(76, 154, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2); }
  50% { box-shadow: 0 4px 28px rgba(76, 154, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.25); }
}

.t8c-get-me-home-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 28px rgba(76, 154, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.t8c-get-me-home-btn:active {
  transform: scale(0.98);
}

.t8c-gmh-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.t8c-gmh-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t8c-gmh-label {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.t8c-gmh-station {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
}

.t8c-gmh-arrow {
  font-size: 28px;
  font-weight: 300;
  opacity: 0.7;
  flex-shrink: 0;
}

/* --- Smart Suggestion --- */

.t8c-smart-suggestion {
  background: rgba(76, 154, 255, 0.08);
  border: 1px solid rgba(76, 154, 255, 0.15);
  border-radius: var(--radius-sm, 10px);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent, #4C9AFF);
  line-height: 1.4;
}

/* --- Commute Actions --- */

.t8c-commute-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.t8c-commute-action-btn {
  flex: 1;
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary, #8B92A8);
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-commute-action-btn:hover {
  background: var(--bg-card-hover, #1C2137);
}

/* --- Autopilot Result Overlay --- */

.t8c-autopilot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: t8c-fadeIn 0.25s ease-out;
  padding: 20px;
}

@keyframes t8c-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.t8c-autopilot-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated, #1E2340);
  border-radius: var(--radius, 14px);
  padding: 24px;
  animation: t8c-scaleIn 0.3s ease-out;
}

@keyframes t8c-scaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.t8c-autopilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.t8c-autopilot-dir-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
}

.t8c-autopilot-destination {
  text-align: center;
  margin-bottom: 16px;
}

.t8c-dest-label {
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.t8c-dest-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text, #F0F2F8);
}

.t8c-autopilot-line {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #F0F2F8);
  margin-bottom: 16px;
}

/* --- Line dot (shared) --- */

.t8c-line-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Status Cards --- */

.t8c-autopilot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.t8c-status-loading {
  background: rgba(76, 154, 255, 0.08);
  color: var(--accent, #4C9AFF);
}

.t8c-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(76, 154, 255, 0.2);
  border-top-color: var(--accent, #4C9AFF);
  border-radius: 50%;
  animation: t8c-spin 0.8s linear infinite;
}

@keyframes t8c-spin {
  to { transform: rotate(360deg); }
}

.t8c-status-disrupted {
  background: rgba(255, 86, 48, 0.1);
  color: var(--red, #FF5630);
}

.t8c-status-good {
  background: rgba(54, 179, 126, 0.1);
  color: var(--green, #36B37E);
}

.t8c-disruption-reason {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  line-height: 1.5;
  margin-bottom: 12px;
  padding: 0 4px;
}

/* --- Alternative Lines --- */

.t8c-alt-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.t8c-alt-line-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text, #F0F2F8);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-alt-line-btn:hover {
  background: var(--bg-card-hover, #1C2137);
  border-color: rgba(255,255,255,0.15);
}

/* --- Position Indicator --- */

.t8c-autopilot-position {
  text-align: center;
  padding: 16px;
  background: rgba(76, 154, 255, 0.06);
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 12px;
}

.t8c-position-label {
  font-size: 20px;
  font-weight: 800;
  color: var(--text, #F0F2F8);
  margin-bottom: 4px;
}

.t8c-pos-front .t8c-position-label { color: var(--green, #36B37E); }
.t8c-pos-back .t8c-position-label { color: var(--amber, #FFAB00); }
.t8c-pos-middle .t8c-position-label { color: var(--accent, #4C9AFF); }

.t8c-exit-name {
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
}

.t8c-no-exit-info {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 12px;
}

/* --- Train Diagram --- */

.t8c-train-visual {
  text-align: center;
  margin-bottom: 16px;
}

.t8c-train-diagram {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.t8c-train-car {
  width: 48px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, #8B92A8);
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 4px;
}

.t8c-train-car.t8c-car-active {
  background: var(--accent, #4C9AFF);
  color: #fff;
  border-color: var(--accent, #4C9AFF);
}

.t8c-train-arrow {
  font-size: 11px;
  color: var(--accent, #4C9AFF);
  font-weight: 600;
}

.t8c-autopilot-from {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t8c-from-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

/* --- Shared Modal Styles --- */

.t8c-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10000;
  animation: t8c-fadeIn 0.25s ease-out;
}

.t8c-modal-content {
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-elevated, #1E2340);
  border-radius: var(--radius, 14px) var(--radius, 14px) 0 0;
  padding: 24px 20px 32px;
  animation: t8c-slideUp 0.3s ease-out;
}

.t8c-modal-tall {
  max-height: 90vh;
}

@keyframes t8c-slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.t8c-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.t8c-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin: 0;
}

.t8c-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary, #8B92A8);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
}

.t8c-empty-state {
  text-align: center;
  padding: 32px 16px;
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
  line-height: 1.5;
}

/* --- Setup Form --- */

.t8c-setup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.t8c-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.t8c-form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #F0F2F8);
}

.t8c-autocomplete-wrap {
  position: relative;
}

.t8c-form-input {
  width: 100%;
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: var(--text, #F0F2F8);
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.t8c-form-input:focus {
  border-color: var(--accent, #4C9AFF);
}

.t8c-form-input::placeholder {
  color: var(--text-secondary, #8B92A8);
  opacity: 0.6;
}

.t8c-autocomplete-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated, #1E2340);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 0 0 var(--radius-sm, 10px) var(--radius-sm, 10px);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.t8c-autocomplete-item {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text, #F0F2F8);
  cursor: pointer;
  transition: background 0.1s ease;
}

.t8c-autocomplete-item:hover {
  background: var(--bg-card-hover, #1C2137);
}

.t8c-autocomplete-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  text-align: center;
}

/* --- Line Options --- */

.t8c-line-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.t8c-line-option {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card, #141829);
  border: 2px solid transparent;
  border-radius: var(--radius-sm, 10px);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text, #F0F2F8);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-line-option:hover {
  background: var(--bg-card-hover, #1C2137);
}

.t8c-line-option.selected {
  border-color: var(--line-colour, var(--accent, #4C9AFF));
  background: rgba(76, 154, 255, 0.06);
}

/* --- Save / Reset Buttons --- */

.t8c-save-btn {
  background: linear-gradient(135deg, #4C9AFF 0%, #2E7BFF 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: var(--radius-sm, 10px);
  padding: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-save-btn:hover {
  transform: scale(1.02);
}

.t8c-save-btn:active {
  transform: scale(0.98);
}

.t8c-reset-btn {
  background: none;
  border: 1px solid rgba(255, 86, 48, 0.3);
  color: var(--red, #FF5630);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border-radius: var(--radius-sm, 10px);
  padding: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-reset-btn:hover {
  background: rgba(255, 86, 48, 0.06);
}

/* --- Commute History --- */

.t8c-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t8c-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card, #141829);
  border-radius: var(--radius-sm, 10px);
}

.t8c-history-dir {
  font-size: 20px;
  flex-shrink: 0;
}

.t8c-history-info {
  flex: 1;
  min-width: 0;
}

.t8c-history-station {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #F0F2F8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t8c-history-meta {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  margin-top: 2px;
}


/* ============================================================
   19. RACE THE TUBE — GAMIFIED EXIT TIMING
   Race button, timer overlay, result screen, leaderboard.
   ============================================================ */

/* --- Race Section on Result Screen --- */

.t8c-race-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  margin-top: 8px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t8c-race-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  width: 100%;
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: var(--text, #F0F2F8);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-race-btn:hover {
  background: var(--bg-card-hover, #1C2137);
  border-color: rgba(255, 255, 255, 0.12);
}

.t8c-race-btn:active {
  transform: scale(0.98);
}

.t8c-race-icon {
  flex-shrink: 0;
  opacity: 0.8;
}

.t8c-race-pb-badge {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber, #FFAB00);
  padding: 6px 12px;
  background: rgba(255, 171, 0, 0.08);
  border-radius: var(--radius-sm, 10px);
}

.t8c-leaderboard-btn {
  background: none;
  border: none;
  color: var(--accent, #4C9AFF);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 8px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.t8c-leaderboard-btn:hover {
  text-decoration: underline;
}

/* --- Race Timer Overlay --- */

.t8c-race-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: t8c-fadeIn 0.2s ease-out;
}

.t8c-race-card {
  text-align: center;
  padding: 40px 32px;
  width: 100%;
  max-width: 360px;
  position: relative;
}

.t8c-race-header {
  margin-bottom: 32px;
}

.t8c-race-station-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin-bottom: 4px;
}

.t8c-race-subtitle {
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
}

.t8c-race-timer {
  font-size: 72px;
  font-weight: 800;
  color: var(--accent, #4C9AFF);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
  line-height: 1;
}

.t8c-race-timer-label {
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 24px;
}

.t8c-race-pulse {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent, #4C9AFF);
  margin: 0 auto 32px;
  animation: t8c-racePulse 1.2s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes t8c-racePulse {
  0%, 100% { transform: scale(0.9); opacity: 0.3; border-color: var(--accent, #4C9AFF); }
  50% { transform: scale(1.1); opacity: 0.6; border-color: var(--green, #36B37E); }
}

.t8c-race-done-btn {
  width: 100%;
  background: linear-gradient(135deg, #36B37E 0%, #2DA36E 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: var(--radius, 14px);
  padding: 18px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(54, 179, 126, 0.35);
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 12px;
}

.t8c-race-done-btn:hover {
  transform: scale(1.03);
}

.t8c-race-done-btn:active {
  transform: scale(0.97);
}

.t8c-race-cancel {
  background: none;
  border: none;
  color: var(--text-secondary, #8B92A8);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 8px 16px;
  -webkit-tap-highlight-color: transparent;
}

.t8c-race-cancel:hover {
  color: var(--text, #F0F2F8);
}

/* --- Race Result --- */

.t8c-race-result-card {
  text-align: center;
  background: var(--bg-elevated, #1E2340);
  border-radius: var(--radius, 14px);
  padding: 32px 24px;
  max-width: 360px;
  width: 100%;
  animation: t8c-scaleIn 0.3s ease-out;
}

.t8c-race-pb-glow {
  box-shadow: 0 0 30px rgba(255, 171, 0, 0.3), 0 0 60px rgba(255, 171, 0, 0.1);
  animation: t8c-scaleIn 0.3s ease-out, t8c-pbGlow 2s ease-in-out infinite;
}

@keyframes t8c-pbGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 171, 0, 0.3), 0 0 60px rgba(255, 171, 0, 0.1); }
  50% { box-shadow: 0 0 40px rgba(255, 171, 0, 0.4), 0 0 80px rgba(255, 171, 0, 0.15); }
}

.t8c-race-result-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

.t8c-race-result-time {
  font-size: 56px;
  font-weight: 800;
  color: var(--text, #F0F2F8);
  line-height: 1;
  margin-bottom: 8px;
}

.t8c-race-result-rank {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 4px 16px;
  border-radius: 20px;
  display: inline-block;
}

.t8c-rank-lightning {
  color: #FFAB00;
  background: rgba(255, 171, 0, 0.1);
}

.t8c-rank-speedy {
  color: var(--green, #36B37E);
  background: rgba(54, 179, 126, 0.1);
}

.t8c-rank-steady {
  color: var(--accent, #4C9AFF);
  background: rgba(76, 154, 255, 0.1);
}

.t8c-rank-tourist {
  color: var(--text-secondary, #8B92A8);
  background: rgba(139, 146, 168, 0.1);
}

.t8c-race-result-station {
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 12px;
}

.t8c-race-new-pb {
  font-size: 14px;
  font-weight: 700;
  color: var(--amber, #FFAB00);
  padding: 8px 14px;
  background: rgba(255, 171, 0, 0.08);
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 12px;
}

.t8c-race-fun-fact {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 16px;
}

.t8c-race-result-actions {
  display: flex;
  gap: 8px;
}

.t8c-race-share-btn {
  flex: 1;
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--accent, #4C9AFF);
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-race-share-btn:hover {
  background: var(--bg-card-hover, #1C2137);
}

.t8c-race-close-btn {
  flex: 1;
  background: var(--accent, #4C9AFF);
  border: none;
  border-radius: var(--radius-sm, 10px);
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-race-close-btn:hover {
  transform: scale(1.02);
}

/* --- Leaderboard --- */

.t8c-lb-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.t8c-lb-stat {
  flex: 1;
  text-align: center;
  background: var(--bg-card, #141829);
  border-radius: var(--radius-sm, 10px);
  padding: 14px 8px;
}

.t8c-lb-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text, #F0F2F8);
  margin-bottom: 4px;
}

.t8c-lb-stat-label {
  font-size: 11px;
  color: var(--text-secondary, #8B92A8);
  line-height: 1.3;
}

.t8c-lb-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin: 20px 0 10px;
}

.t8c-lb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t8c-lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card, #141829);
  border-radius: var(--radius-sm, 10px);
}

.t8c-lb-rank {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary, #8B92A8);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.t8c-lb-info {
  flex: 1;
  min-width: 0;
}

.t8c-lb-station {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #F0F2F8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t8c-lb-exit {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t8c-lb-time {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  flex-shrink: 0;
}


/* ============================================================
   20. BUGGY / PRAM MODE
   Toggle, info card, score badge, baby changing modal.
   ============================================================ */

/* --- Buggy Mode Toggle --- */

.t8c-buggy-toggle-wrap {
  padding: 4px 16px 8px;
}

.t8c-buggy-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 10px 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-buggy-toggle:hover {
  background: var(--bg-card-hover, #1C2137);
}

.t8c-buggy-toggle.t8c-buggy-active {
  border-color: rgba(54, 179, 126, 0.3);
  background: rgba(54, 179, 126, 0.06);
}

.t8c-buggy-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.t8c-buggy-toggle-label {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #F0F2F8);
  text-align: left;
}

.t8c-buggy-switch {
  flex-shrink: 0;
}

.t8c-buggy-switch-track {
  display: block;
  width: 40px;
  height: 22px;
  background: var(--bg-elevated, #1E2340);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s ease;
}

.t8c-buggy-active .t8c-buggy-switch-track {
  background: var(--green, #36B37E);
}

.t8c-buggy-switch-thumb {
  display: block;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.t8c-buggy-active .t8c-buggy-switch-thumb {
  transform: translateX(18px);
}

/* --- Buggy Info Card --- */

.t8c-buggy-card {
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius, 14px);
  padding: 16px;
  margin: 12px 16px 0;
}

.t8c-buggy-card.t8c-buggy-good {
  border-color: rgba(54, 179, 126, 0.2);
}

.t8c-buggy-card.t8c-buggy-ok {
  border-color: rgba(255, 171, 0, 0.2);
}

.t8c-buggy-card.t8c-buggy-difficult {
  border-color: rgba(255, 86, 48, 0.15);
}

.t8c-buggy-card.t8c-buggy-avoid {
  border-color: rgba(255, 86, 48, 0.25);
}

.t8c-buggy-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.t8c-buggy-card-icon {
  font-size: 18px;
}

.t8c-buggy-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  flex: 1;
}

.t8c-buggy-score {
  display: flex;
  align-items: center;
  gap: 6px;
}

.t8c-buggy-score-stars {
  font-size: 14px;
  letter-spacing: 1px;
}

.t8c-star-filled {
  color: var(--amber, #FFAB00);
}

.t8c-star-empty {
  color: rgba(255, 255, 255, 0.15);
}

.t8c-buggy-score-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary, #8B92A8);
}

.t8c-buggy-no-data {
  border-color: var(--border, rgba(255,255,255,0.08));
}

.t8c-buggy-no-data-text {
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  text-align: center;
  padding: 8px 0;
}

/* --- Buggy Details --- */

.t8c-buggy-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.t8c-buggy-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.t8c-buggy-detail-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1.4;
}

.t8c-buggy-detail-text {
  color: var(--text, #F0F2F8);
}

.t8c-buggy-detail-text.t8c-buggy-good { color: var(--green, #36B37E); }
.t8c-buggy-detail-text.t8c-buggy-ok { color: var(--amber, #FFAB00); }
.t8c-buggy-detail-text.t8c-buggy-difficult { color: var(--red, #FF5630); }
.t8c-buggy-detail-text.t8c-buggy-avoid { color: var(--red, #FF5630); }

.t8c-buggy-detail-warn {
  padding: 4px 0;
}

.t8c-buggy-detail-bonus .t8c-buggy-detail-text {
  color: var(--green, #36B37E);
  font-weight: 600;
}

/* --- Buggy Tips --- */

.t8c-buggy-tips {
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  line-height: 1.5;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 8px;
}

.t8c-buggy-tips-label {
  font-weight: 600;
  color: var(--amber, #FFAB00);
}

/* --- Quiet Times --- */

.t8c-buggy-quiet {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  padding: 8px 0 12px;
  line-height: 1.4;
}

/* --- Find Baby Changing Button --- */

.t8c-buggy-find-changing {
  width: 100%;
  background: rgba(54, 179, 126, 0.08);
  border: 1px solid rgba(54, 179, 126, 0.2);
  border-radius: var(--radius-sm, 10px);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--green, #36B37E);
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8c-buggy-find-changing:hover {
  background: rgba(54, 179, 126, 0.12);
}

/* --- Buggy Badge (exits screen) --- */

.t8c-buggy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.t8c-buggy-badge.t8c-buggy-good {
  color: var(--green, #36B37E);
  background: rgba(54, 179, 126, 0.1);
}

.t8c-buggy-badge.t8c-buggy-ok {
  color: var(--amber, #FFAB00);
  background: rgba(255, 171, 0, 0.1);
}

.t8c-buggy-badge.t8c-buggy-difficult {
  color: var(--red, #FF5630);
  background: rgba(255, 86, 48, 0.08);
}

.t8c-buggy-badge.t8c-buggy-avoid {
  color: var(--red, #FF5630);
  background: rgba(255, 86, 48, 0.12);
}

/* --- Buggy Line Suggestion --- */

.t8c-buggy-line-suggestion {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  padding: 10px 16px;
  margin-top: 4px;
}

.t8c-buggy-line-label {
  font-weight: 600;
  color: var(--green, #36B37E);
}

/* --- Baby Changing Modal --- */

.t8c-baby-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.t8c-baby-station {
  background: var(--bg-card, #141829);
  border-radius: var(--radius-sm, 10px);
  padding: 14px;
}

.t8c-baby-station-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin-bottom: 4px;
}

.t8c-baby-station-meta {
  font-size: 12px;
  color: var(--green, #36B37E);
}

.t8c-baby-note {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  line-height: 1.5;
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm, 10px);
}
