/* ─── Cassette Player ─────────────────────────────────────────────────────── */

.cassette-player {
  padding: 0.25rem 0;
}

.cassette-player__body,
.cassette-player__surface {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1rem 0.8rem;
  background: linear-gradient(160deg, #1a1a22 0%, #111118 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 2px solid rgba(0, 0, 0, 0.5);
  border-radius: var(--profile-radius-md, 10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ─── Reel viewport ───────────────────────────────────────────────────────── */

.cassette-player__viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3.2rem;
}

[data-profile-child-id="deck"].cassette-player__viewport,
[data-profile-child-id="controls"].cassette-player__controls {
  padding: 0;
}

[data-profile-child-id="trackLabel"].cassette-player__label {
  padding: 0;
}

.cassette-player__tape-window {
  flex: 1;
  height: 0.6rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.cassette-player__tape-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232, 212, 77, 0.08) 40%,
    rgba(232, 212, 77, 0.08) 60%,
    transparent 100%
  );
}

.cassette-player__reel {
  flex-shrink: 0;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2e2e3a, #141418);
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Spoke marks around the reel */
.cassette-player__reel::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.cassette-player__reel-hub {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: radial-gradient(circle, #3a3a4a, #1a1a22);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

@keyframes cassette-reel-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.cassette-player__reel--spinning {
  animation: cassette-reel-spin 2.5s linear infinite;
}

/* ─── Label area ──────────────────────────────────────────────────────────── */

.cassette-player__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.45rem 0.75rem;
  background: linear-gradient(135deg, #1e1a10, #2a2415);
  border: 1px solid rgba(232, 212, 77, 0.2);
  border-radius: var(--profile-radius-sm, 6px);
  min-height: 3.2rem;
  justify-content: center;
  text-align: center;
}

.cassette-player__now-playing {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(232, 212, 77, 0.5);
  margin-bottom: 0.1rem;
}

.cassette-player__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-accent, #e8d44d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}

.cassette-player__artist {
  font-size: 0.72rem;
  color: rgba(232, 212, 77, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cassette-player__index {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 0.1rem;
}

/* ─── Transport controls ──────────────────────────────────────────────────── */

.cassette-player__controls {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
}

.cassette-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 2px solid rgba(0, 0, 0, 0.4);
  border-radius: var(--profile-radius-xs, 3px);
  background: linear-gradient(180deg, #2a2a36 0%, #1e1e28 100%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.1s, transform 0.07s, border-bottom-width 0.07s;
  width: 2rem;
  height: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.cassette-btn:hover {
  background: linear-gradient(180deg, #333340 0%, #26262e 100%);
  color: #fff;
}

.cassette-btn:active {
  transform: translateY(1px);
  border-bottom-width: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.cassette-btn--play {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.95rem;
  background: linear-gradient(180deg, rgba(232, 212, 77, 0.18) 0%, rgba(232, 212, 77, 0.08) 100%);
  border-color: rgba(232, 212, 77, 0.3);
  border-bottom-color: rgba(0, 0, 0, 0.5);
  color: var(--color-accent, #e8d44d);
}

.cassette-btn--play:hover {
  background: linear-gradient(180deg, rgba(232, 212, 77, 0.28) 0%, rgba(232, 212, 77, 0.16) 100%);
  color: #f0df6a;
}

.cassette-btn--mute {
  margin-left: auto;
}

/* ─── Volume slider ───────────────────────────────────────────────────────── */

.cassette-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 5rem;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.cassette-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent, #e8d44d);
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.cassette-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent, #e8d44d);
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.cassette-volume::-webkit-slider-runnable-track {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
}

.cassette-volume::-moz-range-track {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
}

/* ─── Empty state ─────────────────────────────────────────────────────────── */

.cassette-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.4rem 1rem;
  text-align: center;
}

.cassette-empty__icon {
  font-size: 1.6rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 0.2rem;
}

.cassette-empty__text {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
}

.cassette-empty__sub {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.25);
}

/* ─── Compact cassette at small panel heights ────────────────────────────── */

@container panel (max-height: 210px) {
  .cassette-player__viewport {
    display: none;
  }
  .cassette-player__body {
    padding: 0.55rem 0.75rem 0.5rem;
    gap: 0.4rem;
  }
  .cassette-player__label {
    min-height: 0;
    padding: 0.35rem 0.6rem;
    gap: 0;
  }
  .cassette-player__now-playing,
  .cassette-player__index {
    display: none;
  }
}

@container panel (max-height: 170px) {
  .cassette-player {
    padding: 0;
  }
  .cassette-player__label {
    display: none;
  }
  .cassette-player__body {
    padding: 0.4rem 0.6rem;
    gap: 0.35rem;
  }
}

/* ─── Music Editor Slots (profile editor panel — unchanged) ───────────────── */

.music-editor-slots {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.music-slot {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--profile-radius-sm, 6px);
  cursor: default;
}

.music-slot[draggable="true"] {
  cursor: grab;
}

.music-slot--empty {
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.07);
}

.music-slot--dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.music-slot--drag-over {
  border-color: var(--color-accent, #e8d44d);
  background: rgba(232, 212, 77, 0.06);
}

.music-slot--uploading {
  opacity: 0.7;
}

.music-slot__handle {
  flex-shrink: 0;
  padding: 0.25rem 0.1rem;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  line-height: 1;
  user-select: none;
  cursor: grab;
}

.music-slot__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.music-slot__inputs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.music-slot__controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.music-slot__upload-btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
}

.music-slot__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--profile-radius-xs, 3px);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}

.music-slot__clear:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.music-slot__status {
  font-size: 0.72rem;
  color: rgba(255, 100, 100, 0.9);
  margin: 0;
}

.music-slot__ready {
  font-size: 0.72rem;
  color: rgba(100, 220, 130, 0.85);
}

.music-slot__file-input {
  display: none;
}
