:root {
  --bg-1: #1c3a26;
  --bg-2: #10241a;
  --wood: #4b3826;
  --wood-light: #5e4830;
  --wood-dark: #2b1f14;
  --gold: #dbab4f;
  --gold-soft: #cbb488;
  --cream: #f2ead9;
  --pine: #4f7a54;
  --pine-light: #7fa77f;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Bitter', Georgia, serif;
  color: var(--cream);
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
}

.topo-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
  background:
    repeating-radial-gradient(circle at 15% 20%,
      transparent 0, transparent 26px,
      rgba(242, 234, 217, 0.05) 27px, rgba(242, 234, 217, 0.05) 28px,
      transparent 29px, transparent 60px),
    repeating-radial-gradient(circle at 85% 15%,
      transparent 0, transparent 34px,
      rgba(242, 234, 217, 0.06) 35px, rgba(242, 234, 217, 0.06) 36px,
      transparent 37px, transparent 74px),
    repeating-radial-gradient(circle at 60% 90%,
      transparent 0, transparent 30px,
      rgba(242, 234, 217, 0.05) 31px, rgba(242, 234, 217, 0.05) 32px,
      transparent 33px, transparent 66px);
}

header {
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(219, 171, 79, 0.18);
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
}

.badge {
  width: 76px;
  height: 76px;
  margin-bottom: 0.75rem;
}

.badge-ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
}

.badge-ring-inner {
  fill: var(--wood);
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0.9;
}

.badge-mountain {
  fill: var(--pine-light);
  opacity: 0.9;
}

.badge-tree {
  fill: var(--gold);
}

.badge-sun {
  fill: var(--gold);
  opacity: 0.85;
}

header h1 {
  margin: 0 0 0.5rem;
  font-family: 'Bevan', 'Bitter', serif;
  font-size: 2.75rem;
  letter-spacing: 0.03em;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

header p {
  margin: 0;
  color: var(--gold-soft);
  font-size: 1.05rem;
  font-style: italic;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 2rem 1rem;
}

.card {
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, var(--wood-light), var(--wood));
  border: 1px solid var(--wood-dark);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(219, 171, 79, 0.08);
}

.card h2 {
  margin-top: 0;
  font-family: 'Bevan', 'Bitter', serif;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.card code {
  background: rgba(0, 0, 0, 0.25);
  color: var(--cream);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

button {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--wood-dark);
  border-radius: 6px;
  background: var(--gold);
  color: var(--wood-dark);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: 'Bitter', Georgia, serif;
}

button:hover {
  background: #e8bd6b;
}

footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--gold-soft);
  font-size: 0.85rem;
  opacity: 0.75;
}

.map-card {
  max-width: 800px;
}

.map-embed {
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
  border: 3px solid var(--wood-dark);
  box-shadow: inset 0 0 0 1px rgba(219, 171, 79, 0.25);
}

.map-embed iframe {
  border: 0;
  display: block;
}

.progress-card {
  max-width: 800px;
  text-align: left;
}

.progress-card h2 {
  text-align: center;
}

.progress-status {
  text-align: center;
  color: var(--gold-soft);
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.progress-bar {
  background: var(--wood-dark);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(219, 171, 79, 0.2);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pine), var(--gold));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-count {
  text-align: center;
  margin: 0.6rem 0 1.4rem;
  color: var(--cream);
  font-weight: 700;
  font-family: 'Bevan', 'Bitter', serif;
  letter-spacing: 0.02em;
}

.progress-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

#place-search {
  flex: 1 1 200px;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(219, 171, 79, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--cream);
  font-family: 'Bitter', Georgia, serif;
  font-size: 0.9rem;
}

#place-search::placeholder {
  color: rgba(242, 234, 217, 0.45);
}

#place-search:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.filter-buttons {
  display: flex;
  gap: 0.4rem;
}

.region-filters {
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(219, 171, 79, 0.3);
  background: transparent;
  color: var(--gold-soft);
  font-size: 0.85rem;
  font-family: 'Bitter', Georgia, serif;
  cursor: pointer;
}

.filter-btn:hover {
  background: rgba(219, 171, 79, 0.1);
}

.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--wood-dark);
  font-weight: 700;
}

.refresh-btn {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(219, 171, 79, 0.3);
  background: transparent;
  color: var(--gold-soft);
  font-size: 0.85rem;
  font-family: 'Bitter', Georgia, serif;
  cursor: pointer;
  margin-left: auto;
}

.refresh-btn:hover {
  background: rgba(219, 171, 79, 0.1);
}

.place-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid rgba(219, 171, 79, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
}

.place-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(219, 171, 79, 0.1);
  font-size: 0.9rem;
}

.place-list li:last-child {
  border-bottom: none;
}

.place-list .dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.3rem;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.place-list .place-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.place-list .place-name {
  color: var(--cream);
  font-weight: 600;
  overflow-wrap: break-word;
}

.place-list .place-region,
.place-list .place-layer {
  color: var(--gold-soft);
  opacity: 0.75;
  font-size: 0.78rem;
  overflow-wrap: break-word;
}

.place-list .place-region {
  font-weight: 600;
  opacity: 0.9;
}

.place-list li.clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.place-list li.clickable:hover,
.place-list li.clickable:focus-visible {
  background: rgba(219, 171, 79, 0.1);
  outline: none;
}

.place-list li.clickable:focus-visible {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.map-focus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 0 0.9rem;
  color: var(--gold-soft);
  font-size: 0.9rem;
}

.map-focus[hidden] {
  display: none;
}

.map-focus strong {
  color: var(--cream);
}

.map-reset-btn {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid rgba(219, 171, 79, 0.35);
}

.map-reset-btn:hover {
  background: rgba(219, 171, 79, 0.12);
}

.place-list .empty-state {
  padding: 1rem;
  text-align: center;
  color: var(--gold-soft);
}

.place-list::-webkit-scrollbar {
  width: 10px;
}

.place-list::-webkit-scrollbar-track {
  background: transparent;
}

.place-list::-webkit-scrollbar-thumb {
  background: var(--wood-light);
  border-radius: 999px;
}

.state-card {
  max-width: 800px;
}

.state-map {
  margin-top: 0.5rem;
  border: 3px solid var(--wood-dark);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(219, 171, 79, 0.25);
  padding: 1rem;
}

.state-map-loading {
  text-align: center;
  color: var(--gold-soft);
  margin: 3rem 0;
}

.state-map svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.state-map svg g.state {
  fill: var(--wood-light);
}

.state-map svg g.borders {
  stroke: rgba(10, 5, 2, 0.55);
  stroke-width: 1;
}

.state-map svg circle.dc {
  fill: var(--wood-light);
  stroke: rgba(10, 5, 2, 0.55);
  stroke-width: 1;
}

.state-map svg path.separator1 {
  stroke: rgba(242, 234, 217, 0.35);
  stroke-width: 2;
}

.state-map svg path,
.state-map svg circle {
  cursor: pointer;
  transition: fill 0.4s ease, stroke 0.2s ease;
}

.state-map svg path:hover,
.state-map svg circle:hover {
  stroke: var(--gold) !important;
  stroke-width: 1.5px;
}

.state-map-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--gold-soft);
  font-size: 0.85rem;
}

.state-map-legend-bar {
  width: 160px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e05a3f, #cfa93f, #4caf6b);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.state-map-note {
  text-align: center;
  color: var(--gold-soft);
  opacity: 0.7;
  font-size: 0.78rem;
  margin: 0.75rem 0 0;
}
