:root {
  --bg: #f7eee6;
  --bg-deep: #f0dfd5;
  --paper: rgba(255, 250, 245, 0.74);
  --line: rgba(127, 79, 72, 0.12);
  --text: #49332f;
  --muted: #866d65;
  --accent: #dd8e7a;
  --accent-strong: #c86d61;
  --shadow: 0 20px 50px rgba(127, 79, 72, 0.13);
  --player-shadow: 0 20px 44px rgba(127, 79, 72, 0.18);
  --max-width: 430px;
  --seek-percent: 0%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.gift-page {
  min-height: 100svh;
  color: var(--text);
  font-family:
    "SF Pro Text",
    "PingFang SC",
    "Hiragino Sans GB",
    "Helvetica Neue",
    sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.82), transparent 24%),
    radial-gradient(circle at 88% 16%, rgba(233, 190, 176, 0.55), transparent 22%),
    radial-gradient(circle at 50% 86%, rgba(216, 171, 155, 0.4), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body.gift-page::before,
body.gift-page::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  filter: blur(16px);
  pointer-events: none;
  z-index: 0;
}

body.gift-page::before {
  top: 96px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: rgba(244, 213, 200, 0.52);
}

body.gift-page::after {
  left: -50px;
  bottom: 150px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.46);
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding:
    calc(24px + env(safe-area-inset-top))
    18px
    calc(180px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  padding: 22px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 243, 0.52));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 18px;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(200, 109, 97, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.78), transparent 42%),
    linear-gradient(145deg, rgba(221, 142, 122, 0.3), rgba(255, 255, 255, 0.12));
}

.eyebrow,
.card-label {
  margin: 0;
  color: var(--accent-strong);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.title,
.card-title,
.cover-copy strong,
.track-main {
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    "Songti SC",
    "STSong",
    serif;
  letter-spacing: -0.04em;
}

.title {
  margin: 12px 0 0;
  font-size: clamp(38px, 12vw, 56px);
  line-height: 0.98;
}

.title-sub {
  display: block;
  margin-top: 8px;
  font-size: clamp(18px, 5vw, 24px);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.intro,
.card-text,
.wish-item span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.intro {
  margin: 18px 0 0;
  max-width: 24em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chip {
  padding: 10px 14px;
  border: 1px solid rgba(200, 109, 97, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.45);
}

.cover-card,
.note-card,
.wish-card {
  margin-top: 18px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.cover-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.64);
}

.cover-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(160deg, rgba(221, 142, 122, 0.2), rgba(255, 255, 255, 0.2)),
    #f2dfd4;
}

.cover-frame::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  width: 60px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.66);
  transform: rotate(-10deg);
  z-index: 2;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 900ms ease, filter 900ms ease;
}

body.playing .cover-frame img {
  transform: scale(1.05);
  filter: saturate(1.04) contrast(1.02);
}

.cover-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 6px 2px;
}

.cover-copy strong,
.track-main {
  display: block;
  font-size: 22px;
  font-weight: 600;
}

.cover-copy span,
.track-sub {
  color: var(--muted);
  font-size: 13px;
}

.seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(200, 109, 97, 0.16);
  border-radius: 50%;
  color: var(--accent-strong);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

.note-card,
.wish-card {
  padding: 20px 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
}

.card-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.card-text {
  margin: 14px 0 0;
}

.wish-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.wish-item {
  padding: 14px 14px 15px;
  border: 1px solid rgba(200, 109, 97, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.38);
}

.wish-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.switch-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 13px;
}

.switch-link::after {
  content: "→";
}

.footer-note {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.player-dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 5;
  width: min(calc(100% - 24px), 406px);
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: rgba(255, 250, 245, 0.84);
  box-shadow: var(--player-shadow);
  backdrop-filter: blur(24px);
  transform: translateX(-50%);
}

.player-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.play-btn {
  flex: none;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 24px rgba(200, 109, 97, 0.26);
  color: #fffaf5;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.play-btn svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
}

.play-btn .icon-pause,
.play-btn .icon-replay,
.play-btn.is-playing .icon-play,
.play-btn.is-ended .icon-play,
.play-btn.is-ended .icon-pause {
  display: none;
}

.play-btn.is-playing .icon-pause,
.play-btn.is-ended .icon-replay {
  display: block;
}

.track {
  flex: 1;
  min-width: 0;
}

.track-label {
  display: block;
  color: var(--accent-strong);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.track-main {
  margin-top: 6px;
}

.track-sub {
  display: block;
  margin-top: 4px;
}

.status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  margin-top: 14px;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      var(--accent-strong) 0%,
      var(--accent) var(--seek-percent),
      rgba(200, 109, 97, 0.12) var(--seek-percent),
      rgba(200, 109, 97, 0.12) 100%
    );
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #fff8f3;
  box-shadow: 0 0 0 4px rgba(221, 142, 122, 0.16);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #fff8f3;
  box-shadow: 0 0 0 4px rgba(221, 142, 122, 0.16);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.audio-bars {
  display: flex;
  align-items: end;
  gap: 3px;
  margin-left: 4px;
}

.audio-bars span {
  width: 3px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f1b3a3, var(--accent-strong));
  animation: bounce 0.95s ease-in-out infinite;
  animation-play-state: paused;
}

.audio-bars span:nth-child(2) {
  animation-delay: 0.12s;
}

.audio-bars span:nth-child(3) {
  animation-delay: 0.24s;
}

.audio-bars span:nth-child(4) {
  animation-delay: 0.36s;
}

body.playing .audio-bars span {
  animation-play-state: running;
}

audio {
  display: none;
}

@keyframes bounce {
  0%,
  100% {
    height: 8px;
    opacity: 0.55;
  }
  50% {
    height: 20px;
    opacity: 1;
  }
}

@media (min-width: 720px) {
  .page {
    padding-left: 22px;
    padding-right: 22px;
  }

  .player-dock {
    width: min(calc(100% - 40px), 430px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
