/* System Font Stack used for performance and native feel */

:root {
  --bg: #0a0a0a;
  --card: #161616;
  --text: #fff;
  --dim: #a0a0a0;
  --accent: #2ecc71;
  --icon: #8d8d8d;
  --icon-hover: #ffffff;
  --icon-active: var(--accent);
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 10px;
  padding-bottom: 90px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#discography-root {
  min-height: 80vh; /* Reserve space to prevent footer shift */
  flex: 1;
}

/* Prevent background scroll when loader is active */
body.loading-active {
  overflow: hidden !important;
}

.album-nav {
  display: flex;
  background: var(--card);
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #333;
  min-height: 52px; /* Reserve space to prevent CLS shift during hydration */
}

.album-nav.has-year-column {
  flex-direction: row;
}

.year-nav-column {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 6px 12px;
  border-right: 1px solid #333;
  gap: 4px;
}

.year-link {
  color: var(--dim);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: bold;
  transition: color 0.2s;
}

.year-link:hover {
  color: var(--accent);
}

/* --- Year Group Header (discography content area) --- */
.year-group-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0 10px;
  margin-bottom: 4px;
}

.year-group-header::before {
  content: '';
  display: block;
  width: 3px;
  height: 1.4em;
  background: var(--accent);
  border-radius: 3px;
  flex-shrink: 0;
}

.year-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.year-group-link {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.year-group-link:hover {
  color: var(--accent);
}

/* --- Nav Year Groups (album-nav bar) --- */
.album-links-grouped {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 12px 0;
}

.nav-year-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}

.nav-year-albums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.nav-year-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  line-height: 1;
  padding: 0;
  margin: 0 0 2px;
  opacity: 0.7;
  transition: color 0.2s, opacity 0.2s;
}

a.nav-year-label:hover {
  color: var(--accent);
  opacity: 1;
}

/* Albums inside each year group flow in a row */
.nav-year-group .nav-item {
  flex: unset;
  min-width: 150px;
}

.album-links-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  overflow-x: auto;
  flex: 1;
}

.nav-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 130px;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
  flex: 1;
}

.nav-item:hover {
  background: #222;
  border-color: var(--accent);
}

.nav-art-mini {
  width: 35px;
  height: 35px;
  border-radius: 4px;
  flex-shrink: 0;
}

.artist-intro-blurb {
  margin: 10px 0;
  padding: 0 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--dim);
  min-height: 120px; /* Synchronized with index.html for 0.000 CLS */
  contain-intrinsic-size: auto 120px;
}

/* PayPal Tip Button Styles */
.paypal-gold {
  background-color: #ffc439 !important;
}

.paypal-gold:hover {
  background-color: #f2ba36 !important;
}

.paypal-font {
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 700;
}

.btn-shadow {
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-tip-paypal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  color: #000 !important;
  font-size: 12px;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-tip-paypal:active {
  transform: scale(0.95);
}

.album-container {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 260px) 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
  padding-top: 25px;
  border-top: 1px solid #222;
  align-items: start;
  isolation: isolate;
  overflow: hidden;
  border-radius: 12px;
  contain-intrinsic-size: auto 600px;
  scroll-margin-top: 10px;
}

.album-bg-blur {
  position: absolute;
  top: -100px;
  left: -100px;
  right: -100px;
  bottom: -100px;
  background-size: cover;
  background-position: center;
  filter: blur(25px) brightness(0.2);
  z-index: -1;
  transform: translateZ(0) scale(1.1);
  pointer-events: none;
  opacity: 0.6;
  backface-visibility: hidden;
  contain: layout size;
}

.album-art-box {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1/1;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 10px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  cursor: zoom-in;
}

.album-art-box.failed {
  font-size: 3rem;
  background: transparent !important;
}

.emoji-placeholder {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  border-radius: 3px;
  width: 28px;
  height: 28px;
  color: var(--dim);
}

.player-wrapper {
  display: none;
  margin-bottom: 15px;
  background: #1a1a1a;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #333;
  max-width: 260px;
}

.player-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-main-play {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: white;
  width: 24px;
  display: flex;
  justify-content: center;
}

.progress-slider {
  -webkit-appearance: none;
  appearance: none;
  flex-grow: 1;
  height: 4px;
  border-radius: 2px;
  background: #444;
  outline: none;
  cursor: pointer;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 100%;
}

.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.volume-container {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 4px;
  flex-shrink: 0;
}

.volume-popover {
  position: absolute;
  bottom: 35px;
  right: 0;
  transform: rotate(-90deg) translateX(40px);
  transform-origin: right;
  background: #222;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #444;
  display: none;
  width: 80px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.volume-container:hover .volume-popover {
  display: block;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #444;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 40% 100%;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background: #fff;
}

.time-text {
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.now-playing-text {
  font-size: 10px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  font-weight: bold;
  opacity: 0.9;
}

.credits-box {
  background: var(--card);
  padding: 2px;
  border-radius: 6px;
  font-size: 0.75rem;
  border: 1px solid #222;
}

.credits-box h3 {
  margin: 0 0 2px 0;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.credits-box p {
  margin: 0 0 10px 0;
  line-height: 1.4;
  color: var(--dim);
  white-space: pre-line;
}

.track-credits-area {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #444;
  color: var(--accent);
}

.album-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.track-item-wrapper {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #1a1a1a;
  contain: layout style;
}

.track-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  padding: 4px;
  font-size: 0.85rem;
  border-radius: 4px;
  gap: 8px;
  contain: layout style;
}

.track-row.has-art {
  grid-template-columns: 35px auto 1fr auto auto auto;
}

.track-row:hover {
  background: #111;
}

.track-row.active-track {
  background: rgba(46, 204, 113, 0.1);
  border-left: 3px solid var(--accent);
  padding-left: 1px;
}

.track-row.active-track .track-title {
  color: #fff;
  font-weight: 600;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.track-number {
  color: var(--dim);
  font-size: 0.75rem;
  text-align: center;
  transition: color 0.1s;
}
.active-track .track-number {
  color: var(--accent);
}
.btn-play:hover .track-number {
  color: #fff;
}

.track-thumb-box {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-thumb-box .track-thumb {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: contain; /* Set to contain to fulfill "NO CROPPING" rule */
  background-color: transparent;
  cursor: zoom-in;
}

/* Base style for standalone track-thumbs (e.g. in headers) */
.track-thumb { 
  width: 28px; 
  height: 28px; 
  object-fit: cover;
}

.track-title-cell {
  display: block;
  overflow: hidden;
}

.versions-row {
  display: flex;
  gap: 4px;
}

.btn-version {
  background: #333;
  color: #fff;
  border: none;
  font-size: 0.6rem;
  padding: 2px 5px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-version:hover {
  background: var(--accent);
  color: #000;
}

.btn-action:hover, .jump-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  opacity: 1;
}

.btn-action.active-lyric {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
  opacity: 1 !important;
  background: rgba(46, 204, 113, 0.1); /* Subtle background tint using accent color */
}
.track-duration-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.meta-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px; /* Increased from 10px for better accessibility spacing */
  white-space: nowrap;
  overflow: visible;
  min-width: 10px;
}

.jump-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px; /* Increased from 2px for touch target spacing */
  min-width: 10px;
  flex-shrink: 0;
}

.btn-play {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.1rem;
  padding: 0;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 45px;
  justify-content: center;
}

.btn-play:hover {
  opacity: 1;
  transform: scale(1.1);
}

.track-title {
  cursor: pointer;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
  display: block;
  transition: color 0.1s;
}

.track-title:hover {
  color: var(--accent);
}

.btn-action {
  background: none;
  border: 1px solid #333;
  color: #888;
  border-radius: 3px;
  cursor: pointer;
  padding: 6px 10px; /* Increased from 4px 8px for accessibility */
  font-size: 0.65rem;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
  position: relative; /* Anchor for stealth hit area */
}

.btn-action:hover {
  border-color: var(--accent);
  color: var(--icon-hover);
}

.jump-btn {
  border: none;
  background: none;
  color: var(--icon);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0 2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; /* Increased from 24px */
  height: 28px; /* Increased from 24px */
  line-height: 1;
  flex-shrink: 0;
  position: relative; /* Anchor for stealth hit area */
}

.jump-btn:hover {
  color: var(--icon-hover);
}

/* Dynamic SVG Icon inheritance */
.jump-btn svg,
.btn-action svg,
.btn-gp svg {
  stroke: currentColor;
}

.btn-play svg,
.btn-gp-play svg {
  stroke: currentColor;
}

.btn-gp.gp-active,
.btn-action.active,
.jump-btn.active,
.track-row.active-track .btn-play {
  color: var(--icon-active) !important;
}

/* Lucide Icon Base Styling */
.btn-play,
.btn-action,
.jump-btn,
.btn-gp,
.btn-gp-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-play svg {
  stroke: #fff;
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.btn-gp-play svg {
  stroke: #000;
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.jump-btn svg,
.btn-action svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.btn-gp svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

/* âœ… Accessibility: Expand hit areas for all devices (using ::after stealth area) */
.btn-action::after,
.jump-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px; /* Standard Lighthouse/Android hit area size */
  height: 48px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 10;
}

@media (max-width: 1000px) {
  .btn-action {
    padding: 4px 8px; /* Tighter box on mobile to prevent overflow */
    min-width: 32px;
    min-height: 24px;
  }

  .meta-col {
    gap: 8px;
    margin-right: 2px;
  }
}

.lyrics-container {
  background: #0f0f0f;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #1a1a1a;
  height: fit-content;
  max-height: 600px;
  overflow-y: auto;
}

.lyrics-header {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
  color: var(--accent);
}

.lyrics-text {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  color: #bbb;
  line-height: 1.4;
  white-space: pre-line;
}

.lyric-paragraph {
  margin-bottom: 12px;
}

.lyric-paragraph.indent {
  padding-left: 20px;
  border-left: 2px solid #222;
}

.inline-lyrics {
  display: none;
  padding: 5px 10px 15px 65px;
  font-size: 0.85rem;
  color: #bbb;
  line-height: 1.5;
  white-space: pre-line;
  background: transparent;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

.inline-desc {
  display: none;
  padding: 12px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #bbb;
  line-height: 1.5;
  white-space: pre-line;
  background: #111;
  border-radius: 6px;
  border: 1px solid #222;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid #333;
  margin-bottom: 10px;
  border-radius: 8px;
  flex-wrap: nowrap;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0;
}

.top-bar-left h1 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-right>button {
  opacity: 0.6;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-bar-right>button:hover {
  opacity: 1;
}

.top-bar-right>button svg {
  width: 20px;
  height: 20px;
}

.social-icons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.social-icons a {
  opacity: 0.6;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  color: #fff !important;
}

.social-icons a:hover {
  opacity: 1;
  transform: scale(1.1);
}

.social-icons a i,
.social-icons a svg {
  stroke: currentColor;
}

/* Only SoundCloud and Threads use fill, and they have it inline in icons.js, so we stay neutral here */
.top-bar-right form {
  margin: 0;
  display: flex;
  align-items: center;
}

/* Search Bar */
.search-container {
  display: flex;
  align-items: center;
  background: #222;
  border-radius: 20px;
  padding: 2px 12px;
  border: 1px solid #333;
  transition: all 0.3s ease;
  position: relative;
}

.search-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.search-input {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  padding: 4px 8px;
  width: 140px;
  outline: none;
}

.search-input::placeholder {
  color: #666;
}

.btn-search-mobile {
  display: none !important;
}

.search-clear {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  margin-left: 4px;
  border-radius: 50%;
  transition: all 0.2s;
  visibility: hidden;
  opacity: 0;
}

.search-clear.visible {
  visibility: visible;
  opacity: 1;
}

.search-clear:hover {
  color: #fff;
  background: #333;
}

.search-highlight {
  background: var(--accent);
  color: #000;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: bold;
}

.lyric-date {
  font-size: 0.72rem;
  color: #888;
  font-weight: normal;
  margin-left: auto;
  padding-left: 10px;
  opacity: 0.8;
}


/* Help Button */
.btn-help {
  opacity: 0.8;
  transition: all 0.2s;
}

.btn-help:hover {
  opacity: 1;
  color: var(--accent);
}

/* Help Modal */
.help-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.help-content {
  background: #1a1a1a;
  padding: 30px;
  border-radius: 12px;
  border: 1px solid #333;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.help-close {
  position: absolute;
  top: 15px;
  right: 20px;
  cursor: pointer;
  color: #666;
  font-size: 1.5rem;
  transition: color 0.2s;
}

.help-close:hover {
  color: #fff;
}

.help-content h2 {
  margin-top: 0;
  color: var(--accent);
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.help-section {
  margin-bottom: 20px;
}

.help-section h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 20px;
}

.shortcut-key {
  background: #333;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #fff;
  border-bottom: 2px solid #000;
  display: inline-block;
  min-width: 20px;
  text-align: center;
}

.shortcut-desc {
  font-size: 0.85rem;
  color: #ccc;
  display: flex;
  align-items: center;
}


@media (max-width: 1000px) {
  :root {
    --bg: #000; /* OLED True Black for Mobile */
  }
  .album-container {
    grid-template-columns: 1fr;
  }

  .col-3 {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .top-bar {
    padding: 4px 8px;
    gap: 6px;
  }

  .top-bar-left h1 {
    font-size: 0.95rem;
  }

  .social-icons {
    gap: 6px;
  }

  .social-icons img {
    width: 16px;
    height: 16px;
  }

  .top-bar-right form input[type='image'] {
    height: 18px;
  }

  .top-bar-right {
    gap: 6px;
  }

  .nav-item {
    min-width: 100px;
  }

  .nav-art-mini {
    width: 26px;
    height: 26px;
  }

  .nav-info h4 {
    font-size: 0.65rem !important;
  }

  .nav-info p {
    font-size: 0.55rem !important;
  }

  .btn-help,
  .hide-mobile,
  .gp-album {
    display: none !important;
  }

  .show-mobile {
    display: inline !important;
  }
}

/* Marquee for Overflowing Titles */
.marquee {
  display: inline-block;
  white-space: nowrap;
  animation: marquee-scroll linear infinite;
  padding-left: 0;
  will-change: transform;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  10% { transform: translateX(0); }
  90% { transform: translateX(var(--scroll-dist, -100%)); }
  100% { transform: translateX(var(--scroll-dist, -100%)); }
}



.show-mobile {
  display: none;
}


/* Lightbox Style */
.lightbox {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: calc(100% - 80px);
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox-content {
  max-width: 95vw;
  max-height: calc(95vh - 80px);
  object-fit: contain;
  box-shadow: 0 0 30px rgba(0, 0, 0, 1);
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  z-index: 2001;
}

.lightbox-close:hover {
  color: var(--accent);
}

@keyframes randomDrift {
  0% {
    background-position: 50% 50%;
  }

  12% {
    background-position: 80% 20%;
  }

  25% {
    background-position: 10% 90%;
  }

  37% {
    background-position: 90% 80%;
  }

  50% {
    background-position: 20% 10%;
  }

  62% {
    background-position: 80% 80%;
  }

  75% {
    background-position: 10% 40%;
  }

  87% {
    background-position: 90% 10%;
  }

  100% {
    background-position: 50% 50%;
  }
}

/* Global Bottom Player Host Isolation */
.global-player {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 85px;
  z-index: 2000;
  overflow: visible;
  padding: 0 !important;
  margin: 0 !important;
}

@media (max-width: 1220px) {
  .lightbox {
    height: calc(100% - 85px);
    background: #000 !important; /* OLED True Black for Mobile */
  }

  .lightbox-content {
    max-height: calc(95vh - 85px);
  }

  body {
    padding: 4px 2px;
    padding-bottom: 90px;
  }

  .album-nav {
    padding: 4px;
    gap: 5px;
    margin-bottom: 10px;
  }

  .nav-item {
    min-width: 130px;
    padding: 3px;
    font-size: 0.75rem;
  }

  .top-bar {
    padding: 6px;
    margin-bottom: 6px;
    gap: 4px;
  }

  .top-bar-left h1 {
    font-size: 1.1rem;
  }

  .top-bar-right,
  .social-icons {
    gap: 6px;
  }

  .album-container {
    padding: 8px 3px;
    margin-bottom: 20px;
    gap: 6px;
    border-radius: 6px;
    scroll-margin-top: 10px;
  }

  /* Tighten track rows significantly - ONLY if lyrics are enabled */
  body:not(.no-lyrics-mode) .track-row {
    padding: 6px 0;
    /* Columns: Play, Dur, Spacer, Meta, Jump */
    grid-template-columns: auto auto 1fr auto auto; 
    display: grid;
    font-size: 0.75rem;
    gap: 4px 10px;
    grid-template-areas: none; /* Disabling areas to prevent auto-move bugs */
  }

  /* Explicit Grid Placement for 100% Stability */
  /* Unified Number + Play Button Area */
  .btn-play { 
    grid-column: 1; 
    grid-row: 1 / span 2; 
    align-self: start; 
    padding-top: 8px; 
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 32px;
  }
  .track-number { 
    font-size: 0.65rem; 
    height: 1.2rem; /* Match Title Line height */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .track-title-cell { grid-column: 2 / -1; grid-row: 1; padding-top: 8px; } /* SPAN FULL ROW 1 */
  .track-duration-cell { grid-column: 2; grid-row: 2; font-size: 0.65rem; color: var(--dim); padding-top: 2px; }
  .meta-col { grid-column: 4; grid-row: 2; display: flex !important; justify-content: flex-end !important; align-items: center; gap: 8px; }
  .jump-col { grid-column: 5; grid-row: 2; display: flex !important; justify-content: flex-end !important; align-items: center; gap: 8px; }

  body:not(.no-lyrics-mode) .track-row.has-art {
    /* Columns: Thumb, Play, Dur, Spacer, Meta, Jump */
    grid-template-columns: auto auto auto 1fr auto auto;
  }
  body:not(.no-lyrics-mode) .track-row.has-art .track-thumb-box { 
    grid-column: 1; 
    grid-row: 1 / span 2; 
    align-self: start; 
    margin-top: 8px; /* Switched from padding to margin to preserve 1:1 aspect ratio */
    width: 42px;
    height: 42px;
    aspect-ratio: 1 / 1;
  }
  body:not(.no-lyrics-mode) .track-row.has-art .btn-play { grid-column: 2; }
  body:not(.no-lyrics-mode) .track-row.has-art .track-title-cell { grid-column: 3 / -1; } /* SPAN FULL ROW 1 */
  body:not(.no-lyrics-mode) .track-row.has-art .track-duration-cell { grid-column: 3; }
  body:not(.no-lyrics-mode) .track-row.has-art .meta-col { grid-column: 5; }
  body:not(.no-lyrics-mode) .track-row.has-art .jump-col { grid-column: 6; }

  .track-title-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    justify-content: center;
    overflow: hidden;
  }

  .track-title {
    white-space: normal;
    line-height: 1.2;
    padding-right: 4px;
  }

  .track-number {
    font-size: 0.65rem;
    width: auto;
  }

  .btn-play {
    font-size: 1.1rem;
    width: 24px;
  }

  .inline-lyrics {
    padding: 8px 8px 15px 30px;
    font-size: 0.8rem;
  }

  .meta-col {
    min-width: unset; /* Allow it to shrink to contents */
    gap: 6px; /* Tight minimal gap */
    flex-direction: row;
    justify-content: flex-end;
  }

  .jump-col {
    min-width: unset;
    gap: 4px; /* Minimal gap for jump buttons */
    justify-content: flex-end;
  }

  .btn-action {
    padding: 4px 8px;
    font-size: 0.65rem;
  }

  /* Hide unused or non-essential parts */
  .btn-help,
  .hide-mobile,
  a.jump-btn[target="_blank"]:not(#gp-newtab),
  .credits-box {
    display: none !important;
  }

  .show-mobile {
    display: inline !important;
  }

  .album-meta-under-art {
    font-size: 0.75rem;
    padding-bottom: 4px;
  }

  /* Mobile Search Adjustments */
  .search-container {
    position: absolute;
    top: 100%;
    left: 10px;
    right: 10px;
    background: #000; /* OLED True Black */
    margin-top: 5px;
    z-index: 100;
    display: none;
  }

  .search-container.active {
    display: flex;
  }

  .btn-search-mobile {
    display: flex !important;
  }

  .search-input {
    width: 100%;
  }
}

/* Page Loader: Optimized into index.html for FOUC/LCP. 
   See index.html <style> block for critical loader geometry. */
@keyframes loader-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Custom Tooltip */
.custom-tooltip {
  position: fixed;
  z-index: 10000;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  transform: translate(-50%, 10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.custom-tooltip.visible {
  opacity: 1;
}

/* Cinematic Transition & Multi-Art Support */
.gp-art-container {
  width: 42px;
  height: 42px;
  min-width: 42px;
  background-size: cover;
  background-position: center;
  border-radius: 0;
  overflow: hidden;
  margin-right: 12px;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: none;
}

.gp-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: border-radius 0.3s, opacity 0.5s ease-in-out;
  opacity: 0;
  pointer-events: none;
  border: none;
}

.gp-art.active {
  opacity: 1;
  z-index: 11;
}

.overlay-art {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.02);
  object-fit: contain;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  z-index: 10;
}

.overlay-art.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  z-index: 11;
}

/* UR Area overrides to ensure custom transparent logos work */
.track-row.ur-track .track-thumb {
  background: transparent !important;
  border: none !important;
}

/* Waterfall Site Logo Phase */
.wfall-site-logo {
  opacity: 0;
  transition: opacity 0.2s ease;
  max-width: 160px;
  max-height: 38px;
  min-height: 38px; /* Reserve height to prevent header jump */
}

/* Global Lyrics Toggle */
.no-lyrics-artist #toggle-lyrics,
.no-lyrics-artist #overlay-lyrics-panel {
  display: none !important;
}

.no-lyrics-artist #fullscreen-overlay:has(#overlay-lyrics-panel) .overlay-art-panel {
  /* Fullscreen is flex, so without lyrics panel, art panel will occupy remaining space automatically */
}

@media (min-width: 1001px) {
  .no-lyrics-artist .overlay-art {
    max-width: min(90%, 850px) !important;
  }
}
/* Site Footer Stabilization */
#site-footer {
  opacity: 0;
  transition: opacity 1s ease-in;
}

#site-footer.visible {
  opacity: 1;
}
/* OLED True Black Package (Mobile Optimization) */
@media (max-width: 1000px) {
  :root {
    --bg: #000;
  }
  .page-loader {
    background: #000;
  }
  .lightbox {
    background: #000;
  }
  /* Ensure the mobile search overlay is also pitch black */
  .search-container {
    background: #000 !important;
  }
}

.track-play-col { display: flex; flex-direction: row-reverse; align-items: center; gap: 8px; justify-content: flex-end; min-width: 44px; cursor: pointer; }
