:root {
  /* Halloween season palette: midnight purple, pumpkin orange, slime green. */
  --bg: #0e0a14;
  --surface: #1a1224;
  --surface-2: #261a33;
  --border: #33243f;
  --text: #f7f0ff;
  --muted: #b3a3c2;
  --accent: #ff7a1a;
  --accent-ink: #1a0b02;
  --link: #ffa95c;
  --chip: #2d1c3d;
  --chip-text: #e2c8ff;
  --good: #9be36b;
  --bad: #ff7b7b;
  --warn: #ffc24d;
  --radius: 14px;
  --rainbow: linear-gradient(90deg, #ff7a1a, #ffb347, #c084fc, #9be36b);
  --spooky: linear-gradient(110deg, #2a0f3d 0%, #5b1a6b 35%, #c2410c 75%, #f59e0b 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(255, 122, 26, .14), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, rgba(124, 58, 237, .12), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 12px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand span { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* banner */
.banner {
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  margin: 4px 0 18px;
  background: var(--spooky);
  color: #fff7ed;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px -12px rgba(194, 65, 12, .45);
}
.banner::before, .banner::after {
  content: "🦇"; position: absolute; font-size: 22px; opacity: .55; pointer-events: none;
}
.banner::before { top: 10px; left: 6%; transform: rotate(-14deg); }
.banner::after { bottom: 8px; right: 7%; transform: rotate(12deg) scaleX(-1); font-size: 18px; }
.banner > * { position: relative; }
.banner h1 { margin: 0; font-size: clamp(24px, 5vw, 36px); letter-spacing: -0.02em; }
.banner h1 { text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.banner p { margin: 6px 0 0; opacity: .9; font-weight: 500; }

/* controls */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 999px;
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted);
}
.tab[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filter-toggle { margin-left: auto; }
.filter-toggle[aria-pressed="true"] { background: #ff7a18; color: #1a0d00; border-color: #ff7a18; }
.controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 18px; }
@media (max-width: 640px) { .controls { grid-template-columns: 1fr 1fr; } .controls .seg { grid-column: 1 / -1; } }
.input, select.input, textarea.input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; outline: none;
}
.input:focus { border-color: var(--link); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { background: var(--surface); border: 0; padding: 9px 16px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  border: 1px solid transparent; border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px;
  background: #3b2350; color: #f1e2ff;
}
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.danger { background: #4a1f24; color: #ffc9c9; }
.btn.good { background: #1d4030; color: #c8f5d9; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 20px; line-height: 1; padding: 6px; color: var(--warn); }
.going-btn { background: none; border: 0; cursor: pointer; color: var(--good); font-weight: 600; font-size: 14px; padding: 6px; }
.going-btn[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 4px; }

/* event cards (2023 layout: text left, image right) */
.day { margin: 26px 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.day.featured { color: var(--accent); }
.card {
  display: grid; grid-template-columns: 1fr 240px; gap: 16px; background: var(--surface); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; border: 1px solid transparent;
}
.card h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.card h3 a { color: inherit; text-decoration: none; }
.card .meta { color: var(--muted); font-weight: 600; font-size: 14px; }
.card .price { color: var(--link); font-weight: 600; margin-top: 6px; }
.card .thumb { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.card:hover { border-color: var(--border); }
.card.promoted, .card.promoted:hover { border-color: var(--accent); }
.sponsored { display: inline-block; margin-bottom: 6px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card .thumb.placeholder { display: grid; place-items: center; font-size: 40px; background: var(--spooky); }
.card .actions { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; grid-column: 1 / -1; }
.card .actions .right { display: flex; align-items: center; gap: 4px; }
@media (max-width: 640px) {
  .card { grid-template-columns: 1fr; }
  .card .thumb { order: -1; }
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { background: var(--chip); color: var(--chip-text); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.chip.halloween { background: #4a2410; color: #ffc896; }
.soldout { color: var(--bad); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* map */
#map, .map { height: 70vh; min-height: 380px; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.map.small { height: 280px; min-height: 0; }
.map.venue { height: 480px; min-height: 0; }
@media (max-width: 640px) { .map.venue { height: 360px; } }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content a { color: var(--link); }
.leaflet-container { font: inherit; background: var(--surface); }
.leaflet-tile-pane { filter: invert(1) hue-rotate(200deg) brightness(.85) contrast(.9) saturate(.7) sepia(.15); }
.pin { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.map-hint { position: absolute; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; text-align: center; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.map-hint.show { opacity: 1; }
.map-note { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* event page */
.hero { width: 100%; max-height: 520px; object-fit: contain; display: block; border-radius: var(--radius); background: var(--surface); }
.detail h1 { font-size: clamp(26px, 5vw, 40px); margin: 16px 0 6px; letter-spacing: -0.02em; }
.facts { display: grid; gap: 6px; margin: 14px 0; color: var(--muted); }
.facts strong { color: var(--text); }
.detail .buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.desc { white-space: pre-line; background: var(--surface); padding: 16px; border-radius: var(--radius); }

/* forms / portal */
.panel { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel h2 { margin-top: 0; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.form .hint { color: var(--muted); font-weight: 400; font-size: 13px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpick label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; font-weight: 500; cursor: pointer; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; }
.preview { max-height: 200px; border-radius: 10px; display: block; margin-top: 8px; }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.msg.error { background: #3d1c20; color: #ffc9c9; }
.msg.ok { background: #183526; color: #c8f5d9; }
.msg:empty { display: none; }
.status { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; }
.status.pending { background: #47391a; color: var(--warn); }
.status.approved { background: #183526; color: var(--good); }
.status.rejected { background: #3d1c20; color: var(--bad); }
.list-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-item img, .list-item .noimg { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.list-item .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .list-item { grid-template-columns: 64px 1fr; } .list-item img, .list-item .noimg { width: 64px; height: 40px; } .list-item .btns { grid-column: 1 / -1; justify-content: flex-start; } }
.sub { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--border); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
footer { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* members */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.list-item.unseen { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.follow-btn { background: var(--chip); color: var(--chip-text); border: 1px solid transparent; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; cursor: pointer; margin-left: 6px; }
.follow-btn[aria-pressed="true"] { background: transparent; border-color: var(--good); color: var(--good); }
.promoter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.promoter-row:first-child { border-top: 0; }
.feed-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.sync { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-note { font-size: 13px; color: var(--muted); margin: -6px 0 12px; }
.panel.form > h2, .panel > .form > h2 { margin-bottom: 0; }
