/* ============================================================= Beartaria ===
   Mobile-first design system. Palette lifted from the 2025 Event Guide flyer. */
:root {
  /* Brand accents — identical in both themes */
  --navy: #16263b;
  --navy-deep: #0f1b2a;
  --navy-soft: #223b57;
  --orange: #f58220;
  --teal: #17838c;
  --yellow: #f8c517;
  --red: #e8443b;
  --green: #8cc63f;
  --purple: #5b3a87;

  /* Dark theme = default */
  --paper: #0e1826;
  --card: #182636;
  --ink: #e7edf3;
  --ink-soft: #9db0c2;
  --line: #2a3a4c;
  --now-bg: #33291a;
  --map-bg: #16323a;
  --btn-outline-fg: #e7edf3;
  --link: #4cbcc6;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);

  --radius: 14px;
  --maxw: 680px;
  --nav-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Georgia", "Times New Roman", serif;
}
:root[data-theme="light"] {
  --paper: #fbf7ef;
  --card: #ffffff;
  --ink: #1c2733;
  --ink-soft: #55636f;
  --line: #e7e0d2;
  --now-bg: #fff7e6;
  --map-bg: #cfe3a9;
  --btn-outline-fg: #16263b;
  --link: #17838c;
  --shadow: 0 2px 10px rgba(16, 27, 43, .08);
  --shadow-lg: 0 8px 28px rgba(16, 27, 43, .16);
}
html { background: var(--paper); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.page { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); min-height: 100vh; }

/* ---------------------------------------------------------------- header --- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .crest { width: 34px; height: 34px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.2); }
.topbar .brand-txt { min-width: 0; }
.topbar .brand-txt b { display: block; font-size: 15px; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand-txt span { display: block; font-size: 11px; color: #ffd98a; text-transform: uppercase; letter-spacing: 1.5px; }
.topbar .spacer { flex: 1; }
.topbar .adminlink { color: rgba(255,255,255,.6); font-size: 12px; padding: 6px; }
.topbar .themebtn { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.topbar .themebtn:active { background: rgba(255,255,255,.28); }

/* ----------------------------------------------------------------- hero ---- */
.hero {
  position: relative; color: #fff; text-align: center;
  padding: 34px 18px 40px;
  background: var(--navy-deep);
  overflow: hidden;
}
.hero .hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .55;
}
.hero .hero-bg + * { position: relative; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,27,42,.2), rgba(15,27,42,.85)); }
.hero-inner { position: relative; z-index: 2; }
.hero .kicker { text-transform: uppercase; letter-spacing: 3px; font-size: 12px; color: #ffd98a; margin-bottom: 8px; }
.hero h1 { font-family: var(--display); font-size: 30px; font-weight: 700; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.hero .edition {
  display: inline-block; margin-top: 6px; color: var(--yellow);
  font-family: var(--display); font-style: italic; font-size: 22px;
}
.hero .dates { margin-top: 12px; font-size: 15px; font-weight: 600; }
.hero .dates b { color: var(--yellow); }
.hero .loc { font-size: 13px; color: rgba(255,255,255,.85); margin-top: 2px; }
.hero .hero-cta { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: 0; cursor: pointer; text-align: center; min-height: 46px;
  transition: transform .06s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-outline { background: var(--card); color: var(--btn-outline-fg); border: 1.5px solid var(--line); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 14px; min-height: 38px; font-size: 13px; }
.btn-danger { background: #fdecea; color: var(--red); }
/* Inline icons need explicit sizing or they collapse to 0 in most browsers */
.btn svg { width: 18px; height: 18px; flex: none; }
.sec-head svg { width: 20px; height: 20px; flex: none; }
.tile .chev svg { width: 20px; height: 20px; }
.ev .body .loc svg { width: 12px; height: 12px; vertical-align: -1px; }

/* --------------------------------------------------------- section header -- */
.sec-head {
  color: #fff; padding: 12px 16px; margin: 0 0 4px;
  font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .3px;
  text-transform: uppercase; border-radius: 10px; display: flex; align-items: center; gap: 10px;
}
.sec-head.orange { background: var(--orange); }
.sec-head.teal { background: var(--teal); }
.sec-head.red { background: var(--red); }
.sec-head.navy { background: var(--navy); }
.sec-head.green { background: var(--green); color: var(--navy); }
.section { margin: 22px 0; }
.section > .wrap > h2, .lead-h { font-family: var(--display); font-size: 22px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* ----------------------------------------------------------------- cards -- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 16px; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }

.tile {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink);
}
.tile .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.tile .ic svg { width: 24px; height: 24px; }
.tile b { display: block; font-size: 16px; }
.tile small { color: var(--ink-soft); }
.tile .chev { margin-left: auto; color: var(--ink-soft); }

/* -------------------------------------------------------------- schedule --- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 9px 15px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line); cursor: pointer; white-space: nowrap;
}
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.daypills { display: flex; gap: 8px; margin: 12px 0 6px; }
.daypill { flex: 1; padding: 8px 6px; border-radius: 10px; text-align: center; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); cursor: pointer; font-weight: 700; font-size: 13px; }
.daypill.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.daypill small { display: block; font-weight: 500; font-size: 11px; opacity: .8; }

.ev { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .time { flex: none; width: 68px; text-align: right; font-weight: 700; font-size: 13px; color: var(--ink); padding-top: 1px; }
.ev .time small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 11px; }
.ev .body b { font-size: 15.5px; }
.ev .body .perf { color: var(--teal); font-weight: 600; font-size: 13.5px; }
.ev .body .desc { color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }
.ev .body .loc { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--ink-soft); }
.ev .addcal { margin-left: auto; align-self: center; flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: rgba(245, 130, 32, .16); color: var(--orange); border: 0; border-radius: 11px; cursor: pointer; }
.ev .addcal svg { width: 22px; height: 22px; display: block; }
.ev .addcal:active { background: rgba(245, 130, 32, .3); }
.ev.is-now { background: var(--now-bg); border-radius: 10px; }
.badge-now { background: var(--red); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; margin-left: 6px; vertical-align: middle; }
.hint { font-size: 12.5px; color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }

/* ------------------------------------------------------------------ map ---- */
.mapswitch { display: flex; gap: 8px; margin-bottom: 10px; }
.map-stage {
  position: relative; overflow: hidden; touch-action: none;
  background: var(--map-bg); border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); height: 66vh; max-height: 560px; user-select: none;
}
.map-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.map-canvas img { pointer-events: none; max-width: none; }
/* Clickable colored zones overlaid on the illustration (scale with the image) */
.zones { position: absolute; top: 0; left: 0; z-index: 2; }
.zone {
  fill: var(--zc, #F58220); fill-opacity: 0;
  stroke: #fff; stroke-opacity: 0; stroke-width: 1.5;
  vector-effect: non-scaling-stroke; pointer-events: all; cursor: pointer;
  transition: fill-opacity .12s ease, stroke-opacity .12s ease;
}
.zone.active { fill-opacity: .4; stroke-opacity: .95; }
.map-tools { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.map-tools button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(22,38,59,.9); color: #fff; font-size: 20px; font-weight: 700; box-shadow: var(--shadow); }
.map-caption { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 8px; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(15,27,42,.5); z-index: 100; display: none; }
.sheet-backdrop.open { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 101; background: var(--card);
  border-radius: 18px 18px 0 0; padding: 18px 18px calc(env(safe-area-inset-bottom) + 22px);
  transform: translateY(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
  max-width: var(--maxw); margin: 0 auto; color: var(--ink);
}
.sheet.open { transform: translateY(0); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font-size: 19px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 8px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .li-ic { width: 24px; text-align: center; font-size: 16px; }

/* --------------------------------------------------------------- vendors --- */
.vendor { display: flex; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.vendor:last-child { border-bottom: 0; }
.vnum {
  flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--orange); color: #fff;
  font-weight: 800; font-size: 13px; display: grid; place-items: center; margin-top: 2px;
}
.vendor.food .vnum { background: var(--red); }
.vendor .vbody b { font-size: 15.5px; }
.vendor .vbody p { margin: 2px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.vendor .vthumb { flex: none; width: 54px; height: 54px; border-radius: 10px; object-fit: cover; }
.numlist { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 18px; }
.numlist li { break-inside: avoid; display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; }
.numlist .n { flex: none; width: 22px; height: 22px; border-radius: 6px; color: #fff; font-weight: 800; font-size: 11px; display: grid; place-items: center; }
.numlist a { color: var(--ink); }

/* ----------------------------------------------------------------- lists --- */
.rulelist { counter-reset: r; list-style: none; padding: 0; margin: 0; }
.rulelist li { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 14px 52px; margin-bottom: 10px; box-shadow: var(--shadow); }
.rulelist.numbered li::before {
  counter-increment: r; content: counter(r);
  position: absolute; left: 12px; top: 13px; width: 28px; height: 28px; border-radius: 8px;
  background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.rulelist:not(.numbered) li { padding-left: 40px; }
.rulelist:not(.numbered) li::before { content: "•"; position: absolute; left: 16px; top: 12px; color: var(--orange); font-size: 22px; font-weight: 800; }
.rulelist li b { display: block; font-size: 15.5px; }
.rulelist li span { color: var(--ink-soft); font-size: 14px; }

/* ------------------------------------------------------------ prose/page --- */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.prose h1, .prose h2 { font-family: var(--display); }
.prose p { margin: 0 0 .9em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: .3em; }
.prose h3 { font-family: var(--display); font-size: 17px; margin: 1.1em 0 .4em; }
.prose code { background: rgba(127,127,127,.18); padding: 2px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }
.prose table { width: 100%; border-collapse: collapse; margin: .6em 0; }
.prose th, .prose td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.prose th { color: var(--ink-soft); font-weight: 700; width: 42%; }

/* --------------------------------------------------------- subscribe card -- */
.sub-steps { counter-reset: s; padding: 0; list-style: none; margin: 14px 0; }
.sub-steps li { position: relative; padding-left: 40px; margin-bottom: 14px; }
.sub-steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* --------------------------------------------------------------- flash ----- */
.flash { background: #e7f6ec; border: 1px solid #b6e2c4; color: #1d6b39; padding: 10px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }

/* ---------------------------------------------------------- bottom nav ----- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(16,27,43,.06);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 0 8px; color: var(--ink-soft); font-size: 10.5px; font-weight: 600; min-height: var(--nav-h);
}
.bottomnav a svg { width: 23px; height: 23px; }
.bottomnav a.active { color: var(--orange); }
.footer-note { text-align: center; color: var(--ink-soft); font-size: 12px; padding: 22px 16px 8px; }

@media (min-width: 680px) {
  .hero h1 { font-size: 36px; }
}
