@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:wght@500;600;700&display=swap');

:root {
  --primary: #1d3557;
  --primary-soft: #30527a;
  --accent: #b07d62;
  --accent-soft: #d2aa8a;
  --canvas: #f7f5f1;
  --surface: #ffffff;
  --surface-muted: #f2efe9;
  --ink: #1f2933;
  --ink-soft: #3d4a58;
  --muted: #677487;
  --border: rgba(27, 46, 81, 0.12);
  --border-strong: rgba(27, 46, 81, 0.24);
  --shadow-sm: 0 8px 24px rgba(29, 53, 87, 0.08);
  --shadow-md: 0 18px 42px rgba(29, 53, 87, 0.12);
  --shadow-lg: 0 32px 80px rgba(16, 24, 40, 0.18);
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --player-surface: #ffffff;
  --player-border: rgba(27, 46, 81, 0.14);
  --player-accent: #1d3557;
  color-scheme: light;
}

[data-theme='dark'] {
  --primary: #91baff;
  --primary-soft: #6e97db;
  --accent: #d8a77a;
  --accent-soft: #f0caa3;
  --canvas: #0f172a;
  --surface: #131c31;
  --surface-muted: #172338;
  --ink: #e5edf7;
  --ink-soft: #cdd6e5;
  --muted: #97a7c3;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --shadow-sm: 0 8px 24px rgba(9, 13, 23, 0.35);
  --shadow-md: 0 18px 42px rgba(8, 12, 21, 0.45);
  --shadow-lg: 0 32px 80px rgba(5, 8, 16, 0.55);
  --player-surface: #172338;
  --player-border: rgba(148, 163, 184, 0.18);
  --player-accent: #91baff;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Source Serif 4', 'Merriweather', serif;
  color: var(--ink);
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-soft);
}

img {
  max-width: 100%;
  display: block;
}

button, select, input {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
}

button {
  cursor: pointer;
}


.hero {
  position: relative;
  padding: 4.5rem 1.5rem 3.25rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.95) 0%, rgba(244,240,233,0.85) 35%, rgba(231,224,212,0.82) 100%);
  overflow: hidden;
}

.hero .hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero .decor {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(0);
  opacity: 0.28;
}

.hero .decor--ring {
  width: 220px;
  height: 220px;
  border: 40px solid rgba(29, 53, 87, 0.12);
  top: -40px;
  right: -60px;
}

.hero .decor--grid {
  width: 320px;
  height: 320px;
  background: url('data:image/svg+xml,%3Csvg width="280" height="280" viewBox="0 0 280 280" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cdefs%3E%3Cpattern id="d" x="0" y="0" width="28" height="28" patternUnits="userSpaceOnUse"%3E%3Crect width="1" height="28" fill="rgba(27,46,81,0.08)"/%3E%3Crect width="28" height="1" fill="rgba(27,46,81,0.08)"/%3E%3C/pattern%3E%3C/defs%3E%3Crect width="280" height="280" fill="url(%23d)"/%3E%3C/svg%3E');
  bottom: -140px;
  left: -80px;
  border-radius: 32px;
}

.hero .decor--pill {
  width: 180px;
  height: 48px;
  background: linear-gradient(135deg, rgba(176, 125, 98, 0.18), rgba(176, 125, 98, 0.28));
  bottom: 60px;
  right: 14%;
  transform: rotate(-12deg);
}

[data-theme='dark'] .hero {
  background: linear-gradient(160deg, rgba(19,28,49,0.92) 0%, rgba(15,25,44,0.95) 40%, rgba(12,20,36,0.98) 100%);
}

[data-theme='dark'] .hero .decor {
  opacity: 0.20;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 15%, rgba(189, 213, 239, 0.25) 0, transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(208, 184, 168, 0.22) 0, transparent 40%),
    url('data:image/svg+xml,%3Csvg width="404" height="404" viewBox="0 0 404 404" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cdefs%3E%3Cpattern id="grid" x="0" y="0" width="24" height="24" patternUnits="userSpaceOnUse"%3E%3Crect x="0" y="0" width="1" height="24" fill="rgba(29,53,87,0.08)"/%3E%3Crect x="0" y="0" width="24" height="1" fill="rgba(29,53,87,0.08)"/%3E%3C/pattern%3E%3C/defs%3E%3Crect width="404" height="404" fill="url(%23grid)"/%3E%3C/svg%3E');
  opacity: 0.35;
  pointer-events: none;
}

[data-theme='dark'] .hero::after {
  opacity: 0.18;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 2.8rem;
  align-items: stretch;
}

.hero-copy {
  display: grid;
  gap: 1.2rem;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 3vw + 1rem, 3.8rem);
  letter-spacing: -0.015em;
}

.tagline {
  font-size: 1.05rem;
  max-width: 520px;
  color: var(--muted);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

[data-theme='dark'] .hero-tags span {
  background: rgba(19, 28, 49, 0.72);
}

.hero-tags span .iconify {
  font-size: 1rem;
  color: var(--primary);
}

[data-theme='dark'] .hero-tags span {
  background: rgba(19, 28, 49, 0.72);
}

.search-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
}

.input-column {
  display: grid;
  gap: 0.5rem;
}

.field-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-input-wrapper {
  position: relative;
}

#search-input {
  width: 100%;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink);
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

#search-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(29, 53, 87, 0.20);
  background: var(--surface);
}

#search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.8rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #fefefe;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 16px 36px rgba(29, 53, 87, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

#search-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 56px rgba(29, 53, 87, 0.24);
}

#search-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(29, 53, 87, 0.18);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.control-field {
  display: grid;
  gap: 0.6rem;
}

select {
  appearance: none;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink);
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
  background-image: url('data:image/svg+xml,%3Csvg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M4 6l4 4 4-4" stroke="%23677487" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: calc(100% - 1.1rem) center;
}

select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(29, 53, 87, 0.20);
  background: var(--surface);
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.segmented button {
  border: none;
  padding: 0.7rem 1rem;
  border-radius: calc(var(--radius-md) - 6px);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.segmented button:hover {
  color: var(--ink);
  background: rgba(29, 53, 87, 0.08);
}

.segmented button.active {
  background: linear-gradient(135deg, rgba(29,53,87,0.16), rgba(29,53,87,0.24));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.control-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.control-actions button {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 0.75rem 1.1rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: border 160ms ease, background 160ms ease, color 160ms ease;
}

.control-actions button:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

#theme-toggle {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.4rem;
}

.grid {
  display: grid;
  gap: 1.75rem;
  padding: 3.5rem min(7vw, 90px) 4.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.cover {
  position: relative;
  width: 100%;
  padding-top: 146%;
  background: var(--surface-muted);
}

.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card h3 {
  font-size: 1.05rem;
  padding: 1.2rem 1.2rem 0.4rem;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card p {
  padding: 0 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.card .buttons {
  display: flex;
  gap: 0.65rem;
  padding: 1.1rem 1.2rem 1.25rem;
  margin-top: auto;
}

.card .buttons a,
.card .buttons button {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: border 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.card .buttons .iconify {
  font-size: 1.05rem;
  color: var(--primary);
}

.card .buttons a:hover,
.card .buttons button:hover {
  background: linear-gradient(135deg, rgba(29, 53, 87, 0.12), rgba(29, 53, 87, 0.16));
  border-color: var(--border-strong);
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: rgba(176, 125, 98, 0.16);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.loader {
  width: 64px;
  height: 64px;
  margin: 3rem auto;
  border-radius: 50%;
  border: 6px solid rgba(29, 53, 87, 0.16);
  border-top: 6px solid var(--primary);
  animation: spin 1s linear infinite;
}

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

.stats {
  margin-top: 1.4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.32);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.4rem 1.5rem;
  z-index: 1000;
}

.modal-content {
  position: relative;
  width: min(960px, 92vw);
  height: min(92vh, 720px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.close-btn {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border 160ms ease, background 160ms ease;
}

.close-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.pdf-container {
  flex: 1;
  padding: 2rem;
  overflow: auto;
  background: var(--surface-muted);
}

.detail {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  align-items: start;
}

.detail-cover img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.detail-info {
  display: grid;
  gap: 1rem;
}

.detail-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
}

.detail-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.detail-subjects .chip {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(29, 53, 87, 0.08);
  border: 1px solid rgba(29, 53, 87, 0.16);
  font-size: 0.78rem;
  color: var(--muted);
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.detail-links a {
  font-weight: 600;
  text-decoration: none;
}

.detail-links a:hover {
  text-decoration: underline;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.detail-actions button {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(29,53,87,0.12), rgba(29,53,87,0.18));
  color: var(--ink);
  font-weight: 600;
  transition: transform 140ms ease, box-shadow 140ms ease, background 180ms ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.detail-actions button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.detail-actions .iconify {
  font-size: 1.1rem;
  color: var(--primary);
}

.similar-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.mini-card {
  text-align: center;
  display: grid;
  gap: 0.5rem;
}

.mini-card img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.mini-card p {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 0.4rem;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  z-index: 20;
}

.suggestions li {
  padding: 0.75rem 0.9rem;
  border-radius: calc(var(--radius-md) - 6px);
  font-size: 0.92rem;
  color: var(--ink);
  transition: background 120ms ease;
}

.suggestions li:hover {
  background: rgba(29, 53, 87, 0.08);
}

.hidden {
  display: none !important;
}

.stats strong {
  color: var(--primary);
}

.pagination {
  display: none !important;
}


.audio-player {
  display: grid;
  gap: 1.5rem;
  background: var(--player-surface);
  border: 1px solid var(--player-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-lg);
  max-width: 100%;
  transition: box-shadow 200ms ease;
}

.player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2rem);
  align-items: start;
}

.now {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 0;
  padding: 1rem;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--player-border);
}

.now-cover {
  width: clamp(80px, 12vw, 100px);
  height: clamp(80px, 12vw, 100px);
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--player-border);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.now-meta {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
}

.now-title {
  font-weight: 600;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-artist {
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctrl {
  display: grid;
  gap: 1.2rem;
  padding: 1rem;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--player-border);
}

.ctrl-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1vw, 0.8rem);
  flex-wrap: wrap;
}

.ctrl-buttons button {
  border-radius: 999px;
  border: 1px solid var(--player-border);
  background: var(--surface);
  color: var(--ink);
  width: clamp(42px, 7vw, 48px);
  height: clamp(42px, 7vw, 48px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.ctrl-buttons button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(29, 53, 87, 0.15);
}

.ctrl-buttons .play-btn {
  width: clamp(56px, 10vw, 64px);
  height: clamp(56px, 10vw, 64px);
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #ffffff;
  border: none;
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  box-shadow: 0 16px 32px rgba(29, 53, 87, 0.3);
}

.ctrl-buttons .play-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 16px 36px rgba(29, 53, 87, 0.3);
}

.timebar {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1vw, 0.8rem);
}

.timebar time {
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.8rem, 1.2vw, 0.9rem);
  color: var(--muted);
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}

.seek {
  flex: 1;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 160ms ease;
}

.seek:hover {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(29, 53, 87, 0.1);
}

.seek::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(176, 125, 98, 0.4);
  transition: all 160ms ease;
}

.seek::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 6px 16px rgba(176, 125, 98, 0.5);
}

.seek::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(176, 125, 98, 0.4);
  transition: all 160ms ease;
}

.seek::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 6px 16px rgba(176, 125, 98, 0.5);
}

.extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.8rem, 1.5vw, 1.2rem);
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--player-border);
}

.extra .rate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  color: var(--muted);
  font-weight: 500;
}

.extra select {
  min-width: clamp(80px, 12vw, 100px);
  padding: 0.6rem 0.8rem;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
}

.extra button {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 0.6rem 0.8rem;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  transition: all 160ms ease;
}

.extra button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.volume {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.volume input[type='range'] {
  width: clamp(80px, 15vw, 120px);
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.volume input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(176, 125, 98, 0.3);
}

.volume input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(176, 125, 98, 0.3);
}

.tracklist-wrapper {
  margin-top: 1rem;
}

.tracklist-title {
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-size: 1rem;
}

.tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--player-border);
  max-height: clamp(300px, 45vh, 500px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface-muted);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tracklist li {
  padding: 0;
  border-bottom: 1px solid var(--border);
  transition: all 180ms ease;
  background: var(--surface);
}

.tracklist li:last-child {
  border-bottom: none;
}

.tracklist li:hover {
  background: var(--surface-muted);
}

.tracklist li.active {
  background: linear-gradient(90deg, rgba(176, 125, 98, 0.18), rgba(176, 125, 98, 0.08));
  border-left: 4px solid var(--accent);
  box-shadow: inset 0 0 12px rgba(176, 125, 98, 0.15);
}

.tracklist .play-track {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(0.8rem, 2.5vw, 1.2rem);
  padding: clamp(0.9rem, 2vw, 1.2rem);
  text-align: left;
  background: transparent;
  border: none;
  font-size: clamp(0.92rem, 1.3vw, 0.98rem);
  color: var(--ink-soft);
  transition: all 180ms ease;
  cursor: pointer;
}

.tracklist .play-track:hover {
  color: var(--ink);
}

.tracklist li.active .play-track {
  color: var(--ink);
  font-weight: 600;
}

.track-index {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
  min-width: clamp(2.2rem, 3.5vw, 2.8rem);
  font-size: clamp(0.9rem, 1.2vw, 1rem);
}

.track-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-duration {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: clamp(0.8rem, 1.1vw, 0.85rem);
}

audio {
  width: 100%;
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ═══════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════ */

@media (max-width: 1024px) {
  .controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .extra {
    justify-content: space-between;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .audio-player {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: 3.5rem;
  }

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

  #search-submit {
    width: 100%;
  }

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

  .control-actions {
    justify-content: flex-start;
  }

  .grid {
    padding-inline: 1.5rem;
    grid-template-columns: 1fr;
  }

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

  .modal-content {
    width: 95vw;
    max-height: 90vh;
    padding: 1.5rem;
  }

  .player-row {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .now {
    padding: 1rem;
  }

  .now-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    max-width: 240px;
  }

  .ctrl-buttons {
    gap: 0.6rem;
    justify-content: center;
  }

  .extra {
    padding: 1rem;
    gap: 1rem;
  }

  .extra .rate,
  .volume {
    width: 100%;
    justify-content: space-between;
  }

  .volume input[type='range'] {
    flex: 1;
    max-width: none;
  }

  .extra select {
    width: 100%;
  }

  .tracklist {
    max-height: 300px;
  }

  .audio-player {
    padding: 1.2rem;
    gap: 1.2rem;
  }
}

@media (max-width: 480px) {
  :root {
    --radius-lg: 20px;
    --radius-md: 12px;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .search-card {
    padding: 1.2rem;
  }

  .grid {
    gap: 1.2rem;
    padding: 2rem 1rem;
  }

  .card {
    padding: 1rem;
  }

  .audio-player {
    gap: 1rem;
    padding: 1rem;
  }

  .now {
    padding: 0.8rem;
  }

  .now-cover {
    max-width: 180px;
  }

  .ctrl {
    padding: 0.8rem;
  }

  .ctrl-buttons button {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .ctrl-buttons .play-btn {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
  }

  .timebar time {
    min-width: 38px;
    font-size: 0.8rem;
  }

  .extra {
    padding: 0.8rem;
  }

  .tracklist .play-track {
    gap: 0.6rem;
    padding: 0.8rem;
  }

  .track-index {
    min-width: 1.8rem;
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
