* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #3a3a42 0%, #16161a 70%, #0a0a0c 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #eee;
  overflow-x: hidden;
}

.room {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 60px;
}

.room-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #d9d6ce;
  margin: 0 0 8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.collection-total {
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #a8b39f;
  margin: 0 0 28px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ---------- iPod chrome ---------- */

.ipod {
  width: 380px;
  border-radius: 34px;
  padding: 22px 22px 30px;
  background: linear-gradient(155deg, #fdfdfd 0%, #dcdcdf 18%, #eeeeee 30%, #c9c9cd 55%, #f2f2f4 70%, #cfcfd3 100%);
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.55),
    0 2px 0 rgba(255, 255, 255, 0.6) inset,
    0 -2px 10px rgba(0, 0, 0, 0.15) inset;
  position: relative;
}

.ipod::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 34px;
  background: repeating-linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.35) 0px,
    rgba(255, 255, 255, 0.05) 2px,
    rgba(0, 0, 0, 0.03) 3px,
    rgba(255, 255, 255, 0.2) 5px
  );
  opacity: 0.5;
  pointer-events: none;
  border-radius: 34px;
}

.ipod-screen-bezel {
  position: relative;
  z-index: 1;
  background: #0c0c0e;
  border-radius: 14px;
  padding: 10px;
  box-shadow:
    0 2px 4px rgba(255, 255, 255, 0.15) inset,
    0 -2px 6px rgba(0, 0, 0, 0.6) inset,
    0 6px 14px rgba(0, 0, 0, 0.4);
  margin-bottom: 26px;
}

.ipod-screen {
  position: relative;
  height: 300px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef3ec 0%, #d7e2d6 45%, #c3d1c2 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
}

.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #33402f;
  z-index: 50;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent);
}

.search-toggle {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #33402f;
  cursor: pointer;
}

.stage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.search-panel {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, #eef3ec 0%, #d7e2d6 45%, #c3d1c2 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-panel.open {
  opacity: 1;
  pointer-events: auto;
}

.search-input {
  flex: none;
  width: 100%;
  border: none;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  color: #24301f;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset;
  outline: none;
}

.search-input::placeholder {
  color: #6b7a63;
}

.search-results {
  flex: 1;
  overflow-y: auto;
}

.search-group {
  margin-bottom: 8px;
}

.search-group h4 {
  margin: 0 0 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a6b1f;
}

.search-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  color: #24301f;
  font-size: 11px;
}

.search-result-item:hover,
.search-result-item:focus {
  background: rgba(255, 255, 255, 0.6);
}

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

.search-result-sub {
  flex: none;
  font-size: 10px;
  color: #5a6b1f;
  white-space: nowrap;
}

.search-empty {
  font-size: 11px;
  color: #5a6b1f;
  padding: 4px 6px;
}

.cover {
  position: absolute;
  top: 44%;
  left: 50%;
  width: 118px;
  height: 118px;
  margin-top: -59px;
  margin-left: -59px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.45s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
  color: #fff;
  padding: 6px;
  overflow: hidden;
}

.cover .cover-placeholder-text {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  font-weight: 600;
}

.cover .cover-vinyl-peek {
  position: absolute;
  right: -14px;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #444 0%, #111 55%, #000 100%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
  z-index: -1;
}

.cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 90%;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  transform: scaleY(-1);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.32), transparent 70%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.32), transparent 70%);
  opacity: 0.55;
}

.now-playing {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 8px 10px 10px;
  z-index: 50;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.55), transparent);
}

.now-playing-title {
  font-size: 13px;
  font-weight: 700;
  color: #24301f;
}

.now-playing-sub {
  font-size: 11px;
  color: #4b5a45;
}

.now-playing-price {
  font-size: 11px;
  font-weight: 600;
  color: #5a6b1f;
  margin-top: 1px;
}

/* ---------- click wheel ---------- */

.click-wheel {
  position: relative;
  width: 230px;
  height: 230px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #e4e4e6 35%, #cfcfd2 70%, #b9b9bd 100%);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 -6px 14px rgba(0, 0, 0, 0.15) inset;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.click-wheel.dragging {
  cursor: grabbing;
}

.wheel-label {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #7a7a7e;
  cursor: pointer;
  z-index: 1;
}

.wheel-label-top { top: 16px; left: 50%; transform: translateX(-50%); }
.wheel-label-bottom { bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; }
.wheel-label-left { left: 18px; top: 50%; transform: translateY(-50%); display: flex; }
.wheel-label-right { right: 18px; top: 50%; transform: translateY(-50%); display: flex; }

.wheel-label svg { display: block; }

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, #fbfbfb 0%, #d8d8db 55%, #c2c2c6 100%);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -3px 8px rgba(0, 0, 0, 0.15) inset;
  cursor: pointer;
}

.wheel-center:active {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 -2px 6px rgba(0, 0, 0, 0.2) inset;
}

.hint {
  margin-top: 22px;
  font-size: 12.5px;
  color: #9a9aa0;
  text-align: center;
  max-width: 380px;
}

/* ---------- detail overlay ---------- */

.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
  padding: 24px;
}

.detail-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.detail-card {
  position: relative;
  display: flex;
  gap: 28px;
  max-width: 720px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(155deg, #f6f1e6 0%, #ece4d2 100%);
  color: #2b2620;
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}

.detail-overlay.open .detail-card {
  transform: translateY(0) scale(1);
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #6b6355;
  cursor: pointer;
}

.detail-cover-wrap {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.detail-cover {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  background: #444;
}

.detail-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 220px;
}

.detail-condition-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #ddd5c2;
  color: #6b6355;
}

.detail-price-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.detail-price-value {
  font-size: 16px;
  font-weight: 700;
  color: #2b2620;
}

.detail-price-sub {
  font-size: 11px;
  color: #8a7f66;
}

.detail-body {
  flex: 1;
  min-width: 0;
}

.detail-header h2 {
  margin: 0 0 2px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
}

.detail-header h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  color: #5c5546;
}

.detail-meta {
  font-size: 12.5px;
  color: #78715f;
  margin-bottom: 18px;
}

.detail-section {
  margin-bottom: 16px;
}

.detail-section h4 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a7f66;
}

.detail-section p, .detail-section li {
  font-size: 13.5px;
  line-height: 1.5;
}

#detail-tracklist {
  margin: 0;
  padding-left: 20px;
}

.detail-discogs-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: #a1461f;
  text-decoration: none;
  font-weight: 600;
}

.detail-discogs-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .detail-card { flex-direction: column; }
  .detail-cover-wrap { flex: none; }
  .detail-cover { width: 100%; height: auto; aspect-ratio: 1; }
}
