/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0e0e0e;
  --bg2:         #1a1a1a;
  --bg3:         #252525;
  --border:      #2e2e2e;
  --text:        #e8e8e8;
  --text2:       #888;
  --text3:       #555;
  --accent:      #c8902a;
  --accent2:     #a07020;
  --accent-dim:  rgba(200,144,42,0.12);
  --danger:      #c0392b;
  --bar-h:       150px;
  --header-h:    52px;
  --font: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  background: none; border: none;
  color: inherit; cursor: pointer;
  font-family: inherit; font-size: inherit; padding: 0;
}

/* ── App shell ────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────────── */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#header-title-block {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

#header-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

#header-subtitle {
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.1px;
  margin-top: 1px;
}

.back-btn {
  display: none;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  font-size: 15px;
  padding: 8px 0;
  z-index: 1;
}
.back-btn.visible { display: flex; }
.back-btn svg { width: 18px; height: 18px; }

.header-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  z-index: 1;
}

.header-actions button {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  border-radius: 8px;
}
.header-actions button:active { background: var(--bg3); }
.header-actions svg { width: 20px; height: 20px; display: block; }

/* ── Search Input (persistent in header) ─────────────────────────── */
#search-input {
  flex: 1;
  min-width: 0;
  background: var(--bg3);
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0 8px;
}
#search-input::placeholder { color: var(--text3); }
#search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
#search-input.search-hidden { display: none; }

.search-clear-btn {
  font-size: 15px;
  color: var(--text3);
  padding: 6px 4px 6px 0;
  flex-shrink: 0;
  line-height: 1;
}
.search-clear-btn:active { color: var(--text); }

/* ── Search history dropdown ──────────────────────────────────────── */
#search-history {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 60;
  overflow: hidden;
}
.search-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.search-history-item:last-of-type { border-bottom: none; }
.search-history-item:active { background: var(--bg2); }
.search-history-icon {
  font-size: 13px;
  color: var(--text3);
  flex-shrink: 0;
}
.search-history-clear {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  cursor: pointer;
  border-top: 1px solid var(--border);
}
.search-history-clear:active { color: var(--accent); }

/* ── Mode Bar ─────────────────────────────────────────────────────── */
#mode-bar {
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#mode-bar.hidden { display: none; }

.mode-btn {
  flex: 1;
  padding: 9px 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.mode-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Sort Bar ─────────────────────────────────────────────────────── */
#sort-bar {
  display: flex;
  gap: 0;
  padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
#sort-bar::-webkit-scrollbar { display: none; }
#sort-bar.hidden { display: none; }

.sort-btn {
  white-space: nowrap;
  font-size: 13px;
  color: var(--text2);
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.sort-btn.active {
  color: var(--accent);
  border-color: var(--accent2);
  background: var(--accent-dim);
}

/* ── Main ─────────────────────────────────────────────────────────── */
#main {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#view-library,
#view-concert {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

#view-favorites {
  display: flex;
  height: 100%;
}

/* ── Concert List (shared by library, favorites, search) ──────────── */
.concert-list { list-style: none; }

.concert-item {
  display: flex;
  align-items: center;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  cursor: pointer;
  transition: background 0.1s;
}
.concert-item:active { background: var(--bg2); }

.concert-info { flex: 1; min-width: 0; }

.concert-date {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}

.concert-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}

.concert-creator {
  font-size: 13px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.concert-fav {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  font-size: 18px;
  border-radius: 50%;
  transition: color 0.15s, transform 0.1s;
}
.concert-fav.active { color: var(--accent); }
.concert-fav:active { transform: scale(1.3); }

.card-fav {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text3);
  border-radius: 50%;
  transition: color 0.15s, transform 0.1s;
  z-index: 1;
}
.card-fav.active { color: var(--accent); }
.card-fav:active { transform: scale(1.3); }

.concert-chevron { color: var(--text3); flex-shrink: 0; }
.concert-chevron svg { width: 16px; height: 16px; display: block; }

/* ── Load More ────────────────────────────────────────────────────── */
#load-more {
  display: block;
  width: 100%;
  padding: 18px;
  font-size: 14px;
  color: var(--accent);
  text-align: center;
  border-top: 1px solid var(--border);
}
#load-more:disabled { color: var(--text3); }

/* ── Artist Column View ───────────────────────────────────────────── */
#view-artists, #view-year, #view-venue {
  display: flex;
  height: 100%;
}

.artist-col {
  width: 38%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  padding-left: env(safe-area-inset-left, 0px);
}

.concerts-col {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: env(safe-area-inset-right, 0px);
}

/* Concert detail photo carousel */

.artist-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.artist-item:active { background: var(--bg2); }
.artist-item.selected {
  background: var(--accent-dim);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}

.artist-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-item.selected .artist-name { color: var(--accent); }

.artist-count {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}

/* Compact concert rows in the right column */
.artist-concert-item {
  display: flex;
  align-items: center;
  padding: 10px 16px 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  cursor: pointer;
  transition: background 0.1s;
}
.artist-concert-item:active { background: var(--bg2); }

.artist-concert-info { flex: 1; min-width: 0; }

.artist-concert-date {
  font-size: 11px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.artist-concert-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Concert Detail View ──────────────────────────────────────────── */
.concert-hero {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.concert-hero-art {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--bg2);
}

.concert-hero-meta {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.concert-artist-link {
  cursor: pointer;
}
.concert-artist-link:active { opacity: 0.7; }

.concert-archive-mini {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.concert-archive-mini a {
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
}
.concert-archive-mini a:active { opacity: 0.5; }

.concert-upload-date {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

.concert-info-block {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}



.concert-also {
  padding: 10px 16px 4px;
  border-bottom: 1px solid var(--border);
}

.concert-section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-bottom: 2px;
}

.concert-also-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 0;
  user-select: none;
}

.concert-also-toggle-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.concert-also-count {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
}

.concert-also-chevron-toggle {
  width: 16px;
  height: 16px;
  color: var(--text3);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.concert-also.open .concert-also-chevron-toggle {
  transform: rotate(180deg);
}

.concert-also-list {
  display: none;
}

.concert-also.open .concert-also-list {
  display: block;
}

.concert-also-item {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  gap: 10px;
}
.concert-also-item:active { opacity: 0.6; }

.concert-also-info { flex: 1; min-width: 0; }

.concert-also-creator {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.concert-also-title {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.concert-also-chevron {
  width: 18px;
  height: 18px;
  color: var(--text3);
  flex-shrink: 0;
}

.concert-snippets {
  padding: 10px 16px 4px;
  border-bottom: 1px solid var(--border);
}

.concert-snippet {
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.concert-snippet-quote {
  font-size: 13px;
  color: var(--text);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 4px;
}

.concert-snippet-attr {
  font-size: 11px;
  color: var(--text3);
}

.concert-artist-blurb {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin-top: 6px;
}

#concert-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#concert-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
}

.concert-header-date {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.concert-header-creator {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
}

.concert-header-venue {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 4px;
}
.concert-date-context {
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}

.concert-date-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-right: 8px;
}

.concert-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-primary {
  flex: 1;
  background: var(--accent);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 8px;
  text-align: center;
}

.btn-secondary {
  flex: 1;
  background: var(--bg3);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 0;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border);
}

.btn-fav {
  flex-shrink: 0;
  font-size: 22px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text3);
  transition: color 0.15s;
}
.btn-fav.active { color: var(--accent); border-color: var(--accent2); }

.track-list { list-style: none; }

.track-item {
  display: flex;
  align-items: center;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.track-item:active { background: var(--bg2); }
.track-item.playing .track-title { color: var(--accent); }

.track-num {
  font-size: 13px;
  color: var(--text3);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.track-info { flex: 1; min-width: 0; }

.track-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-duration {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.track-add {
  color: var(--text2);
  padding: 8px;
  margin-right: -6px;
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
}

/* ── Now Playing Bar ──────────────────────────────────────────────── */
#now-playing-bar {
  flex-shrink: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: none;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
#now-playing-bar.visible { display: flex; }

/* Info row: art + title/artist */
.bar-body {
  display: flex;
  align-items: center;
  padding: 10px 14px 6px;
  gap: 12px;
}

.bar-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg3);
}

.bar-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.bar-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-artist {
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  margin-top: 2px;
}
.bar-artist-inner { display: inline-block; }
.bar-artist-inner.scrolling { animation: bar-marquee 16s linear infinite; }
@keyframes bar-marquee {
  0%    { transform: translateX(0); }
  10%   { transform: translateX(0); }
  90%   { transform: translateX(-50%); }
  100%  { transform: translateX(-50%); }
}

/* Scrub row */
.bar-scrub-wrap {
  padding: 0 14px 2px;
}
.bar-scrub-track {
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.bar-scrub-rail {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
}
.bar-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.5s linear;
}
.bar-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* Controls row */
.bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 8px;
}
#bar-prev  { margin-left: auto; }
#bar-queue { margin-left: auto; }

.bar-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  border-radius: 50%;
}
.bar-btn:active { background: var(--bg3); }
.bar-btn.primary { color: var(--accent); }
.bar-btn svg { width: 28px; height: 28px; display: block; }
.bar-btn.small svg { width: 24px; height: 24px; }

/* ── Queue Sheet ──────────────────────────────────────────────────── */
#queue-sheet {
  position: fixed; top: 0; left: 0; right: 0; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); z-index: 100;
  display: none; flex-direction: column;
  background: var(--bg);
}
#queue-sheet.visible { display: flex; }

.sheet-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-header h2 { font-size: 17px; font-weight: 600; }
.sheet-close { color: var(--accent); font-size: 15px; padding: 8px 0; }
.sheet-clear { color: var(--text2); font-size: 15px; padding: 8px 0; }


.queue-list { list-style: none; overflow-y: auto; flex: 1; }

.queue-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.queue-item.current .queue-track-title { color: var(--accent); }

.queue-track-info { flex: 1; min-width: 0; }
.queue-track-title {
  font-size: 15px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-track-meta {
  font-size: 12px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-remove {
  color: var(--text3); font-size: 20px;
  padding: 8px; margin-right: -8px;
}
.queue-menu-btn {
  font-size: 18px; color: var(--text2);
  padding: 4px 8px; letter-spacing: 1px;
  flex-shrink: 0;
}

/* ── Settings Sheet ───────────────────────────────────────────────── */
#settings-sheet,
#help-sheet {
  position: fixed; inset: 0; z-index: 100;
  display: none; flex-direction: column;
  background: var(--bg);
}
#settings-sheet.visible,
#help-sheet.visible { display: flex; }

.help-body {
  padding: 16px 16px 12px;
  gap: 4px;
}
.help-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 8px 0;
}
.help-feature-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.help-feature-icon svg { width: 16px; height: 16px; }
.help-feature-body { min-width: 0; }
.help-feature-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.help-feature-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.45;
}
.help-guide-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  padding: 12px 0 4px;
  opacity: 0.85;
}

.settings-body {
  padding: 24px 16px;
  display: flex; flex-direction: column; gap: 20px;
}
.settings-label {
  font-size: 12px; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.settings-input, #favs-import-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  outline: none;
}
.settings-input:focus, #favs-import-input:focus { border-color: var(--accent); }
.settings-save {
  background: var(--accent); color: #000;
  font-size: 15px; font-weight: 600;
  padding: 13px; border-radius: 10px; width: 100%;
}
.settings-hint { font-size: 13px; color: var(--text2); margin-top: 4px; }
.settings-divider { border-top: 1px solid var(--border); margin: 8px 0; }

/* ── Track action sheet ───────────────────────────────────────────── */
#track-action-sheet,
#queue-item-sheet {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  display: none;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#track-action-sheet.visible,
#queue-item-sheet.visible { display: block; }

.action-sheet-inner {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bg2);
  border-radius: 16px 16px 0 0;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
}

.action-sheet-title {
  font-size: 13px;
  color: var(--text2);
  text-align: center;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-sheet-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 15px 20px;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.action-sheet-btn:last-child { border-bottom: none; }
.action-sheet-btn:active { background: var(--bg3); }
.action-sheet-btn.cancel { color: var(--text2); margin-top: 4px; border-top: 1px solid var(--border); }

/* ── Go to a Show (bill cards) ───────────────────────────────────── */
.bill-card {
  flex-shrink: 0;
  width: 140px;
  height: 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: background 0.1s;
}
.bill-card:active { background: var(--bg3); }

.bill-date-full {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
  margin-bottom: 5px;
}

.bill-artists {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.bill-venue {
  font-size: 11px;
  font-weight: 400;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.7;
}

/* ── Persistent stat banner ──────────────────────────────────────── */
#stat-banner {
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

/* ── Discover view ────────────────────────────────────────────────── */
#view-discover,
#view-filtered {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.discover-section {
  padding: 16px 0 4px;
  border-bottom: 1px solid var(--border);
}

.discover-section:last-child { border-bottom: none; }

.discover-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 16px 10px;
}

.discover-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text2);
}

.discover-section-count {
  font-size: 12px;
  color: var(--text3);
}

.discover-section-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discover-refresh-btn {
  font-size: 15px;
  color: var(--text3);
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.discover-refresh-btn:active { color: var(--accent); }

.discover-section-desc {
  font-size: 12px;
  color: var(--text3);
  padding: 0 16px 8px;
  line-height: 1.4;
}

/* Horizontal scroll strip */
.discover-h-scroll {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.discover-h-scroll::-webkit-scrollbar { display: none; }

/* Today's show cards */
.today-card {
  flex-shrink: 0;
  width: 140px;
  height: 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.today-card:active { background: var(--bg3); }

.today-card-year {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.today-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  flex: 1;
}

.today-card-artist {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-card-weather {
  font-size: 10px;
  color: var(--text3);
  margin-top: auto;
  padding-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Surprise cards (Discover — horizontal scroll) */
.surprise-card {
  flex-shrink: 0;
  width: 150px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: background 0.1s;
}
.surprise-card:active { background: var(--bg3); }
.surprise-info { min-width: 0; }
.surprise-artist {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.surprise-venue {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.surprise-date {
  font-size: 11px;
  color: var(--accent);
  margin-top: 3px;
}

/* Popular in the Archive cards */
.popular-card {
  flex-shrink: 0;
  width: 140px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.1s;
  position: relative;
}
.popular-card:active { opacity: 0.7; }
.popular-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg3);
}
.popular-card-info { padding: 7px 8px 8px; }
.popular-card-artist {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popular-card-city {
  font-size: 10px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.popular-card-date {
  font-size: 10px;
  color: var(--text3);
  margin-top: 1px;
}
.popular-card-plays {
  font-size: 10px;
  color: var(--accent);
  opacity: 0.7;
  margin-top: 3px;
}

/* Recently Added list */
.recent-list { list-style: none; padding: 0 16px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:active { opacity: 0.6; }
.recent-date {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 72px;
}
.recent-info { min-width: 0; flex: 1; }
.recent-fav { margin-left: auto; flex-shrink: 0; }
.recent-title {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-artist {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Year pills */
.year-pill {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
  min-width: 56px;
}
.year-pill:active { background: var(--bg3); }

.year-pill-year {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.year-pill-count {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
}

/* Venue list */
.venue-item {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 10px;
  transition: background 0.1s;
}
.venue-item:active { background: var(--bg2); }

.venue-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.venue-count {
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 16px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Upload activity chart ────────────────────────────────────────── */
.upload-chart-wrap {
  padding: 0 16px 16px;
}

.upload-chart {
  display: block;
  width: 100%;
  height: 90px;
  overflow: visible;
}

.chart-bar {
  fill: var(--accent);
  opacity: 0.85;
  rx: 2;
}

.chart-label {
  font-size: 9px;
  fill: var(--text2);
  font-family: var(--font);
}

/* Filtered list view header */
.filtered-list-label {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

/* ── Utility ──────────────────────────────────────────────────────── */
.loading-msg, .error-msg, .empty-msg {
  padding: 48px 20px;
  text-align: center;
  color: var(--text2);
  font-size: 15px;
}
.error-msg { color: var(--danger); }

.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 48px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
