/* XploreR map page */
.map-page { overflow: hidden; height: 100vh; height: 100dvh; }
#map { position: fixed; inset: 0; background: #02040a; }
:root[data-theme="light"] .seg button.on, :root[data-theme="light"] .chip.on, :root[data-theme="light"] .btn[aria-pressed="true"] { background: var(--charcoal); color: #fff; }
:root[data-theme="light"] .maplibregl-ctrl-attrib { background: rgba(255,255,255,.7) !important; }
.maplibregl-ctrl-attrib { background: rgba(10,14,20,.6) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-bottom-right { right: 8px; bottom: 4px; }

/* search */
.search { position: relative; flex: 1; max-width: 440px; min-width: 120px; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 13px; background: var(--fill-2); border: 1px solid var(--line); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; }
.search input::placeholder { color: var(--muted); }
.suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; border-radius: 14px; padding: 6px; max-height: 60vh; overflow: auto; background: var(--glass-strong); }
.suggest button { display: flex; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; align-items: center; }
.suggest button:hover, .suggest button.on { background: var(--fill-2); }
.suggest small { color: var(--muted); display: block; }
.suggest .grp { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }

.seg { display: inline-flex; background: var(--fill-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; flex: none; }
.seg button { padding: 5px 12px; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--charcoal); }
.btn[aria-pressed="true"] { background: #fff; color: var(--charcoal); }

/* chips */
.chips { position: fixed; z-index: 20; top: 70px; left: 12px; right: 12px; display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .cemoji { width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; line-height: 1; flex: none; }
.chip.on { background: #fff; color: var(--charcoal); }
.chip.live.on { background: var(--red); color: #fff; }
.chip select { background: none; border: 0; outline: none; font-weight: 800; }
.chip select option { color: #000; }

/* left panel */
.panel { position: fixed; z-index: 15; top: 118px; left: 12px; bottom: 12px; width: 350px; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; }
.panel header { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 20px; font-weight: 900; letter-spacing: -.01em; line-height: 1.2; }
.panel-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.panel-grip { display: none; }
.stats { display: flex; gap: 8px; margin-top: 10px; }
.stats:empty { display: none; }
.stat { flex: 1; background: var(--fill); border-radius: 12px; padding: 7px 10px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.plist { overflow-y: auto; padding: 6px; flex: 1; }
.row { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 14px; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; text-align: left; }
.row:hover, .row:focus-visible { background: var(--fill-2); outline: none; }
.row .thumb { width: 54px; height: 54px; border-radius: 12px; flex: none; background: #1a2230 center/cover no-repeat; display: grid; place-items: center; font-size: 22px; }
.row .t { font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .m { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .body { min-width: 0; flex: 1; }
.livebadge { display: inline-flex; align-items: center; gap: 4px; color: #fff; background: var(--red); border-radius: 999px; padding: 1px 7px; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.livebadge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tag { display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.empty { color: var(--muted); text-align: center; padding: 28px 16px; }
.cityrow .thumb { font-size: 20px; background: var(--fill-2); }

/* list view */
.listview { position: fixed; z-index: 16; top: 118px; left: 12px; right: 12px; bottom: 12px; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; background: var(--panel-solid); border: 1px solid var(--line); }
.listview header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.listview h2 { margin: 0; font-size: 20px; flex: 1; }
.cards { overflow-y: auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-auto-rows: max-content; gap: 14px; }
.ecard { border-radius: 18px; overflow: hidden; background: var(--fill); border: 1px solid var(--line); text-align: left; transition: transform .15s, box-shadow .15s; }
.ecard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.4); }
.ecard .img { height: 120px; background: #1a2230 center/cover no-repeat; position: relative; display: grid; place-items: center; font-size: 34px; }
.ecard .img .livebadge { position: absolute; top: 8px; left: 8px; }
.ecard .b { padding: 10px 12px 12px; }
.ecard .t { font-weight: 800; line-height: 1.25; }
.ecard .m { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* drawer */
.drawer { position: fixed; z-index: 25; top: 118px; right: 12px; bottom: 12px; width: 410px; border-radius: 22px; overflow-y: auto; overscroll-behavior: contain; background: var(--panel-solid); border: 1px solid var(--line); }
.drawer .hero-img { height: 190px; background: #1a2230 center/cover no-repeat; position: relative; flex: none; display: grid; place-items: center; font-size: 60px; }
.drawer .hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.25), transparent 45%, var(--panel-solid)); }
/* The close button stays in the corner while the whole panel scrolls. */
.drawer .dclose { position: sticky; top: 0; height: 0; z-index: 3; }
.drawer .back { position: absolute; z-index: 3; top: 10px; left: 10px; height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-weight: 800; font-size: 13px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); max-width: calc(100% - 64px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer .close { position: absolute; z-index: 3; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.5); font-size: 15px; }
.drawer .tags { position: absolute; z-index: 2; left: 16px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.dbody { padding: 14px 18px 24px; }
.dbody h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.dbody .venue { color: var(--muted); font-size: 14px; }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.cell { background: var(--fill); border-radius: 13px; padding: 8px 10px; font-size: 13px; min-width: 0; }
.cell span { display: block; font-size: 10px; color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.cell b { display: block; overflow: hidden; text-overflow: ellipsis; }
a.cell { text-decoration: none; }
a.cell b { color: var(--blue-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.go-menu { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.desc { color: rgba(243,246,250,.86); white-space: pre-line; font-size: 14px; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.more { color: var(--blue-2); font-weight: 700; font-size: 13px; margin-top: 4px; }
.section-title { margin: 18px 0 8px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stories { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.story { flex: none; width: 64px; text-align: center; font-size: 11px; color: var(--muted); }
.story i { display: block; width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--amber), #d5443c, var(--amber)); }
.story i b { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--panel-solid); background: #1a2230 center/cover no-repeat; }
.comment { padding: 7px 0; border-bottom: 1px solid var(--fill); font-size: 14px; }
.comment b { color: var(--blue-2); margin-right: 6px; }
.comment small { color: var(--muted); margin-left: 6px; }
.note { color: var(--muted); font-size: 12px; }
.flames { letter-spacing: 1px; }
.flames .off { opacity: .22; filter: grayscale(1); }

/* explore */
.explore { position: fixed; z-index: 24; top: 118px; right: 12px; bottom: 12px; width: 380px; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; background: var(--glass-strong); }
.explore header { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); position: relative; }
.explore header .close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--fill-2); }
.lore { overflow-y: auto; padding: 10px; flex: 1; }
.lore-item { display: flex; gap: 12px; padding: 10px; border-radius: 14px; text-align: left; width: 100%; }
.lore-item:hover { background: var(--fill); }
.lore-item .ph { width: 64px; height: 64px; border-radius: 12px; flex: none; background: #2a2140 center/cover no-repeat; display: grid; place-items: center; font-size: 24px; }
.lore-item h4 { margin: 0 0 3px; font-size: 15px; }
.lore-item p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lore-item small { color: #b9a6ff; font-weight: 700; }

/* controls, dart, toast */
.map-controls { position: fixed; z-index: 14; right: 12px; bottom: 34px; display: flex; flex-direction: column; gap: 8px; }
.ctl { width: 42px; height: 42px; border-radius: 13px; font-size: 17px; }
.dart-fly { position: fixed; z-index: 28; left: 50%; top: 50%; pointer-events: none; display: none; transform: translate(-50%, -50%); }
.dart-fly.fly, .dart-fly.stick { display: block; }
.dart-rot { transition: transform .12s linear; filter: drop-shadow(0 0 10px rgba(255,170,60,.85)) drop-shadow(0 12px 14px rgba(0,0,0,.5)); }
.dart-fly.fly .dart-svg { animation: wobble .35s ease-in-out infinite alternate; }
.dart-fly.stick .dart-svg { animation: stick .6s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes wobble { from { transform: rotate(-5deg) scale(1.04); } to { transform: rotate(5deg) scale(.97); } }
@keyframes stick { 0% { transform: scale(1.3); } 55% { transform: scale(.55) translateY(10px); } 80% { transform: scale(.62) translateY(8px) rotate(4deg); opacity: 1; } 100% { transform: scale(.6) translateY(8px); opacity: 0; } }
.dart-card { position: fixed; z-index: 27; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); border-radius: 22px; padding: 16px 18px; background: var(--glass-strong); animation: up .45s cubic-bezier(.2,1.2,.3,1); }
@keyframes up { from { transform: translate(-50%, 140%); } }
.dart-card .kick { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.dart-card h3 { margin: 2px 0 2px; font-size: 22px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; transition: all .3s; pointer-events: none; padding: 10px 16px; border-radius: 14px; font-weight: 700; max-width: calc(100vw - 30px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 20px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 86vh; border-radius: 16px; }
.lightbox .cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--muted); }
.user-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--blue-2); border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(79,179,240,.25); }

@media (max-width: 860px) {
  .site-header { flex-wrap: wrap; gap: 8px; padding: 7px 8px 8px 10px; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; }
  .site-header .brand { font-size: 18px; }
  .site-header .seg button { padding: 5px 9px; }
  .site-header .btn.small { width: 38px; height: 36px; padding: 0; }
  .menu-btn { margin-left: auto; }
  .search { order: 9; flex-basis: 100%; max-width: none; }
  .mobile-nav { top: 60px; right: 8px; }
  .chips { top: calc(max(8px, env(safe-area-inset-top)) + 104px); left: 8px; right: 0; padding-right: 8px; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 30vh; transition: height .3s; }
  .panel.expanded { height: 70vh; }
  .panel-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin: 8px auto 0; }
  .drawer, .explore, .listview { top: calc(max(8px, env(safe-area-inset-top)) + 146px); left: 8px; right: 8px; bottom: 8px; width: auto; }
  .map-controls { bottom: calc(30vh + 18px); right: 10px; }
  .cells { grid-template-columns: repeat(2, 1fr); }
}
