/* HauntMap v1 — mobile-first, tasteful Halloween theme */
:root {
  --bg: #14101d;
  --bg2: #1d1530;
  --card: #241b3a;
  --ink: #f3ecff;
  --muted: #b9a8d6;
  --accent: #ff7b1c;
  --accent2: #b266ff;
  --danger: #e5484d;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #2b1c4d 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120vmin;
  height: 120vmin;
  background: url('/static/img/hauntmap_logo.jpg') center/contain no-repeat;
  opacity: 0.29;
  pointer-events: none;
  z-index: -1;
}
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 1rem; }

.site-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0.15rem 1rem;
  background: rgba(20, 16, 29, 0.9);
  border-bottom: 1px solid #33254f;
  position: sticky; top: 0; z-index: 10;
  min-height: unset;
  line-height: 1.2;
}
.site-header nav {
  display: flex; gap: 0.5rem; align-items: center;
  padding-bottom: 0.4rem;
  margin-left: auto;
}
.site-header nav a {
  padding: 0.2rem 0;
}
.brand { font-size: 1.25rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand-logo { height: 88px; width: 88px; max-height: 88px; max-width: 88px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
/* Phone */
@media (max-width: 600px) {
  .brand-logo { height: 80px; width: 80px; max-height: 80px; max-width: 80px; }
  .site-header { flex-wrap: wrap; gap: 0.5rem; }
  .site-header nav { flex-wrap: wrap; gap: 0.5rem; font-size: 0.85rem; }
}
/* Tablet */
@media (min-width: 601px) and (max-width: 1024px) {
  .brand-logo { height: 56px; width: 56px; max-height: 56px; max-width: 56px; }
}
/* Desktop */
@media (min-width: 1025px) {
  .brand-logo { height: 175px; width: 175px; max-height: 175px; max-width: 175px; }
}
.site-header nav { display: flex; gap: 0.75rem; align-items: center; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.btn-upload {
  background: var(--accent); color: #1a0f00 !important; font-weight: 700;
  padding: 0.45rem 0.9rem; border-radius: 999px;
}

.site-footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 2rem 1rem; }

/* feed */
.feed-controls { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.feed-top-row { display: flex; gap: 0.5rem; align-items: center; }
.search-inline { flex: 1; margin: 0; }
.town-search-inline {
  width: 100%; box-sizing: border-box;
  background: var(--bg2); color: var(--ink); border: 1px solid #33254f;
  border-radius: 999px; padding: 0.45rem 0.9rem; font-size: 0.9rem;
}
.town-search-inline::placeholder { color: var(--muted); }
.cat-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.9rem; }
.cat-tabs a { flex: 1; text-align: center; padding: 0.6rem; border-radius: 12px; background: var(--bg2); color: var(--muted); text-decoration: none; font-weight: 700; font-size: 1rem; border: 1px solid #33254f; }
.cat-tabs a.active { background: var(--accent); color: #1a0f00; border-color: var(--accent); }
.sort-toggle { display: flex; background: var(--bg2); border-radius: 999px; padding: 3px; flex-shrink: 0; }
.sort-toggle a { padding: 0.4rem 0.9rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.85rem; white-space: nowrap; }
.sort-toggle a.active { background: var(--accent); color: #1a0f00; font-weight: 700; }
.town-filter select {
  background: var(--bg2); color: var(--ink); border: 1px solid #33254f;
  border-radius: 10px; padding: 0.5rem; font-size: 0.95rem; max-width: 45vw;
}
.nearby-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.nearby-form input[type="text"] {
  flex: 1; min-width: 140px; background: var(--bg2); color: var(--ink);
  border: 1px solid #33254f; border-radius: 10px; padding: 0.55rem 0.7rem; font-size: 0.95rem;
}
.nearby-form select {
  background: var(--bg2); color: var(--ink); border: 1px solid #33254f;
  border-radius: 10px; padding: 0.5rem; font-size: 0.95rem;
}
.nearby-count { color: var(--muted); margin: 0.5rem 0 1rem; }
.tag-checks { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; margin-top: 0.3rem; }
.tag-checks label { display: flex; align-items: center; gap: 0.3rem; font-weight: normal; font-size: 0.9rem; }
.town-filter { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; }
.town-search {
  background: var(--bg2); color: var(--ink); border: 1px solid #33254f;
  border-radius: 10px; padding: 0.5rem 0.7rem; font-size: 0.95rem; width: 130px;
}
.town-search-full { width: 100%; box-sizing: border-box; }
.filter-row { display: flex; gap: 0.4rem; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.2rem; -webkit-overflow-scrolling: touch; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row select {
  background: var(--bg2); color: var(--ink); border: 1px solid #33254f;
  border-radius: 999px; padding: 0.4rem 0.8rem; font-size: 0.85rem; flex-shrink: 0;
}
.book-banner {
  background: var(--bg2); border: 1px solid #33254f; border-radius: 12px;
  padding: 1.2rem; margin-top: 2rem; display: flex; gap: 1rem; align-items: center;
}
.book-cover {
  flex-shrink: 0; width: 70px;
  display: flex; align-items: center; justify-content: center;
}
.book-cover-img {
  width: 70px; height: auto; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.book-info h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.book-title { margin: 0 0 0.2rem; font-size: 1.1rem; }
.book-desc { color: var(--muted); margin: 0 0 0.6rem; font-size: 0.9rem; }
.book-btn { display: inline-block; text-decoration: none; }

.newsletter-box {
  background: var(--bg2); border: 1px solid #33254f; border-radius: 12px;
  padding: 1.2rem; margin-top: 2rem; text-align: center;
}
.newsletter-box h3 { margin: 0 0 0.3rem; }
.newsletter-box p { color: var(--muted); margin: 0 0 0.8rem; font-size: 0.9rem; }
.newsletter-form { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; }
.newsletter-form input {
  background: var(--bg); color: var(--ink); border: 1px solid #33254f;
  border-radius: 10px; padding: 0.5rem 0.7rem; font-size: 0.95rem;
}
.newsletter-success { color: #7ee787; font-weight: 700; }
.newsletter-error { color: #ff7b72; font-size: 0.85rem; }
.tips-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #33254f; }
.tips-section h3 { margin: 0 0 1rem; }
.tips-list { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1.2rem; }
.tip { background: var(--bg2); border-radius: 10px; padding: 0.8rem 1rem; }
.tip-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.tip p { margin: 0; }
.tip-form { display: flex; flex-direction: column; gap: 0.5rem; }
.tip-form input, .tip-form textarea {
  background: var(--bg2); color: var(--ink); border: 1px solid #33254f;
  border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.95rem; font-family: inherit;
}
.tip-form button { align-self: flex-start; }
.cat-tabs-main { display: flex; gap: 0.5rem; margin-bottom: 0.4rem; }
.state-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.state-tabs-bottom { display: flex; gap: 0.5rem; margin: 1rem 0; }
.state-btn {
  flex: 1; text-align: center; padding: 0.5rem; border-radius: 10px;
  background: var(--bg2); color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 0.95rem; border: 2px solid transparent;
}
.state-btn.active { border-color: var(--accent); background: #1a1030; }
.cat-btn-main {
  flex: 1; text-align: center; padding: 0.7rem; border-radius: 12px;
  background: var(--bg2); color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 1.05rem; border: 2px solid transparent;
}
.cat-btn-main.active { border-color: var(--accent); background: #1a1030; }
.cat-tabs-sub { display: flex; gap: 0.35rem; align-items: center; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 0.8rem; padding-bottom: 0.2rem; -webkit-overflow-scrolling: touch; }
.cat-tabs-sub::-webkit-scrollbar { display: none; }
.cat-sub-label { font-size: 0.8rem; color: var(--muted); flex-shrink: 0; }
.cat-btn-sub {
  padding: 0.3rem 0.7rem; border-radius: 20px; font-size: 0.8rem; white-space: nowrap; flex-shrink: 0;
  background: var(--bg2); color: var(--muted); text-decoration: none;
  border: 1px solid #33254f;
}
.cat-btn-sub.active { color: var(--ink); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--ink); border: 1px solid #33254f;
  display: block;
}
.card-media { position: relative; aspect-ratio: 4/3; background: #0d0916; }
.card-media-empty { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-badge {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px;
  background: rgba(0,0,0,0.55); border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.sample-badge {
  position: absolute; top: 8px; left: 8px; background: var(--accent2);
  color: #160a28; font-size: 0.72rem; font-weight: 800; padding: 0.15rem 0.55rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.card-body { padding: 0.7rem 0.85rem; }
.card-body h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.meta { color: var(--muted); font-size: 0.85rem; margin: 0; }
.votes { margin: 0.35rem 0 0; font-weight: 700; color: var(--accent); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-emoji { font-size: 3rem; margin: 0; }

/* forms & buttons */
.form label { display: block; margin-bottom: 1rem; font-weight: 600; }
.form input[type="text"], .form input[type="password"], .form input[type="file"] {
  display: block; width: 100%; margin-top: 0.35rem;
  background: var(--bg2); border: 1px solid #33254f; color: var(--ink);
  border-radius: 10px; padding: 0.65rem; font-size: 1rem;
}
.form small { color: var(--muted); font-weight: 400; }
.req { color: var(--accent); } .opt { color: var(--muted); font-weight: 400; }
.btn {
  display: inline-block; background: var(--bg2); color: var(--ink);
  border: 1px solid #443366; border-radius: 999px; padding: 0.55rem 1.2rem;
  font-size: 1rem; text-decoration: none; cursor: pointer;
}
.btn-big { background: var(--accent); color: #1a0f00; font-weight: 800; border: none; width: 100%; padding: 0.85rem; font-size: 1.1rem; }
.btn-voted { background: #2c2145; color: var(--muted); cursor: default; }
.btn-small { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.alert { background: #3d1620; border: 1px solid var(--danger); border-radius: 10px; padding: 0.8rem; margin-bottom: 1rem; }
.lede { color: var(--muted); }
#map { height: 260px; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid #33254f; z-index: 0; }
.detail-map { height: 220px; border-radius: var(--radius); margin: 1rem 0; border: 1px solid #33254f; z-index: 0; }

/* detail */
.detail-media { border-radius: var(--radius); overflow: hidden; position: relative; background: #0d0916; }
.detail-media img, .detail-media video { width: 100%; display: block; max-height: 70vh; object-fit: contain; background: #0d0916; }
.votes-big { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.detail-actions { margin: 1rem 0; }
.detail-foot { display: flex; gap: 1rem; align-items: center; margin-top: 1.25rem; flex-wrap: wrap; }
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 0.95rem; padding: 0; text-decoration: underline; }
.linklike.danger { color: var(--danger); }
.inline-form { display: inline; }
.muted { color: var(--muted); }

/* leaderboard */
.leader-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.7rem; }
.leader-list li a {
  display: flex; gap: 0.8rem; align-items: center; background: var(--card);
  border: 1px solid #33254f; border-radius: var(--radius); padding: 0.6rem;
  text-decoration: none; color: var(--ink);
}
.leader-list img, .leader-list video { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #0d0916; }
.leader-info { display: flex; flex-direction: column; gap: 0.1rem; }
.leader-info strong { font-size: 0.98rem; }

/* admin */
.admin-list { display: grid; gap: 0.6rem; margin-bottom: 2rem; }
.admin-row {
  background: var(--card); border: 1px solid #33254f; border-radius: 10px;
  padding: 0.7rem 0.9rem; display: flex; flex-direction: column; gap: 0.4rem;
}
.admin-row a { color: var(--ink); }
.admin-actions { display: flex; gap: 0.5rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; color: var(--accent2); margin-top: 1.75rem; }

.hero-intro {
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
  max-width: 600px;
  margin: 0 auto;
}
.hero-intro h1 {
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
  font-weight: 800;
}
.hero-intro p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
}
.hero-intro p:last-child {
  margin-bottom: 0;
}

.directions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.btn-dir {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-dir:hover { background: var(--hover); }

/* Floating spooky side decorations */
.spooky-side {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 60px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.spooky-left { left: 0; }
.spooky-right { right: 0; }
.spooky-side span {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.35;
  animation: float-spooky 6s ease-in-out infinite;
}
.spooky-side span:nth-child(1) { top: 15%; animation-delay: 0s; }
.spooky-side span:nth-child(2) { top: 35%; animation-delay: 1.5s; }
.spooky-side span:nth-child(3) { top: 55%; animation-delay: 3s; }
.spooky-side span:nth-child(4) { top: 75%; animation-delay: 4.5s; }
.spooky-side span:nth-child(5) { top: 90%; animation-delay: 2s; }
@keyframes float-spooky {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}
@media (max-width: 820px) {
  .spooky-side { display: none; }
}

.hook-line {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem;
  font-style: italic;
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  margin-left: auto;
  padding-top: 0;
  margin-top: -0.3rem;
}
.header-hook {
  font-size: 1.1rem;
  font-weight: 700;
  font-style: italic;
  color: #FFF8E7;
  margin: 0 0 1rem;
  text-align: right;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
@media (max-width: 600px) {
  .header-hook {
    font-size: 0.8rem;
    margin: 0 0 0.4rem;
    text-align: center;
    line-height: 1.3;
  }
  .header-center {
    align-items: center;
    width: 100%;
  }
  .site-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .site-header nav {
    justify-content: center;
    flex-wrap: wrap;
    margin-left: 0;
    padding-bottom: 0.2rem;
  }
}

.btn-live {
  display: inline-block;
  background: #ff2d55;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
