:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at 20% 20%, #1b2350 0, #0b1028 40%, #050817 100%);
  color: #e8f1ff;
}
a { color: #7ce7b7; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.chrome { min-height: 100vh; display: flex; flex-direction: column; }
.header {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  align-items: center;
  padding: 0.8rem 1rem;
  background: linear-gradient(90deg, #0d1536, #151e4a);
  border-bottom: 2px solid #233269;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.brand { display: flex; gap: 0.6rem; align-items: center; }
.logo {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f5c542, #f28a2b);
  color: #1a0f05;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
.brand-title { font-weight: 800; letter-spacing: 1px; }
.brand-sub { color: #9fb2df; font-size: 0.9rem; }
.mode-buttons { display: flex; gap: 0.5rem; justify-content: center; }
.credits { display: flex; align-items: center; gap: 0.6rem; justify-content: flex-end; }
.credit-label { color: #9fb2df; font-size: 0.9rem; }
.credit-value { font-weight: 800; font-size: 1.3rem; }

.pill {
  border-radius: 999px;
  padding: 0.5rem 1rem;
  border: 1px solid #2a3d78;
  background: #111a3f;
  color: #e8f1ff;
}
.pill.accent { background: #28c177; border-color: #28c177; color: #04130c; font-weight: 800; }
.pill.ghost { background: transparent; }
.pill.active { background: #233269; border-color: #2e4286; }

.now-playing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
}
.np-info {
  background: #0f193d;
  border: 1px solid #1f2f6a;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.np-line { font-weight: 700; }
.controls { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn {
  background: #1c2d64;
  border: 1px solid #29417f;
  color: #e8f1ff;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-weight: 700;
}
.btn.accent { background: linear-gradient(135deg, #4ae2a1, #1b9c6d); border: none; color: #04130c; }
.btn.ghost { background: #111a3f; border-color: #2a3d78; }

.player-shell {
  background: #0f193d;
  border: 1px solid #1f2f6a;
  border-radius: 12px;
  padding: 0.8rem;
  position: relative;
}
#player-container { position: relative; width: 100%; aspect-ratio: 16 / 9; }
#yt-player { position: absolute; inset: 0; }
#yt-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0b1129;
  border-radius: 10px;
  border: 1px dashed #2a3d78;
  color: #9fb2df;
}

.main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  padding: 0 1rem 1.5rem 1rem;
}
.catalog, .queue-panel {
  background: #0f193d;
  border: 1px solid #1f2f6a;
  border-radius: 12px;
  padding: 1rem;
  min-height: 420px;
}
.section-title { font-weight: 800; margin-bottom: 0.6rem; letter-spacing: 0.5px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}
.card {
  background: #111d45;
  border: 1px solid #243a7a;
  border-radius: 12px;
  padding: 0.5rem;
  display: grid;
  gap: 0.4rem;
}
.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #182650;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-weight: 700; }
.card-artist { color: #9fb2df; font-size: 0.9rem; }

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 480px;
  overflow-y: auto;
}
.queue-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  background: #111d45;
  border: 1px solid #243a7a;
  border-radius: 10px;
}
.queue-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: #182650;
}
.queue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.queue-info { display: flex; flex-direction: column; gap: 0.15rem; }
.queue-title { font-weight: 700; }
.queue-artist { color: #9fb2df; font-size: 0.9rem; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 18, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.overlay.hidden { display: none; }
.overlay-inner {
  width: min(1200px, 95vw);
  background: linear-gradient(180deg, #1b2350, #0d1536);
  border: 2px solid #2f4aa0;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 15px 40px rgba(0,0,0,0.45);
}
.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.overlay-title { font-size: 1.3rem; font-weight: 800; letter-spacing: 1px; }
.overlay-sub { color: #a9b9e6; }
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin: 0.6rem 0;
}
.search-bar input {
  flex: 1;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #2a3d78;
  background: #0d1536;
  color: #e8f1ff;
  font-size: 1rem;
}
.kbd { display: grid; gap: 0.4rem; margin-bottom: 0.6rem; }
.kbd-row { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.key {
  background: #111d45;
  border: 1px solid #2a3d78;
  color: #e8f1ff;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  min-width: 46px;
}
.key.wide { flex: 1; text-align: center; }
.results-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.result-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  background: #111d45;
  border: 1px solid #243a7a;
  border-radius: 10px;
}
.result-row .thumb {
  width: 80px; height: 60px;
  border-radius: 8px;
}

@media (max-width: 960px) {
  .header { grid-template-columns: 1fr; gap: 0.5rem; }
  .main { grid-template-columns: 1fr; }
  .now-playing { grid-template-columns: 1fr; }
}
