/* ===================================================================
   🎨 3D WEBGL BIRTHDAY GIFT - GLASSMORHPISM & RESPONSIVE STYLES
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Cormorant+Garamond:ital,wght@0,500;0,700;1,600&family=Nunito:wght@300;400;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,500&display=swap');

:root {
  --primary: #f092a8;
  --secondary: #b39ddb;
  --gold: #fed385;
  --accent: #81d4fa;
  --bg-dark: #05040d;
  --glass-bg: rgba(18, 14, 30, 0.65);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(240, 146, 168, 0.16);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: 'Nunito', sans-serif;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* 🌌 Living Cosmic Aurora Waves Background */
.aurora-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, #0c081e 0%, #060410 70%, #030208 100%);
}

.aurora-wave {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.38;
  pointer-events: none;
  will-change: transform, opacity;
}

.wave-1 {
  width: 120vw;
  height: 80vh;
  top: -20%;
  left: -10%;
  background: radial-gradient(circle, rgba(179, 157, 219, 0.32), rgba(74, 30, 92, 0.18), transparent 70%);
  animation: driftAurora1 18s ease-in-out infinite alternate;
}

.wave-2 {
  width: 110vw;
  height: 90vh;
  bottom: -25%;
  right: -10%;
  background: radial-gradient(circle, rgba(240, 146, 168, 0.28), rgba(120, 40, 90, 0.14), transparent 70%);
  animation: driftAurora2 22s ease-in-out infinite alternate;
}

.wave-3 {
  width: 90vw;
  height: 70vh;
  top: 25%;
  left: 15%;
  background: radial-gradient(circle, rgba(129, 212, 250, 0.16), rgba(40, 80, 130, 0.1), transparent 65%);
  animation: driftAurora3 26s ease-in-out infinite alternate;
}

@keyframes driftAurora1 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(5%, 6%) scale(1.1); opacity: 0.45; }
  100% { transform: translate(-4%, 3%) scale(0.95); opacity: 0.35; }
}

@keyframes driftAurora2 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.25; }
  50% { transform: translate(-6%, -5%) scale(1.12); opacity: 0.42; }
  100% { transform: translate(5%, -3%) scale(0.98); opacity: 0.28; }
}

@keyframes driftAurora3 {
  0% { transform: translate(0, 0) scale(0.95); opacity: 0.15; }
  50% { transform: translate(4%, -6%) scale(1.08); opacity: 0.28; }
  100% { transform: translate(-5%, 5%) scale(1); opacity: 0.2; }
}

/* 🌌 3D WebGL Canvas & 2D FX Overlay */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
}

#fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  display: block;
}

/* ✨ Ambient Vignette Glow */
.vignette-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(circle at center, transparent 45%, rgba(3, 2, 8, 0.72) 100%);
}

/* 💬 Stage 1: Intro Hint Prompt */
#intro-prompt {
  position: fixed;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
  width: 90%;
  max-width: 480px;
}

#intro-prompt.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
}

.hint-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 8px;
  background: radial-gradient(ellipse, rgba(5, 4, 13, 0.45), transparent 72%);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.15px;
  line-height: 1.5;
  color: #f6e9dc;
  text-shadow: 0 2px 10px rgba(5, 4, 13, 0.9);
}

.hint-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.hint-subtitle {
  font-size: 12px;
  letter-spacing: 1px;
  color: #c0adbf;
}

.hint-badge .icon-sparkle {
  font-size: 12px;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(254, 211, 133, 0.45);
  animation: hintGlow 3.5s ease-in-out infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .hint-badge .icon-sparkle { animation: none; }
}

@keyframes floatPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 4px 18px rgba(240, 146, 168, 0.15); }
  50% { transform: translateY(-6px); box-shadow: 0 6px 24px rgba(240, 146, 168, 0.35); }
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 🕯️ Stage 2: Hold-to-blow Radial Progress Indicator */
#blow-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#blow-indicator.active {
  opacity: 1;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring__circle-bg {
  stroke: rgba(255, 255, 255, 0.12);
}

.progress-ring__circle {
  stroke: var(--gold);
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(254, 211, 133, 0.65));
  transition: stroke-dashoffset 0.05s linear;
}

.indicator-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.indicator-flame {
  font-size: 28px;
  animation: flickerFlame 0.3s ease-in-out infinite alternate;
}

@keyframes flickerFlame {
  0% { transform: scale(0.9) rotate(-3deg); opacity: 0.85; }
  100% { transform: scale(1.1) rotate(3deg); opacity: 1; filter: drop-shadow(0 0 8px #fed385); }
}

.indicator-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-top: 4px;
}

/* 💖 Stage 4: Frameless Cinematic Romantic Typography */
#romantic-story-container {
  position: fixed;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 520px;
  z-index: 25;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 1.2s;
}

#romantic-story-container.visible {
  opacity: 1;
  visibility: visible;
}

.story-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Kính mờ cao cấp giúp chữ siêu rõ nét, không bị hạt 3D chiếu xuyên gây chói */
  background: linear-gradient(180deg, rgba(12, 10, 24, 0.08), rgba(12, 10, 24, 0.7));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  border-radius: 22px;
  box-shadow: none;
  padding: 14px 20px;
}

.story-header {
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.story-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.story-star {
  color: var(--gold);
  font-size: 11px;
  filter: drop-shadow(0 0 6px var(--gold));
  display: inline-block;
  animation: pulseStar 2s ease-in-out infinite alternate;
}

@keyframes pulseStar {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 1; }
}

.story-badge {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #f7a8b8;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(240, 146, 168, 0.45);
}

.story-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  margin-top: 1px;
}

.story-crush-name {
  display: none; /* Đã có chữ 3D Thu Uyên phát sáng phía trên Trái tim */
}

.story-body {
  width: 100%;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 4px 0 8px 0;
}

.story-typed-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.story-typed-text {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 10px rgba(240, 146, 168, 0.35);
  letter-spacing: 0.3px;
  max-width: 480px;
}

.story-cursor {
  font-size: 15px;
  margin-left: 6px;
  color: var(--gold);
  animation: blinkCursor 0.8s infinite;
  filter: drop-shadow(0 0 6px var(--gold));
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; transform: scale(1.15); }
  50% { opacity: 0; transform: scale(0.8); }
}

.story-footer {
  margin-top: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
}

.story-footer.visible {
  opacity: 1;
  transform: translateY(0);
}

.story-signature {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: #fce4ec;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(240, 146, 168, 0.45);
}

/* 💌 Nút Mở Điều Ước Cho Thu Uyên */
.btn-open-wish {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, rgba(240, 146, 168, 0.35), rgba(179, 157, 219, 0.35));
  border: 1px solid rgba(254, 211, 133, 0.5);
  border-radius: 50px;
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 18px rgba(240, 146, 168, 0.25), 0 0 10px rgba(254, 211, 133, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pulseWishBtn 2.6s ease-in-out infinite alternate;
}

.btn-open-wish:hover, .btn-open-wish:active {
  transform: translateY(-2px) scale(1.03);
  background: linear-gradient(135deg, rgba(240, 146, 168, 0.55), rgba(179, 157, 219, 0.55));
  border-color: var(--gold);
  box-shadow: 0 6px 24px rgba(240, 146, 168, 0.45), 0 0 16px rgba(254, 211, 133, 0.55);
}

.wish-sparkle {
  font-size: 14px;
  animation: spinSlow 4s linear infinite;
}

.wish-arrow {
  color: var(--gold);
  font-size: 13px;
  transition: transform 0.2s ease;
}

.btn-open-wish:hover .wish-arrow {
  transform: translateX(3px);
}

@keyframes pulseWishBtn {
  0% { box-shadow: 0 4px 16px rgba(240, 146, 168, 0.2), 0 0 8px rgba(254, 211, 133, 0.2); }
  100% { box-shadow: 0 6px 24px rgba(240, 146, 168, 0.4), 0 0 14px rgba(254, 211, 133, 0.45); }
}

/* 🔄 Bộ Chuyển Đổi Hình Thái 3D (Constellation Morph Switcher) */
.shape-switcher {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 14, 30, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 40px;
  padding: 4px 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 14px rgba(179, 157, 219, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.shape-switcher.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.shape-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 30px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.shape-btn .shape-icon {
  font-size: 13px;
  transition: transform 0.25s ease;
}

.shape-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.shape-btn.active {
  background: linear-gradient(135deg, rgba(240, 146, 168, 0.3), rgba(179, 157, 219, 0.3));
  border-color: rgba(254, 211, 133, 0.55);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(240, 146, 168, 0.25);
}

.shape-btn.active .shape-icon {
  transform: scale(1.2);
}

/* 🌟 Modal Lá Bài Điều Ước Bí Mật 3D (Secret Wish Modal) */
.wish-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  pointer-events: none;
}

.wish-modal.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wish-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 4, 12, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.wish-card-wrapper {
  position: relative;
  z-index: 1001;
  perspective: 1200px;
  width: 90%;
  max-width: 380px;
  padding: 10px;
}

.wish-card {
  position: relative;
  background: linear-gradient(165deg, rgba(26, 18, 42, 0.95) 0%, rgba(14, 10, 24, 0.96) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(254, 211, 133, 0.4);
  border-radius: 26px;
  padding: 24px 22px 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(240, 146, 168, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform-style: preserve-3d;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

.wish-modal.visible .wish-card {
  transform: scale(1) translateY(0);
}

/* Góc trang trí hoàng gia */
.wish-card-decor {
  position: absolute;
  color: rgba(254, 211, 133, 0.5);
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}
.decor-tl { top: 12px; left: 14px; }
.decor-tr { top: 12px; right: 14px; }
.decor-bl { bottom: 12px; left: 14px; }
.decor-br { bottom: 12px; right: 14px; }

.wish-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.wish-card-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(254, 211, 133, 0.5);
}

.btn-close-wish {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-wish:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.1);
}

.wish-card-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px 14px 4px;
  min-height: 170px;
  justify-content: center;
}

.wish-card-icon {
  font-size: 42px;
  margin-bottom: 12px;
  animation: pulseIcon 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 14px rgba(240, 146, 168, 0.6));
}

@keyframes pulseIcon {
  0% { transform: scale(0.92); }
  100% { transform: scale(1.08); }
}

.wish-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff, #fed385);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(254, 211, 133, 0.35));
}

.wish-card-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.wish-card-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wish-page-indicator {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-next-wish {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(240, 146, 168, 0.3), rgba(254, 211, 133, 0.3));
  border: 1px solid rgba(254, 211, 133, 0.5);
  border-radius: 20px;
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-next-wish:hover {
  background: linear-gradient(135deg, rgba(240, 146, 168, 0.5), rgba(254, 211, 133, 0.5));
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(254, 211, 133, 0.35);
}

/* Lật thẻ khi chuyển điều ước */
.wish-card.flipping {
  animation: cardFlip 0.5s ease-in-out;
}

@keyframes cardFlip {
  0% { transform: scale(1) rotateY(0deg); opacity: 1; }
  50% { transform: scale(0.85) rotateY(90deg); opacity: 0.3; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

/* 💖 Hiệu ứng tim bay bổng khi click bất kỳ đâu (Floating Hearts on Click) */
.floating-heart {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  font-size: 22px;
  animation: floatUpAndFade 1.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  filter: drop-shadow(0 0 8px rgba(240, 146, 168, 0.6));
}

@keyframes floatUpAndFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
  }
  50% {
    opacity: 0.95;
    transform: translate(calc(-50% + var(--drift-x, 0px)), -120px) scale(1.3) rotate(var(--rot, 15deg));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift-x, 0px)), -230px) scale(0.8) rotate(var(--rot, 30deg));
  }
}

.btn-explore:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240, 146, 168, 0.4);
}

/* 🎛️ Floating Action Controls */
#floating-controls {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  gap: 12px;
  align-items: center;
}

.control-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

.control-btn:hover {
  transform: translateY(-3px) scale(1.06);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

#btn-controls-menu {
  font-size: 27px;
  line-height: 1;
}

#controls-dropdown {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(230px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(18,12,29,0.94);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

#controls-dropdown[hidden] { display: none; }

#controls-dropdown .control-btn {
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 10px 12px;
  justify-content: flex-start;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  font: 12px/1.4 'Nunito', sans-serif;
  text-align: left;
}

#controls-dropdown .control-btn:hover,
#controls-dropdown .control-btn:focus-visible { background: rgba(255,255,255,0.08); transform: none; }
#controls-dropdown .control-btn.active { color: var(--primary); }
#controls-dropdown svg, #controls-dropdown .equalizer { flex-shrink: 0; width: 20px; }

.control-btn.active {
  background: linear-gradient(135deg, rgba(240, 146, 168, 0.35), rgba(179, 157, 219, 0.35));
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(240, 146, 168, 0.4);
}

/* 🎵 Animated Equalizer in Music Button */
.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 16px;
}

.eq-bar {
  width: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  height: 4px;
  transition: height 0.2s ease;
}

.control-btn.playing .eq-bar:nth-child(1) { animation: soundBar 0.8s ease-in-out infinite alternate; }
.control-btn.playing .eq-bar:nth-child(2) { animation: soundBar 1.1s ease-in-out 0.2s infinite alternate; }
.control-btn.playing .eq-bar:nth-child(3) { animation: soundBar 0.9s ease-in-out 0.4s infinite alternate; }
.control-btn.playing .eq-bar:nth-child(4) { animation: soundBar 1.2s ease-in-out 0.1s infinite alternate; }

@keyframes soundBar {
  0% { height: 3px; }
  100% { height: 16px; }
}

/* 📱 Responsive Mobile Adjustments: Portrait & Landscape */

/* 1. Mobile Portrait (Màn hình dọc) */
@media (max-width: 600px) and (orientation: portrait), (max-width: 480px) {
  #intro-prompt {
    bottom: max(10%, env(safe-area-inset-bottom, 24px));
    width: 90%;
  }

  .hint-badge {
    font-size: clamp(13px, 3.8vw, 15px);
    padding: 8px 0;
    gap: 5px;
  }

  #romantic-story-container {
    bottom: max(3.5%, env(safe-area-inset-bottom, 12px));
    width: 90%;
    max-width: 360px;
  }

  .story-content {
    padding: 10px 16px;
    border-radius: 18px;
  }

  .story-header {
    margin-bottom: 4px;
    gap: 2px;
  }

  .story-star {
    font-size: 10px;
  }

  .story-badge {
    font-size: 10.5px;
    letter-spacing: 1.5px;
  }

  .story-subtitle {
    font-size: 13px;
    margin-top: 1px;
  }

  .story-crush-name {
    display: none;
  }

  .story-body {
    min-height: 48px;
    margin: 3px 0 5px 0;
  }

  .story-typed-container {
    min-height: 42px;
  }

  .story-typed-text {
    font-size: 13.5px;
    line-height: 1.5;
  }

  .story-cursor {
    font-size: 13px;
  }

  .story-footer {
    margin-top: 2px;
  }

  .story-signature {
    font-size: 12px;
  }

  #floating-controls {
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    right: 16px;
    gap: 8px;
  }

  .control-btn {
    width: 40px;
    height: 40px;
  }

  .shape-switcher {
    top: max(14px, env(safe-area-inset-top, 14px));
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 6px;
    gap: 4px;
  }

  .shape-switcher.visible {
    transform: translateX(-50%) translateY(0);
  }

  .shape-btn {
    padding: 5px 10px;
    font-size: 11px;
    gap: 4px;
  }

  .shape-btn .shape-icon {
    font-size: 12px;
  }

  .wish-card {
    padding: 20px 18px 16px 18px;
  }

  .wish-card-title {
    font-size: 18px;
  }

  .wish-card-desc {
    font-size: 13.5px;
  }
}

/* 2. Mobile Landscape (Màn hình xoay ngang, chiều cao 320px - 520px) */
@media (orientation: landscape) and (max-height: 520px) {
  #intro-prompt {
    bottom: max(4%, env(safe-area-inset-bottom, 10px));
    width: 80%;
    max-width: 420px;
  }

  .hint-badge {
    font-size: 14px;
    padding: 4px 0;
    gap: 2px;
  }

  #romantic-story-container {
    bottom: max(2%, env(safe-area-inset-bottom, 8px));
    width: 88%;
    max-width: 580px;
  }

  .story-content {
    padding: 6px 14px;
    border-radius: 18px;
  }

  .story-header {
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2px;
  }

  .story-star {
    font-size: 11px;
  }

  .story-badge {
    display: none; /* Ẩn badge phụ để chữ gọn gàng không che trái tim 3D */
  }

  .story-subtitle {
    font-size: 13px;
    letter-spacing: 0.5px;
  }

  .story-crush-name {
    font-size: 20px;
    line-height: 1.1;
    margin-top: 0;
  }

  .story-body {
    min-height: 36px;
    margin: 2px 0;
  }

  .story-typed-container {
    min-height: 32px;
  }

  .story-typed-text {
    font-size: 13px;
    line-height: 1.4;
  }

  .story-cursor {
    font-size: 13px;
  }

  .story-footer {
    margin-top: 1px;
  }

  .story-signature {
    font-size: 12px;
  }

  #floating-controls {
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    right: 14px;
    gap: 6px;
  }

  .control-btn {
    width: 34px;
    height: 34px;
  }

  .control-btn svg {
    width: 14px;
    height: 14px;
  }

  .equalizer {
    height: 12px;
  }

  @keyframes soundBar {
    0% { height: 2px; }
    100% { height: 12px; }
  }

  .shape-switcher {
    top: max(8px, env(safe-area-inset-top, 8px));
    right: 14px;
    padding: 2px 4px;
    gap: 3px;
  }

  .shape-btn {
    padding: 4px 8px;
    font-size: 10.5px;
  }

  .wish-card {
    padding: 14px 18px 10px 18px;
  }

  .wish-card-body {
    min-height: 100px;
  }

  .wish-card-icon {
    font-size: 26px;
    margin-bottom: 4px;
  }

  .wish-card-title {
    font-size: 16px;
    margin-bottom: 4px;
  }

  .wish-card-desc {
    font-size: 12.5px;
    line-height: 1.4;
  }
}

/* ===================================================================
   📟 THE MATRIX DIGITAL RAIN & 5S CYBER COUNTDOWN
   =================================================================== */
.matrix-intro-container {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #02060b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.75s ease;
  user-select: none;
  -webkit-user-select: none;
}

.matrix-intro-container.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Hiệu ứng CRT Scanlines & Vignette của màn hình hacker */
.matrix-scanlines {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.35) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.02),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.02)
  );
  background-size: 100% 4px, 6px 100%;
  opacity: 0.75;
}

.matrix-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 35%, rgba(1, 4, 8, 0.85) 95%);
}

/* Hộp Cyber HUD trung tâm - Hoàn toàn không viền, hòa quyện tự nhiên trong cơn mưa ma trận */
.matrix-hud-box {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px 20px;
  max-width: 540px;
  width: 92%;
  background: radial-gradient(circle at center, rgba(2, 6, 12, 0.68) 0%, rgba(2, 6, 12, 0.3) 55%, transparent 100%);
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.matrix-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #00ffcc;
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.7);
  margin-bottom: 18px;
  opacity: 0.9;
}

.matrix-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  animation: matrix-blink 1s ease-in-out infinite;
}

@keyframes matrix-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

.matrix-terminal-lines {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 2.0;
  color: rgba(220, 255, 240, 0.92);
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
  background: transparent;
  padding: 0;
  border: none;
}

.matrix-log {
  margin: 3px 0;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.65), 0 2px 4px rgba(0, 0, 0, 0.95);
}

.matrix-prompt {
  color: #00ff88;
  font-weight: bold;
  text-shadow: 0 0 8px #00ff88;
}

.matrix-highlight {
  color: #fed385;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(254, 211, 133, 0.9), 0 0 22px rgba(254, 211, 133, 0.5), 0 2px 4px #000;
}

/* Số đếm ngược Cyber 5s - Phóng chiếu ba chiều trực tiếp trong dải mưa hạt */
.matrix-countdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  position: relative;
}

.matrix-countdown-number {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: clamp(56px, 17vw, 98px);
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 
    0 0 12px #ffffff,
    0 0 28px #00ffcc,
    0 0 55px rgba(0, 255, 136, 0.85),
    0 0 95px rgba(0, 229, 255, 0.65);
  letter-spacing: 3px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.matrix-countdown-number.pulse {
  animation: matrix-num-pulse 0.45s ease-out;
}

@keyframes matrix-num-pulse {
  0% { transform: scale(1.3); text-shadow: 0 0 35px #ffffff, 0 0 75px #00ffcc, 0 0 120px #00ff88; }
  100% { transform: scale(1); }
}

.matrix-countdown-label {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(0, 255, 204, 0.75);
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.6), 0 2px 4px #000;
  margin-top: 8px;
}

/* Nút Bỏ qua dạng Cyber Hacker Bracket Link */
.btn-skip-matrix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(0, 255, 204, 0.45);
  color: rgba(0, 255, 204, 0.85);
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.65);
  transition: all 0.25s ease;
  margin-bottom: 12px;
}

.btn-skip-matrix:hover {
  color: #ffffff;
  border-bottom-color: #00ffcc;
  text-shadow: 0 0 16px #00ffcc, 0 0 24px #00ff88;
  transform: translateY(-1px);
}

.matrix-hint {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 11px;
  color: rgba(0, 255, 170, 0.45);
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(0, 255, 170, 0.3), 0 1px 3px #000;
}

@media (max-width: 480px) {
  .matrix-hud-box {
    padding: 20px 14px 16px;
  }
  .matrix-terminal-lines {
    font-size: 11.5px;
    line-height: 1.9;
  }
  .matrix-countdown-number {
    font-size: clamp(48px, 15vw, 68px);
  }
}
