/* Colours come from tokens.css, the project copy of the danielk.am palette. Add roles here. */
/* The only values defined outside that palette are the game-state colours below. */
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  /* Map pin roles for this product. Shape differs per type too; see pins.js. */
  /* A gym takes the colour of the team holding it; Power Spots get their own colour. */
  --color-team-mystic: var(--color-brand);
  --color-team-valor: #D92D20;
  --color-team-instinct: #E5A50A;
  --color-team-none: var(--color-muted);
  --color-marker-stop: var(--color-teal);
  --color-marker-power: #C026D3;
  --gutter: 48px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, summary { font: inherit; }
a { color: var(--color-brand); text-underline-offset: 4px; }
a:hover { color: var(--color-brand-hover); }
button, a, summary, input { touch-action: manipulation; }
button, summary { cursor: pointer; }
button { background: var(--color-brand); color: var(--color-white); border: 1px solid var(--color-brand); border-radius: 9px; padding: 13px 19px; font-weight: 650; min-height: 46px; }
button:hover { background: var(--color-brand-hover); }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, #results:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
input { width: 100%; min-width: 0; padding: 14px; border: 1px solid var(--color-border-strong); border-radius: 9px; background: var(--white); color: var(--ink); font-size: 16px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(38px, 5vw, 66px); line-height: 1.04; letter-spacing: -2.7px; font-weight: 550; margin-bottom: 20px; }
h2 { font-weight: 550; letter-spacing: -.8px; }
h3 { line-height: 1.35; letter-spacing: -.2px; }
p { line-height: 1.6; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 10px; top: -70px; background: var(--ink); color: var(--color-white); padding: 12px; z-index: 10000; }
.skip:focus { top: 10px; color: var(--color-white); }

.masthead, main, footer { max-width: 1320px; margin: auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.masthead { height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.4px; font-size: 18px; min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand-name { display: flex; flex-direction: column; gap: 3px; line-height: 1.15; }
.brand-name strong { font-weight: 700; }
.brand-name small { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.brand-mark { display: block; width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; margin-right: 5px; }
.about-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; text-decoration: none; color: var(--ink); white-space: nowrap; }

.intro { display: flex; justify-content: space-between; padding: 56px 0 30px; gap: 36px; }
.eyebrow { font-size: 10px; letter-spacing: 2.1px; font-weight: 750; text-transform: uppercase; margin-bottom: 13px; }
.lede { max-width: 620px; color: var(--muted); font-size: 17px; margin-bottom: 0; }
.intro-art { align-self: center; flex-shrink: 0; width: clamp(200px, 24vw, 320px); height: auto; }

.finder { padding: 26px 28px 15px; background: var(--color-brand-soft); border: 1px solid var(--color-border); border-radius: 15px; }
.finder label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 9px; }
.finder-label { font-size: 14px; font-weight: 650; margin: 0 0 9px; }
.help, .small { font-size: 12px; color: var(--muted); line-height: 1.6; }
.help { margin: 9px 0; }
.finder-tools { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.finder-tools > button { font-size: 14px; }
.secondary { background: var(--color-white); color: var(--ink); border-color: var(--color-border-strong); font-size: 13px; }
.secondary:hover { background: var(--color-brand-soft-hover); }
.quiet { background: transparent; color: var(--muted); border-color: transparent; font-size: 13px; }
.quiet:hover { background: var(--color-brand-soft-hover); color: var(--ink); }
.coordinate-entry { padding: 0 4px; flex: 1; min-width: 170px; }
.coordinate-entry summary { font-size: 13px; min-height: 46px; display: flex; align-items: center; gap: 6px; list-style: none; }
.coordinate-entry summary::-webkit-details-marker { display: none; }
.coordinate-entry summary::before { content: "▸"; }
.coordinate-entry[open] summary::before { content: "▾"; }
.coordinate-fields { display: flex; align-items: flex-end; gap: 9px; margin: 6px 0 12px; }
.coordinate-fields label { flex: 1; margin: 0; }
.coordinate-fields input { margin-top: 7px; }
.coordinate-fields button { white-space: nowrap; }
.finder #status { font-size: 12px; margin: 10px 0 0; min-height: 20px; }
#google-search { margin-bottom: 18px; }
#google-input gmp-place-autocomplete { display: block; width: 100%; color-scheme: light; }
#google-enable { margin-top: 4px; }

.catalogue-source { font-size: 12px; color: var(--muted); margin: 18px 0 26px; line-height: 1.7; }

.workspace { display: grid; grid-template-columns: minmax(340px, .86fr) minmax(0, 1.14fr); gap: 28px; align-items: start; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { font-size: 25px; margin: 0; overflow-wrap: anywhere; }
.section-heading .small { white-space: nowrap; }
.list-panel { min-width: 0; }

.type-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.type-filter button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 9px 14px; font-size: 13px; font-weight: 600; background: var(--color-white); color: var(--ink); border-color: var(--color-border-strong); border-radius: 999px; }
.type-filter button:hover { background: var(--color-brand-soft-hover); }
.type-filter button[aria-pressed="true"] { background: var(--color-brand-soft); border-color: var(--color-brand); color: var(--color-blue-ink); box-shadow: inset 0 0 0 1px var(--color-brand); }
.type-filter .count { color: var(--muted); font-weight: 500; }

/* A white edge plus a thin dark halo keeps every pin, yellow included, readable on a light map. */
.pin { display: block; flex-shrink: 0; overflow: visible; filter: drop-shadow(0 0 .6px var(--color-ink)) drop-shadow(0 1px 1px color-mix(in srgb, var(--color-ink) 35%, transparent)); }
.pin path { stroke: var(--color-marker-outline); stroke-width: 2; stroke-linejoin: round; paint-order: stroke; }
.pin--gym path { fill: var(--color-team-none); }
.pin--team-mystic path { fill: var(--color-team-mystic); }
.pin--team-valor path { fill: var(--color-team-valor); }
.pin--team-instinct path { fill: var(--color-team-instinct); }
.pin--pokestop path { fill: var(--color-marker-stop); }
.pin--power_spot path { fill: var(--color-marker-power); }
.map-pin { background: none; border: 0; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-top: 12px; scroll-margin: 18px; }
.card-type { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.card h3 { font-size: 16px; margin: 0 0 12px; overflow-wrap: anywhere; }
.card-live { font-size: 13px; line-height: 1.5; margin: -4px 0 12px; }
.card-raid { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.countdown { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-brand-hover); white-space: nowrap; }
.leaflet-popup-content .countdown { display: block; margin-top: 4px; }
.freshness { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; font-size: 13px; margin: 6px 0 0; }
.freshness button { min-height: 44px; padding: 8px 10px; color: var(--color-brand); font-weight: 650; }
.distance { font-size: 14px; white-space: nowrap; font-weight: 650; color: var(--color-brand-hover); }
.card details { font-size: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.card summary { min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 600; list-style: none; }
.card summary::-webkit-details-marker { display: none; }
.card summary::before { content: "▸"; }
.card details[open] summary::before { content: "▾"; }
.card ul { padding-left: 18px; margin: 0 0 6px; line-height: 1.6; color: var(--muted); }
.card li { margin: 5px 0; }
.card-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.card-actions a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 650; }
.card-actions button { min-height: 44px; padding: 9px 14px; font-size: 12px; }
.load-more { width: 100%; margin-top: 15px; }
.empty { padding: 32px 22px; border: 1px dashed var(--color-border-strong); border-radius: 12px; font-size: 14px; margin-top: 15px; }

.map-panel { position: sticky; top: 20px; }
#map { height: 590px; border-radius: 15px; background: var(--color-map-surface); overflow: hidden; border: 1px solid var(--color-border); isolation: isolate; z-index: 0; }
.map-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 35px; background: linear-gradient(30deg, transparent 45%, var(--color-map-street) 45%, var(--color-map-street) 49%, transparent 49%), linear-gradient(110deg, transparent 41%, var(--color-map-street-secondary) 41%, var(--color-map-street-secondary) 47%, transparent 47%), var(--color-map-surface); }
.map-placeholder h2 { margin-bottom: 9px; font-size: 27px; }
.map-placeholder p { max-width: 260px; font-size: 13px; }
.map-symbol { font-size: 68px; line-height: 1.2; color: var(--color-brand); margin-bottom: 25px; }
.map-legend { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0; padding: 13px 0 0; font-size: 12px; }
.map-legend:empty { display: none; }
.map-legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend-origin { width: 14px; height: 14px; border-radius: 50%; background: var(--color-marker-outline); border: 3px solid var(--color-origin); flex-shrink: 0; }
.map-tip { color: var(--muted); }
.map-privacy { font-size: 11px; color: var(--muted); margin: 9px 0 0; line-height: 1.55; }
.leaflet-popup-content { font: 13px/1.5 system-ui; color: var(--ink); }
.leaflet-popup-content button { display: block; margin-top: 10px; min-height: 44px; padding: 9px 14px; font-size: 12px; }
.leaflet-container a { color: var(--color-brand); }

.about { display: grid; grid-template-columns: .8fr 1.2fr; border-top: 1px solid var(--line); margin-top: 56px; padding: 35px 0; gap: 30px; }
.about h2 { font-size: 30px; line-height: 1.15; }
.about p:not(.eyebrow) { font-size: 14px; color: var(--muted); max-width: 640px; }
.questions { margin-top: 0; }
.questions h3 { font-size: 16px; margin-bottom: 8px; }
.questions h3:not(:first-child) { margin-top: 24px; }
.about p.source-summary { border-left: 3px solid var(--color-brand); padding-left: 14px; color: var(--ink); }

footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 23px; padding-bottom: max(30px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
footer span { font-weight: 650; }
footer p { margin: 0; max-width: 560px; }

.page { max-width: 760px; padding: 48px 0 56px; }
.page h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -2px; }
.page h2 { font-size: 22px; margin: 34px 0 10px; }
.page p { color: var(--muted); font-size: 15px; }

@media (min-width: 900px) {
  #results { overflow: auto; scrollbar-gutter: stable; padding-right: 5px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
  #results.results-expanded { max-height: 760px; }
  #results:hover, #results:focus-within { scrollbar-color: var(--color-border-strong) transparent; }
}
@media (hover: none) { #results { scrollbar-color: auto; } }
@media (forced-colors: active) { #results { scrollbar-color: auto; } }

@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .intro { padding-top: 36px; align-items: center; }
  .intro-art { width: 200px; }
  .workspace { grid-template-columns: 1fr 1fr; gap: 18px; }
  .finder { padding: 22px; }
  .coordinate-entry { flex: auto; }
  .coordinate-fields { flex-wrap: wrap; }
  .coordinate-fields label { min-width: 95px; }
  #map { height: 480px; }
}
@media (max-width: 650px) {
  :root { --gutter: 18px; }
  .masthead { height: 74px; }
  .brand { font-size: 15px; gap: 4px; }
  .brand-mark { width: 34px; height: 34px; }
  .about-link { font-size: 12px; }
  .intro { padding: 31px 0 24px; }
  .intro-art { display: none; }
  h1 { font-size: 40px; letter-spacing: -2px; }
  .lede { font-size: 15px; }
  .finder { padding: 18px 15px; }
  .finder-tools { gap: 8px; }
  .finder-tools > button { flex: 1 1 100%; }
  .coordinate-entry { width: 100%; padding: 0 1px; }
  .coordinate-fields button { width: 100%; }
  .workspace { display: flex; flex-direction: column; gap: 23px; }
  .map-panel { position: static; order: -1; width: 100%; }
  .list-panel { width: 100%; }
  #map { height: 340px; }
  .map-symbol { font-size: 43px; margin-bottom: 8px; }
  .map-placeholder { padding: 18px; }
  .map-placeholder h2 { font-size: 22px; }
  .map-placeholder p { margin-bottom: 12px; }
  .about { grid-template-columns: 1fr; gap: 0; margin-top: 36px; }
  .about h2 { font-size: 27px; }
  .about h2 br { display: none; }
  footer { flex-direction: column; gap: 9px; }
  .card { padding: 17px; }
  .card h3 { font-size: 15px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background .15s; }
  .card { animation: appear .2s ease; }
  @keyframes appear { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}
