/* Baseball shell — sticky top nav, phone-first type */
:root {
  --bg: #070b10;
  --panel: #10161e;
  --line: #243040;
  --text: #eef1f6;
  --muted: #9aa6b8;
  --dim: #6a7588;
  --cyan: #5ee7ff;
  --gold: #d4a84b;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(ellipse 90% 45% at 50% -8%, #142a32 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  padding-bottom: calc(1.1rem + var(--safe-b));
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Two-row sticky bar: title left · Lathom Pages top-right · second-level nav below */
.bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  padding: calc(.45rem + var(--safe-t)) 1rem .5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.94);
  font-size: .88rem;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  width: 100%;
  min-height: 1.75rem;
}
.bar-top-left {
  display: flex;
  align-items: center;
  gap: .5rem .65rem;
  min-width: 0;
  flex-wrap: wrap;
}
.bar strong { color: var(--gold); font-weight: 700; white-space: nowrap; }
.bar .spacer { display: none; }
.bar a.home-link {
  font-weight: 600;
  color: var(--cyan);
  white-space: nowrap;
  flex-shrink: 0;
}
.bar a.back {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.bar a.back:hover { color: var(--cyan); }

nav.topnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  width: 100%;
  padding-top: .35rem;
  border-top: 1px solid rgba(36, 48, 64, 0.65);
  text-align: center;
}
nav.topnav a,
nav.topnav button.nav-era {
  font-family: inherit;
  font-weight: 600;
  font-size: .8rem;
  color: var(--muted);
  padding: .3rem .55rem;
  border-radius: 7px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
nav.topnav a:hover,
nav.topnav a.active,
nav.topnav button.nav-era:hover,
nav.topnav button.nav-era.active {
  color: var(--cyan);
  background: var(--panel);
  text-decoration: none;
}
.score-section.hidden,
.section-label.hidden,
.score-sub.hidden,
.score-list.hidden,
.trip-map.hidden,
.trip-order.hidden,
.trip-links.hidden,
.hist-note.hidden {
  display: none !important;
}
.score-list.era-filter .score-item { display: none; }
.score-list.era-filter .score-item.show-era { display: block; }

.wrap {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 1.15rem 1.05rem 2rem;
}
.kicker {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: .35rem;
}
h1 {
  font-size: clamp(1.55rem, 6vw, 1.95rem);
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .35rem;
}
.meta {
  color: var(--dim);
  font-size: clamp(.95rem, 3.5vw, 1.02rem);
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}
.prose {
  color: var(--muted);
  font-size: clamp(1.02rem, 3.8vw, 1.1rem);
  max-width: 40em;
  margin-bottom: 1.1rem;
}
.prose p { margin-bottom: .85rem; }
.prose a { font-weight: 600; }
.prose strong { color: var(--text); font-weight: 700; }
.prose ul {
  margin: 0 0 .9rem 1.15rem;
  color: var(--muted);
}
.prose li { margin-bottom: .35rem; }

/* Snapshot cards (2009 totals) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  margin: 0 0 .85rem;
}
.score-page .stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem .5rem .5rem;
  text-align: center;
  min-width: 0;
}
.stat-card .n {
  display: block;
  font-size: clamp(1.15rem, 4.5vw, 1.35rem);
  font-weight: 750;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-card .lbl {
  display: block;
  margin-top: .15rem;
  font-size: .68rem;
  color: var(--dim);
  line-height: 1.25;
}
.section-label {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin: 1.15rem 0 .45rem;
}
.todo-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.todo-list li {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  align-items: baseline;
  padding: .65rem .8rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: clamp(.95rem, 3.5vw, 1.02rem);
}
.todo-list .city {
  color: var(--text);
  font-weight: 650;
  min-width: 7.5rem;
}
.todo-list .note { color: var(--dim); font-size: .9em; }
.hist-note {
  margin-top: 1.25rem;
  padding: .75rem .9rem;
  border-left: 3px solid var(--line);
  color: var(--dim);
  font-size: .88rem;
  line-height: 1.45;
}
.hist-note a { font-weight: 600; }

/* Parks-since table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: .5rem 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}
table.parks {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(.88rem, 3.2vw, .98rem);
  min-width: 520px;
}
table.parks th,
table.parks td {
  text-align: left;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.parks th {
  color: var(--dim);
  font-weight: 650;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  white-space: nowrap;
}
table.parks tr:last-child td { border-bottom: none; }
table.parks td.year {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
table.parks td.park { color: var(--text); font-weight: 650; }
table.parks td.team { color: var(--muted); }
table.parks td.city { color: var(--dim); }
table.parks td.replaces {
  color: var(--dim);
  font-size: .9em;
  max-width: 14rem;
}
table.parks .aka {
  display: block;
  font-weight: 500;
  color: var(--dim);
  font-size: .85em;
  margin-top: .15rem;
}
table.parks td.status { white-space: nowrap; text-align: right; }
table.parks.score th:last-child,
table.parks.score td:last-child { text-align: right; }
table.parks.score td.year {
  font-size: .9em;
  color: var(--dim);
  font-weight: 600;
}
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .22rem .5rem;
  border-radius: 999px;
  line-height: 1.2;
  flex-shrink: 0;
}
.badge.todo {
  color: #1a1208;
  background: var(--gold);
}
.badge.visited {
  color: #041418;
  background: var(--cyan);
}
.badge.partial {
  color: #eef1f6;
  background: #3a5060;
}
table.parks td.hist {
  color: var(--dim);
  font-size: .9em;
  max-width: 12rem;
}

/* Scorecard — mobile cards, no horizontal scroll */
.score-page .score-lead {
  margin-bottom: .85rem;
  font-size: clamp(.92rem, 3.5vw, 1.02rem);
}
.score-page .score-sub {
  color: var(--dim);
  font-size: .88rem;
  margin: -.15rem 0 .65rem;
  line-height: 1.4;
}
.sec-count {
  font-weight: 600;
  color: var(--dim);
  letter-spacing: 0;
  text-transform: none;
  font-size: .85em;
}
.sort-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin: 0 0 1rem;
}
.sort-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: .15rem;
}
.sort-btn {
  font-family: inherit;
  font-size: .8rem;
  font-weight: 650;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .7rem;
  cursor: pointer;
  touch-action: manipulation;
}
.sort-btn.active {
  color: #041418;
  background: var(--cyan);
  border-color: transparent;
}
.score-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
/* Photo underlay (chasefield.jpg style: wide aerial, text rides on top) */
.score-item.score-underlay {
  position: relative;
  display: block;
  min-height: clamp(9.5rem, 28vw, 11.5rem);
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #1a222c;
  min-width: 0;
}
.score-item.done { box-shadow: inset 3px 0 0 var(--cyan); }
.score-item.todo { box-shadow: inset 3px 0 0 var(--gold); }
.score-item.closed { box-shadow: inset 3px 0 0 #6a7588; }
.score-bg {
  position: absolute;
  inset: 0;
  background-color: #243040;
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  /* keep aerials bright like chasefield.jpg — darken only via overlay */
  filter: none;
  transform: scale(1.01);
}
.score-item.has-photo .score-bg {
  filter: saturate(1.05) contrast(1.02);
}
.score-overlay {
  position: relative;
  z-index: 1;
  display: block;
  min-height: clamp(9.5rem, 28vw, 11.5rem);
  /* bottom room for BT/TD left + Map right */
  padding: .85rem .95rem 2.45rem .95rem;
  /* left + bottom scrim only — photo stays readable on the right */
  background:
    linear-gradient(
      90deg,
      rgba(6, 10, 14, 0.88) 0%,
      rgba(6, 10, 14, 0.55) 38%,
      rgba(6, 10, 14, 0.12) 72%,
      rgba(6, 10, 14, 0.05) 100%
    ),
    linear-gradient(
      0deg,
      rgba(6, 10, 14, 0.75) 0%,
      rgba(6, 10, 14, 0.2) 42%,
      transparent 70%
    );
}
.score-main {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
/* Status chip — bottom left (BEEN THERE / TO DO / CLOSED) */
.badge.status-corner {
  position: absolute;
  bottom: .65rem;
  left: .7rem;
  top: auto;
  right: auto;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.map-link.map-corner {
  position: absolute;
  bottom: .65rem;
  right: .7rem;
  z-index: 2;
  background: rgba(10, 18, 24, 0.72);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.score-park {
  display: block;
  font-weight: 750;
  font-size: clamp(1.08rem, 4.2vw, 1.22rem);
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 2px 12px rgba(0, 0, 0, 0.45);
}
.score-meta {
  display: block;
  margin-top: .28rem;
  font-size: .9rem;
  color: #e8eef6;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.score-meta.score-open {
  margin-top: .35rem;
  font-size: .88rem;
  color: #d0d8e4;
  font-variant-numeric: tabular-nums;
}
.score-meta.score-uba-line {
  margin-top: .2rem;
  font-size: .88rem;
  color: #c8d4e0;
  font-weight: 600;
}
.score-meta.score-planned {
  margin-top: .2rem;
  font-size: .86rem;
  font-weight: 700;
  color: #ff5c5c;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.score-meta.score-next {
  margin-top: .18rem;
  font-size: .84rem;
  color: #b8c4d2;
  font-weight: 550;
}
a.notes-inline {
  display: inline;
  margin-left: .35rem;
  font-size: .82em;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(94, 212, 232, 0.45);
  text-shadow: none;
}
a.notes-inline:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.55);
}
a.notes-inline.entry {
  color: #f0d78a;
  border-bottom-color: rgba(212, 168, 75, 0.45);
}
.score-note {
  display: block;
  margin-top: .28rem;
  font-size: .8rem;
  color: #c2ccd8;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}
/* legacy action column unused on new cards */
.score-actions {
  display: none;
}
a.map-link {
  display: inline-flex;
  align-items: center;
  font-size: .78rem;
  font-weight: 700;
  color: var(--cyan);
  text-decoration: none;
  padding: .28rem .55rem;
  border-radius: 8px;
  border: 1px solid #1a4a54;
  background: rgba(20, 42, 50, 0.6);
  white-space: nowrap;
  touch-action: manipulation;
}
a.map-link.inline {
  margin-left: .35rem;
  vertical-align: middle;
}
a.map-link:hover { filter: brightness(1.1); text-decoration: none; }

.trip-map {
  width: 100%;
  height: min(52vh, 380px);
  min-height: 240px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 0 0 .75rem;
  background: #0a0e14;
  z-index: 0;
}
.trip-map .leaflet-container {
  font: inherit;
  background: #0a0e14;
}
.trip-order {
  margin: 0 0 .65rem 1.15rem;
  padding: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}
.trip-order li { margin-bottom: .4rem; }
.trip-order strong { color: var(--text); }
.trip-links { margin: 0 0 1.25rem; }

@media (max-width: 520px) {
  .score-item.score-underlay,
  .score-overlay {
    min-height: 10.5rem;
  }
  .score-overlay {
    padding: .85rem .85rem 2.4rem .85rem;
    background:
      linear-gradient(
        180deg,
        rgba(6, 10, 14, 0.15) 0%,
        rgba(6, 10, 14, 0.45) 45%,
        rgba(6, 10, 14, 0.9) 100%
      );
  }
  .score-bg { background-position: center 35%; }
  .score-main { max-width: 100%; }
}

/* Single inline photos (classic posts) */
.pics { margin: .35rem 0 1rem; }
.pic {
  margin: 0 0 1rem;
  padding: 0;
  border: none;
  background: transparent;
}
.pic img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0a0e14;
}
.pic figcaption {
  margin-top: .45rem;
  font-size: clamp(.9rem, 3.4vw, 1rem);
  color: var(--muted);
  font-weight: 600;
}

/* Filmstrip + full-width stage, caption above */
.viewer { margin-top: .25rem; }
.filmstrip {
  display: flex;
  gap: .4rem;
  padding: .3rem 0 .55rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: .65rem;
  -webkit-overflow-scrolling: touch;
}
.film-item {
  flex: 0 0 auto;
  width: 72px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: .15rem;
  font-family: inherit;
  font-size: .6rem;
  color: var(--dim);
  line-height: 1.2;
  text-align: center;
}
.film-item.active { border-color: var(--cyan); color: var(--cyan); }
.film-item img {
  width: 100%;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto .15rem;
}
.stage { width: 100%; text-align: center; }
.stage-caption {
  margin: 0 0 .5rem;
  font-size: clamp(.95rem, 3.6vw, 1.05rem);
  font-weight: 600;
  color: var(--muted);
}
.stage-caption:empty { display: none; }
.stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.list { display: flex; flex-direction: column; gap: .55rem; }
.entry {
  display: block;
  padding: 1.05rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.entry:hover { border-color: #3a5060; text-decoration: none; filter: brightness(1.06); }
.entry .title {
  display: block;
  font-size: clamp(1.08rem, 4.2vw, 1.2rem);
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: .25rem;
  line-height: 1.3;
}
.entry .meta {
  display: block;
  font-size: clamp(.9rem, 3.4vw, .98rem);
  color: var(--dim);
  margin: 0;
}
.lead {
  color: var(--muted);
  font-size: clamp(1.02rem, 3.8vw, 1.12rem);
  margin-bottom: 1.15rem;
}
.foot-note {
  margin-top: 1.25rem;
  font-size: .82rem;
  color: var(--dim);
}

@media (max-width: 480px) {
  .wrap { padding: 1rem .9rem 1.5rem; }
  .entry { padding: 1.15rem 1.05rem; }
}

a.uba-link {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: #f0d78a;
  text-decoration: none;
  padding: .22rem .5rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 168, 75, 0.4);
  background: rgba(10, 18, 24, 0.72);
  white-space: nowrap;
  touch-action: manipulation;
  backdrop-filter: blur(4px);
}
a.uba-link:hover { filter: brightness(1.12); text-decoration: none; }

.trip-day {
  display: inline-block;
  min-width: 9.5rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-size: .85em;
}
@media (max-width: 520px) {
  .trip-day { display: block; min-width: 0; margin-bottom: .15rem; }
  .score-page .stat-card .lbl { font-size: .62rem; }
}

/* Compact one-line entry rows (Post-Tour / Pre-Tour) */
.list-compact { gap: .35rem; }
.entry.entry-oneline,
.entry.entry-static {
  padding: .55rem .85rem;
  display: flex;
  align-items: center;
  min-height: 0;
}
.entry .title.oneline {
  display: block;
  font-size: clamp(.88rem, 3.2vw, 1rem);
  font-weight: 650;
  color: var(--cyan);
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  letter-spacing: -0.01em;
}
.entry.entry-static .title.oneline { color: var(--text); }
.entry.entry-oneline:hover .title.oneline { color: var(--cyan); }
.score-page .meta:empty { display: none; }
