@font-face {
  font-family: 'Amstrad';
  src: url('../fonts/Ac437_Amstrad_PC-2y.ttf') format('truetype');
}

html, body {
  overflow-y: auto !important;
  height: auto !important;
  margin: 0;
  padding: 0;
}

#backbutton {
  position: fixed;
  top: 16px;
  left: 20px;
  font-family: 'Amstrad', monospace;
  font-size: 1rem;
  color: #000;
  text-decoration: none;
  z-index: 999;
  background: rgba(255,255,255,0.6);
  padding: 4px 10px;
  border: 1.5px solid #333;
}

#backbutton:hover {
  background: rgba(255,255,255,0.9);
}

#music-page {
  display: flex;
  width: 100%;
  min-height: 100vh;
  padding-top: 60px;
  font-family: 'Amstrad', monospace;
}

/* ── sidebar ── */
#sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 240px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 20px 16px;
  background: rgba(255,255,255,0.55);
  border-right: 1.5px solid #333;
  font-family: 'Amstrad', monospace;
  font-size: 0.9rem;
  scrollbar-width: none;
  box-sizing: border-box;
}

#sidebar::-webkit-scrollbar { display: none; }

#sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

#sidebar h3 {
  font-size: 0.85rem;
  text-transform: lowercase;
  color: #555;
  border-bottom: 1px solid #aaa;
  padding-bottom: 3px;
  margin: 16px 0 8px 0;
}

.filter-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.filter-actions button {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  padding: 3px 8px;
  border: 1.5px solid #333;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
}

.filter-actions button:hover {
  background: rgba(255,255,255,1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

#sidebar label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  line-height: 1.4;
  padding: 3px 4px;
}

#sidebar label:hover {
  background: rgba(255,255,255,0.5);
}

/* ── main area ── */
#grid-area {
  margin-left: 240px;
  padding: 30px 30px 60px 30px;
  flex: 1;
  min-width: 0;
}

/* ── header row ── */
#grid-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

#grid-header h1 {
  font-family: 'Amstrad', monospace;
  font-size: 1.6rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin: 0;
}

#sort-select {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  border: 1.5px solid #333;
  background: rgba(255,255,255,0.7);
  padding: 4px 8px;
  cursor: pointer;
}

/* ── genre section dividers (only shown when sorted by genre) ── */
.genre-heading {
  font-family: 'Amstrad', monospace;
  font-size: 1rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid #333;
  padding-bottom: 5px;
  margin: 32px 0 16px 0;
  grid-column: 1 / -1;
}

/* ── album grid ── */
#album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

/* ── album card ── */
.album-card {
  border: 1.5px solid #333;
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.album-card:hover {
  transform: rotate(2deg);
  box-shadow: 3px 3px 0px #333;
}

.album-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.album-cover-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #d0d0c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Amstrad', monospace;
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  padding: 8px;
  box-sizing: border-box;
}

.album-info {
  padding: 10px 12px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.album-title {
  font-size: 0.88rem;
  line-height: 1.3;
  font-family: 'Amstrad', monospace;
}

.album-artist {
  font-size: 0.75rem;
  color: #555;
  font-family: 'Amstrad', monospace;
}

.album-year {
  font-size: 0.7rem;
  color: #999;
  font-family: 'Amstrad', monospace;
}

/* ── modal ── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

#modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: rgba(255,255,255,0.97);
  border: 2px solid #333;
  padding: 24px;
  max-width: 560px;
  width: 90%;
  display: flex;
  gap: 20px;
  font-family: 'Amstrad', monospace;
  box-sizing: border-box;
}

#modal-cover {
  width: 180px;
  min-width: 180px;
  height: 180px;
  object-fit: cover;
  border: 1px solid #ccc;
  display: block;
}

#modal-cover-placeholder {
  width: 180px;
  min-width: 180px;
  height: 180px;
  background: #d0d0c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  border: 1px solid #ccc;
  box-sizing: border-box;
  padding: 8px;
}

#modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

#modal-close {
  align-self: flex-start;
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  border: 1.5px solid #333;
  background: transparent;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: auto;
  display: block;
  margin-bottom: 8px;
}

#modal-close:hover {
  background: #000;
  color: #fff;
}

#modal-album  { font-size: 1.05rem; line-height: 1.3; }
#modal-artist { font-size: 0.85rem; color: #555; }
#modal-year   { font-size: 0.75rem; color: #999; }
#modal-meta   { font-size: 0.72rem; color: #777; }

#modal-note {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #222;
  margin-top: 8px;
  font-style: italic;
  border-top: 1px solid #ddd;
  padding-top: 8px;
}

.hidden { display: none !important; }

#no-results {
  display: none;
  font-family: 'Amstrad', monospace;
  font-size: 0.9rem;
  margin-top: 40px;
  color: #555;
}

.album-language {
  font-size: 0.7rem;
  color: #aaa;
  font-family: 'Amstrad', monospace;
  font-style: italic;
}