/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: #f4efe7;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
}

button {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

img {
  display: block;
  pointer-events: none;
}

/* === Page === */
.page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f4efe7;
}

/*
  设计稿基准：750 × 1448。
  当前素材均为整画布导出的分层 PNG，所以所有视觉层统一 0,0 覆盖。
*/
.stage {
  position: relative;
  /* 自适应黑科技 + 安全距离：最大高度限制在 92dvh，上下各留白，完美避开刘海、底部安全区横条及默认浏览器底栏 */
  width: 100vw;
  width: min(100vw, 92vh * (750 / 1448), 750px);
  width: min(100vw, 92dvh * (750 / 1448), 750px);
  aspect-ratio: 750 / 1448;
  overflow: hidden;
  background: #f4efe7;
  container-type: inline-size;
}

.layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
}

.layer-bg { z-index: 1; }
.layer-logo { z-index: 2; }
.layer-slogan { z-index: 3; }
.vinyl-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  /* 静态裁剪黑胶图片外围自带的非对称发光，作为静止层容器，从根本上避开旋转时的亚像素发毛拉扯抖动 */
  clip-path: circle(27.5% at 50.27% 47.86%);
  pointer-events: none;
}
.layer-vinyl {
  transform-origin: 50% 47.86%;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.layer-pick {
  z-index: 5;
  transform-origin: 93% 28.5%;
  transform: rotate(-12deg);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.layer-text { z-index: 6; }

/* 播放状态驱动 */
.stage.playing .layer-vinyl {
  transition: none; /* 播放中屏蔽 transition，防止 JS 帧动画冲突卡顿 */
}
.stage.playing .layer-pick {
  transform: rotate(3deg);
}

/* 字幕预留区：最终音频和字幕文案给到后再填充 */
.subtitle {
  position: absolute;
  z-index: 7;
  left: 12%;
  right: 12%;
  top: 73.2%;
  min-height: 24px;
  text-align: center;
  font-size: clamp(12px, 3.2cqw, 24px);
  line-height: 1.45;
  color: #7a5038;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* === Progress === */
.progress-hit-area {
  position: absolute;
  z-index: 8;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
  pointer-events: none; /* 穿透非热区的交互 */
}

.progress-layer {
  z-index: 1;
}

.progress-base {
  opacity: 1;
}

.progress-mask {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: 0%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  will-change: width;
}

.progress-active {
  z-index: 2;
  width: 100vw;
  max-width: 750px;
}

/* 只让进度条实际区域响应拖拽，避免覆盖整屏误触 */
.progress-hit-area::before {
  content: "";
  position: absolute;
  left: 10.6%;
  top: 79.4%;
  width: 78.8%;
  height: 4.4%;
  pointer-events: auto;
}

/* === Play Button === */
.layer-play-icon {
  z-index: 9;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
  transform-origin: 50% 89.7%;
}

.stage.playing .layer-play-icon {
  opacity: 0.86;
}

.play-button {
  position: absolute;
  z-index: 10;
  left: 41.1%;
  top: 86.2%;
  width: 18.2%;
  height: 7%;
  cursor: pointer;
  pointer-events: auto; /* 确保 100% 接收点击事件 */
  touch-action: manipulation;
  outline: none;
}

/* 播放按钮按下时，底层关联的图片执行轻微缩放反馈 */
.play-button:active ~ .layer-play-icon {
  transform: scale(0.965);
}

@media (min-width: 751px) {
  .page {
    align-items: center;
    padding: 24px 0;
  }

  .stage {
    height: min(100dvh - 48px, 1448px);
    width: auto;
  }

  .progress-active {
    width: min(calc((100dvh - 48px) * 750 / 1448), 750px);
  }
}
