:root {
  --bg: #07111f;
  --panel: #0f1b2d;
  --panel-soft: #14243a;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --brand: #14b8a6;
  --brand-dark: #0f766e;
  --gold: #fbbf24;
  --danger: #ef4444;
  --ok: #22c55e;
  --border: rgba(255,255,255,0.12);
  --shadow: 0 24px 60px rgba(0,0,0,0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #12304d 0, var(--bg) 48%, #030712 100%);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  padding: 22px 18px 16px;
}

.hero-card {
  max-width: 1180px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(20,184,166,0.2), rgba(15,23,42,0.94));
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero-kicker {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 8px;
}

.hero h1 {
  font-size: clamp(2rem, 8vw, 4.5rem);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 14px 0 0;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.btn-primary {
  background: var(--brand);
  color: #042f2e;
}

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.main-grid {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.map-panel,
.side-panel {
  background: rgba(15, 27, 45, 0.92);
  border: 1px solid var(--border);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-toolbar {
  padding: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.filter-pill {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
}

.filter-pill.is-active {
  background: var(--brand);
  color: #042f2e;
}

#map {
  width: 100%;
  height: 620px;
  background: #0b1220;
}

.side-panel {
  padding: 16px;
}

.panel-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.panel-subtitle {
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.mission-list {
  display: grid;
  gap: 12px;
}

.mission-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,0.055);
  padding: 14px;
}

.mission-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.mission-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.tag {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255,255,255,0.1);
  color: var(--muted);
}

.tag.points {
  background: rgba(251,191,36,0.15);
  color: var(--gold);
}

.mission-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 12px;
  font-size: 0.93rem;
}

.quiz-box {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.quiz-question {
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.35;
}

.answer-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.answer-btn {
  text-align: left;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  font-weight: 700;
}

.answer-btn.correct {
  border-color: rgba(34,197,94,0.9);
  background: rgba(34,197,94,0.18);
}

.answer-btn.wrong {
  border-color: rgba(239,68,68,0.9);
  background: rgba(239,68,68,0.18);
}

.feedback {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.score-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(20,184,166,0.08));
  border: 1px solid var(--border);
}

.score-number {
  font-size: 2rem;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0f1b2d;
  color: var(--text);
}

.popup-title {
  font-weight: 900;
  margin-bottom: 4px;
}

.popup-meta {
  color: var(--brand);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.popup-copy {
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  #map {
    height: 480px;
  }
}

@media (max-width: 540px) {
  .hero {
    padding: 12px;
  }

  .hero-card {
    border-radius: 22px;
    padding: 18px;
  }

  .main-grid {
    width: calc(100% - 20px);
  }

  #map {
    height: 430px;
  }

  .side-panel {
    border-radius: 22px;
  }
}

.popup-start-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  font-weight: 800;
  cursor: pointer;
  background: var(--brand);
  color: #042f2e;
}

.mission-context {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(20,184,166,0.12);
  border: 1px solid rgba(20,184,166,0.25);
  color: var(--text);
  font-weight: 850;
}

.tag.complete {
  background: rgba(34,197,94,0.18);
  color: #86efac;
}

.mission-slide,
.poi-focus-card,
.mission-complete {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,0.055);
  padding: 15px;
}

.poi-focus-card h3,
.mission-complete h3 {
  margin: 6px 0 8px;
  font-size: 1.2rem;
}

.poi-focus-card p,
.mission-complete p {
  color: var(--muted);
  line-height: 1.5;
}

.slide-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.progress-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.2s ease;
}

.slide-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.slide-actions .btn[disabled],
.answer-btn[disabled],
.mission-card .btn[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
}

.complete-icon {
  font-size: 2.4rem;
  margin-bottom: 6px;
}

@media (max-width: 540px) {
  .slide-topline,
  .slide-actions {
    flex-direction: column;
  }

  .slide-actions .btn {
    width: 100%;
  }
}
