:root {
  --bg-deep: #07050f;
  --bg-card: rgba(18, 12, 32, 0.82);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --neon-pink: #ff2d95;
  --neon-purple: #b44dff;
  --neon-cyan: #00e5ff;
  --text: #f0ecff;
  --text-muted: #a89ec4;
  --border: rgba(180, 77, 255, 0.25);
  --radius: 14px;
  --font-display: "Orbitron", "Noto Sans TC", sans-serif;
  --font-body: "Noto Sans TC", system-ui, sans-serif;
  --marquee-h: 36px;
  --music-h: 56px;
  --ad-h: 72px;
}

@property --music-h {
  syntax: "<length>";
  inherits: true;
  initial-value: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-deep);
  padding-top: calc(var(--marquee-h) + var(--music-h));
  padding-bottom: calc(var(--ad-h) + 48px);
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(255, 45, 149, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(0, 229, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(180, 77, 255, 0.15), transparent 60%),
    var(--bg-deep);
}

/* Marquee */
.marquee-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--marquee-h);
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #120a1e, #1a0f2e);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.marquee-label {
  flex-shrink: 0;
  padding: 0 12px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--neon-pink);
  background: rgba(255, 45, 149, 0.12);
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
}

.marquee-track {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.marquee-content {
  display: flex;
  gap: 2rem;
  white-space: nowrap;
  animation: marquee-scroll var(--marquee-duration, 33.33s) linear infinite;
  padding-left: 100%;
}

.marquee-content:hover {
  animation-play-state: paused;
}

.marquee-item {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.marquee-sep {
  color: var(--neon-purple);
  opacity: 0.5;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

@media (max-width: 900px) {
  :root {
    --music-h: 88px;
    transition: --music-h 0.28s ease;
  }

  html.music-progress-collapsed {
    --music-h: 56px;
  }

  .marquee-content {
    animation-duration: var(--marquee-duration-mobile, var(--marquee-duration, 33.33s));
  }
}

/* Music bar */
.sc-hidden {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 300px;
  height: 166px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  border: 0;
}

.music-bar {
  position: fixed;
  top: var(--marquee-h);
  left: 0;
  right: 0;
  z-index: 190;
  height: var(--music-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  column-gap: 1rem;
  padding: 0 1.25rem;
  background: rgba(10, 6, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.music-bar.is-playing {
  border-bottom-color: rgba(255, 45, 149, 0.35);
}

.music-bar.is-playing .music-icon {
  color: var(--neon-pink);
}

.music-bar.music-needs-gesture,
.music-bar.music-needs-sound {
  border-bottom-color: rgba(0, 229, 255, 0.45);
  box-shadow: inset 0 -2px 0 rgba(0, 229, 255, 0.35);
}

.music-bar.music-needs-gesture .ctrl-main,
.music-bar.music-needs-sound .ctrl-main {
  animation: music-pulse 1.4s ease-in-out infinite;
}

@keyframes music-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 45, 149, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(255, 45, 149, 0); }
}

.music-info {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.music-icon {
  font-size: 1.25rem;
  color: var(--neon-cyan);
  animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.music-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.music-label {
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-link {
  color: inherit;
  text-decoration: none;
  cursor: default;
}

.music-link:not(.is-disabled) {
  cursor: pointer;
}

.music-link:not(.is-disabled):hover {
  color: var(--neon-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.music-link.is-disabled {
  pointer-events: none;
}

.music-playlist {
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.music-track {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(36vw, 260px);
}

.music-progress {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 480px;
  padding: 0 0.25rem;
}

.music-time {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 2.4rem;
  text-align: center;
}

.music-seek {
  flex: 1;
  min-width: 0;
  height: 4px;
  margin: 0;
  padding: 0;
  touch-action: none;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  accent-color: var(--neon-pink);
}

.music-seek:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.music-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.music-seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  border: 2px solid rgba(10, 6, 20, 0.9);
  box-shadow: 0 0 8px rgba(255, 45, 149, 0.45);
  cursor: grab;
}

.music-seek:active::-webkit-slider-thumb {
  cursor: grabbing;
}

.music-seek::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.music-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  border: 2px solid rgba(10, 6, 20, 0.9);
  cursor: grab;
}

.music-controls {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-glass);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl-btn:hover {
  background: rgba(180, 77, 255, 0.2);
  border-color: var(--neon-purple);
}

.ctrl-btn:active {
  transform: scale(0.94);
}

.ctrl-main {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border-color: transparent;
  font-size: 1rem;
}

.ctrl-main:hover {
  background: linear-gradient(135deg, #ff4da6, #c86dff);
}

.ctrl-btn.muted {
  opacity: 0.55;
}

/* CSS-drawn glyphs — avoids colorful emoji on mobile (⏮⏭⏸🔊). */
.ctrl-icon {
  position: relative;
  font-size: 0;
  line-height: 0;
}

.ctrl-icon-prev::before,
.ctrl-icon-next::before,
.ctrl-icon-play::before,
.ctrl-icon-mute::before {
  content: "";
  display: block;
}

.ctrl-icon-prev::before {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 6px 5px 0;
  border-color: transparent currentColor transparent transparent;
  box-shadow: -6px 0 0 0 currentColor;
}

.ctrl-icon-next::before {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 6px;
  border-color: transparent transparent transparent currentColor;
  box-shadow: 6px 0 0 0 currentColor;
}

.ctrl-icon-play::before {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 2px;
}

.ctrl-icon-play.is-playing::before {
  width: 3px;
  height: 12px;
  margin-left: 0;
  border: none;
  background: currentColor;
  box-shadow: 5px 0 0 0 currentColor;
}

.ctrl-icon-mute::before {
  width: 7px;
  height: 8px;
  background: currentColor;
  clip-path: polygon(0 30%, 40% 30%, 100% 0, 100% 100%, 40% 70%, 0 70%);
}

.ctrl-icon-mute::after {
  content: "";
  position: absolute;
  left: calc(50% + 1px);
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translateY(-50%);
  border: 2px solid currentColor;
  border-left: none;
  border-radius: 0 50% 50% 0;
}

.ctrl-icon-mute.muted::after {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 0;
  background: linear-gradient(
    to top right,
    transparent calc(50% - 1px),
    currentColor calc(50% - 1px),
    currentColor calc(50% + 1px),
    transparent calc(50% + 1px)
  );
  transform: translate(-10%, -50%);
}

@media (max-width: 900px) {
  /* Row 1: artist + title (left) · controls (right); row 2: full-width seek.
     Must follow base .music-bar — earlier @media block was overridden by cascade. */
  .music-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: minmax(42px, auto) minmax(20px, auto);
    align-content: start;
    align-items: center;
    row-gap: 0.2rem;
    column-gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    height: var(--music-h);
    overflow: hidden;
    transition: height 0.28s ease, row-gap 0.28s ease;
  }

  html.music-progress-collapsed .music-bar {
    grid-template-rows: minmax(42px, auto) 0fr;
    row-gap: 0;
  }

  .music-info {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .music-controls {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    flex-shrink: 0;
  }

  .music-progress {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
    max-width: none;
    width: 100%;
    min-height: 20px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    transition: opacity 0.28s ease, max-height 0.28s ease, min-height 0.28s ease;
  }

  html.music-progress-collapsed .music-progress {
    opacity: 0;
    max-height: 0;
    min-height: 0;
    pointer-events: none;
  }

  .music-track {
    max-width: none;
  }
}

/* Layout */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.page-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.filter-sheet-host {
  min-width: 0;
}

.filter-sheet-backdrop,
.filter-sheet-header {
  display: none;
}

.filter-sheet-panel,
.filter-sheet-body {
  display: block;
}

.filter-fab {
  display: none;
}

.venue-sidebar {
  position: sticky;
  top: calc(var(--marquee-h) + var(--music-h) + 1rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.region-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0 0.75rem 0.75rem;
}

.region-tab {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-glass);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.4rem 0.25rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.region-tab:hover {
  color: var(--text);
  border-color: rgba(180, 77, 255, 0.45);
}

.region-tab.active {
  background: linear-gradient(135deg, rgba(255, 45, 149, 0.2), rgba(180, 77, 255, 0.2));
  color: var(--text);
  border-color: rgba(255, 45, 149, 0.45);
}

.sidebar-filters {
  padding: 0;
}

.filter-section + .filter-section,
.venue-filters-block {
  border-top: 1px solid var(--border);
}

.venue-filters-block .region-tabs {
  padding-top: 0.75rem;
}

.venue-filters-block .filter-section {
  border-top: 1px solid var(--border);
}

.filter-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-align: left;
}

.filter-section-toggle:hover {
  background: rgba(180, 77, 255, 0.08);
}

.filter-section-label {
  font-weight: 600;
}

.filter-section-chevron::before {
  content: "▾";
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.filter-section:not(.is-expanded) .filter-section-chevron::before {
  transform: rotate(-90deg);
}

.filter-section-panel {
  padding: 0 0.75rem 0.75rem;
}

.filter-section:not(.is-expanded) .filter-section-panel {
  display: none;
}

.sidebar-filters .city-filter select {
  width: 100%;
}

.venue-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.25rem;
  max-height: calc(100vh - var(--marquee-h) - var(--music-h) - 220px);
  overflow-y: auto;
}

.venue-list li {
  margin: 0;
}

.venue-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.venue-item:hover {
  background: rgba(180, 77, 255, 0.1);
  border-color: rgba(180, 77, 255, 0.2);
}

.venue-item.active {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.35);
}

.venue-item-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.venue-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.venue-item-ig {
  font-size: 0.7rem;
  color: var(--neon-pink);
}

.loading-venues,
.venue-empty {
  padding: 1rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.main-content {
  min-width: 0;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.logo {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin: 0;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.04em;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.city-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.city-filter select {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  min-width: 120px;
}

.events-section {
  min-width: 0;
}

/* Mobile: flatten wrappers and reorder — header → section-head → sidebar → grid */
@media (max-width: 900px) {
  .layout {
    padding: 1rem 0.85rem 1.5rem;
  }

  .page-body {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .main-content,
  .events-section {
    display: contents;
  }

  .site-header {
    order: 1;
    width: 100%;
    min-width: 0;
    margin-bottom: 1rem;
  }

  .section-head {
    order: 2;
    width: 100%;
    min-width: 0;
    margin-bottom: 1rem;
  }

  .venue-sidebar {
    position: static;
    top: auto;
    z-index: auto;
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    box-shadow: none;
    border-bottom-color: var(--border);
  }

  .filter-sheet-host {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    visibility: hidden;
  }

  .filter-sheet-host.is-open {
    pointer-events: auto;
    visibility: visible;
  }

  .filter-sheet-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(4, 2, 10, 0.72);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .filter-sheet-host.is-open .filter-sheet-backdrop {
    opacity: 1;
  }

  .filter-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    max-height: min(88dvh, calc(100dvh - var(--marquee-h) - var(--music-h) - 0.5rem));
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .filter-sheet-host.is-open .filter-sheet-panel {
    transform: translateY(0);
  }

  .filter-sheet-header {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 0.55rem 1rem 0.65rem;
    border-bottom: 1px solid var(--border);
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
  }

  .filter-sheet-header.is-dragging {
    cursor: grabbing;
  }

  .filter-sheet-drag-handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    flex-shrink: 0;
  }

  .filter-sheet-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .filter-sheet-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
  }

  .filter-sheet-panel.is-dragging {
    transition: none;
  }

  .filter-sheet-close {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-glass);
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .filter-sheet-close:hover {
    color: var(--text);
    border-color: rgba(180, 77, 255, 0.45);
  }

  .filter-sheet-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .filter-sheet-body .venue-sidebar {
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .filter-sheet-body .venue-list {
    max-height: none;
  }

  .filter-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: fixed;
    right: 1rem;
    bottom: calc(var(--ad-h) + 1rem);
    z-index: 190;
    min-height: 48px;
    padding: 0.65rem 1.1rem;
    border: 1px solid rgba(255, 45, 149, 0.45);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 45, 149, 0.5), rgba(180, 77, 255, 0.5));
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .filter-fab:hover {
    border-color: var(--neon-pink);
    background: linear-gradient(135deg, rgba(255, 45, 149, 0.6), rgba(180, 77, 255, 0.6));
  }

  .filter-fab-dot {
    display: none;
    position: absolute;
    top: 6px;
    right: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.65);
  }

  .filter-fab.is-active .filter-fab-dot {
    display: block;
  }

  body.filter-sheet-open {
    overflow: hidden;
  }

  .events-grid {
    order: 3;
    width: 100%;
    min-width: 0;
  }

  .venue-list {
    max-height: 146px;
  }

  .filter-section-toggle,
  .region-tab {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-filters .city-filter select {
    min-height: 44px;
  }
}

.section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.section-head-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}

.when-filters {
  display: flex;
  gap: 0.385rem;
  flex-wrap: wrap;
}

.when-filter {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-glass);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.825rem;
  padding: 0.385rem 0.715rem;
  min-height: 1.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.when-filter:hover {
  color: var(--text);
  border-color: rgba(180, 77, 255, 0.45);
}

.when-filter.active {
  background: linear-gradient(135deg, rgba(255, 45, 149, 0.2), rgba(180, 77, 255, 0.2));
  color: var(--text);
  border-color: rgba(255, 45, 149, 0.45);
}

.list-scope-filters {
  display: flex;
  gap: 0.385rem;
  flex-wrap: wrap;
}

.list-scope-filter {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-glass);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.825rem;
  padding: 0.385rem 0.715rem;
  min-height: 1.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.list-scope-filter:hover {
  color: var(--text);
  border-color: rgba(180, 77, 255, 0.45);
}

.list-scope-filter.active {
  background: linear-gradient(135deg, rgba(255, 45, 149, 0.2), rgba(180, 77, 255, 0.2));
  color: var(--text);
  border-color: rgba(255, 45, 149, 0.45);
}

@media (max-width: 900px) {
  .section-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem;
  }

  .section-head-title {
    display: contents;
  }

  .section-head h2 {
    grid-column: 1;
    grid-row: 1;
  }

  .section-head .badge {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    white-space: nowrap;
  }

  .list-scope-filters {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .when-filters {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }

  .list-scope-filter,
  .when-filter {
    flex: 1;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

.event-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.event-favorite:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.05);
}

.event-favorite svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.75;
}

.event-favorite.is-active svg {
  fill: var(--neon-pink);
  stroke: var(--neon-pink);
}

.event-ended-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(80, 80, 90, 0.75);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 229, 255, 0.25);
}

/* Events grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.loading-card,
.empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.event-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 45, 149, 0.4);
  box-shadow: 0 8px 32px rgba(180, 77, 255, 0.15);
}

.event-cover {
  background: linear-gradient(135deg, #1a0a2e 0%, #0d1a2e 100%);
  display: block;
  position: relative;
  overflow: hidden;
  line-height: 0;
  aspect-ratio: 4 / 5;
  width: 100%;
}

.event-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 55%,
    rgba(10, 6, 20, 0.35) 100%
  );
  z-index: 1;
}

.event-cover.has-video {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1a2e;
}

.event-cover-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #0d1a2e;
}

.event-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: linear-gradient(135deg, #1a0a2e 0%, #0d1a2e 100%);
}

.event-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  line-height: normal;
  font-family: var(--font-display);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.1em;
}

.event-date-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  line-height: 1.25;
}

.event-date-badge--relative {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.event-date-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.event-date-sub {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.88;
}

.event-body {
  padding: 1rem 1.1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.event-body-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.event-venue {
  font-size: 0.75rem;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.event-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.event-meta span::before {
  content: "· ";
  opacity: 0.4;
}

.event-meta span:first-child::before {
  content: "";
}

.event-djs {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* TEMP: 暫時隱藏曲風 — 刪除此區塊即可恢復 */
#genre-filter-section,
#event-genres-field,
.event-genres {
  display: none !important;
}

.event-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.genre-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(180, 77, 255, 0.15);
  color: var(--neon-purple);
  border: 1px solid rgba(180, 77, 255, 0.25);
}

.event-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 0.75rem;
  flex-shrink: 0;
}

.event-link {
  width: auto;
  min-width: 0;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  box-sizing: border-box;
}

button.event-link {
  appearance: none;
  -webkit-appearance: none;
}

.event-link:hover {
  background: rgba(255, 45, 149, 0.15);
  border-color: var(--neon-pink);
}

.event-link.ig {
  border-color: rgba(255, 45, 149, 0.35);
  color: var(--neon-pink);
}

.event-link.navigate {
  border-color: rgba(0, 229, 255, 0.45);
  color: var(--neon-cyan);
  font-weight: 600;
}

.event-link.navigate:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--neon-cyan);
}

.event-link.share {
  border-color: rgba(180, 77, 255, 0.45);
  color: var(--neon-purple);
  font-weight: 600;
}

.event-link.share:hover {
  background: rgba(180, 77, 255, 0.12);
  border-color: var(--neon-purple);
}

.event-link.calendar {
  border-color: rgba(168, 255, 96, 0.45);
  color: #a8ff60;
  font-weight: 600;
}

.event-link.calendar:hover {
  background: rgba(168, 255, 96, 0.12);
  border-color: #a8ff60;
}

.event-link.ticket {
  border-color: rgba(255, 213, 79, 0.45);
  color: #ffd54f;
  font-weight: 600;
}

.event-link.ticket:hover {
  background: rgba(255, 213, 79, 0.12);
  border-color: #ffd54f;
}

.event-link--disabled,
.event-link--disabled:hover {
  opacity: 0.32;
  pointer-events: none;
  cursor: default;
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.share-toast {
  position: fixed;
  bottom: calc(var(--ad-h, 56px) + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  z-index: 300;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(20, 12, 32, 0.95);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Bottom ad banner */
.ad-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 180;
  height: var(--ad-h);
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #0f0818, #150d22, #0f0818);
  border-top: 1px solid var(--border);
}

.ad-nav {
  flex-shrink: 0;
  width: 40px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.ad-nav:hover {
  color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.06);
}

.ad-slide {
  flex: 1;
  text-decoration: none;
  color: inherit;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
}

.ad-tag {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--neon-pink);
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 45, 149, 0.35);
  border-radius: 4px;
}

.ad-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ad-text strong {
  font-size: 0.95rem;
}

.ad-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ad-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.ad-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0;
  cursor: pointer;
}

.ad-dot.active {
  background: var(--neon-cyan);
}

@media (max-width: 900px) {
  :root {
    --ad-h: 43px; /* 54px × 0.8 */
  }

  .ad-inner {
    gap: 0.6rem;
    padding: 0 0.6rem;
  }

  .ad-dots {
    bottom: 3px;
  }
}

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

.site-footer p {
  margin: 0;
}

@media (max-width: 600px) {
  .music-progress {
    gap: 0.35rem;
  }

  .music-time {
    font-size: 0.62rem;
    min-width: 2rem;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .event-date-badge {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
  }

  .event-date-label {
    font-size: 1.05rem;
  }

  .event-date-sub {
    font-size: 0.78rem;
  }

  .ad-text strong {
    font-size: 0.85rem;
  }
}
