:root {
  --bg: #ffffff;
  --card: #ffffff;
  --surface: #f3f3f3;
  --text: #111111;
  --muted: #6b6b6b;
  --red: #d10600;
  --red-soft: #ffe8e6;
  --border: #ececec;
  --gold: #b8860b;
  --header-bg: rgba(255,255,255,0.92);
  --shadow: 0 6px 20px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
  --bg: #000000;
  --card: #111111;
  --surface: #1a1a1a;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --red: #e10600;
  --red-soft: rgba(225,6,0,0.16);
  --border: #2a2a2a;
  --gold: #ffb800;
  --header-bg: rgba(0,0,0,0.92);
  --shadow: 0 8px 24px rgba(0,0,0,0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.demo-banner {
  background: #111; color: #fff;
  font-size: 11px; font-weight: 600;
  text-align: center; padding: 7px 12px;
}
.demo-banner span { color: #ffcc66; }

.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}
.header-inner {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-weight: 800; font-size: 15px; letter-spacing: -0.03em; }
.logo span { color: var(--red); }
.header-right { display: flex; align-items: center; gap: 6px; }
.spots-count, .nav-link, .theme-btn {
  font-size: 11px; font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
}
.theme-btn {
  width: 32px; height: 32px; padding: 0;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.stories {
  max-width: 760px; margin: 0 auto;
  padding: 12px 10px 4px;
}
.stories-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; margin-bottom: 8px;
}
.stories-label a { color: var(--red); text-transform: none; letter-spacing: 0; font-weight: 700; }
.stories-row {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 6px;
}
.stories-row::-webkit-scrollbar { display: none; }
.story {
  flex: 0 0 78px; text-align: center; background: none; border: 0; cursor: pointer; color: var(--text);
}
.story-img {
  width: 72px; height: 72px; border-radius: 18px; overflow: hidden;
  border: 2px solid var(--red); position: relative; background: #ddd;
}
.story-img img { width: 100%; height: 100%; object-fit: cover; }
.story-pin {
  position: absolute; bottom: 4px; left: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 8px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #fff;
}
.story span {
  display: block; margin-top: 5px; font-size: 10px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 78px;
}

.map-toggle {
  max-width: 760px; margin: 8px auto 0;
  padding: 0 10px;
}
.map-toggle button {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.map-section {
  max-width: 760px; margin: 8px auto 0;
  padding: 0 10px;
  display: none;
}
.map-section.open { display: block; }
.map-container {
  height: 200px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border);
}
#map { width: 100%; height: 100%; background: var(--surface); }

.filters {
  max-width: 760px; margin: 0 auto;
  padding: 10px;
  display: flex; gap: 6px; overflow-x: auto;
}
.filters::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.filter-btn.active {
  background: var(--red); border-color: var(--red); color: #fff;
}

.grid-wrap { max-width: 760px; margin: 0 auto; padding: 0 8px 100px; }
.masonry {
  column-count: 2;
  column-gap: 8px;
}
@media (min-width: 560px) { .masonry { column-count: 3; } }
@media (min-width: 800px) { .masonry { column-count: 4; } }

.card {
  break-inside: avoid;
  margin-bottom: 8px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: var(--surface);
  display: block;
}
.card.prime { box-shadow: 0 0 0 1px rgba(184,134,11,0.45); }
.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}
.card.wide img { aspect-ratio: 4 / 3; }
.card-pointer {
  position: absolute; bottom: 8px; left: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.card-qr {
  position: absolute; bottom: 8px; right: 8px;
  width: 22px; height: 22px; background: #fff;
  border-radius: 5px; padding: 2px;
}
.card-qr img { width: 100%; height: 100%; object-fit: contain; aspect-ratio: auto; }
.card-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  color: #fff; font-size: 12px; font-weight: 700;
}

.cta-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  padding: 10px 14px 18px;
  background: linear-gradient(to top, var(--bg) 55%, transparent);
}
.cta-btn {
  display: block; max-width: 760px; margin: 0 auto;
  background: var(--red); color: #fff;
  text-align: center; padding: 14px;
  border-radius: 14px; font-weight: 800; font-size: 14px;
}

.partner-page { background: #000; color: #fff; min-height: 100vh; }
.partner-hero { position: relative; min-height: 72vh; }
.partner-hero img { width: 100%; height: 72vh; object-fit: cover; }
.partner-qr {
  position: absolute; top: 16px; right: 16px;
  background: #fff; padding: 5px; border-radius: 10px;
  width: 58px; height: 58px; border: 2px solid var(--red);
}
.partner-sheet {
  background: var(--bg); color: var(--text);
  border-radius: 22px 22px 0 0;
  margin-top: -22px;
  padding: 18px 16px 40px;
  position: relative;
}
.partner-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.partner-meta { font-size: 13px; color: var(--muted); margin: 4px 0 16px; }
.partner-desc { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.btn-row { display: flex; gap: 8px; }
.btn-primary, .btn-secondary {
  flex: 1; text-align: center; padding: 13px 8px;
  border-radius: 12px; font-weight: 700; font-size: 13px;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-secondary {
  background: transparent; color: var(--red);
  border: 1.5px solid var(--red);
}

.leaflet-container { background: var(--surface); font-family: inherit; }
.leaflet-popup-content-wrapper {
  background: var(--card); color: var(--text); border-radius: 12px;
  border: 1px solid var(--border);
}
.leaflet-popup-tip { background: var(--card); }
.leaflet-popup-content a { color: var(--red); font-weight: 700; }

.title-block { max-width:760px; margin:0 auto; padding:12px 14px 6px; text-align:center; }
.title-block h1 { font-size:18px; font-weight:800; letter-spacing:-0.03em; }
.title-block p { font-size:12px; color:var(--muted); margin-top:4px; }
.section-label { font-size:11px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; padding:8px 2px 6px; display:flex; justify-content:space-between; }

.card-qr, .partner-qr, .mini-qr, .ticket-qr {
  overflow: hidden;
  background: #fff !important;
}
.card-qr img, .partner-qr img, .mini-qr img, .ticket-qr img,
.story-img + .card-qr img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
}
.partner-hero { overflow: hidden; }
.partner-qr {
  width: 52px !important;
  height: 52px !important;
  top: 14px !important;
  right: 14px !important;
  left: auto !important;
}
