:root {
  --bg: #efe4d5;
  --surface: rgba(255, 250, 244, 0.82);
  --surface-strong: rgba(255, 251, 246, 0.94);
  --line: rgba(97, 77, 60, 0.12);
  --text: #3f2d22;
  --text-soft: #786756;
  --muted: #a08d7a;
  --ink: #1f1713;
  --accent: #d67b39;
  --accent-strong: #c76621;
  --accent-soft: #f2d9bc;
  --sage: #dce6cf;
  --sage-strong: #2f6d68;
  --success: #2f6d68;
  --warning: #b67936;
  --error: #b25c4c;
  --shadow: 0 26px 70px rgba(89, 63, 41, 0.16);
  --shadow-soft: 0 14px 34px rgba(89, 63, 41, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f1e8dc 0%, #e9ddcb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 54%);
}

.ambient,
.metro-lines {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.ambient {
  border-radius: 999px;
  opacity: 0.82;
}

.ambient-left {
  top: -120px;
  left: -160px;
  width: 420px;
  height: 420px;
  background: rgba(226, 206, 180, 0.72);
}

.ambient-right {
  top: -90px;
  right: -130px;
  width: 360px;
  height: 360px;
  background: rgba(214, 224, 203, 0.74);
}

.ambient-bottom {
  right: -140px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  background: rgba(229, 210, 183, 0.72);
}

.metro-lines {
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 1600' fill='none'%3E%3Cpath d='M-30 360L160 300L248 382L398 314L554 454L732 406L970 520' stroke='%23B7C8A9' stroke-width='10' stroke-linecap='round'/%3E%3Cpath d='M70 770L230 716L372 808L546 734L712 848L930 786' stroke='%23B7C8A9' stroke-width='10' stroke-linecap='round'/%3E%3Cpath d='M150 1210L288 1102L446 1114L594 1244L786 1164L970 1288' stroke='%23B7C8A9' stroke-width='10' stroke-linecap='round'/%3E%3Cpath d='M544 182L488 316L612 470L550 640L690 826L630 1030L714 1340' stroke='%23B7C8A9' stroke-width='10' stroke-linecap='round'/%3E%3Ccircle cx='554' cy='454' r='16' fill='%23D67B39'/%3E%3Ccircle cx='546' cy='734' r='16' fill='%232F6D68'/%3E%3Ccircle cx='594' cy='1244' r='16' fill='%23D67B39'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: min(540px, 86vw);
  background-position: right -40px center;
  opacity: 0.28;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(470px, calc(100% - 18px));
  margin: 0 auto;
  padding: 14px 0 22px;
}

.screen {
  display: none;
}

body[data-screen="start"] .start-screen,
body[data-screen="loading"] .start-screen {
  display: grid;
}

body[data-screen="game"] .play-screen,
body[data-screen="result"] .play-screen {
  display: block;
}

.app-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 4px 6px 0;
}

.brand-lockup h1,
.start-hero h2,
.info-card h3,
.result-copy h3,
.panel-header h2,
.compare-card__title,
.challenge-card h3,
.metric-value,
.round-card h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: -0.04em;
}

.brand-lockup h1 {
  font-size: 1.7rem;
  line-height: 0.98;
}

.eyebrow,
.panel-kicker,
.metric-label,
.badge,
.chip,
.nav-item__label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.panel {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.12)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.32), transparent 38%);
}

.panel > * {
  position: relative;
  z-index: 1;
}

.badge,
.chip,
.city-pill,
.challenge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.badge {
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-soft);
}

.badge-accent,
.chip-accent,
.city-pill {
  background: rgba(242, 217, 188, 0.96);
  color: var(--accent-strong);
}

.chip {
  border: 1px solid transparent;
}

.chip-muted {
  background: rgba(220, 230, 207, 0.96);
  color: var(--sage-strong);
}

.chip-outline {
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--line);
  color: var(--text-soft);
}

.city-pill-small {
  min-height: 34px;
  font-size: 0.68rem;
}

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

.start-screen {
  gap: 14px;
}

.start-hero {
  min-height: 240px;
  padding: 26px 24px;
}

.start-hero h2 {
  max-width: 10ch;
  font-size: clamp(2.2rem, 10vw, 3.6rem);
  line-height: 0.94;
}

.subtitle {
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.68;
}

.start-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.metric-card {
  min-height: 174px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.metric-value {
  font-size: 1.2rem;
  line-height: 1.12;
}

.metric-note,
.info-list p,
.challenge-card p,
.hint,
.credit,
.status,
.result-summary,
.compare-card__note {
  line-height: 1.64;
}

.metric-note,
.challenge-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.info-card {
  display: grid;
  gap: 12px;
}

.info-card h3,
.challenge-card h3 {
  font-size: 1.2rem;
  line-height: 1.08;
}

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

.info-list p {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  color: var(--text-soft);
}

.info-list span {
  flex: none;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(242, 217, 188, 0.96);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
}

.challenge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.challenge-pill {
  min-width: 62px;
  background: var(--sage-strong);
  color: #fffaf3;
  box-shadow: var(--shadow-soft);
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 16px;
}

.nav-item {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--muted);
}

.nav-item__icon {
  font-size: 1rem;
  line-height: 1;
}

.nav-item__label {
  font-size: 0.64rem;
  font-weight: 800;
}

.nav-item-active {
  color: var(--accent);
}

.play-stage {
  position: relative;
  min-height: calc(100svh - 110px);
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background:
    linear-gradient(180deg, rgba(220, 230, 207, 0.88), rgba(207, 219, 192, 0.98));
  box-shadow: var(--shadow);
}

#map {
  position: relative;
  width: 100%;
  height: calc(100svh - 110px);
  min-height: 680px;
  background: transparent;
}

.play-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 401;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(135deg, transparent 0 62%, rgba(255, 255, 255, 0.08) 100%);
}

body[data-screen="result"] .play-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 402;
  background: linear-gradient(180deg, rgba(239, 228, 213, 0.12), rgba(239, 228, 213, 0.18));
}

.round-card,
.result-sheet {
  position: absolute;
  left: 14px;
  right: 14px;
  z-index: 500;
}

.round-card {
  top: 14px;
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(255, 250, 244, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.round-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.round-card h2 {
  font-size: 1.6rem;
  line-height: 1.02;
}

.round-card__body {
  display: grid;
  grid-template-columns: 152px 1fr;
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.round-media {
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #eadcc8, #f6ecdf);
}

.round-media img {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
}

.round-copy {
  display: grid;
  align-content: start;
  gap: 10px;
}

.hint {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.credit {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.credit a {
  color: inherit;
  text-underline-offset: 0.18em;
}

.credit a:hover {
  color: var(--accent-strong);
}

.result-sheet {
  top: 14px;
  bottom: 88px;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding-right: 2px;
}

.result-sheet::-webkit-scrollbar {
  width: 6px;
}

.result-sheet::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(160, 141, 122, 0.42);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-header h2 {
  font-size: 1.55rem;
  line-height: 1.02;
}

#resultPill[data-tone="info"] {
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--line);
  color: var(--text-soft);
}

#resultPill[data-tone="success"] {
  background: rgba(220, 230, 207, 0.96);
  color: var(--success);
}

#resultPill[data-tone="warning"] {
  background: rgba(242, 217, 188, 0.96);
  color: var(--warning);
}

#resultPill[data-tone="error"] {
  background: rgba(241, 213, 205, 0.96);
  color: var(--error);
}

.result-primary {
  padding: 22px;
}

.result-spotlight {
  display: grid;
  justify-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(220, 230, 207, 0.7));
}

.score-orb {
  --score-progress: 0deg;
  width: 164px;
  height: 164px;
  padding: 12px;
  border-radius: 50%;
  background:
    conic-gradient(var(--accent) 0deg var(--score-progress), rgba(222, 220, 215, 0.9) var(--score-progress) 360deg);
  box-shadow: 0 20px 40px rgba(89, 63, 41, 0.12);
}

.score-orb__inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 251, 246, 0.97);
}

.score-orb__value {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 2.4rem;
  line-height: 0.96;
}

.score-orb__label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.result-copy h3 {
  font-size: 1.7rem;
  line-height: 1.02;
}

.result-summary {
  margin: 0;
  color: var(--text-soft);
}

.compare-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.compare-card__media {
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, #eadcc8, #f6ecdf);
}

.compare-card__media img {
  display: block;
  width: 100%;
  height: 154px;
  object-fit: cover;
}

.compare-card__copy {
  display: grid;
  gap: 8px;
}

.compare-card__title {
  font-size: 1.12rem;
  line-height: 1.14;
}

.compare-card__note {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  padding: 18px;
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-value {
  display: block;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.2rem;
  line-height: 1.08;
}

.result-actions {
  display: grid;
  gap: 10px;
}

.status {
  margin: 0;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.94);
  color: var(--text-soft);
  box-shadow: var(--shadow-soft);
}

.status[data-tone="success"] {
  color: var(--success);
  background: rgba(220, 230, 207, 0.96);
  border-color: rgba(47, 109, 104, 0.18);
}

.status[data-tone="warning"] {
  color: var(--warning);
  background: rgba(242, 217, 188, 0.96);
  border-color: rgba(182, 121, 54, 0.18);
}

.status[data-tone="error"] {
  color: var(--error);
  background: rgba(241, 213, 205, 0.96);
  border-color: rgba(178, 92, 76, 0.18);
}

.status-float {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 500;
}

button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 22px;
  font: inherit;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 2px solid rgba(214, 123, 57, 0.3);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-primary {
  color: #fffaf3;
  background: var(--ink);
  box-shadow: 0 16px 28px rgba(31, 23, 19, 0.18);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 251, 246, 0.92);
  border-color: rgba(214, 123, 57, 0.24);
}

.button-large {
  width: 100%;
}

body[data-screen="game"] .result-sheet,
body[data-screen="loading"] .result-sheet {
  display: none;
}

body[data-screen="result"] .round-card {
  display: none;
}

.leaflet-container {
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: transparent;
}

.leaflet-tile {
  filter: sepia(0.18) saturate(0.72) hue-rotate(-18deg) brightness(1.04);
}

.leaflet-control-zoom {
  border: 0;
  margin: 0 12px 12px 0;
  box-shadow: 0 12px 28px rgba(89, 63, 41, 0.16);
}

.leaflet-control-zoom a {
  width: 42px;
  height: 42px;
  border: 0;
  color: var(--text);
  background: rgba(255, 251, 246, 0.95);
}

.leaflet-bottom .leaflet-control-attribution {
  margin: 0 12px 12px 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.94);
  color: var(--muted);
  box-shadow: 0 8px 20px rgba(89, 63, 41, 0.12);
}

.leaflet-control-attribution a {
  color: inherit;
}

.custom-map-marker {
  background: transparent;
  border: 0;
}

.map-pin {
  position: relative;
  display: block;
}

.map-pin--guess {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 5px solid var(--accent);
  background: rgba(255, 251, 246, 0.94);
  box-shadow: 0 10px 20px rgba(199, 102, 33, 0.2);
}

.map-pin--guess::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.map-pin--answer {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: var(--sage-strong);
  transform: rotate(-45deg);
  box-shadow: 0 14px 22px rgba(47, 109, 104, 0.24);
}

.map-pin--answer::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 251, 246, 0.96);
}

body[data-screen="loading"] .start-hero,
body[data-screen="loading"] .info-card,
body[data-screen="loading"] .challenge-card {
  opacity: 0.88;
}

@media (max-width: 390px) {
  .brand-lockup h1 {
    font-size: 1.5rem;
  }

  .start-metrics,
  .result-stats {
    grid-template-columns: 1fr;
  }

  .round-card__body {
    grid-template-columns: 1fr;
  }

  .round-media img {
    height: 190px;
  }

  .result-sheet {
    bottom: 86px;
  }
}
