/* ==========================================================================
   Karry Wang - NFC Exclusive Audio Showcase H5
   Aesthetic: Fresh Cerulean Sky Blue, Polaroid Bounce-In Pop, Restrained Modern UI
   ========================================================================== */

:root {
  /* Fresh, airy sky blue palette */
  --blue-top: #7ea8dc;
  --blue-mid: #90b8e6;
  --blue-deep: #78a2d6;
  --blue-bottom: #6692cb;

  --color-navy-main: #14243b;
  --color-navy-sub: #1e3556;
  --color-navy-muted: #53719c;

  --color-white: #ffffff;
  --color-white-90: rgba(255, 255, 255, 0.90);
  --color-white-75: rgba(255, 255, 255, 0.75);
  --color-white-55: rgba(255, 255, 255, 0.55);
  --color-white-20: rgba(255, 255, 255, 0.20);
  --color-white-12: rgba(255, 255, 255, 0.12);

  --color-blue-pill: #3b6fb6;

  --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: #121e2e;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--color-white);
  overflow-x: hidden;
}

/* ==========================================================================
   Mobile Viewport Container
   ========================================================================== */
.h5-container {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--blue-top) 0%, var(--blue-mid) 38%, var(--blue-deep) 72%, var(--blue-bottom) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 20px max(24px, env(safe-area-inset-bottom, 24px));
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.45);
}

@media (max-width: 450px) {
  .h5-container {
    box-shadow: none;
    min-height: 100dvh;
  }
}

/* Airy ambient glow in background */
.h5-container::before {
  content: "";
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Background Breezy Wave Lines */
.breeze-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
}

/* Bottom Frosted Mist Layer */
.bottom-mist {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 85px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.45) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ==========================================================================
   1. NFC Sensor Signal Header (Entrance)
   ========================================================================== */
.nfc-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 0;
  animation: nfc-header-fade 0.5s ease-out both;
}

@keyframes nfc-header-fade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nfc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
  box-shadow: 0 4px 12px rgba(18, 40, 75, 0.15);
}

.nfc-icon-ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--color-blue-pill);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nfc-tag-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(20, 45, 80, 0.2);
}

.artist-top-id {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(15, 35, 65, 0.25);
}

/* ==========================================================================
   2. Core Visual: Polaroid Card with Jelly Bounce-In Pop Animation
   ========================================================================== */
.polaroid-section {
  position: relative;
  z-index: 10;
  margin: 14px auto 0;
  display: flex;
  justify-content: center;
  perspective: 1000px;
}

/*
 * Requested Bounce-In Pop (@keyframes + cubic-bezier)
 * Scale 0.8 (opacity 0) -> Scale 1.08 -> gentle damped oscillation -> Scale 1 at rotate(3deg)
 * Duration: ~0.65s
 */
.polaroid-card {
  position: relative;
  width: 262px;
  height: 326px;
  background-color: #ffffff;
  padding: 10px 10px 18px;
  border-radius: 6px;
  box-shadow:
    0 22px 44px -8px rgba(18, 42, 75, 0.42),
    0 6px 16px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.25);
  transform-origin: center center;
  animation: nfc-jelly-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  cursor: pointer;
}

.polaroid-card:hover {
  transform: scale(1.02) rotate(1.5deg);
  box-shadow:
    0 26px 52px -6px rgba(18, 42, 75, 0.5),
    0 8px 20px rgba(0, 0, 0, 0.15);
}

@keyframes nfc-jelly-pop {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(0deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.08) rotate(4.2deg);
  }
  75% {
    transform: scale(0.97) rotate(2.4deg);
  }
  88% {
    transform: scale(1.02) rotate(3.4deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(3.0deg);
  }
}

.polaroid-photo-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  overflow: hidden;
  background-color: #1a283d;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Delicate subtle glossy sheen on polaroid photo */
.polaroid-gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 45%);
  pointer-events: none;
}

/* ==========================================================================
   3. Emotional Headline & Subtitle Section
   ========================================================================== */
.headline-section {
  position: relative;
  z-index: 15;
  text-align: center;
  margin-top: 4px;
  animation: headline-fade 0.6s ease-out 0.22s both;
}

@keyframes headline-fade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  margin-bottom: 6px;
}

.title-row-1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(18, 40, 75, 0.25);
}

.title-row-2 {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--color-white-90);
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.title-en {
  font-family: 'Brush Script MT', 'Dancing Script', cursive;
  font-size: 16px;
  font-style: italic;
  color: #ffffff;
  opacity: 0.95;
}

.song-sub-quote {
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--color-white-75);
  margin-top: 2px;
}

/* ==========================================================================
   4. Audio Controller Section (Refined Floating Frosted Glass)
   ========================================================================== */
.audio-controller-section {
  position: relative;
  z-index: 15;
  width: 100%;
  max-width: 320px;
  margin: 12px auto 0;
  animation: controller-fade 0.6s ease-out 0.35s both;
}

@keyframes controller-fade {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.player-capsule {
  display: flex;
  align-items: center;
  gap: 16px; /* expanded gap so 00:00 heart thumb has safe comfortable clearance from play button */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 6px 16px 6px 8px;
  box-shadow:
    0 10px 28px -4px rgba(18, 42, 75, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Main Play / Pause Button */
.main-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: var(--color-navy-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(15, 35, 65, 0.25);
  transition: transform 0.15s ease, background-color 0.15s ease;
  flex-shrink: 0;
}

.main-play-btn:hover {
  transform: scale(1.06);
  background: #fdfdfd;
}

.main-play-btn:active {
  transform: scale(0.94);
}

/* Progress Track & Heart Scrubber */
.progress-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.32);
  border-radius: 2px;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.progress-heart-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(15, 35, 65, 0.35));
  transition: transform 0.1s ease;
}

.progress-container:hover .progress-heart-thumb {
  transform: translate(-50%, -50%) scale(1.2);
}

.time-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum";
  color: var(--color-white-90);
  letter-spacing: 0.03em;
  flex-shrink: 0;
  user-select: none;
}

/* Bottom Hint & Studio Footer */
.footer-hint {
  text-align: center;
  font-size: 11px;
  color: var(--color-white-75);
  letter-spacing: 0.12em;
  margin-top: 14px;
}

.footer-copyright {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--color-white-55);
  letter-spacing: 0.10em;
  margin-top: 4px;
}
