/* ==========================================================================
   Retro Stores UK — neon / CRT / cartridge theme
   ========================================================================== */

@font-face { font-family: 'Press Start 2P'; src: url('../vendor/fonts/press-start-2p.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'VT323'; src: url('../vendor/fonts/vt323.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Chakra Petch'; font-weight: 400; src: url('../vendor/fonts/chakra-petch-400.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Chakra Petch'; font-weight: 500; src: url('../vendor/fonts/chakra-petch-500.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Chakra Petch'; font-weight: 600; src: url('../vendor/fonts/chakra-petch-600.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Chakra Petch'; font-weight: 700; src: url('../vendor/fonts/chakra-petch-700.woff2') format('woff2'); font-display: swap; }

:root {
  --bg: #0a0719;
  --bg-2: #120c2b;
  --panel: #19113b;
  --panel-2: #22184d;
  --line: #3a2c78;
  --ink: #f3efff;
  --muted: #a99fd6;
  --dim: #6f66a0;
  --pink: #ff2e93;
  --cyan: #26e5ff;
  --yellow: #ffd23f;
  --green: #3dff8b;
  --amber: #ffad1f;
  --red: #ff4f5e;
  --purple: #9b5cff;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --term: 'VT323', ui-monospace, monospace;
  --body: 'Chakra Petch', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 4px;
  --shadow-pink: 0 0 0 1px rgba(255, 46, 147, .5), 0 0 24px rgba(255, 46, 147, .25);
  --shadow-cyan: 0 0 0 1px rgba(38, 229, 255, .5), 0 0 24px rgba(38, 229, 255, .25);
  --wrap: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(155, 92, 255, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(255, 46, 147, .12), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
/* CRT scanlines + vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .16) 3px, rgba(0, 0, 0, 0) 4px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .35) 100%);
  mix-blend-mode: multiply;
}
main { flex: 1; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
::selection { background: var(--pink); color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.pixel { font-family: var(--pixel); letter-spacing: .02em; }
.term { font-family: var(--term); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10000; background: var(--yellow); color: #000; padding: 8px 12px; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(10, 7, 25, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--purple) 40%, var(--cyan));
  opacity: .8;
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.logo svg { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 0 6px rgba(255, 46, 147, .6)); }
.logo-text { font-family: var(--pixel); font-size: 13px; line-height: 1.35; }
.logo-text b { color: var(--pink); font-weight: 400; }
.logo-text small { display: block; font-family: var(--term); font-size: 16px; color: var(--muted); letter-spacing: .08em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  font-family: var(--term); font-size: 21px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: var(--radius);
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--ink); background: var(--panel); }
.nav a[aria-current='page'] { box-shadow: inset 0 -2px 0 var(--pink); }
.nav a.nav-cta { color: var(--yellow); }
@media (max-width: 640px) {
  .header-inner { gap: 6px; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; margin: 0 -8px; padding-bottom: 2px; scrollbar-width: none; }
  .nav a { font-size: 19px; white-space: nowrap; }
}

/* ---------- Buttons & forms ---------- */
.btn {
  --c: var(--pink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--pixel); font-size: 11px; line-height: 1; text-transform: uppercase;
  color: #0a0719; background: var(--c); border: 0; cursor: pointer; text-decoration: none;
  padding: 14px 18px; min-height: 44px;
  box-shadow: 0 -4px 0 0 rgba(0, 0, 0, .28) inset, 4px 4px 0 0 #000;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.12); color: #0a0719; }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 -4px 0 0 rgba(0, 0, 0, .28) inset, 1px 1px 0 0 #000; }
.btn.cyan { --c: var(--cyan); }
.btn.yellow { --c: var(--yellow); }
.btn.green { --c: var(--green); }
.btn.ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--cyan); color: var(--ink); }
.btn.small { font-size: 9px; padding: 10px 12px; min-height: 34px; }
.btn.danger { --c: var(--red); }
.btn svg { width: 14px; height: 14px; }

label { display: block; font-family: var(--term); font-size: 20px; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=search], input[type=url], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg-2); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(38, 229, 255, .2); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%), linear-gradient(135deg, var(--cyan) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-family: var(--body); font-size: 16px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--pink); }
.field { margin-bottom: 16px; }
.field-hint { font-size: 14px; color: var(--dim); margin-top: 4px; }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); isolation: isolate; }
.hero-sky { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, #0a0719 0%, #1d0f45 55%, #3b0f5e 72%, #0a0719 72.2%); }
.hero-sun {
  position: absolute; z-index: -1; left: 50%; top: 18%; width: min(520px, 90vw); aspect-ratio: 1; transform: translateX(-10%);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--yellow) 0%, #ff8a3d 35%, var(--pink) 70%);
  /* union of "top half" and "stripes" = classic striped synthwave sun */
  -webkit-mask-image: linear-gradient(180deg, #000 0 52%, transparent 52%), repeating-linear-gradient(180deg, #000 0 10px, transparent 10px 15px);
  mask-image: linear-gradient(180deg, #000 0 52%, transparent 52%), repeating-linear-gradient(180deg, #000 0 10px, transparent 10px 15px);
  filter: drop-shadow(0 0 40px rgba(255, 46, 147, .55));
  opacity: .9;
}
.hero-grid {
  position: absolute; z-index: -1; left: -50%; right: -50%; bottom: 0; height: 30%;
  background-image:
    linear-gradient(to right, rgba(255, 46, 147, .7) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(255, 46, 147, .7) 2px, transparent 2px);
  background-size: 60px 40px;
  transform: perspective(300px) rotateX(60deg);
  transform-origin: top center;
  animation: grid-roll 1.6s linear infinite;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 25%);
  mask: linear-gradient(to bottom, transparent, #000 25%);
}
@keyframes grid-roll { to { background-position: 0 40px; } }
.hero-inner { position: relative; padding: 64px 16px 150px; }
@media (min-width: 720px) { .hero-inner { padding: 96px 28px 190px; } }
.hero-kicker { font-family: var(--term); font-size: 24px; color: var(--cyan); letter-spacing: .12em; margin: 0 0 14px; text-shadow: 0 0 10px rgba(38, 229, 255, .7); }
.hero-kicker .blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero h1 {
  font-family: var(--pixel); font-weight: 400; font-size: clamp(24px, 5.2vw, 52px); line-height: 1.25; margin: 0 0 22px; max-width: 16ch;
  color: #fff;
  text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 rgba(155, 92, 255, .8), 0 0 30px rgba(255, 46, 147, .6);
}
.hero-lede { font-size: clamp(17px, 2vw, 20px); max-width: 52ch; color: #dcd5ff; margin-bottom: 28px; }
.search-bar {
  display: flex; gap: 10px; max-width: 640px; padding: 10px;
  background: rgba(18, 12, 43, .88); border: 2px solid var(--line); box-shadow: var(--shadow-cyan); border-radius: 6px;
}
.search-bar input { border: 0; background: transparent; font-size: 18px; min-width: 0; }
.search-bar input:focus { box-shadow: none; }
.hero-actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 16px; font-family: var(--term); font-size: 20px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--cyan); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; gap: 6px; align-items: center; }
.linkish:hover { color: var(--ink); }
.linkish svg { width: 16px; height: 16px; }
@media (max-width: 560px) {
  .search-bar { flex-direction: column; }
  .search-bar .btn { width: 100%; }
}

/* ---------- Scoreboard ---------- */
.scoreboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: -46px auto 0; position: relative; z-index: 2; max-width: 860px; background: #000; border: 3px solid var(--line); box-shadow: 6px 6px 0 #000, var(--shadow-pink); }
.score { padding: 14px 18px; text-align: center; border-right: 2px dashed var(--line); }
.score:last-child { border-right: 0; }
.score b { display: block; font-family: var(--term); font-size: 46px; line-height: 1; color: var(--yellow); text-shadow: 0 0 12px rgba(255, 210, 63, .6); font-weight: 400; }
.score span { font-family: var(--pixel); font-size: 9px; color: var(--muted); letter-spacing: .1em; }
@media (max-width: 520px) { .score { border-right: 0; border-bottom: 2px dashed var(--line); } .score:last-child { border-bottom: 0; } }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section.tight { padding: 36px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2, .page-title {
  font-family: var(--pixel); font-weight: 400; font-size: clamp(16px, 2.4vw, 22px); margin: 0; color: var(--ink);
  text-shadow: 2px 2px 0 var(--pink);
}
.section-head .eyebrow, .eyebrow { display: block; font-family: var(--term); font-size: 20px; color: var(--cyan); letter-spacing: .1em; margin-bottom: 6px; text-shadow: none; }
.page-head { padding: 44px 0 20px; }
.page-head p { color: var(--muted); max-width: 60ch; margin-top: 12px; }
.crumbs { font-family: var(--term); font-size: 19px; color: var(--dim); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }

/* ---------- Region select ---------- */
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.region-tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 104px;
  padding: 14px; text-decoration: none; color: var(--ink);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 2px solid var(--line); border-radius: var(--radius);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.region-tile:hover { transform: translateY(-3px); border-color: var(--pink); box-shadow: var(--shadow-pink); color: var(--ink); }
.region-tile .n { font-family: var(--term); font-size: 40px; line-height: 1; color: var(--cyan); }
.region-tile .name { font-family: var(--pixel); font-size: 10px; line-height: 1.5; }
.region-tile .num { position: absolute; top: 10px; right: 12px; font-family: var(--term); font-size: 16px; color: var(--dim); }
.region-tile.empty { opacity: .55; }

/* ---------- Cartridge cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.cart {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: #2a2350;
  border-radius: 10px 10px 4px 4px;
  padding: 18px 14px 14px;
  box-shadow: 0 0 0 2px #120c2b, 6px 6px 0 #000;
  transition: transform .14s, box-shadow .14s;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 92% 100%, 92% 97%, 8% 97%, 8% 100%, 0 100%);
}
.cart::before { /* grip ridges */
  content: ''; position: absolute; top: 6px; left: 22%; right: 22%; height: 6px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .35) 0 3px, transparent 3px 8px);
  border-radius: 2px;
}
.cart:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 0 0 2px var(--pink), 6px 10px 0 #000, 0 0 30px rgba(255, 46, 147, .35); color: var(--ink); }
.cart-label {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(170deg, #1b1240 0%, #12092f 100%);
  border: 2px solid #0b0620; border-radius: 4px; padding: 14px 14px 12px;
  position: relative; overflow: hidden;
}
.cart-label::after { /* label stripes */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: linear-gradient(90deg, var(--pink) 0 33%, var(--yellow) 33% 66%, var(--cyan) 66%);
}
.cart[data-status='closed'] .cart-label::after { background: var(--dim); }
.cart[data-status='temporarily_closed'] .cart-label::after { background: linear-gradient(90deg, var(--amber) 0 50%, #000 50%); background-size: 16px 6px; }
.cart-title { font-family: var(--pixel); font-size: 12px; line-height: 1.55; margin: 6px 0 0; word-break: break-word; }
.cart-where { font-family: var(--term); font-size: 20px; color: var(--muted); line-height: 1.1; }
.cart-desc { font-size: 14.5px; color: #cfc7f5; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.cart-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.cart-dist { font-family: var(--term); font-size: 19px; color: var(--yellow); }
.cart-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-family: var(--term); font-size: 16px; line-height: 1; padding: 4px 6px; border: 1px solid var(--line); color: var(--muted); border-radius: 3px; background: rgba(0, 0, 0, .25); text-decoration: none; }
a.chip:hover { border-color: var(--cyan); color: var(--ink); }

/* ---------- Status badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 7px; font-family: var(--pixel); font-size: 8.5px; line-height: 1; padding: 6px 8px 6px 7px; border-radius: 3px; background: rgba(0, 0, 0, .45); white-space: nowrap; border: 1px solid currentColor; }
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; flex: none; }
.badge.open { color: var(--green); }
.badge.open::before { animation: pulse 2s ease-in-out infinite; }
.badge.paused { color: var(--amber); }
.badge.over { color: var(--red); }
.badge.unknown { color: var(--muted); }
.badge.big { font-size: 11px; padding: 9px 12px; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Filters ---------- */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; padding: 14px; background: var(--panel); border: 2px solid var(--line); border-radius: 6px; }
.filters .field { margin: 0; }
.filters .opts { grid-column: 1 / -1; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
@media (max-width: 820px) { .filters { grid-template-columns: 1fr 1fr; } .filters .field:first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .filters { grid-template-columns: 1fr; } }
.view-toggle { display: inline-flex; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
.view-toggle a { font-family: var(--pixel); font-size: 10px; padding: 11px 14px; text-decoration: none; color: var(--muted); }
.view-toggle a[aria-current='page'] { background: var(--pink); color: #0a0719; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 18px; font-family: var(--term); font-size: 21px; color: var(--muted); }
.results-bar b { color: var(--yellow); font-weight: 400; }

/* ---------- Empty / notices ---------- */
.empty-state { text-align: center; padding: 60px 16px; border: 2px dashed var(--line); border-radius: 8px; }
.empty-state h2 { font-family: var(--pixel); font-size: 16px; font-weight: 400; color: var(--pink); }
.notice { border: 2px solid var(--line); border-left-width: 6px; padding: 14px 16px; border-radius: 4px; background: var(--panel); margin-bottom: 20px; }
.notice p:last-child { margin: 0; }
.notice h3 { font-family: var(--pixel); font-size: 11px; font-weight: 400; margin-bottom: 8px; }
.notice.paused { border-color: var(--amber); }
.notice.paused h3 { color: var(--amber); }
.notice.over { border-color: var(--red); }
.notice.over h3 { color: var(--red); }
.notice.unknown { border-color: var(--dim); }
.notice.ok { border-color: var(--green); }
.notice.error { border-color: var(--red); }
.flash { margin: 18px 0; }

/* ---------- Store page ---------- */
.store-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.store-head h1 { font-family: var(--pixel); font-weight: 400; font-size: clamp(20px, 3.6vw, 32px); line-height: 1.35; margin: 0 0 10px; text-shadow: 3px 3px 0 var(--pink); word-break: break-word; }
.store-sub { font-family: var(--term); font-size: 24px; color: var(--muted); }
.store-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; margin-top: 28px; }
@media (max-width: 860px) { .store-grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 20px; margin-bottom: 22px; }
.panel h2 { font-family: var(--pixel); font-weight: 400; font-size: 11px; color: var(--cyan); margin-bottom: 14px; letter-spacing: .04em; }
.lead { font-size: 19px; color: #e4ddff; }
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.info-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.info-list svg { width: 20px; height: 20px; color: var(--pink); margin-top: 3px; }
.info-list a { word-break: break-word; }
.store-map { height: 280px; border-radius: 6px; border: 2px solid var(--line); margin-bottom: 14px; background: var(--bg-2); }
.link-row { display: flex; gap: 10px; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px dashed var(--line); }
.timeline li { position: relative; padding: 0 0 14px 18px; font-size: 15px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; background: var(--cyan); }
.timeline time { display: block; font-family: var(--term); font-size: 17px; color: var(--dim); }
.fb-embed { border: 2px dashed var(--line); border-radius: 6px; padding: 16px; text-align: center; }
.fb-embed iframe { width: 100%; max-width: 500px; height: 560px; border: 0; background: #fff; border-radius: 4px; }

/* ---------- Feed ---------- */
.feed { font-family: var(--term); font-size: 21px; line-height: 1.35; background: #04030b; border: 2px solid var(--line); border-radius: 6px; padding: 18px 20px; box-shadow: inset 0 0 40px rgba(38, 229, 255, .07); }
.feed ul { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px dashed rgba(58, 44, 120, .6); }
.feed li:last-child { border: 0; }
.feed time { color: var(--dim); }
.feed a { color: var(--green); text-decoration: none; }
.feed a:hover { text-decoration: underline; }
.feed .k-closed a, .feed .k-closed { color: var(--red); }
.feed .k-temporarily_closed a { color: var(--amber); }
.feed .prompt { color: var(--pink); }
.feed .cursor { display: inline-block; width: 10px; height: 18px; background: var(--green); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@media (max-width: 520px) { .feed li { grid-template-columns: 1fr; gap: 0; } }

/* ---------- CTA band ---------- */
.cta-band { position: relative; text-align: center; padding: 54px 20px; border: 3px solid var(--yellow); border-radius: 8px; background: repeating-linear-gradient(45deg, rgba(255, 210, 63, .06) 0 12px, transparent 12px 24px), var(--bg-2); box-shadow: 8px 8px 0 #000; }
.cta-band h2 { font-family: var(--pixel); font-weight: 400; font-size: clamp(16px, 2.6vw, 24px); color: var(--yellow); text-shadow: 3px 3px 0 #000; }
.cta-band p { color: var(--muted); max-width: 52ch; margin: 0 auto 22px; }

/* ---------- Map page ---------- */
.map-shell { position: relative; height: calc(100vh - 66px); min-height: 480px; }
.map-shell #map { position: absolute; inset: 0; background: #0b0b16; }
.map-panel {
  position: absolute; z-index: 600; top: 14px; left: 14px; width: min(340px, calc(100% - 28px));
  background: rgba(18, 12, 43, .94); border: 2px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: 6px 6px 0 #000;
}
.map-panel h1 { font-family: var(--pixel); font-weight: 400; font-size: 12px; margin: 0 0 12px; text-shadow: 2px 2px 0 var(--pink); }
.map-panel .field { margin-bottom: 10px; }
.map-panel .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.map-panel .count { font-family: var(--term); font-size: 20px; color: var(--yellow); margin: 8px 0 0; }
.map-panel details summary { cursor: pointer; font-family: var(--term); font-size: 20px; color: var(--cyan); list-style: none; }
.map-panel details summary::-webkit-details-marker { display: none; }
@media (max-width: 640px) {
  .map-panel { top: auto; bottom: 14px; }
  .map-panel:not([open]) .panel-body { display: none; }
}
.leaflet-container { font-family: var(--body); background: #0b0b16; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); border: 2px solid var(--pink); border-radius: 6px; box-shadow: 4px 4px 0 #000; }
.leaflet-popup-content { margin: 12px 14px; font-size: 15px; }
.leaflet-popup-content a.popup-title { font-family: var(--pixel); font-size: 10px; line-height: 1.6; color: var(--ink); text-decoration: none; display: block; margin-bottom: 6px; }
.leaflet-popup-content a.popup-title:hover { color: var(--cyan); }
.leaflet-popup-content .popup-town { font-family: var(--term); font-size: 18px; color: var(--muted); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: rgba(10, 7, 25, .8) !important; color: var(--dim) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { background: var(--panel); color: var(--ink); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--panel-2); color: var(--cyan); }
.pin { width: 22px; height: 22px; position: relative; }
.pin i { position: absolute; inset: 3px; transform: rotate(45deg); background: var(--c, var(--green)); box-shadow: 0 0 0 2px #000, 0 0 12px var(--c, var(--green)); }
.pin.s-temporarily_closed { --c: var(--amber); }
.pin.s-closed { --c: var(--red); }
.pin.s-unverified { --c: #b6aee0; }
.pin.you i { --c: var(--cyan); border-radius: 50%; transform: none; }
.cluster { display: grid; place-items: center; width: 40px; height: 40px; font-family: var(--pixel); font-size: 10px; color: #0a0719; background: var(--pink); box-shadow: 0 0 0 3px #000, 0 0 18px var(--pink); border-radius: 4px; }
.cluster.lg { background: var(--yellow); box-shadow: 0 0 0 3px #000, 0 0 18px var(--yellow); }

/* ---------- Prose ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-family: var(--pixel); font-weight: 400; font-size: 13px; color: var(--cyan); margin-top: 2em; }
.prose li { margin-bottom: .4em; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: #06040f; padding: 34px 0; font-size: 15px; color: var(--dim); }
.footer-inner { display: flex; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer .coin { font-family: var(--pixel); font-size: 10px; color: var(--yellow); animation: blink 1.4s steps(1) infinite; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Game over (404) ---------- */
.gameover { text-align: center; padding: 100px 16px; }
.gameover h1 { font-family: var(--pixel); font-weight: 400; font-size: clamp(28px, 7vw, 64px); color: var(--red); text-shadow: 4px 4px 0 #000, 0 0 30px rgba(255, 79, 94, .6); }
.gameover .continue { font-family: var(--pixel); font-size: 14px; color: var(--yellow); margin: 26px 0; }
.gameover .continue b { font-weight: 400; color: var(--ink); }

/* ---------- Forms page ---------- */
.form-card { max-width: 760px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.errors { border-color: var(--red); }
.errors ul { margin: 0; padding-left: 20px; }

/* ---------- Admin ---------- */
.admin-bar { background: #000; border-bottom: 2px solid var(--yellow); font-family: var(--term); font-size: 19px; }
.admin-bar .wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; min-height: 42px; }
.admin-bar a { color: var(--yellow); text-decoration: none; }
.admin-bar a:hover, .admin-bar a[aria-current='page'] { color: #fff; text-decoration: underline; }
.admin-bar form { margin-left: auto; }
.admin-bar .pill { background: var(--pink); color: #000; padding: 0 6px; border-radius: 3px; margin-left: 4px; }
.table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 6px; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-family: var(--term); font-size: 18px; font-weight: 400; color: var(--muted); background: var(--panel); position: sticky; top: 0; }
table.data tr:hover td { background: rgba(34, 24, 77, .5); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.kpi b { display: block; font-family: var(--term); font-size: 44px; line-height: 1; color: var(--yellow); font-weight: 400; }
.kpi span { font-size: 14px; color: var(--muted); }
.kpi .delta { font-family: var(--term); font-size: 18px; }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--pink); }
.chart .bar2 { fill: var(--cyan); }
.chart .axis { fill: var(--dim); font-family: var(--term); font-size: 14px; }
.chart .gridline { stroke: var(--line); stroke-dasharray: 2 4; }
.legend-row { display: flex; gap: 18px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.legend-row i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.suggestion { background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 16px; margin-bottom: 14px; }
.suggestion header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 8px; }
.suggestion h3 { font-size: 17px; margin: 0; }
.suggestion .meta { font-family: var(--term); font-size: 18px; color: var(--dim); }
.suggestion dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 14.5px; margin: 10px 0; }
.suggestion dt { color: var(--muted); }
.suggestion dd { margin: 0; word-break: break-word; }
.suggestion .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.inline-form { display: inline; }
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; font-size: 15px; margin-bottom: 4px; z-index: 0; }
.bar-list li::before { content: ''; position: absolute; inset: 0; width: var(--w, 0%); background: rgba(255, 46, 147, .18); border-radius: 3px; z-index: -1; }
.bar-list li span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }
pre.log { background: #000; color: var(--green); font-family: var(--term); font-size: 17px; padding: 12px; border-radius: 6px; overflow-x: auto; max-height: 360px; white-space: pre-wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
.spaced { margin-top: 16px; }
.lg-pink { background: var(--pink); }
.lg-cyan { background: var(--cyan); }
.hero-actions a { display: inline-flex; gap: 6px; align-items: center; }
.hero-actions svg { width: 16px; height: 16px; flex: none; }
.btn { white-space: nowrap; }
.hero-sun { left: auto; right: -6%; transform: none; opacity: .75; }
@media (max-width: 720px) { .hero-sun { right: -30%; top: 30%; opacity: .45; } }
.hero-lede { text-shadow: 0 1px 12px rgba(10, 7, 25, .9); }
/* Turns standard OSM tiles into a dark, slightly purple night map */
.tiles-dark { filter: invert(1) hue-rotate(200deg) brightness(.85) contrast(.95) saturate(.55); }
@media (max-width: 640px) {
  .nav a { font-size: 18px; padding: 4px 7px; }
  .map-shell { height: calc(100dvh - 104px); min-height: 420px; }
  .map-panel h1 { display: inline; }
}
@media (max-width: 380px) { .nav a { font-size: 17px; padding: 4px 5px; } }
