:root {
  --bg-top: #0c1426;
  --bg-bottom: #070b16;
  --surface: #111a2d;
  --surface-raised: #16213a;
  --glass: rgba(13, 20, 38, 0.78);
  --border: #243450;
  --border-bright: #31497a;
  --text: #eef2f8;
  --text-dim: #9fadc4;
  --accent: #3fb68b;
  --stitch-red: #d7263d;
  --gold: #fdb827;
  --ember: #ff9248;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(140% 100% at 50% 0%, var(--bg-top) 0%, var(--bg-bottom) 75%);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(7, 11, 22, 0.92), rgba(7, 11, 22, 0.55) 80%, transparent);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ring-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.ring { width: 100%; height: 100%; display: block; }

.ring-track {
  fill: none;
  stroke: #1c2942;
  stroke-width: 7;
}

.ring-arc {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 0 188.5;
  transition: stroke-dasharray 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 0 5px rgba(253, 184, 39, 0.45));
}

.ring-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.count-line {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.count-line .of {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.82rem;
  margin-left: 2px;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 380px;
  flex-wrap: wrap;
  min-width: 0;
}

.search {
  flex: 1 1 200px;
  min-width: 140px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 9px 16px;
  outline: none;
  backdrop-filter: blur(8px);
}
.search:focus-visible { border-color: var(--accent); }
.search::placeholder { color: #66738c; }

.filters {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(8px);
}

.chip {
  background: none;
  border: none;
  color: var(--text-dim);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] {
  background: #2563eb;
  color: #fff;
}

.league-sel {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.league-sel:focus-visible { border-color: var(--accent); outline: none; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(8px);
}

.view-tab {
  border: none;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.view-tab:hover { color: var(--text); }
.view-tab[aria-selected="true"] {
  background: var(--accent);
  color: #06251a;
}
.view-tab:disabled { opacity: 0.4; cursor: default; }

.share-btn {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.share-btn:hover { border-color: var(--gold); color: var(--gold); }

.install-btn {
  background: var(--accent);
  color: #06251a;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.install-btn:hover { filter: brightness(1.1); }

/* ---------- map view ---------- */

.map-view {
  flex: 1;
  min-height: 0;
  display: flex;
}
.map-view[hidden], #listView[hidden] { display: none; }

.map-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.map-mount, #mapSvg {
  width: 100%;
  height: 100%;
  display: block;
}

#mapSvg {
  touch-action: none;
  cursor: grab;
  user-select: none;
}
#mapSvg:active { cursor: grabbing; }

.state {
  fill: rgba(19, 31, 61, 0.88);
  stroke: var(--border-bright);
  stroke-width: 0.7;
  transition: fill 0.15s ease;
}
.state:hover { fill: rgba(24, 39, 80, 0.95); }

/* ballpark markers */
.park { cursor: pointer; outline: none; }

.park-hit { fill: transparent; }

.park-halo {
  fill: var(--team);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

/* unvisited: warm ember dot */
.park-ember {
  fill: var(--ember);
  opacity: 0.8;
  filter: drop-shadow(0 0 3px rgba(255, 146, 72, 0.8));
  transition: opacity 0.15s ease;
}

/* visited: glowing team medallion */
.park-medal {
  fill: rgba(10, 16, 30, 0.92);
  stroke: var(--team);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px var(--team));
}

.park-abbr {
  fill: #fff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-anchor: middle;
  pointer-events: none;
}

.park .park-medal, .park .park-abbr { display: none; }
.park.lit .park-medal, .park.lit .park-abbr { display: block; }
.park.lit .park-ember { display: none; }

.park.lit .park-halo {
  animation: park-pulse 2.8s ease-out infinite;
}

@keyframes park-pulse {
  0%   { opacity: 0.4; transform: scale(0.7); }
  70%  { opacity: 0;   transform: scale(2.1); }
  100% { opacity: 0;   transform: scale(2.1); }
}

.park:hover .park-ember,
.park:focus-visible .park-ember { opacity: 1; filter: drop-shadow(0 0 6px var(--ember)); }
.park:hover .park-medal,
.park:focus-visible .park-medal { stroke-width: 3; }
.park:focus-visible .park-ember,
.park:focus-visible .park-medal { stroke: var(--accent); }

.park.dimmed { opacity: 0.1; }

/* map chrome */
.map-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }

/* hover mini-card (bottom-left) */
.mini-card {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  width: min(330px, calc(100% - 28px));
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 4;
}
.mini-card[hidden] { display: none; }

.mc-mono {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.8rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.mc-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mc-text strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-city {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.mc-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.mc-pill {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
}
.mc-pill.on { background: rgba(63, 182, 139, 0.18); color: var(--accent); border: 1px solid rgba(63, 182, 139, 0.5); }
.mc-pill.off { background: rgba(255, 146, 72, 0.12); color: var(--ember); border: 1px solid rgba(255, 146, 72, 0.4); }

/* legend (bottom-center) */
.legend-panel {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  color: var(--text-dim);
  z-index: 3;
}

.legend-row { display: flex; gap: 16px; align-items: center; }
.legend-row strong { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 3px; }
.legend-sub { margin-top: 4px; font-size: 0.72rem; }
.legend-hint { color: #5b6985; }

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: -1px;
}
.legend-dot.lit { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.legend-dot.dim { background: var(--ember); opacity: 0.7; }

/* recently visited (bottom-right) */
.recents {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 14px;
  backdrop-filter: blur(10px);
  z-index: 3;
  max-width: min(320px, 40%);
}
.recents[hidden] { display: none; }

.recents-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.recents-tray {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.recents-tray::-webkit-scrollbar { display: none; }

.recent-chip {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--team);
  background: rgba(10, 16, 30, 0.9);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 8px color-mix(in srgb, var(--team) 65%, transparent);
}
.recent-chip:hover { transform: translateY(-2px); }

/* ---------- list view ---------- */

#listView {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.list-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}

.complete-banner {
  margin: 8px 0 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: rgba(253, 184, 39, 0.1);
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}

.division { margin-top: 22px; }
.division[hidden] { display: none; }

.division h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 0 0 10px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.division-count {
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.75rem;
}

.division-complete .division-count {
  border-color: var(--accent);
  color: var(--accent);
}

.stadium-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stadium {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.stadium[hidden] { display: none; }

.stadium.visited {
  background: var(--surface-raised);
  border-color: rgba(63, 182, 139, 0.45);
}

.card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

/* custom checkbox */
.check-wrap { position: relative; flex-shrink: 0; cursor: pointer; }

.visit-check {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.check-ui {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px dashed #3a4d70;
  background: #0d1424;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.check-ball {
  font-size: 1.05rem;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.15s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.visit-check:hover + .check-ui { border-color: var(--accent); }
.visit-check:focus-visible + .check-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

.visit-check:checked + .check-ui {
  border: 2px solid var(--stitch-red);
  background: #fff;
}
.visit-check:checked + .check-ui .check-ball {
  opacity: 1;
  transform: scale(1);
}

.monogram {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.stadium-name { font-weight: 700; }

.stadium-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit-date-label {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

.opened-chip {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 7px;
}

.expand-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.expand-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}
.stadium.open .chevron { transform: rotate(180deg); }

/* details drawer — single inner wrapper so the 0fr grid trick collapses cleanly */
.card-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
  padding: 0 14px;
}
.card-details-inner {
  overflow: hidden;
  min-height: 0;
}
.stadium.open .card-details {
  grid-template-rows: 1fr;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
}

.stadium-note {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--gold);
}

.detail-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.field.grow { flex: 1 1 240px; }

.field input[type="date"],
.field textarea {
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 10px;
  outline: none;
}
.field input[type="date"]:focus-visible,
.field textarea:focus-visible { border-color: var(--accent); }

.field textarea { resize: vertical; min-height: 40px; }

.no-results {
  text-align: center;
  color: var(--text-dim);
  margin: 40px 0;
}

/* ---------- footer ---------- */

.app-footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.footer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ghost-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.ghost-btn:hover { color: var(--text); border-color: #3a4d70; }
.ghost-btn.danger:hover { color: #ff7b8a; border-color: #ff7b8a; }

.fine-print {
  margin-top: 14px;
  font-size: 0.75rem;
  color: #66738c;
}

/* ---------- stadium card dialog ---------- */

body.card-open { overflow: hidden; }

.card-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 9, 18, 0.65);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 16px;
}
.card-backdrop[hidden] { display: none; }

.park-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  animation: card-pop 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes card-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.pc-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 52px 20px 18px;
  color: #fff;
}

.pc-monogram {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.pc-headtext h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.pc-headtext p {
  margin: 2px 0 0;
  font-size: 0.84rem;
  opacity: 0.9;
}

.pc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}
.pc-close:hover { background: rgba(0, 0, 0, 0.5); }

.pc-body { padding: 16px 18px 18px; }

.pc-stats { display: flex; gap: 8px; flex-wrap: wrap; }

.pc-stat {
  flex: 1 1 0;
  min-width: 90px;
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}
.pc-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.pc-stat strong {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.pc-fact {
  margin: 14px 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  padding: 10px 14px;
  background: rgba(253, 184, 39, 0.06);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
}

.pc-note {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--gold);
}

.pc-visit {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border-radius: 999px;
  border: 2px dashed #3a4d70;
  background: #0d1424;
  color: var(--text-dim);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pc-visit:hover { border-color: var(--accent); color: var(--accent); }
.pc-visit.on {
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #06251a;
}

.pc-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.pc-nav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
.pc-nav:hover { border-color: var(--accent); color: var(--accent); }

.pc-counter {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- confetti ---------- */

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: none;
  z-index: 100;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .topbar { gap: 10px; padding: 10px 12px; }
  h1 { font-size: 1.05rem; }
  .ring-wrap { width: 46px; height: 46px; }
  .topbar-controls { order: 3; flex-basis: 100%; }
  .topbar-actions { margin-left: auto; }
  .share-btn { padding: 8px 12px; }
  .mini-card { display: none; }
  .recents { display: none; }
  .legend-panel {
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
  }
  .legend-hint { display: none; }
}

@media (max-width: 560px) {
  .card-backdrop {
    place-items: end stretch;
    padding: 0;
  }
  .park-card {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    animation: card-up 0.25s ease-out;
  }
  @keyframes card-up {
    from { transform: translateY(40px); opacity: 0.5; }
    to   { transform: none; opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- historic ballparks ---------- */

.hist-chip {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(253, 184, 39, 0.1);
  border: 1px solid rgba(253, 184, 39, 0.35);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 2px;
  white-space: nowrap;
}
.hist-chip[hidden] { display: none; }

/* map: dashed team ring = visited a former home, not the current park */
.park-ring { display: none; fill: none; }
.park.legacy .park-ring {
  display: block;
  stroke: var(--team);
  stroke-width: 1.6;
  stroke-dasharray: 2.4 2;
  opacity: 0.95;
  filter: drop-shadow(0 0 3px var(--team));
}
.park.legacy .park-ember { opacity: 1; }

.legend-dot.ring {
  background: transparent;
  border: 1.5px dashed #c9d6ee;
}

/* "Previous homes" section (list drawer + stadium card) */
.past-parks {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.past-title {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.past-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pp-check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex: 1;
  min-width: 200px;
}

.pp-box {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.pp-tick {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px dashed #3a4d70;
  background: #0d1424;
  color: transparent;
  font-size: 0.7rem;
  font-weight: 800;
  transition: all 0.15s ease;
}
.pp-check:hover .pp-tick { border-color: var(--gold); }
.pp-box:focus-visible ~ .pp-tick { outline: 2px solid var(--accent); outline-offset: 2px; }
.pp-box:checked ~ .pp-tick {
  border: 2px solid var(--gold);
  background: var(--gold);
  color: #2b1d00;
}

.pp-name {
  font-size: 0.85rem;
  min-width: 0;
}
.pp-name em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

.pp-date {
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  padding: 5px 8px;
  outline: none;
}
.pp-date:focus-visible { border-color: var(--accent); }
.pp-date[hidden] { display: none; }

/* ---------- move banner + toast ---------- */

.move-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(253, 184, 39, 0.12);
  border-bottom: 1px solid rgba(253, 184, 39, 0.45);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 20;
}
.move-banner[hidden] { display: none; }
.move-banner a { color: var(--gold); text-decoration: underline; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass);
  border: 1px solid var(--gold);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.88rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 80;
  animation: card-pop 0.25s ease-out;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- stadium card photo hero ---------- */

.pc-head { overflow: hidden; }

.pc-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.pc-photo[hidden] { display: none; }

.pc-head.has-photo {
  min-height: 172px;
  align-items: flex-end;
}
.pc-head.has-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 10, 20, 0) 18%, rgba(7, 10, 20, 0.62) 72%, rgba(7, 10, 20, 0.82) 100%);
  z-index: 1;
}
.pc-head .pc-monogram, .pc-head .pc-headtext { position: relative; z-index: 2; }
.pc-head .pc-close { z-index: 3; }

/* ---------- passport view ---------- */

#passportView {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.passport-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 10px 16px 56px;
}

.passport-head { text-align: center; margin-bottom: 18px; }
.passport-head h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.passport-count {
  margin: 4px 0 0;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.passport-sub {
  margin: 30px 4px 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 14px;
}
.stamp-grid.historic {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}

.stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  padding: 8px 2px;
  border-radius: 12px;
}
.stamp:hover { background: rgba(255, 255, 255, 0.04); }
.stamp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the round stamp itself */
.stamp-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 2.5px dashed #33456b;
  background: #0c1322 center/cover no-repeat;
  transform: rotate(var(--tilt, 0deg));
}
.stamp.mini .stamp-ring { width: 62px; height: 62px; }

.stamp-abbr {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: #4d5f83;
  text-shadow: none;
}
.stamp.mini .stamp-abbr { font-size: 0.6rem; }

/* stamped (visited): team ring, photo ink, gold seal */
.stamp.stamped .stamp-ring {
  border: 3px solid var(--team);
  box-shadow: 0 0 12px color-mix(in srgb, var(--team) 55%, transparent),
              inset 0 0 0 2px rgba(10, 16, 30, 0.35);
}
.stamp.stamped .stamp-abbr {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
}
.stamp.stamped .stamp-ring::after {
  content: "✓";
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: #2b1d00;
  font-size: 0.72rem;
  font-weight: 900;
  border: 2px solid #0c1322;
}
.stamp.mini.stamped .stamp-ring::after { width: 18px; height: 18px; font-size: 0.6rem; }

/* deterministic slight tilt for a hand-stamped feel */
.stamp:nth-child(5n+1) .stamp-ring { --tilt: -3deg; }
.stamp:nth-child(5n+2) .stamp-ring { --tilt: 2deg; }
.stamp:nth-child(5n+3) .stamp-ring { --tilt: -1deg; }
.stamp:nth-child(5n+4) .stamp-ring { --tilt: 3deg; }
.stamp:nth-child(5n)   .stamp-ring { --tilt: -2deg; }

.stamp-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: var(--text-dim);
  min-height: 2.5em;
}
.stamp.stamped .stamp-label { color: var(--text); }

.stamp-date {
  font-size: 0.66rem;
  color: #5b6985;
  font-variant-numeric: tabular-nums;
}
.stamp.stamped .stamp-date { color: var(--gold); }

/* ink-slam on a fresh check-off */
.stamp.slam .stamp-ring {
  animation: stamp-slam 0.45s cubic-bezier(0.2, 1.6, 0.35, 1);
}
@keyframes stamp-slam {
  0%   { transform: rotate(var(--tilt, 0deg)) scale(2.1); opacity: 0; }
  55%  { transform: rotate(var(--tilt, 0deg)) scale(0.92); opacity: 1; }
  100% { transform: rotate(var(--tilt, 0deg)) scale(1); }
}

/* ---------- poster CTA ---------- */

.poster-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding: 18px 20px;
  border: 1px solid rgba(253, 184, 39, 0.5);
  border-radius: 16px;
  background:
    radial-gradient(120% 200% at 0% 0%, rgba(253, 184, 39, 0.12) 0%, rgba(253, 184, 39, 0.03) 60%);
}
.poster-cta[hidden] { display: none; }

.poster-cta-text { display: flex; flex-direction: column; gap: 3px; min-width: 200px; }
.poster-cta-text strong { font-size: 1rem; }
.poster-cta-text span { font-size: 0.84rem; color: var(--text-dim); }

.poster-btn {
  background: var(--gold);
  color: #2b1d00;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.poster-btn:hover { filter: brightness(1.08); }

/* toast action button */
.toast-action {
  margin-left: 10px;
  background: var(--gold);
  border: none;
  color: #2b1d00;
  border-radius: 999px;
  padding: 5px 14px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

/* ---------- account / sync button ---------- */

.account-btn[hidden] { display: none; }
.account-btn.on {
  border-color: rgba(63, 182, 139, 0.6);
  color: var(--accent);
}

/* ---------- in-app poster waitlist form ---------- */

.poster-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.poster-form[hidden] { display: none; }

.poster-form input[type="email"] {
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  padding: 10px 16px;
  outline: none;
  min-width: 210px;
}
.poster-form input[type="email"]:focus-visible { border-color: var(--gold); }

.poster-form .poster-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 0.9rem;
}

.poster-joined {
  color: var(--accent);
  font-weight: 800;
}

.poster-btn[hidden] { display: none; }
