/* ============================================================
   TIER 10C FEATURES CSS — First Out App
   Features: Tube Line Personality Quiz, Carbon Footprint Calculator,
             Station Soundtrack / Busker Guide

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


/* ============================================================
   SHARED — Overlay / Modal / Button base
   ============================================================ */

.t10c-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.t10c-overlay.t10c-active {
  opacity: 1;
  visibility: visible;
}

.t10c-panel {
  background: var(--bg, #0A0E1A);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(30px);
  transition: transform 0.3s ease;
}

.t10c-overlay.t10c-active .t10c-panel {
  transform: translateY(0);
}

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

.t10c-panel-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text, #E8EAED);
}

.t10c-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated, #1E2340);
  border: none;
  color: var(--text-secondary, #8B8FA3);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.t10c-close-btn:active {
  background: var(--bg-card-hover, #1C2137);
}

.t10c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm, 10px);
  border: none;
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

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

.t10c-btn-primary {
  background: var(--accent, #4C9AFF);
  color: #fff;
}

.t10c-btn-secondary {
  background: var(--bg-elevated, #1E2340);
  color: var(--text, #E8EAED);
}

.t10c-btn-full {
  width: 100%;
}

.t10c-card {
  background: var(--bg-card, #141926);
  border-radius: var(--radius, 14px);
  padding: 16px;
  margin-bottom: 12px;
}

.t10c-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.t10c-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #8B8FA3);
  margin-bottom: 12px;
}

.t10c-divider {
  height: 1px;
  background: var(--border, rgba(255,255,255,0.08));
  margin: 16px 0;
}

/* Entry point buttons on home screen */
.t10c-home-section {
  padding: 0 16px;
  margin-bottom: 8px;
}

.t10c-home-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.t10c-home-row::-webkit-scrollbar { display: none; }

.t10c-home-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card, #141926);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  color: var(--text, #E8EAED);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.t10c-home-chip:active {
  background: var(--bg-card-hover, #1C2137);
}

.t10c-home-chip-icon {
  font-size: 18px;
  line-height: 1;
}


/* ============================================================
   1. TUBE LINE PERSONALITY QUIZ
   ============================================================ */

.t10c-quiz-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}

.t10c-quiz-progress-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-elevated, #1E2340);
  transition: background 0.3s;
}

.t10c-quiz-progress-dot.t10c-done {
  background: var(--accent, #4C9AFF);
}

.t10c-quiz-progress-dot.t10c-current {
  background: var(--accent, #4C9AFF);
  opacity: 0.6;
}

.t10c-quiz-q-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #4C9AFF);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.t10c-quiz-question {
  font-size: 20px;
  font-weight: 800;
  color: var(--text, #E8EAED);
  line-height: 1.3;
  margin-bottom: 20px;
}

.t10c-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.t10c-quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card, #141926);
  border: 2px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.t10c-quiz-option:active,
.t10c-quiz-option.t10c-selected {
  border-color: var(--accent, #4C9AFF);
  background: rgba(76, 154, 255, 0.08);
}

.t10c-quiz-option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated, #1E2340);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary, #8B8FA3);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.t10c-quiz-option.t10c-selected .t10c-quiz-option-letter {
  background: var(--accent, #4C9AFF);
  color: #fff;
}

.t10c-quiz-option-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text, #E8EAED);
  line-height: 1.3;
}

/* Result card */
.t10c-quiz-result {
  text-align: center;
  padding: 8px 0;
}

.t10c-quiz-result-line-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
}

.t10c-quiz-result-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.t10c-quiz-result-line {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
}

.t10c-quiz-result-tagline {
  font-size: 15px;
  color: var(--text-secondary, #8B8FA3);
  margin-bottom: 20px;
  line-height: 1.4;
}

.t10c-quiz-match-bars {
  text-align: left;
  margin-bottom: 20px;
}

.t10c-quiz-match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.t10c-quiz-match-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #8B8FA3);
  width: 100px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t10c-quiz-match-bar-bg {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-elevated, #1E2340);
  overflow: hidden;
}

.t10c-quiz-match-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.t10c-quiz-match-pct {
  font-size: 12px;
  font-weight: 700;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.t10c-quiz-share-card {
  background: var(--bg-card, #141926);
  border-radius: var(--radius, 14px);
  padding: 20px;
  margin-bottom: 16px;
  border: 2px solid transparent;
}

.t10c-quiz-actions {
  display: flex;
  gap: 10px;
}


/* ============================================================
   2. CARBON FOOTPRINT CALCULATOR
   ============================================================ */

.t10c-carbon-summary {
  text-align: center;
  margin-bottom: 20px;
}

.t10c-carbon-big-number {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}

.t10c-carbon-big-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary, #8B8FA3);
}

.t10c-carbon-subtitle {
  font-size: 14px;
  color: var(--text-secondary, #8B8FA3);
  margin-top: 4px;
}

.t10c-carbon-green-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.t10c-carbon-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 3px solid var(--green, #36B37E);
}

.t10c-carbon-score-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--green, #36B37E);
  line-height: 1;
}

.t10c-carbon-score-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary, #8B8FA3);
}

.t10c-carbon-equiv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.t10c-carbon-equiv-card {
  background: var(--bg-card, #141926);
  border-radius: var(--radius-sm, 10px);
  padding: 14px 12px;
  text-align: center;
}

.t10c-carbon-equiv-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.t10c-carbon-equiv-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--green, #36B37E);
  line-height: 1.2;
}

.t10c-carbon-equiv-desc {
  font-size: 11px;
  color: var(--text-secondary, #8B8FA3);
  margin-top: 2px;
  line-height: 1.3;
}

/* Tree visualisation */
.t10c-carbon-tree {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 80px;
  margin-bottom: 16px;
}

.t10c-carbon-tree-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s;
}

.t10c-carbon-tree-item.t10c-grown {
  animation: t10c-treeGrow 0.5s ease forwards;
}

@keyframes t10c-treeGrow {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.t10c-carbon-tree-emoji {
  font-size: 28px;
  line-height: 1;
}

/* Add trip form */
.t10c-carbon-add {
  margin-bottom: 16px;
}

.t10c-carbon-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.t10c-carbon-input {
  flex: 1;
  background: var(--bg-elevated, #1E2340);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 12px 14px;
  color: var(--text, #E8EAED);
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

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

.t10c-carbon-input::placeholder {
  color: var(--text-muted, #5A6177);
}

.t10c-carbon-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-elevated, #1E2340) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238B8FA3' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 12px 32px 12px 14px;
  color: var(--text, #E8EAED);
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.t10c-carbon-select:focus {
  border-color: var(--accent, #4C9AFF);
}

.t10c-carbon-select option {
  background: var(--bg, #0A0E1A);
  color: var(--text, #E8EAED);
}

/* Trip history */
.t10c-carbon-history {
  margin-top: 12px;
}

.t10c-carbon-trip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t10c-carbon-trip-row:last-child {
  border-bottom: none;
}

.t10c-carbon-trip-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.t10c-carbon-trip-info {
  flex: 1;
  min-width: 0;
}

.t10c-carbon-trip-route {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #E8EAED);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t10c-carbon-trip-date {
  font-size: 11px;
  color: var(--text-muted, #5A6177);
}

.t10c-carbon-trip-saved {
  font-size: 13px;
  font-weight: 700;
  color: var(--green, #36B37E);
  flex-shrink: 0;
}

/* Period tabs */
.t10c-carbon-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated, #1E2340);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
}

.t10c-carbon-tab {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary, #8B8FA3);
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.t10c-carbon-tab.t10c-tab-active {
  background: var(--accent, #4C9AFF);
  color: #fff;
}

/* Route compare */
.t10c-carbon-compare {
  margin-top: 16px;
}

.t10c-carbon-compare-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t10c-carbon-compare-row:last-child { border-bottom: none; }

.t10c-carbon-compare-mode {
  font-size: 12px;
  font-weight: 600;
  width: 60px;
  color: var(--text-secondary, #8B8FA3);
  flex-shrink: 0;
}

.t10c-carbon-compare-bar-bg {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--bg-elevated, #1E2340);
  overflow: hidden;
}

.t10c-carbon-compare-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

.t10c-carbon-compare-val {
  font-size: 12px;
  font-weight: 700;
  width: 56px;
  text-align: right;
  flex-shrink: 0;
}


/* ============================================================
   3. STATION SOUNDTRACK / BUSKER GUIDE
   ============================================================ */

.t10c-busker-station-card {
  background: var(--bg-card, #141926);
  border-radius: var(--radius, 14px);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.t10c-busker-station-card:active {
  background: var(--bg-card-hover, #1C2137);
}

.t10c-busker-station-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.t10c-busker-station-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #E8EAED);
}

.t10c-busker-station-pitches {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #4C9AFF);
}

.t10c-busker-station-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.t10c-busker-genre-tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elevated, #1E2340);
  color: var(--text-secondary, #8B8FA3);
}

.t10c-busker-genre-tag.t10c-genre-active {
  background: rgba(76, 154, 255, 0.15);
  color: var(--accent, #4C9AFF);
}

/* Pitch detail */
.t10c-busker-pitch {
  background: var(--bg-card, #141926);
  border-radius: var(--radius-sm, 10px);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.t10c-busker-pitch-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #E8EAED);
  margin-bottom: 4px;
}

.t10c-busker-pitch-loc {
  font-size: 12px;
  color: var(--text-secondary, #8B8FA3);
  margin-bottom: 8px;
}

.t10c-busker-pitch-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

/* Star rating */
.t10c-busker-stars {
  display: flex;
  gap: 4px;
}

.t10c-busker-star {
  font-size: 22px;
  cursor: pointer;
  color: var(--bg-elevated, #1E2340);
  transition: color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

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

.t10c-busker-star:active {
  transform: scale(1.2);
}

/* Leaderboard */
.t10c-busker-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.t10c-busker-leaderboard-row:last-child { border-bottom: none; }

.t10c-busker-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-elevated, #1E2340);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.t10c-busker-rank.t10c-rank-1 { background: #FFD700; color: #1a1a1a; }
.t10c-busker-rank.t10c-rank-2 { background: #C0C0C0; color: #1a1a1a; }
.t10c-busker-rank.t10c-rank-3 { background: #CD7F32; color: #fff; }

.t10c-busker-lb-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #E8EAED);
}

.t10c-busker-lb-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber, #FFAB00);
}

/* Checkin badge */
.t10c-busker-checkin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(54, 179, 126, 0.15);
  color: var(--green, #36B37E);
  font-size: 11px;
  font-weight: 600;
}

/* Fun fact card */
.t10c-busker-fact {
  background: linear-gradient(135deg, rgba(76, 154, 255, 0.08), rgba(54, 179, 126, 0.08));
  border: 1px solid rgba(76, 154, 255, 0.15);
  border-radius: var(--radius, 14px);
  padding: 16px;
  margin-bottom: 12px;
}

.t10c-busker-fact-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent, #4C9AFF);
  margin-bottom: 6px;
}

.t10c-busker-fact-text {
  font-size: 14px;
  color: var(--text, #E8EAED);
  line-height: 1.5;
}

/* Genre filter bar */
.t10c-busker-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.t10c-busker-filter-bar::-webkit-scrollbar { display: none; }

.t10c-busker-filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-elevated, #1E2340);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-secondary, #8B8FA3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.t10c-busker-filter-chip.t10c-filter-active {
  background: rgba(76, 154, 255, 0.15);
  border-color: var(--accent, #4C9AFF);
  color: var(--accent, #4C9AFF);
}

/* Spotting game counter */
.t10c-busker-game-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-card, #141926);
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 16px;
}

.t10c-busker-game-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent, #4C9AFF);
}

.t10c-busker-game-label {
  font-size: 13px;
  color: var(--text-secondary, #8B8FA3);
}

/* Tabs inside busker panel */
.t10c-busker-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated, #1E2340);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
}

.t10c-busker-tab {
  flex: 1;
  padding: 8px 4px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary, #8B8FA3);
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.t10c-busker-tab.t10c-tab-active {
  background: var(--accent, #4C9AFF);
  color: #fff;
}

/* Result station badge for busker info */
.t10c-busker-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card, #141926);
  border-radius: var(--radius-sm, 10px);
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.t10c-busker-result-badge:active {
  background: var(--bg-card-hover, #1C2137);
}

.t10c-busker-result-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #E8EAED);
}
