html, body {
  margin: 0;
  padding: 0;
  font-family: Verdana, Arial, sans-serif;
  color: #fff;
}

/* PS2 Font */
@font-face {
  font-family: "PS2";
  src: url("../../fonts/PS2.ttf");
}

/* Background */
body {
  background: #000 url("../../images/stars.png") repeat;
  animation: starScroll 180s linear infinite;
}

/* Header */
.music-header {
  text-align: center;
  margin: 10px auto 20px;
  max-width: 900px;
}

.page-title {
  font-family: "PS2";
  font-size: 2.4em;
}

.page-subtitle {
  color: #ddd;
}

/* =========================
   SHARED PAGE WIDTH
   ========================= */

.music-stage,
.library-box {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* =========================
   PLAYER + ALBUM STAGE
   ========================= */

.music-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

/* Player */
.player-area iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #444;
  display: block;
  background: #000;
}

/* =========================
   ALBUM DISPLAY
   ========================= */

.album-display {
  position: relative;
  width: 320px;
  height: 380px;
}

/* Cover stack container */
.cover-stack {
  position: relative;
  width: 320px;
  height: 320px;
}

/* Album cover */
#album-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid #444;
  position: relative;
  z-index: 2;
  background: #000;
}

/* Overlay frame */
.cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
}

/* Spinning record */
.record-spin {
  position: absolute;
  width: 320px;
  left: 50.4%;
  bottom: -185px;
  transform: translateX(-50%);
  z-index: 1;
  animation: spin 6s linear infinite;
  opacity: 0.95;
}

/* Spin animation */
@keyframes spin {
  from { transform: translateX(-50%) rotate(0deg); }
  to { transform: translateX(-50%) rotate(360deg); }
}

/* =========================
   LIBRARY
   ========================= */

.library-box {
  margin-top: 20px;
  background: rgba(30,30,30,0.7);
  padding: 20px;
}

/* Tabs */
.genre-tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.genre-tab {
  padding: 10px 18px;
  background: #555;
  border: 2px solid #888;
  cursor: pointer;
  font-weight: bold;
  color: #fff;
  transition: 0.2s;
}

.genre-tab.active,
.genre-tab:hover {
  background: #777;
  border-color: #fff;
  box-shadow: 0 0 8px #0ff;
}

/* Album grid */
.genre-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  border-top: 2px solid #444;
  padding-top: 10px;
  max-height: 360px;
  overflow-y: auto;
}

/* Optional scrollbar styling (WebKit browsers) */
.genre-panel::-webkit-scrollbar {
  width: 8px;
}

.genre-panel::-webkit-scrollbar-track {
  background: #222;
}

.genre-panel::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 4px;
}

.genre-panel::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* Cards */
.album-card {
  width: 140px;
  background: #555;
  border: 2px solid #888;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}

.album-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 6px;
}

.album-card span {
  font-size: 0.9em;
  font-weight: bold;
}

.album-card:hover {
  transform: scale(1.05);
  border-color: #fff;
  box-shadow: 0 0 10px #0ff;
  background: #666;
}

/* =========================
   NOW PLAYING
   ========================= */

.now-playing {
  text-align: center;
  font-family: "PS2", Verdana, sans-serif;
  margin: 18px auto 10px;
  padding: 8px 10px;
  max-width: 1500px;

  font-size: clamp(1.2rem, 3vw, 2.2rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  color: #fff;
  text-shadow: 0 0 8px #0ff;
}

/* Return button */
.return-home {
  text-align: center;
  margin: 40px 0;
}

.return-home a {
  padding: 10px 22px;
  background: #333;
  border: 3px solid #888;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
}

.return-home a:hover {
  background: #444;
}

/* Background animation */
@keyframes starScroll {
  from { background-position: 0 0; }
  to { background-position: 2000px 0; }
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}
