*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0f1218;
  --film: #1a1f2e;
  --film-edge: #2a3145;
  --accent: #c9a227;
  --text: #e8eaef;
  --muted: #8b92a5;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% 20%, #1c2233 0%, var(--bg) 55%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.player {
  width: min(100%, 28rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.player__title {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.player__audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Film strip + disc */
.reel {
  width: min(85vmin, 22rem);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel__film {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--film-edge) 0%,
    var(--film) 12%,
    var(--film) 88%,
    var(--film-edge) 100%
  );
  border-radius: 0.35rem;
  box-shadow:
    0 0 0 2px #0a0c10,
    0 1.25rem 2.5rem rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel__sprocket {
  position: absolute;
  z-index: 0;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 0.45rem;
  /* 用实色模拟齿孔，避免 transparent 与下层合成时在圆盘区域产生误读 */
  background: repeating-linear-gradient(
    180deg,
    #0d0f14 0px,
    #0d0f14 5px,
    var(--film) 5px,
    var(--film) 11px
  );
  opacity: 0.9;
}

.reel__sprocket--left {
  left: 0.25rem;
  border-radius: 2px;
}

.reel__sprocket--right {
  right: 0.25rem;
  border-radius: 2px;
}

.reel__disc {
  position: relative;
  z-index: 1;
  width: min(72vmin, 18rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3d3545 0%, #18151c 45%, #0c0a0e 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.06),
    inset 0 0 2rem rgba(0, 0, 0, 0.6),
    0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel__grooves {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at 50% 50%,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.03) 3px,
    rgba(255, 255, 255, 0.03) 4px
  );
  pointer-events: none;
}

.reel__face-wrap {
  position: relative;
  z-index: 2;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(20, 18, 22, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 1.5rem rgba(0, 0, 0, 0.5);
  animation: reel-spin 24s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

.reel__face-wrap.is-playing {
  animation-play-state: running;
}

@keyframes reel-spin {
  to {
    transform: rotate(360deg);
  }
}

.reel__face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
  display: block;
  transform: scale(1.12);
  transform-origin: center center;
}

/* Controls */
.controls {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.controls__btn {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #2d3344, #1e2330);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.12s ease, background 0.15s ease;
}

.controls__btn:hover {
  background: linear-gradient(145deg, #363d52, #252b3a);
}

.controls__btn:active {
  transform: scale(0.96);
}

.controls__icon {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
}

.controls__icon--play {
  border-width: 0.55rem 0 0.55rem 0.95rem;
  border-color: transparent transparent transparent var(--accent);
  margin-left: 0.2rem;
}

.controls__btn.is-playing .controls__icon--play {
  width: 0.75rem;
  height: 0.95rem;
  border: none;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) 32%,
    transparent 32%,
    transparent 68%,
    var(--accent) 68%,
    var(--accent) 100%
  );
  margin-left: 0;
}

.controls__progress-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.controls__progress {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
}

.controls__progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8a7228, var(--accent));
  transition: width 0.08s linear;
}

.controls__time {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
