:root {
  --navy: #111931;
  --navy-2: #1b2547;
  --gold: #efc82f;
  --gold-deep: #c9a21c;
  --white: #ffffff;
  --cream: #f7f8fa;
  --ink: #111931;
  --muted: #5b6478;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Fahkwang, Arial, sans-serif;
  background: var(--navy);
  color: var(--white);
  line-height: 1.5;
  min-width: 320px;
}
a { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header: same layout as the Day Planner */
.site-header { background: var(--white); }
.header-inner { display: flex; align-items: stretch; min-height: 105px; }
.header-logo-panel {
  background: var(--white); flex: 1 1 50%;
  display: flex; align-items: center; justify-content: center; padding: 10px 18px;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; }
.brand-logo { width: 325px; max-width: 100%; height: auto; display: block; }
.brand-strapline { color: var(--navy); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.brand-nav {
  background: var(--navy); flex: 1 1 50%;
  display: flex; align-items: center; justify-content: center; padding: 10px 18px;
}
.brand-nav-inner { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; justify-content: center; }
.brand-nav-inner a {
  color: var(--gold); font-size: 12.6px; font-weight: 500; text-decoration: none; padding: 14px 3px;
}
.brand-nav-inner a:first-child { color: var(--white); }
.brand-nav-inner a:hover { text-decoration: underline; }
.brand-nav-inner a.nav-active {
  background: var(--gold); color: var(--white); border-radius: 4px; padding: 9px 12px; font-weight: 600;
}
.mobile-menu { display: none; }

/* Hero */
.hero { max-width: 1180px; margin: 0 auto; padding: 36px 20px 20px; }
.eyebrow {
  color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600;
  margin: 0 0 12px; display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--gold); }
.hero h1 {
  font-family: Archivo, "Arial Black", Arial, sans-serif; font-weight: 800;
  font-size: clamp(40px, 7vw, 68px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 16px;
}
.hero h1 span { color: var(--gold); display: block; }
.lead { max-width: 620px; margin: 0; font-size: 17px; }

/* Map section */
.map-section { max-width: 1180px; margin: 0 auto; padding: 8px 20px 44px; }
.regions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.region-btn {
  font: inherit; font-weight: 600; cursor: pointer; text-align: left; position: relative; overflow: hidden;
  background: var(--navy-2); color: var(--white);
  border: 2px solid rgba(239,200,47,.55); border-radius: 10px; padding: 12px 14px 16px; line-height: 1.25;
  transition: border-color .2s, transform .2s;
}
.region-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.region-btn::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 5px; width: var(--p, 0%);
  background: linear-gradient(90deg, #f7dc6f, var(--gold)); transition: width .6s ease;
}
.region-btn small { display: block; font-weight: 400; font-size: 12px; color: #d9deea; margin-top: 2px; min-height: 1em; }
.region-btn[aria-pressed="true"] { background: var(--gold); color: var(--navy); }
.region-btn[aria-pressed="true"] small { color: var(--navy); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 10px; }
.search { position: relative; flex: 1 1 280px; }
.search input {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 6px;
  border: 2px solid var(--gold); background: var(--white); color: var(--ink);
}
.search input:disabled { opacity: .6; }
.results {
  position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 4px);
  list-style: none; margin: 0; padding: 4px; background: var(--white); color: var(--ink);
  border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-height: 260px; overflow: auto;
}
.results li { padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.results li small { color: var(--muted); margin-left: 6px; }
.results li:hover, .results li[aria-selected="true"] { background: #fdf3cc; }
.score { margin: 0; font-weight: 600; color: var(--gold); }

.map-wrap { position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(239,200,47,.5); }
.leaflet-tile-pane { filter: grayscale(1) contrast(.9); opacity: .45; }
.leaflet-overlay-pane path { transition: fill-opacity .7s ease, stroke-width .2s; }
.leaflet-overlay-pane path.leaflet-interactive:hover { stroke-width: 2.5; }
#leaflet { height: min(76vh, 720px); background: #ffffff; }
.map-message {
  position: absolute; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px; background: rgba(17, 25, 49, .78); color: var(--white); font-weight: 600;
}

.map-message[hidden] { display: none; }
/* Progress */
.progress-card {
  background: linear-gradient(135deg, #1d2850, #141d3c); border: 1px solid rgba(239,200,47,.45);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
}
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.big { font-family: Archivo, Arial, sans-serif; font-weight: 800; font-size: 40px; color: var(--gold); line-height: 1; margin-right: 8px; }
.of { font-size: 15px; color: #d9deea; }
.pct { font-family: Archivo, Arial, sans-serif; font-weight: 800; font-size: 22px; }
.bar { height: 10px; background: rgba(255,255,255,.1); border-radius: 99px; margin: 12px 0 10px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #f7dc6f, var(--gold), #d4a91f); transition: width .7s ease; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.badges li {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px;
  border: 1px solid rgba(255,255,255,.25); color: #9aa3b8;
}
.badges li.got { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.badges li.got::before { content: "★ "; }

/* Scratch sparkle */
.sparkle { position: absolute; z-index: 700; pointer-events: none; width: 0; height: 0; }
.sparkle i {
  position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 1px;
  background: linear-gradient(135deg, #fff6c9, var(--gold)); animation: fly .8s ease-out forwards;
}
@keyframes fly { to { transform: translate(var(--x), var(--y)) rotate(160deg); opacity: 0; } }

.key { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 12px 0 0; font-size: 14px; }
.key li { display: flex; align-items: center; gap: 8px; }
.swatch { width: 26px; height: 18px; border-radius: 3px; display: inline-block; border: 2px solid var(--navy-2); }
.swatch.foil { background: #111931; border-color: #ffffff; }
.swatch.clear { background: var(--gold); border-color: #ffffff; }
.swatch.want { background: #111931; border: 2px dashed var(--gold); outline: 1px solid #ffffff; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: 10px 16px;
  background: var(--gold); color: var(--navy); border: 2px solid var(--gold); display: inline-block;
}
.btn.ghost { background: transparent; color: var(--white); }
.note { min-height: 1.5em; margin: 10px 0 0; color: #d9deea; font-size: 14px; }

/* Popup */
.leaflet-popup-content-wrapper { border-radius: 8px; }
.leaflet-popup-content { margin: 12px 14px; font-family: Fahkwang, Arial, sans-serif; color: var(--ink); }
.pop h3 { font-family: Archivo, Arial, sans-serif; margin: 0; font-size: 17px; line-height: 1.2; }
.pop p { margin: 2px 0 10px; color: var(--muted); font-size: 13px; }
.pop .row { display: flex; flex-wrap: wrap; gap: 6px; }
.pop button {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 5px; padding: 7px 10px;
  border: 2px solid var(--navy); background: var(--white); color: var(--navy);
}
.pop button.on { background: var(--navy); color: var(--gold); }

.site-footer { border-top: 4px solid var(--gold); padding: 22px 20px 30px; text-align: center; font-size: 14px; }
.site-footer p { margin: 4px auto; max-width: 900px; }
.credits { color: #b8c0d3; font-size: 12px; }

@media (max-width: 760px) {
  .header-inner { flex-direction: column; min-height: 0; }
  .brand-logo { width: 240px; }
  .brand-nav { padding: 0; }
  .brand-nav-inner { display: none; }
  .mobile-menu { display: block; width: 100%; }
  .mobile-menu summary {
    list-style: none; cursor: pointer; color: var(--gold); font-weight: 700; letter-spacing: .08em;
    text-align: center; padding: 12px;
  }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu-list { display: flex; flex-direction: column; padding: 0 16px 12px; }
  .mobile-menu-list a { color: var(--white); text-decoration: none; padding: 10px 4px; border-top: 1px solid rgba(255,255,255,.12); }
  .mobile-menu-list a.current-page { color: var(--gold); font-weight: 600; }
  .hero { padding-top: 28px; }
  .regions { grid-template-columns: repeat(2, 1fr); }
  #leaflet { height: 68vh; }
  .hero h1 { font-size: 40px; }
  .lead { font-size: 15px; }
  .big { font-size: 32px; }
}
