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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-hover: #22223a;
  --accent: #7c3aed;
  --accent-glow: #8b5cf6;
  --accent-dim: #4c1d95;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --border: #1e1e32;
  --success: #10b981;
  --gradient-start: #7c3aed;
  --gradient-end: #06b6d4;
}

body {
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ---- Site Header (shared with content pages) ---- */
.site-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
.site-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--text-primary); text-decoration: none; }
.site-nav a.active { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-link-subtle {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.header-link-subtle:hover { color: var(--text-primary); text-decoration: none; }

.genre-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem 0.45rem 32px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem;
  margin-left: auto;
}

.share-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.3rem;
  margin-left: auto;
  transition: color 0.2s;
  position: relative;
}
.share-btn:hover { color: var(--text-primary); }

.share-menu {
  position: fixed;
  top: 48px;
  right: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 12px;
  padding: 12px;
  z-index: 999;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: shareMenuIn 0.15s ease-out;
}
@keyframes shareMenuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.share-menu-title {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding: 0 4px;
}
.share-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.share-option:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.share-option[data-platform="twitter"]:hover { color: #1da1f2; }
.share-option[data-platform="reddit"]:hover { color: #ff4500; }
.share-option[data-platform="discord"]:hover { color: #5865f2; }
.share-option .share-toast { color: var(--gradient-end); }

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}
.logo:hover { color: var(--accent); text-decoration: none; }

.mobile-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0.25rem 0;
}

.track-count {
  font-size: 0.65rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.genre-bar {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.genre-bar::-webkit-scrollbar { display: none; }

.genre-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.genre-pill:hover { border-color: var(--accent); color: var(--text-primary); }
.genre-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.genre-pill .count {
  font-size: 0.55rem;
  opacity: 0.7;
  margin-left: 0.2rem;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text-primary); }

/* Filter Modal */
.filter-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.filter-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.filter-modal-title {
  font-weight: 700;
  font-size: 1rem;
}

.filter-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.filter-modal-close:hover { color: var(--text-primary); }

.filter-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.filter-checkbox:hover { background: var(--bg-hover); }

.filter-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-checkbox .filter-count {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-left: auto;
}

.filter-checkbox.checked { color: var(--text-primary); }

.filter-modal-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  gap: 0.75rem;
}

.filter-modal-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.filter-modal-btn.primary {
  background: var(--accent);
  color: white;
}
.filter-modal-btn.primary:hover { background: var(--accent-glow); }

.filter-modal-btn.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.filter-modal-btn.secondary:hover { border-color: var(--accent); color: var(--text-primary); }

.main {
  flex: 1;
  padding-bottom: 100px;
  overflow-y: auto;
}

/* Skeleton loading cards */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: 140px;
  gap: 3px;
  padding: 0;
}
.skeleton-card {
  background: linear-gradient(110deg, #1a1a2e 8%, #252545 18%, #1a1a2e 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: 6px;
}
.skeleton-card:nth-child(-n+4) {
  grid-column: span 2;
  grid-row: span 2;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* MOSAIC GRID */
.mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: 140px;
  grid-auto-flow: dense;
  gap: 3px;
  padding: 3px;
}

.tile.featured, .ad-tile.featured {
  grid-column: span 2;
  grid-row: span 2;
}

/* ---- Editorial Featured Tiles (in-feed) ---- */
.tile.editorial-featured {
  grid-column: span 2;
  grid-row: span 2;
  border: 2px solid var(--accent);
  border-radius: 6px;
}
.editorial-badge {
  position: absolute;
  top: 32px;
  left: 8px;
  background: rgba(124, 58, 237, 0.7);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 3;
  backdrop-filter: blur(4px);
}
@media (max-width: 768px) {
  .editorial-badge { font-size: 0.55rem; padding: 2px 6px; }
}

.ad-tile {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  grid-column: span 2;
  min-width: 250px;
}
.ad-tile ins { width: 100%; height: 100%; }
.ad-tile .ad-label {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 1;
}

.tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 4px;
  background: var(--bg-tertiary);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s ease,
              border-radius 0.3s ease;
}

.tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.6rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tile:hover .tile-overlay { opacity: 1; }
.tile:hover .tile-img { transform: scale(1.08); }
@media (pointer: coarse) {
  .tile:hover .tile-overlay { opacity: 0; }
  .tile:hover .tile-img { transform: none; }
}

.tile-title {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  text-decoration: none;
  display: block;
  line-height: 1.2;
  pointer-events: none;
}

.tile-artist {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: block;
  pointer-events: none;
}

.tile-genre {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.6);
  color: rgba(255,255,255,0.8);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  backdrop-filter: blur(4px);
}

.source-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}
.source-badge.suno { background: #7c3aed; color: #fff; }
.source-badge.sc { background: #ff5500; color: #fff; }
.source-badge.sp { background: #1DB954; color: #fff; }

.tile-collect-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s, transform 0.15s, border-color 0.15s;
}

.tile-collect-btn svg {
  fill: rgba(255,255,255,0.9);
}

.tile:hover .tile-collect-btn { opacity: 1; }
@media (pointer: coarse) {
  .tile:hover .tile-collect-btn { opacity: 0; }
}

.tile-collect-btn:hover {
  background: var(--accent);
  border-color: var(--accent-glow);
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(124,58,237,0.5);
}

.tile-collect-btn:hover svg {
  fill: #fff;
}

.tile.expanded .tile-collect-btn {
  opacity: 1;
  width: 48px;
  height: 48px;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  border: 2px solid rgba(255,255,255,0.4);
  z-index: 6;
}

.tile.expanded .tile-collect-btn svg {
  width: 22px;
  height: 22px;
}

.tile-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.tile-play svg {
  width: 20px;
  height: 20px;
  fill: var(--bg-primary);
  margin-left: 2px;
}

.tile:hover .tile-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
@media (pointer: coarse) {
  .tile:hover .tile-play { opacity: 0; }
}

.tile.featured .tile-title { font-size: 1rem; }
.tile.featured .tile-artist { font-size: 0.75rem; }
.tile.featured .tile-overlay { padding: 1rem; }
.tile.featured .tile-play { width: 60px; height: 60px; }
.tile.featured .tile-play svg { width: 24px; height: 24px; }
.tile.featured .tile-genre { font-size: 0.65rem; }

.tile.playing {
  outline: 3px solid var(--accent-glow);
  outline-offset: -3px;
}

.tile.playing .tile-overlay {
  opacity: 1;
  background: linear-gradient(0deg, rgba(124,58,237,0.7) 0%, rgba(0,0,0,0.15) 50%, transparent 100%);
}

.tile.playing .tile-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  background: var(--accent-glow);
}

.tile.playing .tile-play svg { fill: white; }

/* EXPANDED TILE — 3x3 with track detail */
.tile.expanded {
  grid-column: span 3;
  grid-row: span 3;
  z-index: 5;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,58,237,0.3);
}

.tile.expanded .tile-overlay {
  opacity: 1;
  background: linear-gradient(0deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0.3) 100%);
  justify-content: flex-end;
  padding: 1.2rem;
  transition: opacity 0.25s ease, background 0.3s ease;
}

.tile.expanded .tile-img {
  transform: scale(1.02);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tile.expanded .tile-play { display: none; }
.tile.expanded.paused .tile-play {
  display: flex;
  opacity: 0.9;
  transform: translate(-50%, -50%) scale(1);
  background: rgba(0,0,0,0.6);
}
.tile.expanded .tile-genre {
  font-size: 0.7rem;
  transition: font-size 0.25s ease;
}
.tile.expanded .tile-eq {
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
}

@keyframes detailFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tile-detail {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.tile.expanded .tile-detail {
  display: flex;
  animation: detailFadeIn 0.35s ease 0.1s both;
}
.tile.expanded .tile-title {
  font-size: 1.2rem;
  white-space: normal;
  line-height: 1.3;
  transition: font-size 0.25s ease;
  pointer-events: auto;
}
.tile.expanded .tile-title:hover,
.tile.expanded .tile-artist:hover {
  text-decoration: underline;
}
.tile.expanded .tile-artist {
  font-size: 0.85rem;
  transition: font-size 0.25s ease;
  pointer-events: auto;
}

.tile-detail-genre {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

.tile-detail-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
}

.tile-detail-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tile-detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.tile-detail-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}
.tile-detail-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.tile-detail-license {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.35);
  margin-top: 0.1rem;
}

@media (max-width: 768px) {
  .tile.expanded {
    grid-column: 1 / -1;
    grid-row: span 4;
  }
  .tile.expanded .tile-title { font-size: 1.2rem; }
  .tile.expanded .tile-artist { font-size: 0.85rem; }
  .tile.expanded .tile-overlay { padding: 1.2rem; }
  .tile-detail-stats { gap: 0.6rem; font-size: 0.65rem; }
  .tile-detail-btn { font-size: 0.65rem; padding: 0.3rem 0.6rem; }
}

.tile-eq {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  height: 48px;
  width: 100%;
  padding: 0 2px;
  opacity: 0;
  z-index: 4;
  pointer-events: none;
}

.tile.playing .tile-eq { opacity: 1; }
.tile.playing:hover .tile-play { opacity: 1; }

.tile-eq-bar {
  flex: 1;
  max-width: 8px;
  background: white;
  border-radius: 1px 1px 0 0;
  animation: eq 0.8s ease-in-out infinite alternate;
}

.tile-eq-bar:nth-child(1) { animation-delay: 0s; height: 60%; }
.tile-eq-bar:nth-child(2) { animation-delay: 0.2s; height: 100%; }
.tile-eq-bar:nth-child(3) { animation-delay: 0.4s; height: 40%; }
.tile-eq-bar:nth-child(4) { animation-delay: 0.15s; height: 80%; }
.tile-eq-bar:nth-child(5) { animation-delay: 0.35s; height: 55%; }

.tile.paused .tile-eq-bar { animation-play-state: paused; }

@keyframes eq {
  from { height: 15%; }
  to { height: 100%; }
}

/* Tile loading spinner */
.tile.tile-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: tileLoadSpin 0.7s linear infinite;
  z-index: 6;
}

@keyframes tileLoadSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Load more sentinel */
.load-more {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Keep Going button */
.keep-going-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
}
.keep-going-btn {
  background: linear-gradient(135deg, var(--accent), #9333ea);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: 0.9rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.02em;
}
.keep-going-btn:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(99,102,241,0.4); }
.keep-going-count { color: var(--text-dim); font-size: 0.8rem; }

/* Site Footer */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2rem 1.5rem 6rem;
  text-align: center;
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-brand { color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }
.footer-links { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.footer-links a { color: var(--accent); text-decoration: none; font-size: 0.8rem; }
.footer-links a:hover { text-decoration: underline; }
.footer-sep { color: var(--text-dim); font-size: 0.8rem; }
.footer-note { color: var(--text-dim); font-size: 0.7rem; line-height: 1.5; }

/* Legal Modals (ToS / Privacy) */
.legal-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 2rem 1rem;
}
.legal-modal-backdrop.open { display: flex; justify-content: center; align-items: flex-start; }
.legal-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  margin: 2rem auto;
}
.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}
.legal-modal-header h2 { font-size: 1.1rem; color: var(--text-primary); margin: 0; }
.legal-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.legal-modal-close:hover { color: var(--text-primary); }
.legal-modal-body {
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}
.legal-modal-body h3 { color: var(--text-primary); font-size: 0.95rem; margin: 1.5rem 0 0.5rem; }
.legal-modal-body p { margin: 0.5rem 0; }
.legal-modal-body ul { margin: 0.5rem 0 0.5rem 1.5rem; }
.legal-modal-body li { margin: 0.25rem 0; }
.legal-modal-body a { color: var(--accent); }

/* PLAYER BAR */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 18, 26, 0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  z-index: 100;
}

.progress-container {
  position: relative;
  height: 3px;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: height 0.15s ease;
}

.progress-container:hover { height: 6px; }

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.progress-container:hover .progress-bar::after { opacity: 1; }

.player-content {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 0.5rem 1.5rem;
  gap: 1rem;
}

.player-track {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.player-cover {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.player-track-info { min-width: 0; }

.player-track-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  text-decoration: none;
}

.player-track-artist {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.player-track-title:hover, .player-track-artist:hover {
  text-decoration: underline;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.player-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem;
  border-radius: 50%;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-btn:hover { color: var(--text-primary); }

.player-btn.play-btn {
  background: white;
  color: var(--bg-primary);
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.player-btn.play-btn:hover {
  transform: scale(1.05);
  background: var(--text-primary);
}

.player-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  width: 100%;
  position: relative;
  padding: 0.3rem 0;
}

.player-time.loading span {
  visibility: hidden;
}

.player-time.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: playerSpin 0.8s linear infinite;
}

@keyframes playerSpin {
  to { transform: rotate(360deg); }
}

.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

.volume-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .mosaic {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-auto-rows: 100px;
    padding-bottom: 140px;
  }
  .player-content {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    padding: 0.4rem 0.75rem 0.5rem;
    gap: 0.3rem 0.5rem;
  }
  .player-track {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .player-right {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
  }
  .player-right .volume-container { display: none; }
  .player-right .player-btn { font-size: 1rem; padding: 0.3rem; }
  .player-controls {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .player-track-info { max-width: none; flex: 1; min-width: 0; }
  .player-track-title { font-size: 0.78rem; }
  .player-track-artist { font-size: 0.65rem; }
  .player-cover { width: 38px; height: 38px; }
  .player-controls { width: 100%; }
  .player-buttons { gap: 1.25rem; justify-content: center; }
  .player-btn { font-size: 1.4rem; padding: 0.5rem; }
  .player-btn.play-btn { width: 44px; height: 44px; font-size: 1.2rem; }
  .hamburger-btn { display: flex; }
  .genre-bar-wrap { display: none; padding-left: 16px; }
  .genre-bar-wrap.open { display: flex; flex-wrap: wrap; }
  .genre-bar-wrap.open .genre-bar { flex-wrap: wrap; }
  .site-nav { display: none; }
  .site-header { padding: 12px 16px; }
  .header-link-subtle { display: none; }
  .auth-area, .user-menu { display: none !important; }
}

/* =========================================================================
   MOBILE SLIDE MENU
   ========================================================================= */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: #12121e;
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 2001;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mobile-menu-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-menu-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
}

.mobile-menu-body {
  padding: 0.5rem 0;
  flex: 1;
  overflow-y: auto;
}

.mobile-menu-auth {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mobile-menu-auth:empty {
  display: none;
}

.mobile-menu-auth-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.mobile-menu-auth-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.mobile-menu-auth-user span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.mobile-menu-auth-links {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.2rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s;
}
.mobile-menu-item:hover {
  text-decoration: none;
}

.mobile-menu-item:hover, .mobile-menu-item:active {
  background: rgba(255,255,255,0.06);
}

.mobile-menu-item svg {
  opacity: 0.5;
  flex-shrink: 0;
}

.mobile-menu-item.danger {
  color: #ef4444;
}

.mobile-menu-signin-btn {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: transform 0.15s;
}

.mobile-menu-signin-btn:active {
  transform: scale(0.97);
}

/* Hide mobile menu on desktop */
@media (min-width: 769px) {
  .mobile-menu, .mobile-menu-backdrop { display: none !important; }
}

@media (min-width: 1400px) {
  .mosaic {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-auto-rows: 160px;
  }
}

/* =========================================================================
   AUTH UI
   ========================================================================= */
.auth-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.auth-btn {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.auth-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.user-menu-trigger:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}

.user-menu-caret {
  opacity: 0.5;
  transition: transform 0.15s;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.user-name {
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 180px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.6rem;
  padding: 0.35rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  z-index: 1000;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}
.user-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
}
.user-dropdown-item svg {
  opacity: 0.5;
  flex-shrink: 0;
}
.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.3rem 0;
}
.user-dropdown-logout {
  color: #ef4444;
}
.user-dropdown-logout svg {
  opacity: 0.7;
}

.auth-btn-small {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}
.auth-btn-small:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* =========================================================================
   MODAL SHARED STYLES
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 1rem;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 1.25rem;
}

/* =========================================================================
   LOGIN MODAL
   ========================================================================= */
.login-modal { max-width: 380px; }

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.login-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}
.login-input:focus { border-color: var(--accent); }

.login-submit-btn {
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.login-submit-btn:hover { background: var(--accent-glow); }

.login-error {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.5rem;
  min-height: 1em;
}

.login-success {
  color: var(--success);
  font-size: 0.75rem;
  margin-top: 0.5rem;
  min-height: 1em;
}

/* =========================================================================
   ADD TO COLLECTION MODAL
   ========================================================================= */
.collection-modal { max-width: 420px; }

.collection-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  max-height: 240px;
  overflow-y: auto;
}

.collection-modal-empty {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem 0;
}

.collection-modal-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.8rem;
  color: var(--text-secondary);
  user-select: none;
}
.collection-modal-item:hover { background: var(--bg-hover); }
.collection-modal-item.saving { opacity: 0.5; pointer-events: none; }

.collection-modal-item-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 0.2s;
}

.collection-modal-item-check .check-icon circle {
  transition: fill 0.2s, stroke 0.2s;
}

.collection-modal-item.saved .collection-modal-item-check {
  color: var(--success);
}

.collection-modal-item.saved .check-icon {
  fill: var(--success);
  stroke: var(--success);
}

.collection-modal-item.saved .check-icon circle {
  fill: var(--success);
}

.collection-modal-item-check .checkmark {
  opacity: 0;
  stroke: #fff;
  transition: opacity 0.2s;
}

.collection-modal-item.saved .collection-modal-item-check .checkmark {
  opacity: 1;
}

.collection-modal-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-modal-item-count {
  font-size: 0.65rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

.collection-modal-item.saved .collection-modal-item-count {
  color: var(--success);
}

.collection-modal-item-view {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.collection-modal-item:hover .collection-modal-item-view {
  opacity: 1;
}
.collection-modal-item-view:hover {
  color: var(--accent-glow);
  border-color: var(--accent);
}

.collection-modal-create {
  display: flex;
  gap: 0.5rem;
}

.collection-modal-input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}
.collection-modal-input:focus { border-color: var(--accent); }

.collection-modal-create-btn {
  padding: 0.5rem 0.85rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}
.collection-modal-create-btn:hover { background: var(--accent-glow); }

.collection-modal-done-btn {
  width: 100%;
  padding: 0.55rem;
  margin-top: 0.5rem;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.collection-modal-done-btn:hover { background: rgba(255,255,255,0.14); }

/* =========================================================================
   WELCOME MODAL
   ========================================================================= */
.welcome-modal { max-width: 480px; }

.welcome-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.welcome-body strong { color: var(--text-primary); }

.welcome-support {
  background: rgba(124, 58, 237, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.welcome-support p { margin: 0; }

.welcome-links {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.welcome-links p { font-size: 0.85rem; margin: 0 0 0.5rem; }

.welcome-credits {
  color: var(--text-dim) !important;
  font-size: 0.8rem !important;
  margin-top: 0.75rem !important;
}

.welcome-credits a {
  color: var(--accent);
  text-decoration: none;
}
.welcome-credits a:hover { text-decoration: underline; }

.welcome-start-btn {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.welcome-start-btn:hover { background: var(--accent-glow); }

/* =========================================================================
   UPGRADE MODAL
   ========================================================================= */
.upgrade-modal { max-width: 400px; text-align: center; }

.upgrade-modal .modal-body p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.upgrade-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.upgrade-btn {
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
}
.upgrade-btn:hover { transform: scale(1.03); }

.upgrade-btn.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.upgrade-btn.secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* =========================================================================
   VIEW CONTENT — generic route page container
   ========================================================================= */
.view-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.view-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.view-header h2 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0;
}

.btn-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-back:hover { border-color: var(--accent); color: var(--text-primary); }

.btn-create-collection {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-create-collection:hover { background: var(--accent-glow); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* =========================================================================
   COLLECTIONS GRID — Pinterest board layout
   ========================================================================= */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.collection-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.collection-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

.collection-card-art {
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  position: relative;
}

.collection-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collection-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent-dim), var(--bg-tertiary));
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-card-info {
  padding: 0.75rem;
}

.collection-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-card-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.collection-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 0.75rem 0.75rem;
}

.collection-card-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.collection-card-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.collection-card-btn.danger:hover { border-color: #ef4444; color: #ef4444; }

/* =========================================================================
   COLLECTION DETAIL
   ========================================================================= */
.collection-detail .mosaic {
  padding: 0;
}
.collection-detail .collections-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: 140px;
}

.collection-detail .tile {
  position: relative;
}

.collection-detail-count {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.tile-pin-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all 0.15s;
  backdrop-filter: blur(4px);
}
.tile-pin-btn:hover { background: rgba(0, 0, 0, 0.7); color: #fff; }
.tile-pin-btn.active { color: var(--accent-glow); }

.tile-bookmark-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* =========================================================================
   PROFILE PAGE
   ========================================================================= */
.profile-page { max-width: 700px; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}

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

.profile-name {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  line-height: 1.5;
}

.profile-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stat { text-align: center; }
.stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-section-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.btn-settings {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  margin-left: auto;
}
.btn-settings:hover { border-color: var(--accent); color: var(--text-primary); }

/* =========================================================================
   PREMIUM BADGE
   ========================================================================= */
.premium-badge-sm {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 0.5rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 0.2rem;
}
.premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

/* =========================================================================
   PREMIUM / PRICING PAGE
   ========================================================================= */
.premium-page { text-align: center; max-width: 700px; }

.premium-header {
  margin-bottom: 2rem;
}

.premium-header h2 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.premium-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  justify-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 300px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.pricing-card-spacer {
  flex: 1;
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.pricing-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}

.pricing-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.pricing-card-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.pricing-card-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-dim);
}

.pricing-card-savings {
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.pricing-card-features {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  text-align: left;
}

.pricing-card-features li {
  padding: 0.35rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.25rem;
}

.pricing-card-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.pricing-card-btn {
  width: 100%;
  padding: 0.65rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  background: var(--accent);
  color: #fff;
}
.pricing-card-btn:hover { background: var(--accent-glow); transform: scale(1.02); }

.pricing-card-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.pricing-card-btn.secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-dim);
}

.pricing-card.popular .pricing-card-btn {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
}

/* =========================================================================
   PREMIUM SUCCESS PAGE
   ========================================================================= */
.premium-success {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding-top: 2rem;
}

.premium-success h2 {
  font-size: 1.6rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.premium-success-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 0.4rem 1.2rem;
  border-radius: 6px;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.premium-success-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.premium-success-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  margin-bottom: 2rem;
}

.premium-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.premium-feature-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.premium-feature-item strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.premium-feature-item p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin: 0;
}

.premium-success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* =========================================================================
   BUG REPORT PAGE
   ========================================================================= */
.bugreport-page {
  max-width: 520px;
}

.bugreport-page h2 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.bugreport-page .bugreport-sub {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.bugreport-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bugreport-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.bugreport-input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.bugreport-input:focus { border-color: var(--accent); }

.bugreport-textarea {
  min-height: 120px;
  resize: vertical;
}

.bugreport-submit {
  padding: 0.7rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.bugreport-submit:hover { background: var(--accent-glow); }

.bugreport-status {
  font-size: 0.8rem;
  min-height: 1.2em;
}
.bugreport-status.success { color: var(--success); }
.bugreport-status.error { color: #f87171; }

.auth-link-subtle {
  color: #fca5a5;
  font-size: 0.78rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  background: rgba(239, 68, 68, 0.12);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  white-space: nowrap;
}
.auth-link-subtle:hover {
  color: #fef2f2;
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
}

/* =========================================================================
   SETTINGS PAGE
   ========================================================================= */
.settings-page { max-width: 500px; }

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.settings-input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.settings-input:focus { border-color: var(--accent); }

.settings-textarea {
  min-height: 80px;
  resize: vertical;
}

.settings-save-btn {
  padding: 0.6rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 0.5rem;
  transition: background 0.15s;
}
.settings-save-btn:hover { background: var(--accent-glow); }

.settings-upgrade {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}

.settings-upgrade p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.btn-upgrade {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s;
}
.btn-upgrade:hover { transform: scale(1.03); }

.settings-billing {
  margin-top: 2rem;
  text-align: center;
}

.btn-billing {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  border-radius: 8px;
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-billing:hover { background: rgba(34, 197, 94, 0.25); border-color: rgba(34, 197, 94, 0.6); color: #86efac; }

/* =========================================================================
   INTERSTITIAL OVERLAY
   ========================================================================= */
.interstitial-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: modalIn 0.25s ease-out;
}

.interstitial-content {
  text-align: center;
  padding: 2rem;
}

.interstitial-label {
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.interstitial-cta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.interstitial-cta a {
  color: var(--accent-glow);
  text-decoration: underline;
}

.interstitial-close {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.interstitial-close:hover { background: var(--accent-glow); }

/* =========================================================================
   RESPONSIVE — auth and new components
   ========================================================================= */
@media (max-width: 768px) {
  .user-menu {
    gap: 0.3rem;
  }
  .user-name {
    display: none;
  }
  .auth-btn-small {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
  }
  .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .collection-detail .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-auto-rows: 100px;
  }
  .pricing-cards {
    grid-template-columns: 1fr;
  }
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  .profile-avatar {
    width: 56px;
    height: 56px;
  }
  .btn-settings {
    margin-left: 0;
  }
  .view-content {
    padding: 1.5rem 1rem;
  }
}

/* =========================================================================
   SIGN-IN PAGE
   ========================================================================= */
.signin-page {
  display: flex;
  height: calc(100vh - 80px);
  overflow: hidden;
  max-width: none;
  padding: 0;
}

.signin-preview {
  flex: 1 1 50%;
  overflow: hidden;
  position: relative;
  border-right: 1px solid var(--border);
}

.signin-tile-scroll {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 3px;
  animation: signinScroll 50s linear infinite;
}

.signin-tile-item {
  aspect-ratio: 1;
  overflow: hidden;
}

.signin-tile-item:nth-child(7n+1) {
  grid-column: span 2;
  grid-row: span 2;
}

.signin-tile-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes signinScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.signin-card {
  flex: 1 1 50%;
  padding: 3rem 2.5rem;
  max-width: 50%;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  .signin-page {
    display: block;
    height: auto;
    overflow: visible;
    padding: 0;
    max-width: none;
  }
  .signin-preview {
    height: 200px;
    max-height: 200px;
    overflow: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .signin-card {
    display: block;
    padding: 2rem 1.5rem;
  }
}

.signin-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.signin-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.signin-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.signin-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.signin-submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.signin-submit-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.signin-error {
  color: #f87171;
  font-size: 0.8rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.signin-success {
  color: #34d399;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  min-height: 1.2em;
}

.signin-features {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.signin-features h3 {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.signin-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.signin-features li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.signin-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* =========================================================================
   COOKIE NOTICE
   ========================================================================= */
#cookieNotice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 101;
  transition: bottom 0.2s;
}
#cookieNotice.player-open {
  bottom: 72px;
}
@media (max-width: 768px) {
  #cookieNotice.player-open { bottom: 132px; }
}
#cookieDismiss {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
#cookieDismiss:hover { background: var(--accent-glow); }
