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

:root {
  --bg-deep: #00050f;
  --bg: #000d24;
  --bg-card: rgba(0, 20, 60, 0.85);
  --panel: #001440;
  --text: #b8deff;
  --text-bright: #e0f4ff;
  --text-muted: #3a6aaa;
  --cyan: #00eeff;
  --cyan-dim: #0099cc;
  --cyan-glow: rgba(0, 238, 255, 0.45);
  --cyan-bright: #80faff;
  --blue: #0055ff;
  --blue-bright: #3399ff;
  --blue-glow: rgba(0, 85, 255, 0.4);
  --water-top: #00aaff;
  --water-mid: #0044cc;
  --water-deep: #00050f;
  --red: #ff2255;
  --red-glow: rgba(255, 34, 85, 0.3);
  --pink: #ff6b9d;
  --gold: #fbbf24;
  --radius: 2px;
  --font-main: 'Rajdhani', sans-serif;
  --font-display: 'Orbitron', sans-serif;
  --font-script: 'Dancing Script', cursive;
  --font-dialogue: 'Cormorant Garamond', 'Times New Roman', serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========== WATER BACKGROUND ========== */
.water-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    180deg,
    #001a4d 0%,
    #0033aa 25%,
    #0044cc 50%,
    #003399 75%,
    #000d24 100%
  );
  overflow: hidden;
}

/* Caustic light shimmers at the top */
.water-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 200%; height: 40%;
  background: radial-gradient(ellipse 60% 40% at 30% 20%, rgba(0,200,255,0.18) 0%, transparent 70%),
              radial-gradient(ellipse 50% 30% at 70% 10%, rgba(0,150,255,0.12) 0%, transparent 70%),
              radial-gradient(ellipse 40% 25% at 50% 30%, rgba(100,220,255,0.08) 0%, transparent 70%);
  animation: caustics 6s ease-in-out infinite alternate;
}

@keyframes caustics {
  0%   { transform: translateX(0) scaleX(1); }
  50%  { transform: translateX(-5%) scaleX(1.05); }
  100% { transform: translateX(-10%) scaleX(0.97); }
}

/* Deep water glow from below */
.water-bg::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 50%;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(0,30,100,0.9) 0%, transparent 70%);
}

/* ========== WATER WAVES ========== */
.water-waves {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.wave {
  position: absolute;
  width: 220%;
  left: -10%;
  height: 120px;
  opacity: 0.06;
}

.wave svg {
  width: 100%; height: 100%;
  fill: var(--cyan-bright);
}

.wave-1 { top: 8%; animation: waveScroll 14s linear infinite; }
.wave-2 { top: 22%; animation: waveScroll 20s linear infinite reverse; opacity: 0.04; }
.wave-3 { top: 40%; animation: waveScroll 18s linear infinite; opacity: 0.03; }
.wave-4 { top: 60%; animation: waveScroll 25s linear infinite reverse; opacity: 0.025; }

@keyframes waveScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-45.45%); }
}

/* ========== BUBBLES ========== */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(180,240,255,0.7), rgba(0,180,255,0.1));
  border: 1px solid rgba(100,220,255,0.3);
  animation: bubbleRise linear infinite;
  pointer-events: none;
}

@keyframes bubbleRise {
  0%   { opacity: 0; transform: translateY(0) translateX(0) scale(0.5); }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-100vh) translateX(var(--drift)) scale(1); }
}

/* ========== FISH ========== */
.fish-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.fish {
  position: absolute;
}

.fish-svg {
  display: block;
}

.fish-right {
  animation: fishSwimRight linear forwards;
}

.fish-left {
  animation: fishSwimLeft linear forwards;
}

@keyframes fishSwimRight {
  0%   { left: -120px; top: var(--top); }
  20%  { margin-top: -18px; }
  40%  { margin-top: 14px; }
  60%  { margin-top: -12px; }
  80%  { margin-top: 10px; }
  100% { left: calc(100% + 120px); margin-top: 0; }
}

@keyframes fishSwimLeft {
  0%   { left: calc(100% + 120px); }
  20%  { margin-top: -18px; }
  40%  { margin-top: 14px; }
  60%  { margin-top: -12px; }
  80%  { margin-top: 10px; }
  100% { left: -120px; margin-top: 0; }
}

.fish-left .fish-svg {
  transform: scaleX(-1);
}

/* Tail wiggle */
.fish-tail {
  transform-origin: right center;
  animation: tailWiggle 0.55s ease-in-out infinite alternate;
}

@keyframes tailWiggle {
  0%   { transform: rotate(-18deg); }
  100% { transform: rotate(18deg); }
}

.hidden { display: none !important; }
.screen { min-height: 100vh; width: 100%; position: relative; }

/* ========== SCANLINES ========== */
.scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ========== PARTICLES ========== */
.particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0%   { opacity: 0; transform: translateY(100vh) scale(0); }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.1; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ========== GLITCH TEXT ========== */
.glitch-text {
  position: relative;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0.8;
}

.glitch-text::before {
  color: var(--cyan);
  animation: glitchShift 3s infinite;
  clip-path: inset(0 0 60% 0);
}

.glitch-text::after {
  color: var(--red);
  animation: glitchShift 3s infinite reverse;
  clip-path: inset(60% 0 0 0);
}

@keyframes glitchShift {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-3px, 1px); }
  94% { transform: translate(3px, -1px); }
  96% { transform: translate(-1px, 2px); }
  98% { transform: translate(2px, -2px); }
}

/* ========== LOCK SCREEN ========== */
.lock-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 100;
  position: relative;
  overflow: hidden;
}

/* BG Shapes */
.lock-bg-shapes {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.bg-triangle {
  position: absolute;
  width: 0; height: 0;
  border-style: solid;
  opacity: 0.07;
}

.t1 {
  top: -100px; right: -50px;
  border-width: 0 200px 400px 200px;
  border-color: transparent transparent var(--cyan) transparent;
  animation: triFloat 12s ease-in-out infinite;
}

.t2 {
  bottom: -80px; left: 10%;
  border-width: 300px 150px 0 150px;
  border-color: var(--blue) transparent transparent transparent;
  animation: triFloat 15s ease-in-out infinite reverse;
}

.t3 {
  top: 30%; left: -100px;
  border-width: 0 100px 200px 100px;
  border-color: transparent transparent var(--red) transparent;
  opacity: 0.03;
  animation: triFloat 18s ease-in-out infinite;
}

@keyframes triFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-30px) rotate(5deg); }
}

.bg-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.25;
}

.l1 { top: 25%; left: 0; width: 100%; }
.l2 { top: 50%; left: 0; width: 60%; }
.l3 { top: 75%; right: 0; width: 40%; left: auto; }

.lock-container {
  text-align: center;
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Lock Icon */
.lock-icon-wrap {
  margin: 0 auto 2rem;
  width: 80px; height: 80px;
  position: relative;
}

.lock-hexagon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--panel), var(--bg));
  border: 1px solid var(--cyan-dim);
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: lockGlow 2.5s ease-in-out infinite;
}

.lock-svg {
  width: 32px; height: 32px;
  color: var(--cyan);
}

@keyframes lockGlow {
  0%, 100% { box-shadow: 0 0 20px var(--cyan-glow); filter: drop-shadow(0 0 6px var(--cyan-glow)); }
  50%      { box-shadow: 0 0 40px var(--cyan-glow); filter: drop-shadow(0 0 14px var(--cyan-glow)); }
}

.lock-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 6px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.lock-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 3px;
  margin-bottom: 2rem;
  font-family: var(--font-main);
}

/* PIN Dots */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 1.5rem;
}

.pin-dot {
  width: 14px; height: 14px;
  border: 2px solid var(--cyan-dim);
  background: transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.pin-dot.filled {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 14px var(--cyan-glow);
  transform: scale(1.2);
}

.pin-dot.error {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 14px var(--red-glow);
  animation: dotShake 0.4s ease;
}

@keyframes dotShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.pin-dot.success {
  border-color: #34d399;
  background: #34d399;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.5);
  animation: dotPop 0.3s ease;
}

@keyframes dotPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1.2); }
}

/* PIN Keypad */
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  gap: 10px;
  justify-content: center;
}

.pin-key {
  width: 70px; height: 70px;
  border: 1px solid rgba(0, 212, 255, 0.15);
  background: rgba(0, 212, 255, 0.03);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  clip-path: polygon(8% 0, 100% 0, 100% 85%, 92% 100%, 0 100%, 0 15%);
  position: relative;
}

.pin-key:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
}

.pin-key:active {
  transform: scale(0.93);
  background: rgba(0, 212, 255, 0.2);
}

.pin-key-empty { visibility: hidden; }

.pin-key-delete {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}

.pin-error {
  color: var(--red);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 3px;
  margin-top: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.pin-error.visible { opacity: 1; }

/* Unlock Animation */
.lock-screen.unlocking {
  animation: p3rUnlock 1.2s ease-in-out forwards;
}

@keyframes p3rUnlock {
  0%   { opacity: 1; clip-path: inset(0 0 0 0); }
  40%  { clip-path: inset(0 0 0 0); }
  60%  { clip-path: inset(0 50% 0 50%); }
  100% { clip-path: inset(0 50% 100% 50%); opacity: 0; }
}

/* ========== MAIN SITE ========== */
.main-site { position: relative; z-index: 1; }

/* ========== MUSIC PLAYER ========== */
.music-player {
  position: fixed;
  top: 1.25rem; right: 1.25rem;
  z-index: 1000;
}

.music-btn {
  width: 44px; height: 44px;
  border: 1px solid rgba(0, 238, 255, 0.3);
  background: rgba(0, 10, 40, 0.8);
  backdrop-filter: blur(16px);
  color: var(--cyan);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(8% 0, 100% 0, 100% 85%, 92% 100%, 0 100%, 0 15%);
  transition: all 0.3s ease;
  box-shadow: 0 0 16px rgba(0,200,255,0.15);
}

.music-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--cyan);
}

.music-bars {
  display: flex; align-items: flex-end; gap: 3px;
  height: 16px;
}

.music-bars span {
  width: 3px;
  background: var(--cyan);
  border-radius: 1px;
  transition: height 0.3s;
}

.music-bars span:nth-child(1) { height: 6px; }
.music-bars span:nth-child(2) { height: 10px; }
.music-bars span:nth-child(3) { height: 4px; }
.music-bars span:nth-child(4) { height: 8px; }

.music-bars.playing span {
  animation: barDance 0.8s ease-in-out infinite alternate;
}

.music-bars.playing span:nth-child(1) { animation-delay: 0s; }
.music-bars.playing span:nth-child(2) { animation-delay: 0.15s; }
.music-bars.playing span:nth-child(3) { animation-delay: 0.3s; }
.music-bars.playing span:nth-child(4) { animation-delay: 0.45s; }

@keyframes barDance {
  0%   { height: 4px; }
  100% { height: 16px; }
}

.music-bars.muted span {
  height: 3px !important;
  opacity: 0.3;
  animation: none !important;
}

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero-accent-lines {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.hero-accent-lines span {
  position: absolute;
  background: linear-gradient(180deg, var(--cyan), transparent);
  opacity: 0.04;
}

.hero-accent-lines span:nth-child(1) {
  left: 15%; top: 0; width: 1px; height: 60%;
}

.hero-accent-lines span:nth-child(2) {
  right: 20%; top: 10%; width: 1px; height: 80%;
}

.hero-accent-lines span:nth-child(3) {
  left: 40%; top: 0; width: 1px; height: 40%;
}

.hero-pre {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 6px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero-title {
  margin-bottom: 1.5rem;
  line-height: 1;
}

.hero-title-top {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 6rem);
  font-weight: 900;
  letter-spacing: 12px;
  color: #ffffff;
  text-shadow: 0 0 30px var(--cyan-glow), 0 0 60px rgba(0,180,255,0.3), 0 0 100px rgba(0,100,255,0.2);
}

.hero-title-bottom {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 4rem);
  font-weight: 700;
  letter-spacing: 8px;
  background: linear-gradient(135deg, #00eeff 0%, #0088ff 40%, #cc44ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0.25rem;
  filter: drop-shadow(0 0 20px rgba(0,200,255,0.5));
}

.hero-heart {
  -webkit-text-fill-color: var(--red);
  animation: heartBeat 1.2s ease-in-out infinite;
  display: inline-block;
  margin-left: 8px;
  font-size: 0.8em;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.3); }
  30%      { transform: scale(1); }
  45%      { transform: scale(1.2); }
  60%      { transform: scale(1); }
}

.hero-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.div-line {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
}

.div-diamond {
  width: 8px; height: 8px;
  background: var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.hero-message {
  max-width: 520px;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.9;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  letter-spacing: 0.5px;
}

/* P3R Button */
.btn-p3r {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border: 1px solid var(--cyan-dim);
  background: transparent;
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  clip-path: polygon(4% 0, 100% 0, 100% 75%, 96% 100%, 0 100%, 0 25%);
  transition: all 0.3s ease;
}

.btn-p3r-bg {
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  transition: left 0.4s ease;
  z-index: 0;
}

.btn-p3r:hover .btn-p3r-bg { left: 0; }

.btn-p3r:hover {
  color: var(--bg-deep);
  border-color: var(--cyan);
  box-shadow: 0 0 30px var(--cyan-glow);
}

.btn-p3r-text,
.btn-p3r svg {
  position: relative;
  z-index: 1;
}

.btn-p3r:active { transform: scale(0.97); }

/* ========== ANIMATIONS ========== */
.animate-glitch-in {
  opacity: 0;
  transform: translateY(20px);
  animation: glitchIn 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }
.delay-5 { animation-delay: 0.75s; }

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes glitchIn {
  0%   { opacity: 0; transform: translateY(20px) skewX(-2deg); }
  60%  { opacity: 1; transform: translateY(-3px) skewX(1deg); }
  80%  { transform: translateY(1px) skewX(-0.5deg); }
  100% { opacity: 1; transform: translateY(0) skewX(0deg); }
}

/* ========== MESSAGE VIEWER (P3R dialogue) ========== */
.msg-viewer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.25rem 2rem;
  position: relative;
}

.msg-back-home {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 900;
  border: 1px solid rgba(0, 238, 255, 0.25);
  background: rgba(0, 10, 40, 0.75);
  backdrop-filter: blur(12px);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 10px 18px;
  cursor: pointer;
  clip-path: polygon(6% 0, 100% 0, 100% 78%, 94% 100%, 0 100%, 0 22%);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.msg-back-home:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}

.msg-back-slash {
  color: var(--cyan-dim);
  margin-right: 6px;
}

.msg-empty {
  text-align: center;
}

.msg-empty .glitch-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 6px;
  color: var(--text-muted);
}

.msg-empty-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 2px;
  margin-top: 0.75rem;
  opacity: 0.5;
}

.msg-display {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}

/* ---- P3R split scene (portrait + dialogue) ---- */
.p3r-scene {
  display: grid;
  grid-template-columns: minmax(120px, 0.38fr) minmax(0, 1fr);
  gap: clamp(0.75rem, 3vw, 2rem);
  align-items: end;
  width: 100%;
}

.compose-preview-stage {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 0.25rem 1.5rem;
  border: 1px solid rgba(0, 238, 255, 0.12);
  background: linear-gradient(
    180deg,
    rgba(0, 20, 55, 0.25) 0%,
    rgba(0, 8, 28, 0.12) 100%
  );
  box-shadow:
    0 0 48px rgba(0, 40, 120, 0.2),
    inset 0 1px 0 rgba(0, 238, 255, 0.08);
  border-radius: 1px;
}

.preview-hint {
  font-weight: 500;
  letter-spacing: 2px;
  opacity: 0.45;
  font-size: 0.5rem;
}

.photo-count {
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 3px;
  color: var(--cyan-dim);
  margin-top: 0.35rem;
}

.p3r-portrait-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 200px;
}

.p3r-portrait-stack {
  position: relative;
  width: 100%;
  max-width: min(340px, 36vw);
  margin: 0 auto -0.5rem;
  transform-origin: 50% 88%;
  animation: p3rPortraitBreathe 5.4s ease-in-out infinite;
  backface-visibility: hidden;
  will-change: transform;
}

.p3r-portrait-stack.p3r-portrait-stack--swap {
  animation:
    p3rPortraitBreathe 5.4s ease-in-out infinite,
    p3rPortraitFlash 0.52s ease-out;
}

@keyframes p3rPortraitBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.018); }
}

@keyframes p3rPortraitFlash {
  0% {
    filter: brightness(1.85) saturate(1.2) blur(8px);
    opacity: 0.75;
  }
  100% {
    filter: none;
    opacity: 1;
  }
}

.p3r-portrait-aura {
  position: absolute;
  bottom: 8%;
  left: 50%;
  width: 118%;
  height: 95%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  filter: blur(14px);
  opacity: 0.95;
  animation: p3rAuraPulse 3.8s ease-in-out infinite;
}

@keyframes p3rAuraPulse {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

.p3r-portrait-cut {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 5;
  max-height: min(52vh, 420px);
  clip-path: polygon(12% 0, 100% 4%, 94% 100%, 0 88%);
  border: 1px solid rgba(0, 238, 255, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 20, 60, 0.8),
    0 20px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 40px rgba(0, 60, 140, 0.15);
  background: linear-gradient(160deg, rgba(0, 25, 70, 0.5), rgba(0, 8, 24, 0.85));
  overflow: hidden;
}

.p3r-portrait-layers {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.p3r-portrait-layers.hidden {
  display: none !important;
}

.p3r-portrait-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transform-origin: 55% 28%;
}

.p3r-portrait-layer.is-active {
  opacity: 1;
  z-index: 2;
}

.p3r-portrait-layer.p3r-portrait-layer--cut-in {
  animation: p3rPortraitCutIn 0.48s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes p3rPortraitCutIn {
  0% {
    opacity: 0;
    transform: scale(1.18) translateX(12%) skewX(-6deg);
    filter: brightness(2.4) contrast(1.05) blur(10px);
  }
  40% {
    opacity: 1;
    filter: brightness(1.35) blur(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateX(0) skewX(0);
    filter: none;
  }
}

.p3r-portrait-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, rgba(0, 40, 100, 0.4), rgba(0, 15, 40, 0.9));
}

.p3r-portrait-initials {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 4px;
  color: rgba(200, 235, 255, 0.35);
  text-shadow: 0 0 30px var(--cyan-glow);
}

.p3r-dialogue-col {
  min-width: 0;
}

.p3r-counter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 4px;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.p3r-counter-label { opacity: 0.7; }

.p3r-counter-val {
  color: var(--cyan);
  font-weight: 700;
}

.p3r-counter-slash {
  color: var(--cyan-dim);
  margin: 0 2px;
  font-weight: 400;
}

.p3r-dialogue-shell {
  width: 100%;
  perspective: 1400px;
}

.p3r-dialogue {
  --p3r-dlg-h: min(420px, max(268px, 42vh));
  position: relative;
  width: 100%;
  height: var(--p3r-dlg-h);
  min-height: var(--p3r-dlg-h);
  max-height: var(--p3r-dlg-h);
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    118deg,
    rgba(0, 14, 42, 0.82) 0%,
    rgba(0, 10, 32, 0.78) 45%,
    rgba(0, 6, 22, 0.88) 100%
  );
  border: 1px solid rgba(0, 238, 255, 0.32);
  clip-path: polygon(0 6%, 100% 0, 100% 93%, 88% 100%, 0 100%);
  box-shadow:
    0 0 56px rgba(0, 50, 160, 0.35),
    inset 0 1px 0 rgba(0, 238, 255, 0.18),
    inset 0 -24px 48px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  overflow: visible;
  transform-origin: 50% 60%;
  box-sizing: border-box;
}

.p3r-dialogue--static {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.p3r-dialogue-top-highlight {
  position: absolute;
  top: 0;
  left: 0;
  right: 6%;
  height: 4px;
  z-index: 4;
  background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0.95;
  pointer-events: none;
}

.p3r-dialogue-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--cyan);
  box-shadow: 4px 0 24px rgba(0, 238, 255, 0.35);
  clip-path: polygon(0 0, 100% 4%, 100% 96%, 0 100%);
}

.p3r-dialogue-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.p3r-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 238, 255, 0.45);
}

.p3r-bracket-tl {
  top: 52px;
  left: 14px;
  border-right: none;
  border-bottom: none;
}

.p3r-bracket-tr {
  top: 52px;
  right: 14px;
  border-left: none;
  border-bottom: none;
}

.p3r-bracket-bl {
  bottom: 14px;
  left: 14px;
  border-right: none;
  border-top: none;
}

.p3r-bracket-br {
  bottom: 14px;
  right: 14px;
  border-left: none;
  border-top: none;
}

/* Below clip-path top edge: y ≥ 6%·H·(1 − x/W) at left; ~24–30px on wide cards */
.p3r-nameblock {
  position: absolute;
  top: 28px;
  left: 14px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: min(92%, 340px);
  pointer-events: none;
}

.p3r-talk-pill {
  font-family: var(--font-display);
  font-size: clamp(0.48rem, 1.6vw, 0.58rem);
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--cyan-bright);
  padding: 5px 12px 4px 14px;
  background: linear-gradient(105deg, rgba(0, 18, 55, 0.98), rgba(0, 30, 80, 0.92));
  border: 1px solid rgba(0, 238, 255, 0.45);
  clip-path: polygon(5% 0, 100% 0, 100% 72%, 92% 100%, 0 100%, 0 28%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  text-align: left;
}

.p3r-dialogue-body {
  position: relative;
  padding: 4.35rem 1.75rem 1.35rem 1.85rem;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.p3r-text-block {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.p3r-text-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
  margin-right: -2px;
}

.p3r-text-scroll::-webkit-scrollbar {
  width: 6px;
}

.p3r-text-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 238, 255, 0.28);
  border-radius: 3px;
}

.p3r-text-scroll::-webkit-scrollbar-track {
  background: rgba(0, 10, 40, 0.35);
}

.p3r-text-scroll > .p3r-msg-lines {
  position: relative;
  z-index: 1;
}

.p3r-msg-lines {
  display: block;
  font-family: var(--font-dialogue);
  font-size: clamp(1.15rem, 2.6vw, 1.42rem);
  font-weight: 600;
  line-height: 1.65;
  color: #f2f8ff;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  margin: 0;
  padding: 0;
  border: 0;
  text-indent: 0 !important;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  direction: ltr;
  unicode-bidi: isolate;
  word-spacing: normal;
}

/* Do not set text-align on ::first-line — with justify it overrides text-align-last: left
   when the first line is also the last line (typewriter / short text), causing huge gaps
   or a "massive indent" before the first word. */

.p3r-msg-typed {
  display: inline;
}

.p3r-type-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--cyan);
  opacity: 0;
  clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%);
  pointer-events: none;
}

.p3r-type-cursor.typing {
  opacity: 1;
  animation: p3rCursorPulse 0.45s ease-in-out infinite alternate;
}

@keyframes p3rCursorPulse {
  0% { opacity: 0.35; box-shadow: 0 0 6px var(--cyan-glow); }
  100% { opacity: 1; box-shadow: 0 0 14px var(--cyan-glow); }
}

.p3r-dialogue-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(0, 238, 255, 0.14);
}

.p3r-advance-hint {
  font-size: 0.65rem;
  color: var(--cyan);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s, transform 0.35s;
  animation: none;
  filter: drop-shadow(0 0 6px var(--cyan-glow));
}

.p3r-advance-hint.visible {
  opacity: 1;
  transform: translateY(0);
  animation: p3rAdvanceNudge 1.2s ease-in-out infinite;
}

@keyframes p3rAdvanceNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* Dialogue motion — snap + skew like P3R menus */
.p3r-dialogue--out-next {
  animation: p3rDlgOutNext 0.38s cubic-bezier(0.4, 0, 0.8, 0.2) forwards;
}

.p3r-dialogue--out-prev {
  animation: p3rDlgOutPrev 0.38s cubic-bezier(0.4, 0, 0.8, 0.2) forwards;
}

.p3r-dialogue--in-next {
  animation: p3rDlgInNext 0.48s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.p3r-dialogue--in-prev {
  animation: p3rDlgInPrev 0.48s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.p3r-dialogue--in-first {
  animation: p3rDlgInFirst 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes p3rDlgOutNext {
  0% {
    opacity: 1;
    transform: translateX(0) rotateX(0deg) skewX(0deg);
    filter: brightness(1);
  }
  55% {
    opacity: 0.85;
    transform: translateX(-28px) rotateX(6deg) skewX(-3deg);
    filter: brightness(1.15);
  }
  100% {
    opacity: 0;
    transform: translateX(-100px) rotateX(12deg) skewX(-6deg) scale(0.96);
    filter: brightness(1.6) blur(2px);
  }
}

@keyframes p3rDlgOutPrev {
  0% {
    opacity: 1;
    transform: translateX(0) rotateX(0deg) skewX(0deg);
  }
  100% {
    opacity: 0;
    transform: translateX(100px) rotateX(-10deg) skewX(5deg) scale(0.96);
    filter: brightness(1.4) blur(2px);
  }
}

@keyframes p3rDlgInNext {
  0% {
    opacity: 0;
    transform: translateX(80px) rotateX(-8deg) skewX(4deg) scale(0.94);
    filter: brightness(1.5) blur(3px);
  }
  60% {
    opacity: 1;
    transform: translateX(-6px) rotateX(2deg) skewX(-1deg);
    filter: brightness(1.05) blur(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotateX(0) skewX(0) scale(1);
    filter: none;
  }
}

@keyframes p3rDlgInPrev {
  0% {
    opacity: 0;
    transform: translateX(-80px) rotateX(8deg) skewX(-4deg) scale(0.94);
    filter: brightness(1.45) blur(3px);
  }
  60% {
    opacity: 1;
    transform: translateX(6px) rotateX(-2deg) skewX(1deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotateX(0) skewX(0) scale(1);
    filter: none;
  }
}

@keyframes p3rDlgInFirst {
  0% {
    opacity: 0;
    transform: translateY(36px) rotateX(14deg) scale(0.92);
    filter: blur(4px) brightness(1.6);
  }
  45% {
    opacity: 1;
    transform: translateY(-8px) rotateX(-4deg) scale(1.02);
    filter: blur(0) brightness(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0) scale(1);
    filter: none;
  }
}

.msg-nav-controls {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.msg-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  background: rgba(0, 212, 255, 0.04);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  clip-path: polygon(6% 0, 100% 0, 100% 80%, 94% 100%, 0 100%, 0 20%);
}

.msg-nav-btn:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}

.msg-nav-primary {
  border-color: rgba(0, 238, 255, 0.45);
  box-shadow: 0 0 18px rgba(0, 238, 255, 0.12);
}

.msg-nav-primary:hover:not(:disabled) {
  box-shadow: 0 0 26px var(--cyan-glow);
}

.msg-nav-btn:active:not(:disabled) { transform: scale(0.96); }

.msg-nav-btn:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

/* ========== WRITE MESSAGE PAGE (only via #write URL) ========== */
.write-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  position: relative;
}

.write-layout {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: stretch;
}

.write-form-col {
  min-width: 0;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.write-preview-col {
  width: 100%;
}

.preview-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--cyan-dim);
  margin-bottom: 0.85rem;
  opacity: 0.85;
  text-align: center;
}

.form-optional {
  font-weight: 500;
  letter-spacing: 2px;
  opacity: 0.55;
  font-size: 0.55rem;
}

.photo-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.photo-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 238, 255, 0.2);
  background: rgba(0, 30, 80, 0.35);
  color: var(--text-bright);
  font-family: var(--font-main);
  font-size: 0.88rem;
  cursor: pointer;
  clip-path: polygon(2% 0, 100% 0, 100% 85%, 98% 100%, 0 100%, 0 15%);
}

.photo-input::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 238, 255, 0.35);
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
}

.photo-clear {
  border: 1px solid rgba(255, 80, 120, 0.35);
  background: rgba(40, 0, 20, 0.35);
  color: #ff8a9a;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 8px 14px;
  cursor: pointer;
  clip-path: polygon(6% 0, 100% 0, 100% 78%, 94% 100%, 0 100%, 0 22%);
  transition: border-color 0.2s, color 0.2s;
}

.photo-clear:hover {
  border-color: #ff6b9d;
  color: #ffc0d0;
}

.write-success {
  text-align: center;
  padding: 4rem 1.5rem;
}

.write-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.write-title-accent {
  color: var(--cyan);
  margin-right: 6px;
}

.write-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 2.5rem;
}

.write-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--cyan-dim);
}

.write-form input,
.write-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(0, 238, 255, 0.15);
  background: rgba(0, 30, 80, 0.4);
  color: var(--text-bright);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s;
  resize: vertical;
  clip-path: polygon(2% 0, 100% 0, 100% 85%, 98% 100%, 0 100%, 0 15%);
}

.write-form input::placeholder,
.write-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.write-form input:focus,
.write-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(0, 50, 120, 0.4);
  box-shadow: 0 0 20px rgba(0, 238, 255, 0.2);
}

.color-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.color-dots {
  display: flex;
  gap: 10px;
}

.color-dot {
  width: 30px; height: 30px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.color-dot:hover { transform: scale(1.2); }

.color-dot.active {
  border-color: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
  transform: scale(1.15);
}

.btn-submit {
  align-self: flex-start;
  margin-top: 0.5rem;
}

/* Write Success */
.write-success .glitch-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 6px;
  color: #34d399;
}

.write-success-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 2px;
  margin-top: 0.75rem;
}

/* ========== COMING SOON ========== */
.coming-soon {
  text-align: center;
  padding: 2rem 1rem;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  pointer-events: none;
}

.coming-soon p {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 4px;
  color: var(--text-muted);
  opacity: 0.35;
}

/* ========== CONFETTI ========== */
.confetti-piece {
  position: fixed;
  top: -10px;
  z-index: 9999;
  animation: confettiFall linear forwards;
  pointer-events: none;
}

@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* ========== LYRICS CARDS ========== */
.lyrics-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.lyrics-page-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.lyrics-page-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 1px;
  margin-bottom: 3rem;
}

.lyrics-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* Song Card */
.lyrics-song-card {
  position: relative;
  border: 1px solid rgba(0, 238, 255, 0.12);
  background: rgba(0, 15, 50, 0.6);
  backdrop-filter: blur(8px);
  clip-path: polygon(0 0, 92% 0, 100% 8%, 100% 100%, 8% 100%, 0 92%);
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  overflow: hidden;
}

.lyrics-song-card:hover {
  border-color: var(--card-accent, var(--cyan));
  transform: translateY(-4px);
  box-shadow: 0 8px 40px color-mix(in srgb, var(--card-accent, var(--cyan)) 30%, transparent);
}

.lyrics-song-card:active { transform: translateY(-2px); }

/* Card real content */
.card-content {
  position: relative;
  z-index: 1;
}

.lyrics-card-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.lyrics-song-card:hover .lyrics-card-cover { opacity: 1; }

.lyrics-card-no-cover {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  opacity: 0.3;
}

.lyrics-card-info {
  padding: 1.25rem;
  position: relative;
}

.lyrics-card-info::before {
  content: '';
  position: absolute;
  top: 0; left: 1.25rem;
  width: 40px; height: 2px;
  background: var(--card-accent, var(--cyan));
}

.lyrics-card-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.lyrics-card-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.lyrics-card-play-icon {
  position: absolute;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 56px; height: 56px;
  background: rgba(0, 10, 30, 0.75);
  border: 2px solid var(--card-accent, var(--cyan));
  color: var(--card-accent, var(--cyan));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.lyrics-song-card.revealed:hover .lyrics-card-play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ======== MYSTERY VEIL ======== */
.mystery-veil {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: linear-gradient(160deg, #000d24 0%, #001840 60%, #000810 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  /* Reveal sweep animation vars */
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.65s cubic-bezier(0.77, 0, 0.18, 1),
              opacity 0.3s ease 0.5s;
}

/* Scanlines inside veil */
.mystery-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,238,255,0.015) 3px, rgba(0,238,255,0.015) 4px
  );
  pointer-events: none;
}

/* Noise pattern */
.mystery-noise {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(0,238,255,0.8) 1px, transparent 1px),
    radial-gradient(circle at 80% 50%, rgba(0,238,255,0.6) 1px, transparent 1px),
    radial-gradient(circle at 50% 80%, rgba(0,238,255,0.4) 1px, transparent 1px),
    radial-gradient(circle at 70% 10%, rgba(0,150,255,0.5) 1px, transparent 1px),
    radial-gradient(circle at 10% 70%, rgba(0,150,255,0.3) 1px, transparent 1px);
  background-size: 40px 40px, 60px 60px, 35px 35px, 50px 50px, 45px 45px;
  animation: noiseShift 8s linear infinite;
}

@keyframes noiseShift {
  0%   { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 40px 40px, -60px 60px, 35px -35px, -50px 50px, 45px -45px; }
}

/* Corner brackets */
.mystery-corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--cyan-dim);
  border-style: solid;
  opacity: 0.5;
}

.mystery-corner-tl { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.mystery-corner-br { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }

/* Center content */
.mystery-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  z-index: 1;
}

.mystery-hex {
  color: var(--cyan);
  animation: hexPulse 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 10px var(--cyan-glow));
}

@keyframes hexPulse {
  0%, 100% { transform: scale(1);   filter: drop-shadow(0 0 8px var(--cyan-glow)); }
  50%       { transform: scale(1.06); filter: drop-shadow(0 0 20px var(--cyan-glow)); }
}

.mystery-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.mystery-hint {
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 3px;
  color: var(--cyan-dim);
  opacity: 0.7;
  animation: hintBlink 2s ease-in-out infinite;
}

@keyframes hintBlink {
  0%, 80%, 100% { opacity: 0.7; }
  90%            { opacity: 0.2; }
}

/* Hover on unrevealed: intensify glow */
.lyrics-song-card:not(.revealed):hover .mystery-veil {
  background: linear-gradient(160deg, #001030 0%, #002060 60%, #000c20 100%);
}

.lyrics-song-card:not(.revealed):hover .mystery-hex {
  animation: hexPulse 1s ease-in-out infinite;
  color: var(--cyan-bright, #80faff);
}

.lyrics-song-card:not(.revealed):hover .mystery-hint {
  opacity: 1;
  color: var(--cyan);
}

/* ---- REVEALING animation: veil sweeps UP ---- */
.lyrics-song-card.revealing .mystery-veil {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.65s cubic-bezier(0.77, 0, 0.18, 1);
}

/* ---- REVEALED: veil gone ---- */
.lyrics-song-card.revealed .mystery-veil {
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

/* ========== LYRICS PLAYER OVERLAY ========== */
.lyrics-player-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000;
  background: rgba(0, 5, 15, 0.95);
  backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayFadeIn 0.4s ease-out;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lyrics-player {
  width: 100%;
  max-width: 580px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 100vh;
  overflow-y: auto;
  position: relative;
}

.lyrics-close {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 44px; height: 44px;
  border: 1px solid rgba(0, 238, 255, 0.15);
  background: rgba(0, 10, 30, 0.6);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(8% 0, 100% 0, 100% 85%, 92% 100%, 0 100%, 0 15%);
  transition: all 0.2s;
}

.lyrics-close:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

/* Header: Cover + Info */
.lyrics-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  margin-bottom: 2rem;
}

.lyrics-cover-wrap {
  position: relative;
  width: 100px; height: 100px;
  flex-shrink: 0;
}

.lyrics-cover-img {
  width: 100%; height: 100%;
  object-fit: cover;
  clip-path: polygon(0 0, 90% 0, 100% 10%, 100% 100%, 10% 100%, 0 90%);
}

.lyrics-cover-glow {
  position: absolute;
  top: -8px; left: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  z-index: -1;
  opacity: 0.4;
  filter: blur(20px);
  border-radius: 8px;
  transition: background 0.3s;
}

.lyrics-now-playing {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 4px;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.lyrics-song-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

.lyrics-song-artist {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Progress Bar */
.lyrics-progress-wrap {
  width: 100%;
  margin-bottom: 2rem;
}

.lyrics-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(0, 238, 255, 0.1);
  cursor: pointer;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.lyrics-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--song-accent, var(--cyan));
  transition: width 0.1s linear;
  box-shadow: 0 0 12px color-mix(in srgb, var(--song-accent, var(--cyan)) 60%, transparent);
  position: relative;
}

.lyrics-progress-fill::after {
  content: '';
  position: absolute;
  right: -4px; top: -3px;
  width: 10px; height: 10px;
  background: var(--song-accent, var(--cyan));
  border-radius: 50%;
  box-shadow: 0 0 12px color-mix(in srgb, var(--song-accent, var(--cyan)) 70%, transparent);
}

.lyrics-time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.lyrics-time {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* Lyrics — Instagram-story style: one line at a time, no scroll (avoids mobile jank) */
.lyrics-lines-wrap {
  width: 100%;
  min-height: 132px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lyrics-lines {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lyrics-story {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.25rem;
  box-sizing: border-box;
}

.lyrics-story-text {
  margin: 0;
  max-width: 22em;
  font-family: var(--font-main);
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-align: center;
  color: #fff;
  text-shadow:
    0 0 28px color-mix(in srgb, var(--song-accent, var(--cyan)) 50%, transparent),
    0 2px 14px rgba(0, 0, 0, 0.45);
}

.lyrics-story-text.lyrics-story-text--enter {
  animation: lyricsStoryEnter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lyricsStoryEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lyrics-story-text.lyrics-story-text--enter {
    animation: none;
  }
}

/* Controls */
.lyrics-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lyrics-play-btn {
  width: 56px; height: 56px;
  border: 2px solid var(--song-accent, var(--cyan));
  background: rgba(0, 10, 40, 0.6);
  color: var(--song-accent, var(--cyan));
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lyrics-play-btn:hover {
  background: color-mix(in srgb, var(--song-accent, var(--cyan)) 15%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--song-accent, var(--cyan)) 50%, transparent);
}

.lyrics-play-btn:active {
  transform: scale(0.93);
}

/* ========================================
   QUIZ & MATCH GAMES
   ======================================== */
.quiz-container, .match-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  position: relative;
}

/* Intro screens (shared) */
.quiz-intro, .match-intro {
  text-align: center;
  animation: fadeUp 0.6s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quiz-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 5px;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  padding: 4px 14px;
  margin-bottom: 1.5rem;
  background: rgba(0, 238, 255, 0.04);
}

.quiz-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--text-bright);
  text-shadow: 0 0 30px var(--cyan-glow);
  margin-bottom: 0.5rem;
}

.quiz-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
}

.quiz-intro-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.quiz-intro-divider span:first-child,
.quiz-intro-divider span:last-child {
  width: 50px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
}

.quiz-diamond {
  width: 8px; height: 8px;
  background: var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.quiz-intro-text {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 2rem;
}

/* Question screen */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.quiz-progress-text {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: var(--text-muted);
}

#quizCurrent { color: var(--cyan); font-weight: 700; }
.quiz-slash { color: var(--cyan-dim); margin: 0 3px; }

.quiz-score-live {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.quiz-score-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 3px;
  color: var(--cyan-dim);
}

.quiz-score-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cyan);
}

.quiz-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(0, 238, 255, 0.08);
  margin-bottom: 2rem;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--blue-bright));
  box-shadow: 0 0 10px var(--cyan-glow);
  transition: width 0.5s ease;
}

/* Question card */
.quiz-question-card {
  background: rgba(0, 15, 50, 0.6);
  border: 1px solid rgba(0, 238, 255, 0.15);
  padding: 2rem 1.75rem;
  clip-path: polygon(0 0, 96% 0, 100% 4%, 100% 100%, 4% 100%, 0 96%);
  backdrop-filter: blur(8px);
  animation: quizCardIn 0.4s ease-out;
}

@keyframes quizCardIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.quiz-question-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 4px;
  color: var(--cyan-dim);
  margin-bottom: 0.75rem;
}

.quiz-question-text {
  font-family: var(--font-main);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-bright);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(0, 238, 255, 0.15);
  background: rgba(0, 30, 80, 0.3);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  clip-path: polygon(2% 0, 100% 0, 100% 85%, 98% 100%, 0 100%, 0 15%);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(0, 238, 255, 0.08);
  transform: translateX(4px);
}

.quiz-option-letter {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.quiz-option.correct {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  color: #e0fff0;
  animation: correctPulse 0.6s ease-out;
}

.quiz-option.correct .quiz-option-letter {
  border-color: #34d399;
  color: #34d399;
}

.quiz-option.wrong {
  border-color: var(--red);
  background: rgba(255, 34, 85, 0.12);
  color: #ffd0d8;
  animation: wrongShake 0.4s ease;
}

.quiz-option.wrong .quiz-option-letter {
  border-color: var(--red);
  color: var(--red);
}

.quiz-option:disabled { cursor: not-allowed; }

@keyframes correctPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
  50%      { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0.15); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* Feedback card */
.quiz-feedback {
  margin-top: 1.5rem;
  padding: 1.75rem;
  border: 1px solid rgba(0, 238, 255, 0.15);
  background: rgba(0, 15, 50, 0.7);
  text-align: center;
  clip-path: polygon(0 0, 96% 0, 100% 4%, 100% 100%, 4% 100%, 0 96%);
  animation: feedbackIn 0.4s ease-out;
}

@keyframes feedbackIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quiz-feedback-icon {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.quiz-feedback.correct .quiz-feedback-icon { color: #34d399; }
.quiz-feedback.wrong .quiz-feedback-icon { color: var(--red); }

.quiz-feedback-result {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.quiz-feedback-note {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 1.5rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Results screen */
.quiz-results {
  text-align: center;
  animation: fadeUp 0.6s ease-out;
}

.quiz-result-rank {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 40px var(--cyan-glow);
  line-height: 1;
  margin-bottom: 1rem;
}

.quiz-result-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 5px;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
}

.quiz-result-score {
  margin-bottom: 1.5rem;
}

.quiz-result-score-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 20px var(--cyan-glow);
}

.quiz-result-score-total {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-left: 6px;
}

.quiz-result-message {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 2rem;
  font-style: italic;
}

/* ==========================================
   PHOTOS — Apple Music "100 Best Albums" coverflow
   ========================================== */
.photos-cf {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 4rem;
  overflow: hidden;
}

.photos-cf-header {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.photos-cf-brand {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text-bright);
  opacity: 0.85;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
}

/* Big rank number */
.photos-cf-rank {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: clamp(4.5rem, 13vw, 9rem);
  font-weight: 600;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -2px;
  background: linear-gradient(180deg, #fde68a 0%, #f59e0b 55%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  filter: drop-shadow(0 8px 28px rgba(251, 191, 36, 0.35));
  margin-bottom: 0.6rem;
  user-select: none;
  transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.photos-cf-rank.rank-out {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}

/* Stage (perspective container) */
.photos-cf-stage {
  position: relative;
  width: 100%;
  height: clamp(260px, 48vh, 440px);
  perspective: 1500px;
  perspective-origin: 50% 50%;
}

.photos-cf-track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

/* Slides — sit absolutely centered, positioned via inline transform set by JS */
.photos-cf-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(220px, 36vw, 420px);
  aspect-ratio: 4 / 3;
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #000814;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  will-change: transform, opacity;
  transition:
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.55s ease,
    filter    0.55s ease;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.photos-cf-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Soft side-fade on non-active slides */
.photos-cf-slide.is-side    { filter: brightness(0.78) saturate(0.85); }
.photos-cf-slide.is-far     { filter: brightness(0.55) saturate(0.7); }
.photos-cf-slide.is-active  { filter: none; cursor: zoom-in; }

/* Subtle top gloss on active slide */
.photos-cf-slide.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, transparent 30%);
  pointer-events: none;
}

/* Nav arrows */
.photos-cf-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.photos-cf-prev { left: clamp(8px, 3vw, 32px); }
.photos-cf-next { right: clamp(8px, 3vw, 32px); }
.photos-cf-nav:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-50%) scale(1.07);
}
.photos-cf-prev:active { transform: translateY(-50%) translateX(-2px) scale(0.97); }
.photos-cf-next:active { transform: translateY(-50%) translateX(2px)  scale(0.97); }

/* Caption */
.photos-cf-caption {
  text-align: center;
  margin-top: 1.5rem;
  min-height: 60px;
  transition: opacity 0.25s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.photos-cf-caption.cap-out {
  opacity: 0;
  transform: translateY(6px);
}

.photos-cf-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-bright);
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.photos-cf-meta {
  font-family: var(--font-main);
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Progress dots */
.photos-cf-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 1.1rem;
}

.photos-cf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s ease, width 0.25s ease;
}
.photos-cf-dot.active {
  background: var(--gold);
  width: 18px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* Compact phones */
@media (max-width: 600px) {
  .photos-cf-stage { height: clamp(220px, 42vh, 380px); }
  .photos-cf-slide { width: clamp(200px, 65vw, 340px); }
  .photos-cf-prev  { left: 6px; }
  .photos-cf-next  { right: 6px; }
}

/* Photo Lightbox */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 5, 18, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem 1rem;
  animation: photoFadeIn 0.3s ease-out;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.photo-lightbox.hidden { display: none; }

@keyframes photoFadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

.photo-lightbox-close,
.photo-lightbox-nav {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 238, 255, 0.35);
  background: rgba(0, 18, 48, 0.7);
  color: var(--cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  z-index: 2;
}

.photo-lightbox-close { top: 1.25rem; right: 1.25rem; }
.photo-lightbox-prev  { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.photo-lightbox-next  { right: 1.25rem; top: 50%; transform: translateY(-50%); }

.photo-lightbox-close:hover,
.photo-lightbox-nav:hover {
  background: rgba(0, 50, 110, 0.9);
  border-color: var(--cyan);
}

.photo-lightbox-prev:hover { transform: translateY(-50%) translateX(-3px); }
.photo-lightbox-next:hover { transform: translateY(-50%) translateX(3px); }

.photo-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 70vh;
}

.photo-lightbox-img {
  max-width: min(900px, 90vw);
  max-height: 70vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(0, 238, 255, 0.15);
  animation: lightboxIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes lightboxIn {
  0%   { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1);    opacity: 1; }
}

.photo-lightbox-caption {
  margin-top: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 90vw;
}

.photo-lightbox-caption strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--cyan-bright);
  text-shadow: 0 0 18px rgba(0, 238, 255, 0.45);
  text-transform: uppercase;
}

.photo-lightbox-caption span {
  font-family: var(--font-script);
  font-size: 1.1rem;
  color: var(--text);
  opacity: 0.9;
}

/* Compact phones — lightbox arrows hidden (use swipe instead) */
@media (max-width: 520px) {
  .photo-lightbox-prev, .photo-lightbox-next { display: none; }
}

/* ==========================================
   TIMELINE PUZZLE
   ========================================== */
.timeline-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  position: relative;
  z-index: 2;
}

.timeline-intro,
.timeline-win {
  text-align: center;
  animation: fade-slide-up 0.6s ease;
}

.timeline-play {
  animation: fade-slide-up 0.5s ease;
}

.timeline-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 4px;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.timeline-hint-bottom {
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

.timeline-hint-arrow {
  font-size: 1rem;
  animation: timeline-arrow-bob 1.6s ease-in-out infinite;
}

.timeline-hint-bottom .timeline-hint-arrow {
  animation-delay: 0.8s;
}

@keyframes timeline-arrow-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  padding: 1rem 0;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--cyan) 15%,
    var(--cyan) 85%,
    transparent 100%
  );
  opacity: 0.35;
  pointer-events: none;
}

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: linear-gradient(
    135deg,
    rgba(0, 30, 80, 0.85) 0%,
    rgba(0, 50, 120, 0.7) 100%
  );
  border: 1px solid rgba(0, 212, 255, 0.35);
  clip-path: polygon(
    12px 0,
    100% 0,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    0 100%,
    0 12px
  );
  color: #e0f2ff;
  cursor: grab;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  user-select: none;
}

.timeline-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.35);
  transform: translateX(4px);
}

.timeline-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
  transform: scale(0.98);
}

.timeline-card.drop-target {
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.55);
  transform: translateX(8px);
}

.timeline-card.drop-target::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -5px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.timeline-card.correct {
  border-color: #34d399;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.5);
  background: linear-gradient(
    135deg,
    rgba(5, 50, 30, 0.85) 0%,
    rgba(10, 80, 50, 0.7) 100%
  );
}

.timeline-card.wrong {
  border-color: #f87171;
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.4);
  background: linear-gradient(
    135deg,
    rgba(60, 10, 20, 0.85) 0%,
    rgba(90, 20, 30, 0.7) 100%
  );
}

.timeline-card-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  color: var(--cyan);
  background: rgba(0, 20, 60, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.5);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  flex-shrink: 0;
  text-shadow: 0 0 8px var(--cyan-glow);
}

.timeline-card.correct .timeline-card-index {
  color: #34d399;
  border-color: #34d399;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.timeline-card.wrong .timeline-card-index {
  color: #f87171;
  border-color: #f87171;
}

.timeline-card-body {
  min-width: 0;
}

.timeline-card-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.timeline-card-desc {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.82rem;
  color: rgba(200, 230, 255, 0.7);
  margin: 2px 0 0;
  line-height: 1.3;
}

.timeline-card-date {
  display: none;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 2px;
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan-glow);
  white-space: nowrap;
}

.timeline-card.revealed .timeline-card-date {
  display: block;
  animation: fade-in 0.4s ease;
}

.timeline-card.correct .timeline-card-date {
  color: #34d399;
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
}

.timeline-card.wrong .timeline-card-date {
  color: #f87171;
  text-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}

.timeline-card-arrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: auto;
}

.timeline-arrow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 18px;
  padding: 0;
  background: rgba(0, 20, 60, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.4);
  color: var(--cyan);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timeline-arrow-btn:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.25);
  border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.timeline-arrow-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.timeline-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.timeline-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 22px;
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: var(--cyan);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.timeline-shuffle:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.timeline-shuffle svg {
  stroke: currentColor;
}

/* Responsive match */
@media (max-width: 500px) {
  .quiz-container, .match-container, .timeline-container { padding: 5rem 1rem 4rem; }
  .timeline-card { grid-template-columns: 36px 1fr auto; padding: 0.65rem 0.75rem; gap: 0.5rem; }
  .timeline-card-index { width: 32px; height: 32px; font-size: 0.85rem; }
  .timeline-card-title { font-size: 0.95rem; }
  .timeline-card-desc { font-size: 0.75rem; }
  .timeline-list::before { left: 18px; }
  .timeline-actions { flex-direction: column; gap: 0.75rem; }
  .match-grid { gap: 6px; }
  .match-face-back::before { font-size: 1.5rem; }
  .match-face-front { font-size: 1.4rem; }
  .match-stats { gap: 1rem; }
  .quiz-question-text { font-size: 1.1rem; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .p3r-scene {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: center;
  }

  .p3r-portrait-col {
    min-height: 0;
  }

  .p3r-portrait-stack {
    max-width: 220px;
    margin-bottom: 0;
  }
}

@media (max-width: 600px) {
  .lock-title {
    font-size: 1rem;
    letter-spacing: 4px;
  }

  .pin-keypad {
    grid-template-columns: repeat(3, 62px);
    gap: 8px;
  }

  .pin-key {
    width: 62px; height: 62px;
    font-size: 1.1rem;
  }

  .hero { padding: 1.5rem 1.5rem 2rem; }

  .hero-title-top { letter-spacing: 6px; }
  .hero-title-bottom { letter-spacing: 4px; }

  .p3r-dialogue-body { padding: 3.95rem 1.2rem 1.2rem 1.35rem; }

  .msg-nav-controls { gap: 1rem; }
  .msg-nav-btn { padding: 10px 20px; }

  .write-container { padding: 2rem 1rem 3rem; }

  .music-player {
    top: auto;
    bottom: 1rem;
    right: 1rem;
  }

  .coming-soon { bottom: 0; }

  .lyrics-container { padding: 2rem 1rem 4rem; }
  .lyrics-cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
  .lyrics-player { padding: 2rem 1.25rem; }
  .lyrics-lines-wrap { min-height: 112px; }
  .lyrics-story-text { font-size: clamp(1rem, 4.5vw, 1.2rem); }
}

/* ========== SLIDE CARD SYSTEM ========== */
.main-site {
  position: fixed !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
}

.content-section {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateY(100%);
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
  pointer-events: none;
}

.content-section.slide-active {
  transform: translateY(0);
  pointer-events: all;
}

.content-section.slide-above {
  transform: translateY(-100%);
}

/* ========== SLIDE DOT NAV ========== */
.slide-dots {
  position: fixed;
  left: 18px;
  top: 50vh;
  transform: translateY(-50%);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.slide-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 157, 0.5);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.35s ease;
  outline: none;
  display: block;
}

.slide-dot.active {
  background: #ff6b9d;
  border-color: #ff6b9d;
  box-shadow: 0 0 10px rgba(255, 107, 157, 0.7);
  transform: scale(1.25);
}

.slide-dot:hover:not(.active) {
  border-color: rgba(255, 107, 157, 0.7);
  background: rgba(255, 107, 157, 0.2);
}

/* ========== BIRTHDAY CARD ========== */
#cardSection {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.bcard-wrap {
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.bcard-paper {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: 2.8rem 3rem 2.4rem;
  border-radius: 1px;
  /* warm cream paper */
  background-color: #fdf8ef;
  /* subtle ruled lines */
  background-image:
    repeating-linear-gradient(
      transparent, transparent 30px,
      rgba(180, 140, 100, 0.10) 30px,
      rgba(180, 140, 100, 0.10) 31px
    );
  box-shadow:
    0 1px 1px rgba(0,0,0,0.08),
    0 6px 20px rgba(0,0,0,0.22),
    0 24px 64px rgba(0,0,0,0.20),
    inset 0 1px 0 rgba(255,255,255,0.60);
  /* subtle left margin red line */
  border-left: 3px solid rgba(210, 120, 120, 0.18);
}

/* rainbow ribbon at top — like a birthday card seal */
.bcard-paper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 1px 1px 0 0;
  background: linear-gradient(
    90deg,
    #c084fc 0%, #ff6b9d 25%,
    #fbbf24 50%, #ff6b9d 75%, #c084fc 100%
  );
  opacity: 0.85;
}

/* faint paper grain overlay */
.bcard-paper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ── ornament dividers ── */
.bcard-ornament {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.bcard-ornament--top  { margin-bottom: 1.8rem; }
.bcard-ornament--bottom { margin-top: 1.8rem; }

.bcard-orn-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(190,140,120,0.15), rgba(190,140,120,0.45));
}
.bcard-orn-line--rev {
  background: linear-gradient(90deg, rgba(190,140,120,0.45), rgba(190,140,120,0.15));
}

.bcard-orn-icon {
  font-size: 0.85rem;
  color: rgba(190, 130, 110, 0.55);
  line-height: 1;
  flex-shrink: 0;
}

/* ── text lines ── */
#bcardLines {
  font-family: 'Dancing Script', cursive;
  color: #3d1f0d;
}

.bcard-p {
  margin: 0;
  line-height: 1.55;
  min-height: 1px;
}

/* gap spacer */
.bcard-p.cl-gap { height: 0.75em; }

/* salutation: "Ayang," */
.bcard-p.cl-salute {
  font-size: 2.1rem;
  font-weight: 700;
  color: #2b1507;
  margin-bottom: 0.15em;
}

/* body paragraphs */
.bcard-p.cl-body {
  font-size: 1.28rem;
  color: #4a2e18;
}

/* "Happy Birthday, sayang." */
.bcard-p.cl-special {
  font-size: 1.6rem;
  font-weight: 700;
  color: #7a2020;
}

/* "with love," */
.bcard-p.cl-closing {
  font-size: 1.22rem;
  color: #4a2e18;
  margin-top: 0.1em;
}

/* signature "Tya ♥" */
.bcard-p.cl-sign {
  font-size: 2.4rem;
  font-weight: 700;
  font-style: italic;
  color: #2b1507;
}

/* ── writing cursor on active line ── */
.bcard-p.writing::after {
  content: '';
  display: inline-block;
  width: 1.5px;
  height: 0.78em;
  background: #6b3a1e;
  border-radius: 1px;
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: cardCursorBlink 0.55s step-end infinite;
}

@keyframes cardCursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── responsive ── */
@media (max-width: 600px) {
  .bcard-paper { padding: 2rem 1.6rem 1.8rem; }
  .bcard-p.cl-salute { font-size: 1.8rem; }
  .bcard-p.cl-body   { font-size: 1.15rem; }
  .bcard-p.cl-special { font-size: 1.4rem; }
  .bcard-p.cl-sign   { font-size: 2rem; }
}

/* ==========================================
   Slide Arrow Navigation
   ========================================== */
.slide-nav-arrow {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  background: rgba(0, 20, 60, 0.65);
  border: 1.5px solid rgba(255, 107, 157, 0.5);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ff6b9d;
  backdrop-filter: blur(6px);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, opacity 0.4s;
  animation: arrowBob 2s ease-in-out infinite;
  outline: none;
}

.slide-nav-arrow:hover {
  background: rgba(255, 107, 157, 0.18);
  border-color: #ff6b9d;
  box-shadow: 0 0 16px rgba(255, 107, 157, 0.55);
}

.slide-nav-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes arrowBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ==========================================
   Fill-in-blank Lock Screen
   ========================================== */
.fill-lock-container {
  max-width: 420px;
  width: 92%;
  text-align: center;
}

.fill-mascot {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 0.75rem;
  animation: mascotWiggle 2.2s ease-in-out infinite;
  user-select: none;
}

@keyframes mascotWiggle {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50%       { transform: rotate(8deg) scale(1.08); }
}

.fill-lock-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.fill-lock-sub {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  margin-bottom: 1.8rem;
  line-height: 1.5;
}

/* The pantun card */
.fill-card {
  background: rgba(0, 15, 45, 0.75);
  border: 1px solid rgba(255, 107, 157, 0.3);
  border-radius: 20px;
  padding: 1.8rem 1.6rem 1.6rem;
  margin-bottom: 1.4rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(255, 107, 157, 0.08), inset 0 1px 0 rgba(255,255,255,0.04);
}

.fill-card::before {
  content: '♥';
  position: absolute;
  top: -18px; right: 14px;
  font-size: 6rem;
  color: rgba(255, 107, 157, 0.04);
  pointer-events: none;
  user-select: none;
}

.fill-card-tag {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: #ff6b9d;
  opacity: 0.7;
  margin-bottom: 1.4rem;
  text-align: left;
}

.fill-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.fill-label {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-bright);
  white-space: nowrap;
  flex-shrink: 0;
  padding-bottom: 0.3rem;
  line-height: 1.4;
}

.fill-input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.fill-input {
  background: transparent;
  border: none;
  border-bottom: 2px dashed rgba(255, 107, 157, 0.35);
  color: #ff9ec4;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.2rem 0.3rem 0.25rem;
  outline: none;
  width: 100%;
  transition: border-color 0.25s, color 0.25s;
  letter-spacing: 0.03em;
}

.fill-input::placeholder {
  color: rgba(255, 107, 157, 0.28);
  font-weight: 400;
  font-style: italic;
  font-size: 0.85rem;
}

.fill-input:focus {
  border-bottom-color: #ff6b9d;
  border-bottom-style: solid;
  color: #fff;
}

.fill-input.error {
  border-bottom-color: var(--red) !important;
  color: #ff6b7a !important;
  animation: fillInputShake 0.45s ease;
}

.fill-input.success {
  border-bottom-color: #34d399 !important;
  color: #34d399 !important;
}

@keyframes fillInputShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  40%       { transform: translateX(5px); }
  60%       { transform: translateX(-3px); }
  80%       { transform: translateX(3px); }
}

.fill-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1rem 0;
  opacity: 0.3;
}

.fill-divider span:not(.fill-div-dot) {
  flex: 1;
  height: 1px;
  background: rgba(255, 107, 157, 0.5);
}

.fill-div-dot {
  font-size: 0.55rem;
  color: #ff6b9d;
}

/* Submit button */
.fill-submit {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #ff6b9d 0%, #e8447a 100%);
  border: none;
  border-radius: 50px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 5px 22px rgba(255, 107, 157, 0.4), 0 0 0 0 rgba(255,107,157,0.3);
  animation: fillBtnPulse 2.8s ease-in-out infinite;
}

.fill-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.fill-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 107, 157, 0.6);
}

.fill-submit:active {
  transform: scale(0.97) translateY(0);
}

@keyframes fillBtnPulse {
  0%, 100% { box-shadow: 0 5px 22px rgba(255,107,157,0.4), 0 0 0 0 rgba(255,107,157,0.3); }
  50%       { box-shadow: 0 5px 28px rgba(255,107,157,0.55), 0 0 18px 4px rgba(255,107,157,0.12); }
}

/* Error message */
.fill-error-msg {
  margin-top: 0.9rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  min-height: 1.4em;
  opacity: 0;
  transition: opacity 0.3s;
  color: #ff6b7a;
}

.fill-error-msg.visible { opacity: 1; }
.fill-error-msg.success { color: #34d399; }

@media (max-width: 400px) {
  .fill-label { font-size: 0.9rem; }
  .fill-input  { font-size: 0.9rem; }
  .fill-lock-title { font-size: 1.3rem; }
}

/* ==========================================
   Birthday Pantun Reveal Overlay
   ========================================== */
.brev-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at center, #1a0033 0%, #0a000f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.brev-overlay.brev-in  { opacity: 1; }
.brev-overlay.brev-out { opacity: 0; transition-duration: 0.9s; }

/* Floating stars */
.brev-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.brev-star {
  position: absolute;
  color: rgba(255, 200, 230, 0.55);
  animation: brevStarFloat linear infinite;
}

@keyframes brevStarFloat {
  0%   { opacity: 0; transform: translateY(0) scale(0.7); }
  30%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-60px) scale(1.1); }
}

/* Content */
.brev-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  max-width: 520px;
}

.brev-ornament {
  font-size: 1rem;
  letter-spacing: 0.6em;
  color: rgba(255, 180, 210, 0.45);
  margin-bottom: 1.6rem;
  display: block;
}

.brev-ornament-bot {
  margin-top: 1.6rem;
  margin-bottom: 0;
  font-size: 1.2rem;
  color: rgba(255, 120, 160, 0.5);
  letter-spacing: 0;
  animation: brevHeartBeat 1.4s ease-in-out infinite;
}

@keyframes brevHeartBeat {
  0%, 100% { transform: scale(1);   opacity: 0.5; }
  50%       { transform: scale(1.3); opacity: 0.9; }
}

.brev-line {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  color: #ffe8f2;
  line-height: 1.7;
  margin: 0;
  min-height: 1.7em;
}

.brev-line-1 {
  font-size: clamp(1.3rem, 4.5vw, 1.8rem);
  color: #ffcce0;
}

.brev-line-2 {
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  color: rgba(255, 210, 230, 0.85);
  margin-top: 0.5rem;
}

/* ============================================================
   BIRTHDAY CAKE — candle & blow-the-candle interaction
   ============================================================ */

.cake-scene {
  position: relative;
  width: 100%;
  max-width: 240px;
  margin: 1rem auto 0.5rem;
}

.hero-cake-svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 24px rgba(139, 26, 117, 0.5))
          drop-shadow(0 0 50px rgba(0, 238, 255, 0.07));
}

/* --- Flame overlay ---
   Wick tip sits at SVG y=22 inside viewBox(0 0 200 140).
   top: 22/140*100 = 15.71% → the div's bottom lands on the wick tip. */
.cake-flame-overlay {
  position: absolute;
  left: 50%;
  top: 15.71%;
  transform: translateX(-50%) translateY(-100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

/* Warm glow halo */
.cake-glow-halo {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(251,191,36,0.55) 0%,
    rgba(249,115,22,0.22) 45%,
    transparent 72%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: cakeGlowPulse 2s ease-in-out infinite alternate;
}

@keyframes cakeGlowPulse {
  0%   { opacity: 0.6;  transform: translate(-50%,-50%) scale(0.88); }
  100% { opacity: 1;    transform: translate(-50%,-50%) scale(1.22); }
}

/* Flame outer shape */
.cake-flame {
  width: 16px;
  height: 27px;
  background: linear-gradient(
    to top,
    #fbbf24       0%,
    #f97316       32%,
    #ef4444       62%,
    rgba(239,68,68,0.2) 88%,
    transparent   100%
  );
  border-radius: 50% 50% 35% 35% / 58% 58% 42% 42%;
  transform-origin: center bottom;
  animation: flameDance 1.65s ease-in-out infinite;
  position: relative;
}

/* Bright inner core */
.cake-flame-inner {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 12px;
  background: linear-gradient(
    to top,
    rgba(255,255,255,0.95) 0%,
    rgba(255,225,100,0.7)  52%,
    transparent            100%
  );
  border-radius: 50% 50% 30% 30% / 60% 60% 40% 40%;
}

@keyframes flameDance {
  0%   { transform: scaleX(1)    scaleY(1)    skewX(0deg); }
  18%  { transform: scaleX(0.85) scaleY(1.08) skewX(-5deg); }
  37%  { transform: scaleX(1.1)  scaleY(0.93) skewX(4deg); }
  56%  { transform: scaleX(0.9)  scaleY(1.06) skewX(-2deg); }
  75%  { transform: scaleX(1.07) scaleY(0.97) skewX(2deg); }
  100% { transform: scaleX(1)    scaleY(1)    skewX(0deg); }
}

/* Smoke particles (rise after blow) */
.cake-smoke {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 4px;
  pointer-events: none;
}

.cake-smoke span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(185, 215, 255, 0.75);
  opacity: 0;
  bottom: 0;
}
.cake-smoke span:nth-child(1) { left: 50%; transform: translateX(-50%); }
.cake-smoke span:nth-child(2) { left: 18%; transform: translateX(-50%); }
.cake-smoke span:nth-child(3) { left: 82%; transform: translateX(-50%); }

/* ---- BLOWN STATE ---- */
.cake-scene.candle-blown .cake-flame {
  animation: flameBlow 0.45s ease-out forwards;
}
.cake-scene.candle-blown .cake-flame-inner {
  animation: flameBlow 0.35s ease-out forwards;
}
.cake-scene.candle-blown .cake-glow-halo {
  animation: glowFade 0.5s ease-out forwards;
}
.cake-scene.candle-blown .cake-smoke span:nth-child(1) {
  animation: smokeRise1 2.4s ease-out 0.12s 3 both;
}
.cake-scene.candle-blown .cake-smoke span:nth-child(2) {
  animation: smokeRise2 2.4s ease-out 0.3s  3 both;
}
.cake-scene.candle-blown .cake-smoke span:nth-child(3) {
  animation: smokeRise3 2.4s ease-out 0.52s 3 both;
}

@keyframes flameBlow {
  0%   { transform: scaleX(1.4) skewX(-20deg) scaleY(0.8);  opacity: 0.85; }
  40%  { transform: scaleX(2.2) skewX(24deg)  scaleY(0.35); opacity: 0.4; }
  100% { transform: scaleX(0)   skewX(0deg)   scaleY(0);    opacity: 0; }
}
@keyframes glowFade {
  to { opacity: 0; }
}
@keyframes smokeRise1 {
  0%   { opacity: 0.75; transform: translateX(-50%) translateY(0)     scale(0.8); }
  100% { opacity: 0;    transform: translateX(-50%) translateY(-38px) scale(3.2); }
}
@keyframes smokeRise2 {
  0%   { opacity: 0.65; transform: translateX(-50%) translateY(0)     scale(0.7); }
  100% { opacity: 0;    transform: translateX(-90%) translateY(-30px) scale(2.5); }
}
@keyframes smokeRise3 {
  0%   { opacity: 0.65; transform: translateX(-50%) translateY(0)     scale(0.7); }
  100% { opacity: 0;    transform: translateX(-10%) translateY(-28px) scale(2.5); }
}

/* ---- BLOW BUTTON SECTION ---- */
.hero-blow-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.5rem;
  max-height: 180px;
  overflow: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.5s ease, margin 0.5s ease;
}

.hero-blow-section.blow-done {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  max-height: 0;
  margin: 0;
}

.blow-hint {
  font-family: var(--font-script);
  font-size: clamp(1.2rem, 4.2vw, 1.5rem);
  line-height: 1.35;
  color: #e8f6ff;
  letter-spacing: 0.4px;
  text-align: center;
  max-width: 20rem;
  margin: 0 auto;
  padding: 0.55rem 1.4rem;
  background: rgba(0, 18, 48, 0.78);
  border: 1px solid rgba(0, 238, 255, 0.35);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    0 4px 20px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(0, 238, 255, 0.12);
  text-shadow:
    0 0 20px rgba(0, 238, 255, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.blow-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 32px;
  border: 1.5px solid rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.07);
  color: #fbbf24;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  overflow: hidden;
  clip-path: polygon(4% 0, 100% 0, 100% 75%, 96% 100%, 0 100%, 0 25%);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.blow-btn:hover {
  background: rgba(251, 191, 36, 0.17);
  border-color: rgba(251, 191, 36, 0.85);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.3);
}

.blow-btn-wind {
  display: inline-block;
  animation: windShift 1.5s ease-in-out infinite;
}

@keyframes windShift {
  0%, 100% { transform: translateX(0)   scaleX(1);   opacity: 1;    }
  50%       { transform: translateX(5px) scaleX(1.2); opacity: 0.75; }
}

/* ---- HERO REVEAL (post-blow) ---- */
.hero-reveal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  width: 100%;
  transition: max-height 1s ease, opacity 0.65s ease 0.12s;
}

.hero-reveal-wrap.revealed {
  max-height: 520px;
  opacity: 1;
}

.hero-reveal-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-reveal-wrap.revealed .hero-reveal-item:nth-child(1) {
  opacity: 1; transform: translateY(0); transition-delay: 0.22s;
}
.hero-reveal-wrap.revealed .hero-reveal-item:nth-child(2) {
  opacity: 1; transform: translateY(0); transition-delay: 0.42s;
}
.hero-reveal-wrap.revealed .hero-reveal-item:nth-child(3) {
  opacity: 1; transform: translateY(0); transition-delay: 0.62s;
}

.hero-reveal-wrap .hero-divider { margin-top: 0.9rem; margin-bottom: 1.8rem; }
.hero-reveal-wrap .hero-message { margin-bottom: 2.2rem; }

/* Smaller cake on very short screens */
@media (max-height: 680px) {
  .cake-scene { max-width: 190px; margin: 0.5rem auto 0.3rem; }
  .hero-blow-section { gap: 7px; }
}

/* ========== FINAL SLIDE — 3D card, full image (contain, no crop) ========== */
#finalSection.content-section {
  overflow: hidden;
}

.final-screen {
  position: relative;
  width: 100%;
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

.final-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(8, 28, 58, 0.95) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 20% 20%, rgba(30, 70, 120, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 85% 30%, rgba(60, 40, 90, 0.22) 0%, transparent 45%),
    linear-gradient(180deg, #02040c 0%, #050a18 40%, #030612 100%);
  overflow: hidden;
}

.final-ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
}

.final-ambient-orb--a {
  width: min(70vw, 420px);
  height: min(70vw, 420px);
  left: -15%;
  bottom: -10%;
  background: radial-gradient(circle, rgba(80, 160, 220, 0.35) 0%, transparent 70%);
}

.final-ambient-orb--b {
  width: min(55vw, 320px);
  height: min(55vw, 320px);
  right: -8%;
  top: 5%;
  background: radial-gradient(circle, rgba(120, 90, 180, 0.22) 0%, transparent 70%);
}

.final-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(440px, 94vw);
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1400px;
  perspective-origin: 50% 45%;
  flex: 1;
  min-height: 0;
}

.final-card {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  animation: finalCardSway 12s ease-in-out infinite;
  will-change: transform;
}

@keyframes finalCardSway {
  0%,
  100% {
    transform: rotateY(-7deg) rotateX(2deg);
  }
  50% {
    transform: rotateY(7deg) rotateX(-1.5deg);
  }
}

.final-card-specular {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0) 38%,
    rgba(255, 255, 255, 0) 62%,
    rgba(180, 220, 255, 0.05) 100%
  );
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: soft-light;
}

.final-card-inner {
  position: relative;
  z-index: 1;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(
    165deg,
    rgba(12, 22, 42, 0.98) 0%,
    rgba(4, 10, 24, 1) 48%,
    rgba(6, 14, 32, 1) 100%
  );
  box-shadow:
    0 4px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.5) inset,
    0 30px 90px rgba(0, 0, 0, 0.65),
    0 12px 40px rgba(0, 20, 50, 0.5),
    -20px 0 50px rgba(0, 30, 80, 0.15),
    20px 0 50px rgba(80, 40, 100, 0.1);
}

.final-card-media {
  position: relative;
  padding: 14px 14px 0;
  background: radial-gradient(
    ellipse 100% 80% at 50% 80%,
    rgba(20, 50, 90, 0.35) 0%,
    rgba(2, 8, 20, 1) 70%
  );
}

.final-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(48vh, 520px);
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.final-card-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 1.35rem 1.5rem 1.65rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 16, 0.2) 0%,
    rgba(3, 10, 26, 0.97) 28%,
    rgba(2, 8, 22, 1) 100%
  );
  border-top: 1px solid rgba(120, 180, 255, 0.12);
  box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.35);
}

.final-prelude {
  margin: 0 0 1rem;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(170, 215, 255, 0.5);
  opacity: 0;
}

.final-quote {
  margin: 0;
  padding: 0;
  border: none;
  font-style: normal;
}

.final-quote-line {
  display: block;
  opacity: 0;
  transform: translateY(22px);
}

.final-quote-line:first-child {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.28rem, 4vw, 2rem);
  line-height: 1.33;
  letter-spacing: 0.02em;
  color: rgba(252, 254, 255, 0.97);
  text-shadow:
    0 2px 28px rgba(0, 12, 32, 0.95),
    0 0 1px rgba(0, 0, 0, 0.65);
}

.final-quote-line--accent {
  margin-top: 0.18em;
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(1.65rem, 6vw, 3rem);
  line-height: 1.15;
  background: linear-gradient(
    118deg,
    #9fe8ff 0%,
    #f5fbff 42%,
    #ffd4ea 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 28px rgba(0, 24, 48, 0.55));
}

.final-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.75rem;
  opacity: 0;
}

.final-rule span:first-child,
.final-rule span:last-child {
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(160, 210, 255, 0.45),
    transparent
  );
}

.final-rule-heart {
  font-size: 0.75rem;
  color: rgba(255, 182, 210, 0.85);
  text-shadow: 0 0 18px rgba(255, 140, 180, 0.45);
}

#finalSection.slide-active .final-prelude {
  animation: finalFadeUp 1s ease 0.35s forwards;
}

#finalSection.slide-active .final-quote-line:first-child {
  animation: finalFadeUp 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}

#finalSection.slide-active .final-quote-line--accent {
  animation: finalFadeUp 1.25s cubic-bezier(0.22, 1, 0.36, 1) 0.72s forwards;
}

#finalSection.slide-active .final-rule {
  animation: finalFadeUp 1s ease 1.05s forwards;
}

@keyframes finalFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .final-card {
    animation: none;
    transform: rotateY(0) rotateX(0);
  }

  #finalSection.slide-active .final-prelude,
  #finalSection.slide-active .final-quote-line:first-child,
  #finalSection.slide-active .final-quote-line--accent,
  #finalSection.slide-active .final-rule {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
}

@media (max-height: 640px) {
  .final-photo {
    max-height: min(34vh, 360px);
  }

  .final-card-copy {
    padding: 1rem 1.15rem 1.25rem;
  }
}
