/* ============================================================
   TIER 8A FEATURES CSS — First Out App
   Features: Time Saved Counter, Tube Wrapped, Shareable Cards,
             Station Collection Game

   Integration:
     1. Add <link rel="stylesheet" href="/tier8a-features.css"> to <head>
     2. Add <script src="/tier8a-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.
   ============================================================ */


/* ============================================================
   1. TIME SAVED COUNTER
   Odometer-style counter, milestones, breakdown, sharing.
   ============================================================ */

.t8a-time-saved-widget {
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius, 14px);
  padding: 20px;
  margin: 16px 0;
  text-align: center;
}

.t8a-ts-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.t8a-ts-icon {
  font-size: 20px;
  line-height: 1;
}

.t8a-ts-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* --- Odometer --- */

.t8a-ts-odometer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-bottom: 4px;
  min-height: 64px;
}

.t8a-odo-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 56px;
  background: var(--bg-elevated, #1E2340);
  border-radius: var(--radius-sm, 10px);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent, #4C9AFF);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.t8a-odo-digit.t8a-odo-roll {
  animation: t8a-odo-roll 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes t8a-odo-roll {
  0% { transform: translateY(20px); opacity: 0.3; }
  50% { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.t8a-odo-dot {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-secondary, #8B92A8);
  margin: 0 -2px;
  line-height: 56px;
}

.t8a-ts-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 12px;
}

.t8a-ts-today {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 8px;
}

.t8a-ts-comparison {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  font-style: italic;
  margin-bottom: 16px;
  min-height: 16px;
}

/* --- Actions --- */

.t8a-ts-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.t8a-ts-expand-btn,
.t8a-ts-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  background: transparent;
  color: var(--text-secondary, #8B92A8);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-ts-expand-btn:hover,
.t8a-ts-share-btn:hover {
  background: var(--bg-card-hover, #1C2137);
  color: var(--text, #F0F2F8);
}

.t8a-ts-expand-btn svg {
  transition: transform 0.3s ease;
}

.t8a-ts-expand-btn.t8a-expanded svg {
  transform: rotate(180deg);
}

.t8a-ts-share-btn {
  color: var(--accent, #4C9AFF);
  border-color: rgba(76, 154, 255, 0.2);
}

.t8a-ts-share-btn:hover {
  background: rgba(76, 154, 255, 0.1);
  color: var(--accent, #4C9AFF);
}

/* --- Breakdown --- */

.t8a-ts-breakdown {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t8a-ts-bd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.t8a-ts-bd-row + .t8a-ts-bd-row {
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t8a-ts-bd-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
}

.t8a-ts-bd-value {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text, #F0F2F8);
  font-weight: 500;
}


/* ============================================================
   MILESTONE TOAST (shared with badges)
   ============================================================ */

.t8a-milestone-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 10000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.t8a-milestone-toast-visible {
  transform: translateX(-50%) translateY(0);
}

.t8a-milestone-toast-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-elevated, #1E2340);
  border: 1px solid var(--accent, #4C9AFF);
  border-radius: var(--radius, 14px);
  box-shadow: 0 8px 32px rgba(76, 154, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
  max-width: 340px;
}

.t8a-milestone-emoji {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.t8a-milestone-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text, #F0F2F8);
  font-weight: 500;
  line-height: 1.4;
}

.t8a-badge-toast .t8a-milestone-toast-inner {
  border-color: var(--green, #36B37E);
  box-shadow: 0 8px 32px rgba(54, 179, 126, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.t8a-badge-toast-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--green, #36B37E);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}


/* ============================================================
   2. TUBE WRAPPED
   Full-screen overlay, swipeable slides, sharing.
   ============================================================ */

/* --- Wrapped Button (Home) --- */

.t8a-wrapped-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(76, 154, 255, 0.1) 0%, rgba(155, 0, 86, 0.1) 100%);
  border: 1px solid rgba(76, 154, 255, 0.2);
  border-radius: var(--radius, 14px);
  color: var(--text, #F0F2F8);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 12px 0;
  -webkit-tap-highlight-color: transparent;
}

.t8a-wrapped-btn:hover {
  background: linear-gradient(135deg, rgba(76, 154, 255, 0.15) 0%, rgba(155, 0, 86, 0.15) 100%);
  border-color: rgba(76, 154, 255, 0.35);
}

.t8a-wrapped-btn:active {
  transform: scale(0.98);
}

.t8a-wrapped-icon {
  font-size: 22px;
  line-height: 1;
}

.t8a-wrapped-label {
  flex: 1;
  text-align: left;
}

.t8a-wrapped-arrow {
  opacity: 0.5;
}

/* --- Wrapped Overlay --- */

.t8a-wrapped-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg, #0A0E1A);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
}

.t8a-wrapped-visible {
  opacity: 1;
}

.t8a-wrapped-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text, #F0F2F8);
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-wrapped-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Slides --- */

.t8a-wrapped-slides {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.t8a-wrapped-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.t8a-wrapped-slide.t8a-slide-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- Slide Content --- */

.t8a-ws-content {
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.t8a-ws-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #8B92A8);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.t8a-ws-detail {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  color: var(--text-secondary, #8B92A8);
  margin-top: 12px;
}

.t8a-ws-fun {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
  font-style: italic;
  margin-top: 16px;
  opacity: 0.7;
}

/* Slide 1: Title */

.t8a-ws-roundel {
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto 32px;
}

.t8a-ws-roundel-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid var(--accent, #4C9AFF);
}

.t8a-ws-roundel-bar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent, #4C9AFF);
  color: #fff;
  padding: 6px 0;
  width: 100%;
  text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
}

.t8a-ws-roundel-small {
  width: 60px;
  height: 60px;
  margin-bottom: 24px;
}

.t8a-ws-roundel-small .t8a-ws-roundel-ring {
  border-width: 4px;
}

.t8a-ws-roundel-small .t8a-ws-roundel-bar {
  font-size: 11px;
  padding: 4px 0;
}

.t8a-ws-big-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 42px;
  font-weight: 800;
  color: var(--text, #F0F2F8);
  line-height: 1.1;
  margin-bottom: 12px;
}

.t8a-ws-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  color: var(--text-secondary, #8B92A8);
}

/* Slide 2: Time */

.t8a-ws-big-number {
  margin: 16px 0;
}

.t8a-ws-num {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 72px;
  font-weight: 800;
  color: var(--accent, #4C9AFF);
  line-height: 1;
}

.t8a-ws-unit {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
  margin-left: 2px;
}

/* Slide 3: Station */

.t8a-ws-station-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--text, #F0F2F8);
  line-height: 1.2;
  margin: 8px 0;
}

.t8a-ws-station-pin {
  font-size: 48px;
  margin-top: 24px;
  opacity: 0.6;
}

/* Slide 4: Line */

.t8a-ws-line-stripe {
  height: 8px;
  border-radius: 4px;
  width: 80%;
  margin: 0 auto 20px;
}

.t8a-ws-line-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}

/* Slide 5: Position */

.t8a-ws-pos-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text, #F0F2F8);
  line-height: 1.4;
  margin-bottom: 8px;
}

.t8a-ws-pos-highlight {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent, #4C9AFF);
  display: block;
  margin-top: 4px;
}

.t8a-ws-train {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.t8a-ws-train-car {
  width: 48px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
  transition: all 0.3s ease;
}

.t8a-ws-car-highlight {
  background: var(--accent, #4C9AFF);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(76, 154, 255, 0.4);
}

/* Slide 6: Stations Visited */

.t8a-ws-circle-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 16px auto;
}

.t8a-ws-circle {
  width: 100%;
  height: 100%;
}

.t8a-ws-circle-progress {
  transition: stroke-dasharray 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.t8a-ws-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.t8a-ws-circle-num {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 40px;
  font-weight: 800;
  color: var(--text, #F0F2F8);
  line-height: 1;
}

.t8a-ws-circle-total {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
  margin-top: 4px;
}

/* Slide 7: Share */

.t8a-ws-share-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin-bottom: 12px;
}

.t8a-ws-share-summary {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 24px;
}

.t8a-ws-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--accent, #4C9AFF);
  border: none;
  border-radius: var(--radius, 14px);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-ws-share-btn:hover {
  background: #3d8ae8;
  transform: scale(1.02);
}

.t8a-ws-share-btn:active {
  transform: scale(0.98);
}

.t8a-ws-watermark {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  margin-top: 24px;
  opacity: 0.5;
}

/* --- Navigation Dots --- */

.t8a-wrapped-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
}

.t8a-wrapped-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-wrapped-dot.t8a-active {
  background: var(--accent, #4C9AFF);
  transform: scale(1.3);
}

/* --- Navigation Arrows --- */

.t8a-wrapped-nav {
  display: flex;
  justify-content: space-between;
  padding: 0 16px 24px;
}

.t8a-wrapped-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text, #F0F2F8);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-wrapped-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.t8a-wrapped-next-btn {
  background: var(--accent, #4C9AFF);
}

.t8a-wrapped-next-btn:hover {
  background: #3d8ae8;
}


/* ============================================================
   3. SHAREABLE CARDS
   Card preview overlay, card design, format toggle.
   ============================================================ */

/* --- Share Button on Result --- */

.t8a-share-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(76, 154, 255, 0.15) 0%, rgba(76, 154, 255, 0.05) 100%);
  border: 1px solid rgba(76, 154, 255, 0.25);
  border-radius: var(--radius-sm, 10px);
  color: var(--accent, #4C9AFF);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-share-card-btn:hover {
  background: linear-gradient(135deg, rgba(76, 154, 255, 0.25) 0%, rgba(76, 154, 255, 0.1) 100%);
  border-color: rgba(76, 154, 255, 0.4);
}

.t8a-share-card-btn:active {
  transform: scale(0.97);
}

.t8a-result-share-wrap {
  padding: 12px 16px 0;
  display: flex;
  justify-content: center;
}

/* --- Card Overlay --- */

.t8a-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.t8a-card-overlay-visible {
  opacity: 1;
}

.t8a-card-modal {
  background: var(--bg-card, #141829);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius, 14px);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
}

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

.t8a-card-modal-header h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin: 0;
}

.t8a-card-close {
  background: transparent;
  border: none;
  color: var(--text-secondary, #8B92A8);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-card-close:hover {
  color: var(--text, #F0F2F8);
}

/* --- Format Toggle --- */

.t8a-card-format-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg, #0A0E1A);
  border-radius: var(--radius-sm, 10px);
  padding: 4px;
  margin-bottom: 16px;
}

.t8a-card-fmt-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #8B92A8);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-card-fmt-btn.t8a-card-fmt-active {
  background: var(--bg-elevated, #1E2340);
  color: var(--text, #F0F2F8);
}

/* --- Card Preview --- */

.t8a-card-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.t8a-card-canvas {
  width: 100%;
  max-width: 280px;
}

.t8a-card-canvas[data-format="story"] .t8a-card-inner {
  aspect-ratio: 9 / 16;
}

.t8a-card-canvas[data-format="square"] .t8a-card-inner {
  aspect-ratio: 1 / 1;
}

.t8a-card-inner {
  background: var(--bg, #0A0E1A);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* --- Card Design --- */

.t8a-card-brand {
  padding: 20px 20px 12px;
}

.t8a-card-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.t8a-card-logo-icon {
  font-size: 20px;
  line-height: 1;
}

.t8a-card-logo-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
}

.t8a-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.t8a-card-line-stripe {
  height: 6px;
  width: 60px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.t8a-card-line-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.t8a-card-station {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text, #F0F2F8);
  margin: 0 0 20px;
  line-height: 1.2;
}

.t8a-card-position {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.t8a-card-position-value {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.t8a-card-exit {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 20px;
}

/* Train diagram in card */

.t8a-card-train {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}

.t8a-card-train-car {
  width: 28px;
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.t8a-card-car-hl {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.t8a-card-train-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 200px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9px;
  color: var(--text-secondary, #8B92A8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.t8a-card-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.t8a-card-url {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #4C9AFF);
}

.t8a-card-tagline {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  color: var(--text-secondary, #8B92A8);
}

/* --- Card Actions --- */

.t8a-card-actions {
  display: flex;
  gap: 8px;
}

.t8a-card-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: var(--radius-sm, 10px);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-card-share-btn {
  background: var(--accent, #4C9AFF);
  border: none;
  color: #fff;
}

.t8a-card-share-btn:hover {
  background: #3d8ae8;
}

.t8a-card-copy-btn {
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-secondary, #8B92A8);
}

.t8a-card-copy-btn:hover {
  background: var(--bg-card-hover, #1C2137);
  color: var(--text, #F0F2F8);
}


/* ============================================================
   4. STATION COLLECTION GAME
   Collection widget, progress bars, badges, recent visits.
   ============================================================ */

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

.t8a-coll-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.t8a-coll-icon {
  font-size: 18px;
  line-height: 1;
}

.t8a-coll-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #F0F2F8);
  flex: 1;
}

.t8a-coll-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent, #4C9AFF);
}

/* --- Progress Bar --- */

.t8a-coll-progress-bar {
  height: 8px;
  background: var(--bg, #0A0E1A);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.t8a-coll-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #4C9AFF), #36B37E);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 0;
}

.t8a-coll-pct {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 12px;
}

/* --- Expand Button --- */

.t8a-coll-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  background: transparent;
  color: var(--text-secondary, #8B92A8);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.t8a-coll-expand-btn:hover {
  background: var(--bg-card-hover, #1C2137);
  color: var(--text, #F0F2F8);
}

.t8a-coll-expand-btn svg {
  transition: transform 0.3s ease;
}

.t8a-coll-expand-btn.t8a-expanded svg {
  transform: rotate(180deg);
}

/* --- Details Section --- */

.t8a-coll-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

/* --- Line Breakdown --- */

.t8a-coll-lines {
  margin-bottom: 20px;
}

.t8a-coll-line-row {
  padding: 8px 0;
}

.t8a-coll-line-row + .t8a-coll-line-row {
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t8a-coll-line-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.t8a-coll-line-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.t8a-coll-line-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text, #F0F2F8);
  flex: 1;
}

.t8a-coll-line-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  font-weight: 600;
}

.t8a-coll-line-bar {
  height: 4px;
  background: var(--bg, #0A0E1A);
  border-radius: 2px;
  overflow: hidden;
}

.t8a-coll-line-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 0;
}

/* --- Badges --- */

.t8a-coll-badges {
  margin-bottom: 20px;
}

.t8a-coll-badges-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.t8a-coll-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.t8a-coll-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg, #0A0E1A);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  opacity: 0.35;
  transition: all 0.3s ease;
}

.t8a-coll-badge.t8a-badge-achieved {
  opacity: 1;
  border-color: rgba(54, 179, 126, 0.3);
  background: rgba(54, 179, 126, 0.05);
}

.t8a-coll-badge-icon {
  font-size: 24px;
  line-height: 1;
}

.t8a-coll-badge-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
  text-align: center;
  line-height: 1.3;
}

.t8a-badge-achieved .t8a-coll-badge-label {
  color: var(--text, #F0F2F8);
}

/* --- Recent Visits --- */

.t8a-coll-recent {
  margin-bottom: 16px;
}

.t8a-coll-recent-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.t8a-coll-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.t8a-coll-recent-item + .t8a-coll-recent-item {
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t8a-coll-recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.t8a-coll-recent-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text, #F0F2F8);
  flex: 1;
}

.t8a-coll-recent-time {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  color: var(--text-secondary, #8B92A8);
}

/* --- Share Button (inside details) --- */

.t8a-coll-share-wrap {
  text-align: center;
  padding-top: 8px;
}

.t8a-coll-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(76, 154, 255, 0.2);
  border-radius: var(--radius-sm, 10px);
  color: var(--accent, #4C9AFF);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t8a-coll-share-btn:hover {
  background: rgba(76, 154, 255, 0.1);
  border-color: rgba(76, 154, 255, 0.35);
}

/* --- Exit Badge (on exit screen) --- */

.t8a-coll-exit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  margin-left: 8px;
  vertical-align: middle;
}

.t8a-coll-exit-new {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber, #FFAB00);
  background: rgba(255, 171, 0, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

/* --- Nearest Unvisited --- */

.t8a-coll-nearest {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(76, 154, 255, 0.05);
  border: 1px solid rgba(76, 154, 255, 0.15);
  border-radius: var(--radius-sm, 10px);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
}

.t8a-coll-nearest-icon {
  font-size: 16px;
  line-height: 1;
}

.t8a-coll-nearest strong {
  color: var(--text, #F0F2F8);
}
