:root {
  color-scheme: dark light;
  --bg: #0a0a0a;
  --bg-alt: #141414;
  --card: #1a1a1a;
  --card-hover: #252525;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f5f5;
  --text-muted: rgba(245, 245, 245, 0.6);
  --accent: #1db954;
  --accent-hover: #1ed760;
  --danger: #ff4d6d;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 90px;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  height: 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.logo-dot {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #000;
}

.logo-dot::after {
  content: "G";
  font-size: 18px;
}

.app-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.app-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.app-shell {
  padding: 0.75rem;
  display: grid;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.view {
  background: transparent;
  padding: 0;
}

.view--hidden {
  display: none;
}

.view__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.25rem;
  background: var(--bg);
  position: sticky;
  top: 50px;
  z-index: 5;
  border-bottom: 1px solid var(--border);
}

.view__header--compact {
  align-items: flex-start;
}

.view__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.view__actions {
  display: flex;
  gap: 0.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 600;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 150px;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.5rem 0.875rem;
  background: var(--card);
  font-size: 0.875rem;
}

.search-box input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .albums-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .albums-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .albums-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 1025px) {
  .albums-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
  }
}

.search-results {
  margin-top: 1rem;
}

.search-results__label {
  margin-bottom: 0.5rem;
}

.search-results .track-row__album {
  margin: 0.125rem 0 0;
  color: var(--accent);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card {
  background: var(--card);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.album-card:focus-visible,
.album-card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  outline: none;
}

.album-card__artwork {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #1aa34a);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

.album-card__artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.album-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
}

.album-card__title {
  margin: 0;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center;
  word-break: break-word;
}

.album-card__meta {
  display: none;
}

.album-card__chevron {
  display: none;
}

.tracks-list {
  display: flex;
  flex-direction: column;
}

.lyrics-panel {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.lyrics-panel__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.lyrics-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.lyrics-panel__body {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.track-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 4px;
}

.track-row:focus-visible,
.track-row:hover {
  background: var(--card);
  outline: none;
}

.track-row--active {
  background: rgba(29, 185, 84, 0.1);
  border-left: 3px solid var(--accent);
  padding-left: calc(0.5rem - 3px);
}

.track-row--active .track-row__title {
  color: var(--accent);
  font-weight: 600;
}

.track-row__info {
  flex: 1;
  min-width: 0;
}

.track-row__title {
  margin: 0;
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row__meta {
  margin: 0.125rem 0 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row__duration {
  min-width: 3rem;
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.813rem;
}

.track-row__lyrics {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.track-row__lyrics:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.track-row__fav {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.track-row__fav:hover {
  color: #ffd700;
}

.track-row__fav--active {
  color: #ffd700;
}

.track-row__fav--active .fav-icon-outline {
  display: none;
}

.track-row__fav--active .fav-icon-filled {
  display: inline-block !important;
}

.track-row__fav--active:hover {
  color: var(--text-muted);
}

.lyrics-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 300;
}

.lyrics-modal[hidden] {
  display: none;
}

.lyrics-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.lyrics-modal__content {
  position: relative;
  z-index: 1;
  width: min(600px, 90vw);
  max-height: 70vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lyrics-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.lyrics-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.lyrics-modal__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.lyrics-modal__close:hover {
  color: var(--text);
}

.lyrics-modal__body {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
  overflow: auto;
}

.lyrics-modal__footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.player-shell {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.player {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player__meta {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  width: 100%;
}

.player__title {
  margin: 0;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.player__album {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.player__progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.player__progress span {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.75rem;
  min-width: 35px;
}

.player__progress span:first-child {
  text-align: right;
}

.player__progress span:last-child {
  text-align: left;
}

.player__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.player__controls .control-button {
  border: 2px solid var(--accent);
}

.player__controls .control-button:hover {
  background: var(--accent);
  color: #000;
  transform: scale(1.05);
}

.volume-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.volume-slider-popup {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.volume-slider-popup[hidden] {
  display: none;
}

.volume-slider-popup::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--card);
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}

.volume-slider-input {
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  width: 20px;
  height: 100px;
  background: transparent;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  writing-mode: bt-lr;
  -webkit-writing-mode: bt-lr;
}

.volume-slider-input::-webkit-slider-runnable-track {
  width: 4px;
  height: 100px;
  border-radius: 2px;
  background: linear-gradient(to top, 
    var(--accent) 0%, 
    var(--accent) var(--progress, 0%), 
    rgba(255, 255, 255, 0.1) var(--progress, 0%), 
    rgba(255, 255, 255, 0.1) 100%
  );
  margin: 0 auto;
}

.volume-slider-input::-moz-range-track {
  width: 4px;
  height: 100px;
  border-radius: 2px;
  background: linear-gradient(to top, 
    var(--accent) 0%, 
    var(--accent) var(--progress, 0%), 
    rgba(255, 255, 255, 0.1) var(--progress, 0%), 
    rgba(255, 255, 255, 0.1) 100%
  );
}

.volume-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  margin-left: -5px;
}

.volume-slider-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.volume-slider-input:hover::-webkit-slider-thumb {
  background: var(--accent-hover);
  transform: scale(1.2);
}

.volume-slider-input:hover::-moz-range-thumb {
  background: var(--accent-hover);
  transform: scale(1.2);
}

.control-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 20px;
  padding: 0;
}

.control-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

.control-button:active {
  transform: scale(0.95);
}

.control-button--play {
  width: 48px;
  height: 48px;
  border-width: 2px;
  font-size: 22px;
  background: var(--accent);
  color: #000;
}

.control-button--play:hover {
  background: var(--accent-hover);
  color: #000;
  transform: scale(1.1);
}

.control-button--play:active {
  transform: scale(0.98);
}

.control-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--text-muted);
}

.control-button:disabled:hover {
  background: transparent;
  color: var(--text);
  transform: none;
}

.ghost-button {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.375rem 0.875rem;
  background: transparent;
  color: var(--text);
  font-size: 0.813rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ghost-button:hover {
  background: var(--card-hover);
  border-color: var(--text-muted);
}

.ghost-button--primary {
  border-color: var(--accent);
  color: var(--accent);
}

.ghost-button--primary:hover {
  background: var(--accent);
  color: #000;
}

.ghost-button--danger {
  border-color: var(--danger);
  color: var(--danger);
}

.ghost-button--danger:hover {
  background: var(--danger);
  color: #fff;
}

.ghost-button svg {
  flex-shrink: 0;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.ghost-button.loading svg {
  animation: spin 1s linear infinite;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.slider:hover::-webkit-slider-thumb {
  background: var(--accent-hover);
  transform: scale(1.2);
}

.slider:hover::-moz-range-thumb {
  background: var(--accent-hover);
  transform: scale(1.2);
}

.slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, 
    var(--accent) 0%, 
    var(--accent) var(--progress, 0%), 
    rgba(255, 255, 255, 0.1) var(--progress, 0%), 
    rgba(255, 255, 255, 0.1) 100%
  );
}

.slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  margin: 0;
  font-size: 0.875rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.875rem;
  z-index: 200;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
  
  .player-shell {
    position: sticky;
  }
}

.settings-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 300;
}

.settings-modal[hidden] {
  display: none;
}

.settings-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.settings-modal__content {
  position: relative;
  z-index: 1;
  width: min(480px, 90vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.settings-modal__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.settings-modal__close:hover {
  color: var(--text);
}

.settings-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-info {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.settings-info__title {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.settings-info__text {
  margin: 0 0 0.5rem;
  font-size: 0.813rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-info__list {
  margin: 0 0 0.5rem;
  padding-left: 1.25rem;
  font-size: 0.813rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.settings-info__list li {
  margin-bottom: 0.25rem;
}

.settings-info__list strong {
  color: var(--text);
}

.settings-info__note {
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  background: rgba(255, 77, 109, 0.1);
  border-left: 3px solid var(--danger);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.4;
}

.settings-info__note strong {
  color: var(--danger);
}

.settings-info__help {
  margin: 0.75rem 0 0;
  font-size: 0.813rem;
  color: var(--text-muted);
}

.settings-info__help a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.settings-info__help a:hover {
  border-bottom-color: var(--accent);
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.settings-field__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-field__input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  font-size: 0.875rem;
}

.settings-field__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.settings-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .app-shell {
    padding-bottom: 8rem;
  }

  .player-shell {
    position: fixed;
    left: 0;
    right: 0;
  }
}
