/* ========================================================
   🌸 DESIGN SYSTEM & CORE STYLESHEET
   Dành riêng cho web tỏ tình, kỷ niệm 20/10 & tình yêu xa
   ======================================================== */

:root {
  --primary-rgb: 194, 62, 92;
  --secondary-rgb: 181, 61, 92;
  --primary-hover-rgb: 157, 41, 69;
  --accent-rgb: 255, 133, 161;
  --seal-hue-rotation: 0deg;
  --seal-filter: grayscale(0);
  /* Default: Sakura Pink Palette */
  --primary-color: #c23e5c;
  --primary-hover: #9d2945;
  --secondary-color: #b53d5c;
  --accent-pink: #ff85a1;
  --accent-light: #fff0f3;
  --bg-gradient: linear-gradient(135deg, #fff5f6 0%, #ffe5e9 52%, #fff1f4 100%);
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --border-color: rgba(210, 91, 120, 0.2);
  --text-color: #2b2d42;
  --text-muted: #6c757d;
  --shadow-soft: 0 8px 24px rgba(111, 50, 67, 0.09);
  --shadow-hover: 0 12px 30px rgba(111, 50, 67, 0.14);
  --font-main: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-cursive: 'Dancing Script', cursive;
  --font-hand: 'Patrick Hand', 'Caveat', cursive;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --intro-gradient: radial-gradient(circle at center, #fff9fa 0%, #ffe5e9 64%, #f5bfca 100%);
  --page-wash-opacity: 0.11;
}

/* Alternate Theme: Sunset Romance */
[data-theme="sunset"] {
  --seal-hue-rotation: 8deg;
  --primary-rgb: 173, 80, 53;
  --secondary-rgb: 168, 99, 57;
  --primary-hover-rgb: 142, 62, 43;
  --accent-rgb: 233, 196, 106;
  --primary-color: #ad5035;
  --primary-hover: #8e3e2b;
  --secondary-color: #a86339;
  --accent-pink: #e9c46a;
  --accent-light: #fefae0;
  --bg-gradient: linear-gradient(135deg, #fff5e4 0%, #fff9eb 54%, #f5dfc4 100%);
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: rgba(255, 255, 255, 0.94);
  --border-color: rgba(185, 104, 66, 0.19);
  --shadow-soft: 0 8px 24px rgba(120, 68, 39, 0.08);
  --shadow-hover: 0 12px 30px rgba(120, 68, 39, 0.14);
  --page-wash-opacity: 0.1;
  --intro-gradient: radial-gradient(circle at center, #fffaf0 0%, #f9ead2 64%, #edcba8 100%);
}

/* Alternate Theme: Starry Night Romance */
[data-theme="starry"] {
  --seal-hue-rotation: 265deg;
  --primary-rgb: 149, 90, 200;
  --secondary-rgb: 123, 44, 191;
  --primary-hover-rgb: 110, 57, 150;
  --accent-rgb: 224, 170, 255;
  --primary-color: #955ac8;
  --primary-hover: #6e3996;
  --secondary-color: #7b2cbf;
  --accent-pink: #e0aaff;
  --accent-light: #240046;
  --bg-gradient: linear-gradient(145deg, #171329 0%, #241c3b 54%, #30244a 100%);
  --bg-card: rgba(37, 31, 58, 0.92);
  --bg-card-hover: rgba(49, 41, 72, 0.97);
  --border-color: rgba(199, 160, 236, 0.24);
  --text-color: #ffffff;
  --text-muted: #d2c7e4;
  --shadow-soft: 0 10px 30px rgba(9, 6, 20, 0.24);
  --shadow-hover: 0 12px 30px rgba(9, 6, 20, 0.32);
  --page-wash-opacity: 0.055;
  --intro-gradient: radial-gradient(circle at center, #383051 0%, #241c3b 62%, #171329 100%);
}

[data-theme="nude"] {
  --seal-hue-rotation: 15deg;
  --primary-rgb: 133, 82, 63;
  --secondary-rgb: 144, 102, 79;
  --primary-hover-rgb: 112, 66, 47;
  --accent-rgb: 223, 185, 164;
  --primary-color: #85523f;
  --primary-hover: #70422f;
  --secondary-color: #90664f;
  --accent-pink: #dfb9a4;
  --accent-light: #f7eee7;
  --bg-gradient: linear-gradient(135deg, #faf4ef 0%, #f0e1d7 54%, #f8eee7 100%);
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: rgba(255, 255, 255, 0.94);
  --border-color: rgba(143, 94, 72, 0.18);
  --shadow-soft: 0 8px 24px rgba(87, 59, 45, 0.08);
  --shadow-hover: 0 12px 30px rgba(87, 59, 45, 0.14);
  --page-wash-opacity: 0.085;
  --intro-gradient: radial-gradient(circle at center, #fffaf6 0%, #f0e1d7 68%, #d8b9a6 100%);
}

[data-theme="white"] {
  --seal-hue-rotation: 0deg;
  --seal-filter: grayscale(1);
  --primary-rgb: 102, 112, 133;
  --secondary-rgb: 102, 112, 133;
  --primary-hover-rgb: 71, 84, 103;
  --accent-rgb: 208, 213, 221;
  --primary-color: #667085;
  --primary-hover: #475467;
  --secondary-color: #667085;
  --accent-pink: #d0d5dd;
  --accent-light: #f2f4f7;
  --bg-gradient: linear-gradient(135deg, #ffffff 0%, #f7f8fa 56%, #edf0f3 100%);
  --bg-card: rgba(255, 255, 255, 0.84);
  --bg-card-hover: rgba(255, 255, 255, 0.97);
  --border-color: rgba(83, 94, 113, 0.17);
  --shadow-soft: 0 8px 24px rgba(52,64,84,.07);
  --shadow-hover: 0 12px 30px rgba(52,64,84,.12);
  --page-wash-opacity: 0.035;
  --intro-gradient: radial-gradient(circle at center, #fff 0%, #f5f6f8 70%, #dfe3e8 100%);
}

[data-theme="blue"] {
  --seal-hue-rotation: 205deg;
  --primary-rgb: 61, 111, 148;
  --secondary-rgb: 71, 121, 159;
  --primary-hover-rgb: 49, 91, 125;
  --accent-rgb: 169, 203, 227;
  --primary-color: #3d6f94;
  --primary-hover: #315b7d;
  --secondary-color: #47799f;
  --accent-pink: #a9cbe3;
  --accent-light: #edf6fc;
  --bg-gradient: linear-gradient(135deg, #f4f9fd 0%, #dfedf7 54%, #eef7fb 100%);
  --bg-card: rgba(255, 255, 255, 0.84);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(59, 105, 139, 0.18);
  --shadow-soft: 0 8px 24px rgba(52,99,138,.08);
  --shadow-hover: 0 12px 30px rgba(52,99,138,.14);
  --page-wash-opacity: 0.075;
  --intro-gradient: radial-gradient(circle at center, #fbfdff 0%, #dfedf7 68%, #afd0e4 100%);
}

[data-theme="turquoise"] {
  --seal-hue-rotation: 180deg;
  --primary-rgb: 30, 114, 116;
  --secondary-rgb: 33, 118, 121;
  --primary-hover-rgb: 23, 111, 115;
  --accent-rgb: 145, 212, 204;
  --primary-color: #1e7274;
  --primary-hover: #176f73;
  --secondary-color: #217679;
  --accent-pink: #91d4cc;
  --accent-light: #e7f7f5;
  --bg-gradient: linear-gradient(135deg, #f1faf8 0%, #d8f1ed 54%, #eaf7f4 100%);
  --bg-card: rgba(255, 255, 255, 0.84);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(32, 116, 117, 0.18);
  --shadow-soft: 0 8px 24px rgba(27,119,121,.08);
  --shadow-hover: 0 12px 30px rgba(27,119,121,.14);
  --page-wash-opacity: 0.075;
  --intro-gradient: radial-gradient(circle at center, #f9fdfc 0%, #d8f1ed 68%, #a7dcd5 100%);
}

[data-theme="green"] {
  --seal-hue-rotation: 135deg;
  --primary-rgb: 75, 118, 91;
  --secondary-rgb: 80, 125, 94;
  --primary-hover-rgb: 62, 104, 79;
  --accent-rgb: 180, 208, 180;
  --primary-color: #4b765b;
  --primary-hover: #3e684f;
  --secondary-color: #507d5e;
  --accent-pink: #b4d0b4;
  --accent-light: #eef5ed;
  --bg-gradient: linear-gradient(135deg, #f4f8f1 0%, #e3eedf 54%, #eef5e9 100%);
  --bg-card: rgba(255, 255, 255, 0.84);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(65, 105, 77, 0.18);
  --shadow-soft: 0 8px 24px rgba(64,105,77,.08);
  --shadow-hover: 0 12px 30px rgba(64,105,77,.14);
  --page-wash-opacity: 0.075;
  --intro-gradient: radial-gradient(circle at center, #fbfdf9 0%, #e3eedf 68%, #bdd2b9 100%);
}

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

body {
  font-family: var(--font-main);
  background:
    radial-gradient(ellipse at 14% 8%, rgba(var(--accent-rgb), var(--page-wash-opacity, 0.08)) 0, transparent 36%),
    radial-gradient(ellipse at 88% 20%, rgba(var(--secondary-rgb), calc(var(--page-wash-opacity, 0.08) * 0.72)) 0, transparent 42%),
    linear-gradient(90deg, transparent 0 34px, rgba(var(--primary-rgb), 0.035) 34px 35px, transparent 35px),
    var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-color);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Canvas hiệu ứng nền */
#romantic-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Container chính */
.main-wrapper {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 120px;
}

/* ========================================================
   🎁 INTRO CURTAIN REVEAL (MỞ QUÀ 20/10)
   ======================================================== */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: var(--intro-gradient, radial-gradient(circle at center, var(--accent-light) 0%, var(--accent-pink) 60%, var(--accent-pink) 100%));
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.intro-overlay.fade-out {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.intro-box {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-gift-icon {
  font-size: 4.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 6px 12px rgba(var(--primary-rgb), 0.3));
}

.intro-gift-icon i {
  display: block;
  color: var(--primary-color);
  font-size: 4rem;
}

.intro-gift-icon span {
  display: block;
  margin-top: -1rem;
  margin-left: 3.2rem;
  font-size: 1.6rem;
}

.intro-title {
  font-family: var(--font-cursive);
  font-size: clamp(2rem, 6vw, 2.7rem);
  color: var(--primary-color);
  margin-bottom: 6px;
}

.intro-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-unlock {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #fff;
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 34px;
  border-radius: 35px;
  cursor: pointer;
  box-shadow: var(--shadow-hover);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-unlock:hover {
  transform: scale(1.06);
  box-shadow: var(--shadow-hover);
}

/* ========================================================
   🧭 TOP NAVIGATION PILLS
   ======================================================== */
.nav-pills-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding: 8px 4px;
  -webkit-overflow-scrolling: touch;
}

.nav-pills-bar::-webkit-scrollbar {
  display: none;
}

.nav-pill-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-pill-btn:hover,
.nav-pill-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

/* ========================================================
   💑 COUPLE HEADER & AVATARS
   ======================================================== */
.couple-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.couple-avatars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 40px);
  margin-bottom: 18px;
}

.avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-ring {
  width: clamp(80px, 18vw, 115px);
  height: clamp(80px, 18vw, 115px);
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 82%, var(--secondary-color)));
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
  position: relative;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid #fff;
}

.avatar-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 8px;
  color: var(--text-color);
}

.couple-heart-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.beating-heart-icon {
  font-size: clamp(2rem, 5vw, 2.8rem);
  filter: drop-shadow(0 4px 8px rgba(230, 57, 70, 0.4));
}

.heart-subtext {
  font-family: var(--font-cursive);
  font-size: 1.15rem;
  color: var(--primary-color);
  font-weight: bold;
}

.couple-hero-title {
  font-family: var(--font-cursive);
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  color: var(--primary-color);
  margin-bottom: 6px;
}

.couple-hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ========================================================
   ✈️ DISTANCE & LOVE RADAR (HAI ĐẦU CẦU NHỚ THƯƠNG)
   ======================================================== */
.distance-radar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  position: relative;
  text-align: center;
}

.flight-radar-map {
  margin: 18px 0 20px;
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-light) 78%, transparent) 0%, rgba(255, 255, 255, 0.9) 100%);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 16px 14px;
  overflow: hidden;
}

.flight-cities-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
  gap: 10px;
}

.flight-city-card {
  flex: 1;
  max-width: 140px;
  background: var(--bg-card);
  border: 1.5px solid var(--accent-pink);
  border-radius: 16px;
  padding: 12px 8px;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.25s ease;
}

.flight-city-card:hover {
  transform: translateY(-2px);
}

.city-pin-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.city-name-label {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-color);
  white-space: nowrap;
}

.city-sub-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-color);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 10px;
}

.flight-middle-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 2;
  padding: 0 6px;
}

.distance-heart-pill {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.26);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.distance-heart-pill .pulse-dot {
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

.heart-distance-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-color);
  font-style: italic;
}

/* Cung đường bay uốn lượn có máy bay */
.flight-curve-track {
  position: relative;
  height: 48px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flight-dashed-arc {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 30px;
  border-top: 2.5px dashed var(--primary-color);
  border-radius: 50% 50% 0 0;
  opacity: 0.65;
}

.flight-animated-plane {
  position: absolute;
  color: var(--primary-color);
  font-size: 1.4rem;
  animation: flyAlongArc 5s ease-in-out infinite;
  z-index: 3;
}

@keyframes flyAlongArc {
  0% {
    left: 10%;
    transform: translateY(12px) rotate(15deg);
  }
  48% {
    left: 48%;
    transform: translateY(-8px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(0deg);
  }
  98% {
    left: 86%;
    transform: translateY(12px) rotate(-15deg);
  }
  100% {
    left: 10%;
    transform: translateY(12px) rotate(15deg);
  }
}

.radar-quote-box {
  background: color-mix(in srgb, var(--accent-light) 76%, transparent);
  border-left: 4px solid var(--primary-color);
  padding: 12px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 16px;
  text-align: left;
}

.btn-send-hug {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 82%, var(--secondary-color)));
  color: #fff;
  border: none;
  padding: 13px 20px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.24);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-send-hug:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.32);
}

.hug-sent-inline-badge {
  margin-top: 10px;
  padding: 8px 14px;
  background: #e8f5e9;
  color: #2b9348;
  border: 1px solid #c8e6c9;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  animation: popIn 0.3s ease;
}

.flying-hug-heart {
  position: absolute;
  left: 12%;
  top: 30%;
  z-index: 100;
  animation: flyAcross 1.8s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes flyAcross {
  0% { left: 12%; opacity: 1; transform: scale(0.6) rotate(-20deg); }
  50% { top: 10%; transform: scale(1.3) rotate(0deg); }
  100% { left: 80%; opacity: 0; transform: scale(0.8) rotate(20deg); }
}

/* ========================================================
   ⏰ LOVE TIMER & 20/10 COUNTDOWN
   ======================================================== */
.love-timer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  margin-bottom: 30px;
}

.timer-hero-number {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.2rem, 9vw, 5rem);
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
  text-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
  margin: 10px 0 4px;
}

.timer-hero-label {
  font-family: var(--font-cursive);
  font-size: 1.4rem;
  color: var(--secondary-color);
  font-weight: bold;
  margin-bottom: 20px;
}

.timer-units-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 600px;
  margin: 0 auto 24px;
}

@media (max-width: 550px) {
  .timer-units-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

.timer-unit-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.unit-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1.1;
}

.unit-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 2px;
}

/* 20/10 Countdown Ribbon */
.countdown-2010-box {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--accent-rgb), 0.15));
  border: 1.5px dashed var(--primary-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.countdown-digits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(4px, 2vw, 12px);
  width: 100%;
  box-sizing: border-box;
}

.cd-digit-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.cd-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-hover);
}

.cd-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.today-2010-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.2);
}

.today-2010-banner .banner-icon {
  font-size: 1.8rem;
}

.today-2010-banner strong {
  color: var(--primary-color);
  font-size: 1.05rem;
}

.today-2010-banner p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* ========================================================
   💌 3D INTERACTIVE ENVELOPE (PHONG BÌ 20/10)
   ======================================================== */
.letter-section {
  margin: 40px 0;
  text-align: center;
}

.envelope-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
}

.interactive-envelope {
  width: clamp(280px, 80vw, 360px);
  height: 220px;
  background: #fdf0d5;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.3s ease;
  border: 1px solid #e9d8a6;
}

.interactive-envelope:hover {
  transform: translateY(-5px);
}

/* Flap top */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: clamp(140px, 40vw, 180px) solid transparent;
  border-right: clamp(140px, 40vw, 180px) solid transparent;
  border-top: 120px solid #faedcd;
  transform-origin: top;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
}

.interactive-envelope.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

/* Envelope pockets (left/right/bottom) */
.envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: clamp(140px, 40vw, 180px) solid #faedcd;
  border-right: clamp(140px, 40vw, 180px) solid #faedcd;
  border-bottom: 120px solid #fefae0;
  border-radius: 0 0 12px 12px;
  z-index: 3;
}

/* Wax Seal on envelope center */
.envelope-wax-seal {
  position: absolute;
  top: 95px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75px;
  height: 75px;
  z-index: 5;
  cursor: pointer;
  transition: transform 0.25s ease;
  animation: waxSealGlow 2.5s infinite ease-in-out;
}

/* The seal is the themed detail; the envelope itself keeps its paper finish. */
.envelope-wax-seal img {
  filter: hue-rotate(var(--seal-hue-rotation, 0deg)) var(--seal-filter, grayscale(0));
}

.envelope-wax-seal:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.interactive-envelope.opened .envelope-wax-seal {
  opacity: 0;
  pointer-events: none;
}

/* Postage stamp in corner */
.envelope-corner-stamp {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 50px;
  height: 65px;
  z-index: 2;
  transform: rotate(5deg);
}

/* ========================================================
   📜 LETTER MODAL & TYPEWRITER PAPER
   ======================================================== */
.letter-paper-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 28, 0.85);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.letter-paper-modal.active {
  display: flex;
  animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.letter-sheet {
  background-color: #fffdfa;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, color-mix(in srgb, var(--accent-pink) 55%, transparent) 27px 28px);
  background-size: 100% 28px;
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 36px 30px 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  position: relative;
  border: 1px solid var(--accent-pink);
}

.letter-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--accent-pink);
}

.letter-title {
  font-family: var(--font-cursive);
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  color: var(--primary-color);
  margin: 0;
}

.letter-stamp-img {
  width: 55px;
  height: auto;
  transform: rotate(6deg);
}

.letter-recipient {
  font-family: var(--font-cursive);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-hover);
  margin-bottom: 18px;
}

.letter-typed-text {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1.7;
  color: #2b2d42;
  min-height: 160px;
  word-break: break-word;
}

.letter-footer-sign {
  margin-top: 30px;
  text-align: right;
  font-family: var(--font-cursive);
  font-size: 1.6rem;
  color: var(--primary-color);
  font-weight: bold;
}

.letter-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #eee;
}

.btn-letter-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-letter-action:hover {
  background: var(--primary-color);
  color: #fff;
}

.btn-close-letter {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
}

/* ========================================================
   🎮 MINIGAME TIKTOK VIRAL & RUNAWAY BUTTON
   ======================================================== */
.games-section {
  margin: 40px 0;
}

.confess-game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  margin-bottom: 30px;
}

.game-title {
  font-family: var(--font-cursive);
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  color: var(--primary-color);
  margin-bottom: 8px;
}

.game-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 24px;
}

.confess-interactive-arena {
  position: relative;
  min-height: 280px;
  background: color-mix(in srgb, var(--accent-light) 78%, transparent);
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--accent-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 30px 16px;
  overflow: hidden;
}

.btn-confess-yes {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #fff;
  border: none;
  font-size: 1.25rem;
  font-weight: 800;
  padding: 14px 34px;
  border-radius: 35px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.24);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transform-origin: center center;
}

.btn-confess-yes:hover {
  box-shadow: 0 10px 28px rgba(var(--primary-rgb), 0.34);
}

.btn-confess-no {
  background: var(--bg-card);
  color: var(--primary-hover);
  border: 2px solid var(--secondary-color);
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.25s ease, left 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 10;
  white-space: nowrap;
  transform-origin: center center;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.2);
}

/* ========================================================
   🎲 GACHA WISH JAR & VOUCHER UNWRAP
   ======================================================== */
.wish-jar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  position: relative;
}

.gacha-card-title {
  font-family: var(--font-cursive);
  font-size: clamp(2rem, 5vw, 2.5rem);
  color: var(--primary-color);
  margin: 6px 0;
}

.gacha-sub-hint {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.gacha-jar-stage {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 8px 0 14px;
}

/* Chiếc lọ thủy tinh ma thuật */
.gacha-glass-jar {
  width: 140px;
  height: 175px;
  position: relative;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 240, 245, 0.35) 100%);
  border: 3px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 24px 24px 38px 38px;
  box-shadow: 0 12px 30px rgba(var(--primary-rgb), 0.2), inset 0 2px 10px rgba(255, 255, 255, 0.8), inset 0 -6px 14px rgba(var(--secondary-rgb), 0.25);
  backdrop-filter: blur(4px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  outline: none;
}

.gacha-glass-jar:hover {
  transform: translateY(-4px) scale(1.04);
}

.jar-cork-lid {
  width: 88px;
  height: 22px;
  background: linear-gradient(180deg, #d4a373 0%, #bc6c25 100%);
  border-radius: 10px 10px 4px 4px;
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  border: 1.5px solid #a65d1d;
}

.jar-neck-ring {
  width: 104px;
  height: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 2.5px solid rgba(var(--accent-rgb), 0.95);
  border-radius: 8px;
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.jar-tag-ribbon {
  position: absolute;
  top: 12px;
  right: -24px;
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  transform: rotate(12deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.jar-glass-body {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}

.jar-star-particle {
  position: absolute;
  font-size: 1.5rem;
  user-select: none;
  animation: starFloatBob 2.5s infinite ease-in-out;
}

.star-1 { top: 35%; left: 20%; animation-delay: 0s; font-size: 1.5rem; }
.star-2 { top: 48%; right: 22%; animation-delay: 0.4s; font-size: 1.6rem; }
.star-3 { top: 22%; right: 30%; animation-delay: 0.8s; font-size: 1.3rem; }
.star-4 { bottom: 20%; left: 34%; animation-delay: 1.2s; font-size: 1.5rem; }
.star-5 { bottom: 30%; right: 26%; animation-delay: 0.6s; font-size: 1.4rem; }
.star-6 { top: 60%; left: 24%; animation-delay: 1.5s; font-size: 1.2rem; }

.jar-glow-core {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(255, 209, 102, 0.6) 0%, transparent 70%);
  pointer-events: none;
}

/* Final glass finish: layered highlights give the jar a rounded, keepsake feel. */
.gacha-glass-jar {
  isolation: isolate;
  background:
    radial-gradient(ellipse at 24% 30%, rgba(255,255,255,.92) 0 3%, transparent 19%),
    linear-gradient(105deg, rgba(255,255,255,.78) 0%, rgba(255,255,255,.18) 18%, rgba(255,239,246,.42) 48%, rgba(255,255,255,.76) 86%),
    linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,222,234,.35));
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 15px 26px rgba(152,89,111,.18), 0 3px 0 rgba(255,255,255,.8), inset 0 0 0 1px rgba(238,154,181,.44), inset 9px 0 12px rgba(255,255,255,.62), inset -8px 0 12px rgba(213,132,165,.12), inset 0 -13px 18px rgba(255,179,201,.3);
}

.gacha-glass-jar::before,
.gacha-glass-jar::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.gacha-glass-jar::before {
  top: 14px;
  bottom: 20px;
  left: 8px;
  width: 8px;
  border-radius: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.08));
}

.gacha-glass-jar::after {
  right: 9px;
  top: 28px;
  width: 4px;
  height: 47%;
  border-radius: 100%;
  background: rgba(255,255,255,.72);
}

.jar-cork-lid {
  background: linear-gradient(180deg, #f4c7a4, #c88765 72%, #a96853);
  border-color: #aa7058;
  box-shadow: 0 4px 7px rgba(97,48,40,.2), inset 0 2px 2px rgba(255,255,255,.52);
}

.jar-neck-ring {
  background: linear-gradient(180deg, #fff 0%, var(--accent-light) 100%);
  border-color: rgba(var(--accent-rgb),.95);
  box-shadow: 0 2px 5px rgba(148,74,99,.15);
}

.gacha-glass-jar {
  background:
    radial-gradient(ellipse at 24% 30%, rgba(255,255,255,.92) 0 3%, transparent 19%),
    linear-gradient(105deg, rgba(255,255,255,.78) 0%, rgba(255,255,255,.18) 18%, rgba(var(--secondary-rgb),.18) 48%, rgba(255,255,255,.76) 86%),
    linear-gradient(180deg, rgba(255,255,255,.62), rgba(var(--accent-rgb),.2));
  box-shadow: 0 15px 26px rgba(var(--primary-rgb),.18), 0 3px 0 rgba(255,255,255,.8), inset 0 0 0 1px rgba(var(--accent-rgb),.44), inset 9px 0 12px rgba(255,255,255,.62), inset -8px 0 12px rgba(var(--secondary-rgb),.12), inset 0 -13px 18px rgba(var(--accent-rgb),.3);
}

.jar-tag-ribbon {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  box-shadow: 0 4px 8px rgba(var(--primary-rgb),.25), inset 0 1px 0 rgba(255,255,255,.38);
}

/* Flying Ticket Capsule */
.gacha-flying-capsule {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  pointer-events: none;
}

.capsule-folded-ticket {
  width: 90px;
  height: 65px;
  background: linear-gradient(135deg, #ffd166 0%, #ffb703 100%);
  border: 2.5px solid #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 10px 25px rgba(255, 183, 3, 0.6);
  font-size: 1.5rem;
}

/* Coupon Result Card (Unfolded) */
.coupon-result-card {
  background: linear-gradient(135deg, #ffffff 0%, #fff9fa 100%);
  border: 2px solid #ffd166;
  border-radius: var(--radius-md);
  padding: 22px 18px 18px;
  max-width: 440px;
  margin: 16px auto 0;
  box-shadow: 0 12px 36px rgba(var(--primary-rgb), 0.22), 0 0 0 1px rgba(255, 209, 102, 0.4);
  position: relative;
  text-align: center;
}

.coupon-ribbon-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.coupon-badge {
  font-size: 2.8rem;
  margin-bottom: 6px;
  line-height: 1;
}

.coupon-title {
  color: var(--primary-color);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.coupon-desc {
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 10px;
  line-height: 1.5;
}

.coupon-validity {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

.btn-redraw-gacha {
  margin-top: 14px;
  background: var(--accent-light);
  color: var(--primary-color);
  border: 1.5px solid var(--accent-pink);
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-redraw-gacha:hover {
  background: var(--primary-color);
  color: #fff;
}

/* ========================================================
   🎁 VOUCHER MODAL OVERLAY (ĐÈ HẲN LÊN MÀN HÌNH)
   ======================================================== */
.voucher-modal-card {
  max-width: 460px;
  width: 90%;
  text-align: center;
  background: linear-gradient(135deg, #ffffff 0%, #fff9fa 100%);
  border: 2px solid #ffd166;
  border-radius: var(--radius-lg);
  padding: 32px 22px 24px;
  box-shadow: 0 16px 45px rgba(var(--primary-rgb), 0.25), 0 0 0 1px rgba(255, 209, 102, 0.5);
  position: relative;
}

.voucher-modal-card .btn-close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
}

.voucher-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-accept-voucher {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.24);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-accept-voucher:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.32);
}

/* ========================================================
   🎵 FLOATING MUSIC PLAYER & VINYL
   ======================================================== */

.floating-music-bar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  padding: 6px 16px 6px 8px;
  display: flex;
  align-items: center;
  gap: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-width: min(320px, calc(100vw - 24px));
  transition: width 0.5s cubic-bezier(0.2, 0.75, 0.25, 1), padding 0.5s cubic-bezier(0.2, 0.75, 0.25, 1), gap 0.5s ease, border-radius 0.5s ease, box-shadow 0.3s ease;
  width: 58px;
  height: 58px;
  padding: 6px;
  justify-content: flex-start;
  overflow: hidden;
  box-sizing: border-box;
}

.floating-music-bar[data-expanded="true"] {
  width: min(320px, calc(100vw - 24px));
  max-width: min(320px, calc(100vw - 24px));
  height: 58px;
  border-radius: 40px;
  padding: 6px 16px 6px 6px;
  gap: 12px;
}

.vinyl-disk {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle, #333 30%, #111 60%, #000 100%);
  border: 2px solid var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  flex: 0 0 42px;
  padding: 0;
  cursor: pointer;
  appearance: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.vinyl-disk::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: .66;
  background:
    radial-gradient(ellipse at 32% 24%, rgba(255,255,255,.88) 0 3%, transparent 24%),
    conic-gradient(from 18deg, transparent 0 42%, rgba(255,255,255,.04) 48%, rgba(255,255,255,.72) 52%, rgba(255,255,255,.12) 56%, transparent 64% 100%);
}

.vinyl-disk.spinning::before {
  animation: vinyl-sheen-spin 3s linear infinite;
}

.vinyl-disk.spinning {
  animation: none;
}

@keyframes vinyl-sheen-spin {
  to { transform: rotate(1turn); }
}

.vinyl-disk:hover,
.vinyl-disk:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(255,111,145,.22), 0 4px 10px rgba(0,0,0,.25);
}

.vinyl-disk:focus-visible {
  outline: 2px solid var(--primary-hover);
  outline-offset: 3px;
}

.floating-music-bar .music-info-box,
.floating-music-bar .music-controls {
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-7px);
  overflow: hidden;
  transition: max-width 0.5s cubic-bezier(0.2, 0.75, 0.25, 1), opacity 0.35s ease, transform 0.5s ease, visibility 0s linear 0.5s;
}

.floating-music-bar .music-info-box {
  flex-shrink: 0;
}

.floating-music-bar .music-controls {
  flex: 0 0 auto;
}

.floating-music-bar[data-expanded="true"] .music-info-box {
  max-width: 160px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

.floating-music-bar[data-expanded="true"] .music-controls {
  max-width: 80px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .floating-music-bar,
  .floating-music-bar .music-info-box,
  .floating-music-bar .music-controls {
    transition-duration: 0.01ms;
  }
  .vinyl-disk.spinning::before {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}

.vinyl-center {
  position: relative;
  z-index: 3;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid #fff;
}

.music-info-box {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 160px;
  min-width: 0;
}

.music-track-title {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color);
}

.music-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.music-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.music-ctrl-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.music-ctrl-btn:hover {
  transform: scale(1.1);
}

/* ========================================================
   ⚙️ FLOATING CUSTOMIZER BUTTON & MODAL
   ======================================================== */
.btn-floating-gear {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 82%, var(--secondary-color)));
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 35px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.25);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-floating-gear:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(var(--primary-rgb), 0.35);
}

/* Customizer Modal Form */
.love-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 28, 0.82);
  backdrop-filter: blur(10px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.love-modal.active {
  display: flex;
  animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  font-family: var(--font-cursive);
  font-size: 2rem;
  color: var(--primary-color);
  margin: 0;
}

.btn-close-modal {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  background: #ffe3e3;
  color: #e63946;
}

.form-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 500px) {
  .form-row {
    flex-direction: column;
    gap: 8px;
  }
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
}

.form-field input,
.form-field textarea,
.form-field select {
  padding: 10px 14px;
  border: 1.5px solid #e9ecef;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--primary-color);
}

.avatar-preview-row {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 14px;
}

.avatar-preview-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-preview-box img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  object-fit: cover;
}

.share-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.btn-share-link {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-export-json {
  background: #f8f9fa;
  border: 1.5px solid #ced4da;
  color: #495057;
  padding: 10px 18px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
}

/* ========================================================
   💖 TOAST NOTIFICATION
   ======================================================== */
.love-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--accent-pink);
  color: var(--text-color);
  padding: 8px 18px;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.25);
  z-index: 999999;
  font-weight: 700;
  font-size: 0.88rem;
  max-width: min(92vw, 420px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.love-toast.toast-fade-out {
  opacity: 0;
  transform: translate(-50%, -15px);
}

/* ========================================================
   🔒 VIEWER MODE (DÀNH CHO NGƯỜI NHẬN KHI XEM LINK CHIA SẺ)
   ẨN HOÀN TOÀN CÁC NÚT TÙY BIẾN, SETTING, UPLOAD...
   ======================================================== */
body.viewer-mode #btn-open-customizer,
body.viewer-mode #btn-switch-to-studio,
body.viewer-mode .studio-trigger-btn,
body.viewer-mode .gallery-btn-group,
body.viewer-mode #creator-studio-view,
body.viewer-mode .stack-click-hint,
body.viewer-mode .photobooth-controls-bar,
body.mode-studio #btn-open-customizer,
body:not(.mode-storybook) #btn-open-customizer {
  display: none !important;
}

/* Đảm bảo ảnh modal chi tiết trên điện thoại không bao giờ bị to tràn khung */
#detail-modal-img,
.photobooth-detail-image-box img,
.photobooth-detail-photo-wrap img {
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  box-sizing: border-box !important;
}

/* ========================================================
   📱 RESPONSIVE ADJUSTMENTS FOR PHONES & DESKTOPS
   ======================================================== */
@media (max-width: 768px) {
  .main-wrapper {
    padding: 10px 10px 90px;
  }

  /* Đặt thanh nhạc phía dưới để không che tiêu đề và tiến trình chương */
  .floating-music-bar {
    top: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    max-width: min(260px, calc(100vw - 24px));
    width: 46px;
    height: 46px;
    border-radius: 50%;
    justify-content: flex-start;
    padding: 4px;
    gap: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  }

  .floating-music-bar[data-expanded="true"] {
    width: min(220px, calc(100vw - 24px));
    max-width: min(260px, calc(100vw - 24px));
    height: 46px;
    border-radius: 30px;
    padding: 3px 8px 3px 4px;
    gap: 6px;
  }

  .floating-music-bar[data-expanded="true"] .music-info-box {
    max-width: 80px;
  }

  .floating-music-bar .music-track-title {
    font-size: 0.72rem;
  }

  .floating-music-bar .music-status {
    display: none;
  }

  .floating-music-bar .vinyl-disk {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .floating-music-bar:not([data-expanded="true"]) .vinyl-disk {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .floating-music-bar .music-ctrl-btn {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    font-size: 0.72rem;
  }

  #music-next-btn {
    display: none;
  }

  /* Nút tùy biến gear khi ở chế độ tạo: tránh đè nút */
  .btn-floating-gear {
    bottom: 12px;
    right: 12px;
    padding: 8px 14px;
    font-size: 0.78rem;
    border-radius: 20px;
  }

  /* Tối ưu không gian để 1 trang vừa vặn với 1 màn hình điện thoại (Viewport Fitting) */
  .story-progress-container {
    padding: 8px 12px;
    margin-bottom: 12px;
    gap: 6px;
  }

  /* Chừa chỗ cho player cố định ở đáy trên màn hình điện thoại */
  .main-wrapper {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .story-progress-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    font-size: 0.76rem;
  }

  #story-page-indicator {
    white-space: nowrap;
    letter-spacing: -.025em;
  }

  .story-progress-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .story-swipe-hint {
    font-size: .68rem;
    line-height: 1.1;
    opacity: .78;
  }

  .step-dot {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }

  .couple-header-card,
  .distance-radar-card,
  .love-timer-card,
  .polaroid-gallery-section,
  .letter-section,
  .confess-game-card,
  .wish-jar-card {
    padding: 16px 12px !important;
    margin-bottom: 14px !important;
    border-radius: 18px !important;
  }

  .couple-hero-title {
    font-size: 1.6rem !important;
    margin-top: 8px !important;
  }

  .couple-hero-subtitle {
    font-size: 0.88rem !important;
    margin-bottom: 8px !important;
  }

  .avatar-ring {
    width: 68px !important;
    height: 68px !important;
  }

  .avatar-name {
    font-size: 0.95rem !important;
  }

  .timer-hero-number {
    font-size: 2.8rem !important;
  }

  .timer-hero-label {
    font-size: 0.85rem !important;
  }

  .timer-units-grid {
    gap: 6px !important;
  }

  .timer-unit-box {
    padding: 6px 4px !important;
  }

  .timer-unit-box .unit-value {
    font-size: 1.15rem !important;
  }

  .timer-unit-box .unit-title {
    font-size: 0.68rem !important;
  }

  .flight-radar-map {
    padding: 12px 8px 8px !important;
    margin: 10px 0 12px !important;
  }

  .flight-city-card {
    max-width: 105px !important;
    padding: 8px 4px !important;
  }

  .city-name-label {
    font-size: 0.82rem !important;
  }

  .distance-heart-pill {
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
  }

  .heart-distance-sub {
    font-size: 0.65rem !important;
  }

  .radar-quote-box {
    padding: 8px 12px !important;
    font-size: 0.82rem !important;
    margin-bottom: 10px !important;
  }

  .btn-send-hug {
    padding: 10px 14px !important;
    font-size: 0.85rem !important;
  }

  .game-title {
    font-size: 1.6rem !important;
  }

  .game-desc {
    font-size: 0.85rem !important;
    margin-bottom: 12px !important;
  }

  .gacha-card-title {
    font-size: 1.8rem !important;
  }

  .gacha-glass-jar {
    width: 120px !important;
    height: 155px !important;
  }

  .story-nav-footer {
    margin-top: 14px !important;
    padding-top: 12px !important;
    gap: 8px !important;
  }

  .btn-next-page {
    padding: 11px 20px !important;
    font-size: 0.92rem !important;
  }

  .btn-prev-page {
    padding: 10px 16px !important;
    font-size: 0.85rem !important;
  }

  .letter-sheet {
    padding: 20px 14px 24px;
  }
}

/* ========================================================
   📖 MULTI-PAGE STORYBOOK & CHAPTER SLIDE SYSTEM
   ======================================================== */

.story-page {
  display: none;
  min-height: 60vh;
}

.story-page.active {
  display: block;
}

/* Thanh Tiến Trình Chương (Story Progress Header) */
.story-progress-container {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 12px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.story-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-color);
}

.story-swipe-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.story-progress-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-steps-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.story-progress-line-bg {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-light);
  transform: translateY(-50%);
  z-index: 1;
  border-radius: 2px;
}

.story-progress-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
  transform: translateY(-50%);
  z-index: 2;
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.step-dot {
  position: relative;
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-pink);
  color: #adb5bd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step-dot:hover {
  transform: scale(1.15);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.step-dot.active {
  background: var(--primary-color);
  border-color: #fff;
  color: #fff;
  transform: scale(1.22);
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.34);
}

.step-dot.completed {
  background: var(--secondary-color);
  border-color: #fff;
  color: #fff;
}

/* ========================================================
   🚀 NÚT CHUYỂN TRANG TIẾP THEO SIÊU HẤP DẪN (ATTRACTIVE NEXT BUTTON)
   ======================================================== */
.story-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-color);
}

.btn-prev-page {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-color);
  padding: 12px 22px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-prev-page:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateX(-3px);
}

.btn-next-page {
  background: linear-gradient(135deg, var(--primary-color) 0%, color-mix(in srgb, var(--primary-color) 82%, var(--secondary-color)) 50%, color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)) 100%);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 35px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.27);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.btn-next-page::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.22),
    transparent
  );
  transform: rotate(30deg);
  animation: shineSweep 3.5s infinite;
}

@keyframes shineSweep {
  0% { transform: translate(-100%, -100%) rotate(30deg); }
  30%, 100% { transform: translate(100%, 100%) rotate(30deg); }
}

.btn-next-page:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 32px rgba(var(--primary-rgb), 0.36);
}

.btn-next-page:active {
  transform: translateY(0) scale(0.98);
}

.btn-next-page .next-text {
  font-weight: 800;
}

.btn-next-page .next-arrow {
  font-size: 1.2rem;
  transition: transform 0.25s ease;
}

.btn-next-page:hover .next-arrow {
  transform: translateX(4px);
}

/* Đưa nút qua trang ra giữa nếu là trang 1 */
.story-nav-footer.center-single {
  justify-content: center;
}

@media (max-width: 600px) {
  .story-nav-footer {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .btn-next-page,
  .btn-prev-page {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile storybook is presented as a swipe-only journey. Keep story content
   controls (camera, letter, games) intact; remove chapter navigation taps. */
@media (max-width: 768px) {
  body.mode-storybook .step-dot,
  body.mode-storybook #btn-switch-to-studio,
  body.mode-storybook .story-nav-footer .btn-prev-page,
  body.mode-storybook .story-nav-footer .btn-next-page,
  body.mode-storybook .story-final-nav .studio-trigger-btn {
    display: none !important;
  }

  body.mode-storybook.story-last-page .story-swipe-hint {
    display: none;
  }

  body.mode-storybook .story-final-nav > div {
    width: 100%;
  }

  body.mode-storybook .story-final-nav .btn-restart-story {
    display: inline-flex !important;
    width: 100%;
    justify-content: center;
  }
}

/* ========================================================
   🎨 CREATOR STUDIO MODE: 2-COLUMN LAYOUT WITH LIVE PREVIEW
   ======================================================== */

#creator-studio-view.main-wrapper {
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px 100px;
  box-sizing: border-box;
}

.studio-header-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
  box-sizing: border-box;
}

.studio-header-banner h1 {
  font-family: var(--font-cursive);
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  color: var(--primary-color);
  margin-bottom: 4px;
}

.studio-header-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.studio-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1080px) {
  #creator-studio-view.main-wrapper {
    max-width: 100%;
    padding: 14px 14px 90px;
  }
  .studio-workspace-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .studio-workspace-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Progressive, thumb-friendly Studio layout for phones. */
@media (max-width: 860px) {
  #creator-studio-view.main-wrapper {
    padding: 8px 10px calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .studio-header-banner {
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 18px;
  }

  .studio-header-banner .section-badge {
    padding: 4px 9px;
    font-size: .68rem;
  }

  .studio-header-banner h1 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
    line-height: 1.08;
    margin: 4px 0;
  }

  .studio-header-banner p {
    font-size: .76rem;
    line-height: 1.25;
  }

  .studio-workspace-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .studio-preview-column {
    order: -1;
    position: static;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    gap: 8px;
    align-items: stretch;
  }

  .studio-main-actions {
    order: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    width: 100%;
    max-width: none;
  }

  .studio-main-actions > :last-child {
    grid-column: 1 / -1;
  }

  .studio-main-actions .btn-start-storybook,
  .studio-main-actions .btn-share-link,
  .studio-main-actions .btn-export-json {
    min-height: 42px;
    padding: 8px 10px;
    font-size: .78rem;
    line-height: 1.15;
  }

  .studio-live-preview {
    order: 2;
    width: 100%;
  }

  .studio-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--bg-card);
    text-align: left;
    font-size: .78rem;
    white-space: normal;
    cursor: pointer;
    list-style: none;
  }

  .studio-preview-header::-webkit-details-marker {
    display: none;
  }

  .studio-preview-toggle-hint {
    color: var(--text-muted);
    font-size: .68rem;
    white-space: nowrap;
  }

  .studio-live-preview[open] > .studio-preview-header .studio-preview-toggle-hint::after {
    content: " · Đóng";
  }

  .studio-live-preview:not([open]) > .studio-preview-header .studio-preview-toggle-hint::after {
    content: " · Mở";
  }

  .studio-preview-header .studio-preview-toggle-hint {
    font-size: 0;
  }

  .studio-preview-header .studio-preview-toggle-hint::after {
    font-size: .68rem;
  }

  .preview-phone-mockup,
  .studio-main-actions {
    max-width: none;
  }

  .studio-editor-column {
    order: 2;
    gap: 8px;
  }

  .studio-tabs-nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    gap: 6px;
    padding: 7px 2px;
    margin: 0 -2px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: 0 4px 10px rgba(43,45,66,.07);
    scrollbar-width: thin;
  }

  .studio-tab-btn {
    flex: 0 0 auto;
    gap: 5px;
    padding: 6px 9px;
    font-size: .72rem;
  }

  .studio-tab-btn .tab-badge {
    width: 20px;
    height: 20px;
    font-size: .7rem;
  }

  .studio-tab-btn > span:last-child i {
    display: none;
  }

  .studio-tab-pane,
  .studio-tab-pane.active {
    min-width: 0;
  }

  .studio-card-box {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .studio-card-title {
    font-size: .95rem;
    line-height: 1.25;
  }

  .studio-editor-column input:not([type="file"]),
  .studio-editor-column textarea,
  .studio-editor-column select {
    min-height: 42px;
    font-size: 16px !important;
  }

  .studio-youtube-control-row {
    flex-direction: column;
    align-items: stretch;
  }

  .studio-youtube-control-row input,
  .studio-youtube-control-row button {
    width: 100%;
    max-width: none;
    min-height: 42px;
    justify-content: center;
    white-space: normal !important;
  }
}

/* Keep the compact chapter cue on its own line at narrow phone widths. */
@media (max-width: 768px) {
  body.mode-storybook .story-progress-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: initial;
    align-items: start;
    gap: 3px;
  }

  body.mode-storybook #story-page-indicator {
    white-space: nowrap;
    font-size: .75rem;
    letter-spacing: -.03em;
  }

  body.mode-storybook .story-progress-actions {
    justify-content: flex-end;
    min-height: 16px;
  }

  body.mode-storybook .story-swipe-hint {
    font-size: .66rem;
    line-height: 1;
    white-space: nowrap;
    opacity: .76;
  }

  #page-5 .confess-interactive-arena {
    min-height: 230px;
    padding: 18px 12px;
    flex-direction: column;
    gap: 14px;
  }

  #page-5 .btn-confess-yes {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    padding: 12px 14px;
    font-size: .96rem;
  }

  #page-5 .btn-confess-no {
    max-width: calc(100% - 24px);
    white-space: normal;
    text-align: center;
  }
}

/* Cột trái: Form điều khiển */
.studio-editor-column {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}

/* ========================================================
   🧭 STUDIO TABS: TÙY BIẾN TỪNG TRANG RIÊNG BIỆT
   ======================================================== */
.studio-tabs-nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 2px 10px;
  border-bottom: 2px solid rgba(var(--secondary-rgb), 0.2);
  margin-bottom: 8px;
  box-sizing: border-box;
}

.studio-tabs-nav-bar::-webkit-scrollbar {
  height: 4px;
}

.studio-tabs-nav-bar::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.3);
  border-radius: 4px;
}

.studio-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-color);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  user-select: none;
  box-sizing: border-box;
}

.studio-tab-btn .tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary-color);
  font-size: 0.78rem;
  font-weight: 800;
  transition: all 0.2s ease;
}

/* The tab names are descriptive; numeric bubbles added no useful context. */
#creator-studio-view .studio-tab-btn .tab-badge { display: none; }

.studio-tab-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.studio-tab-btn.active {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 78%, var(--primary-hover)));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.22);
  transform: translateY(-2px);
}

.studio-tab-btn.active .tab-badge {
  background: var(--bg-card);
  color: var(--primary-color);
}

.studio-tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.studio-tab-pane.active {
  display: flex;
  animation: fadeInTab 0.3s ease forwards;
}

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

.studio-tab-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  margin-top: 6px;
  border-top: 1.5px dashed rgba(var(--secondary-rgb), 0.25);
  flex-wrap: wrap;
  gap: 10px;
}

.btn-tab-nav {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-color);
  padding: 10px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-tab-nav:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.btn-tab-nav.primary {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 78%, var(--primary-hover)));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.btn-tab-nav.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.3);
}

.studio-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.studio-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px dashed rgba(var(--secondary-rgb), 0.25);
  padding-bottom: 8px;
}

/* Khung Drag & Drop Upload ảnh trong Creator Studio */
.studio-upload-drop-zone {
  border: 2px dashed var(--accent-pink);
  background: color-mix(in srgb, var(--accent-light) 76%, transparent);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.studio-upload-drop-zone:hover,
.studio-upload-drop-zone.dragover {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--accent-light) 94%, transparent);
  transform: scale(1.01);
}

/* Cột phải: Live Preview Mockup Panel */
.studio-preview-column {
  min-width: 0;
  width: 100%;
  max-width: 350px;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  align-items: center;
}

.studio-preview-header {
  text-align: center;
  font-weight: 800;
  color: var(--primary-color);
  font-size: 0.88rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.preview-phone-mockup {
  background: var(--bg-card);
  border-radius: 36px;
  border: 9px solid #2b2d42;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 0 25px rgba(var(--secondary-rgb), 0.25);
  overflow: hidden;
  position: relative;
  max-width: 340px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.phone-speaker-notch {
  width: 100px;
  height: 16px;
  background: #2b2d42;
  border-radius: 0 0 12px 12px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.phone-screen-content {
  background: var(--bg-gradient);
  padding: 14px 12px 20px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.phone-screen-content::-webkit-scrollbar {
  width: 4px;
}
.phone-screen-content::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.3);
  border-radius: 4px;
}

/* Mockup Components */
.mockup-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mockup-avatars-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}

.mockup-avatar-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.mockup-names-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-color);
}

.mockup-radar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 4px 0;
}

.mockup-days-display {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
}

.mockup-letter-box {
  background: var(--bg-card-hover);
  border-left: 3px solid var(--primary-color);
  padding: 8px 12px;
  border-radius: 6px;
  text-align: left;
  font-size: 0.8rem;
}

.studio-main-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  box-sizing: border-box;
}

.studio-main-actions button,
.studio-main-actions .btn-start-storybook,
.studio-main-actions .btn-share-link,
.studio-main-actions .btn-export-json {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  justify-content: center;
}

@media (max-width: 1080px) {
  .studio-preview-column {
    max-width: 310px;
  }
  .preview-phone-mockup,
  .studio-main-actions {
    max-width: 310px;
  }
}

@media (max-width: 860px) {
  .studio-preview-column {
    position: static;
    max-width: 340px;
    margin: 10px auto 0;
  }
  .preview-phone-mockup,
  .studio-main-actions {
    max-width: 340px;
  }
}

.btn-start-storybook {
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 76%, var(--primary-hover)));
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-start-storybook:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.35);
}

/* ========================================================
   📸 MULTI-PHOTO UPLOAD THUMBNAILS PREVIEW
   ======================================================== */
.upload-selected-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.upload-preview-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px 2px;
}

.preview-thumb-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border: 1.5px solid var(--accent-pink);
}

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

.btn-remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-remove-thumb:hover {
  background: #e63946;
}

/* Mobile Studio: keep actions and navigation reachable before the long editor. */
@media (max-width: 860px) {
  #creator-studio-view.main-wrapper { padding: 8px 10px calc(84px + env(safe-area-inset-bottom, 0px)); }
  #creator-studio-view .studio-header-banner { padding: 12px 14px; margin-bottom: 8px; border-radius: 18px; }
  #creator-studio-view .studio-header-banner h1 { font-size: clamp(1.35rem, 6vw, 1.8rem); line-height: 1.08; margin: 4px 0; }
  #creator-studio-view .studio-header-banner p { font-size: .76rem; line-height: 1.25; }
  #creator-studio-view .studio-workspace-grid { display: flex; flex-direction: column; gap: 8px; }
  #creator-studio-view .studio-preview-column { order: -1; position: static; width: 100%; max-width: none; margin: 0 auto; gap: 8px; align-items: stretch; }
  #creator-studio-view .studio-main-actions { order: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: none; }
  #creator-studio-view .studio-main-actions > :last-child { grid-column: 1 / -1; }
  #creator-studio-view .studio-main-actions button { min-height: 42px; padding: 8px 10px; font-size: .78rem; line-height: 1.15; }
  #creator-studio-view .studio-live-preview { order: 2; width: 100%; }
  #creator-studio-view .studio-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: 13px; background: var(--bg-card); text-align: left; font-size: .78rem; white-space: normal; cursor: pointer; list-style: none; }
  #creator-studio-view .studio-preview-header::-webkit-details-marker { display: none; }
  #creator-studio-view .studio-preview-toggle-hint { color: var(--text-muted); font-size: 0; white-space: nowrap; }
  #creator-studio-view .studio-preview-toggle-hint::after { content: "· Mở"; font-size: .68rem; }
  #creator-studio-view .studio-live-preview[open] .studio-preview-toggle-hint::after { content: "· Thu gọn"; }
  #creator-studio-view .preview-phone-mockup { max-width: 100%; }
  #creator-studio-view .studio-editor-column { order: 2; gap: 8px; }
  #creator-studio-view .studio-tabs-nav-bar { position: sticky; top: 0; z-index: 100; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; gap: 6px; padding: 7px 2px; margin: 0 -2px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); box-shadow: 0 4px 10px rgba(43,45,66,.07); scrollbar-width: thin; }
  #creator-studio-view .studio-tab-btn { flex: 0 0 auto; gap: 5px; padding: 6px 9px; font-size: .72rem; }
  #creator-studio-view .studio-tab-btn .tab-badge { width: 20px; height: 20px; font-size: .7rem; }
  #creator-studio-view .studio-tab-btn > span:last-child i { display: none; }
  #creator-studio-view .studio-tab-pane, #creator-studio-view .studio-tab-pane.active { min-width: 0; }
  #creator-studio-view .studio-card-box { padding: 14px 12px; border-radius: 16px; }
  #creator-studio-view .studio-card-title { font-size: .95rem; line-height: 1.25; }
  #creator-studio-view .studio-editor-column input:not([type="file"], [type="checkbox"], [type="radio"]), #creator-studio-view .studio-editor-column textarea, #creator-studio-view .studio-editor-column select { min-height: 42px; font-size: 16px !important; }
  #creator-studio-view .studio-youtube-control-row { flex-direction: column; align-items: stretch; }
  #creator-studio-view .studio-youtube-control-row input, #creator-studio-view .studio-youtube-control-row button { width: 100%; max-width: none; min-height: 42px; justify-content: center; white-space: normal !important; }
  #creator-studio-view .studio-photo-list { max-height: none; overflow: visible; padding-right: 0; }
  #creator-studio-view .avatar-preview-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
  #creator-studio-view .avatar-preview-box { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
  #creator-studio-view .avatar-preview-box img { flex: 0 0 48px; }
  #creator-studio-view .avatar-preview-box .btn-reset-photos { display: block; width: 100%; min-width: 0; box-sizing: border-box; padding: 8px 5px; font-size: .76rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
}

.studio-photo-edit-card { display: block; padding: 0; overflow: hidden; }
.studio-photo-edit-card { flex: 0 0 auto; min-height: max-content; }
.photo-edit-summary { display: flex; align-items: center; gap: 10px; padding: 10px; cursor: pointer; list-style: none; }
.photo-edit-summary::-webkit-details-marker { display: none; }
.photo-edit-summary .photo-preview-wrap { flex: 0 0 54px; margin: 0; }
.photo-edit-summary-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
.photo-edit-index, .photo-edit-summary-date { color: var(--text-muted); font-size: .72rem; }
.photo-edit-summary-caption { overflow: hidden; color: var(--text-color); font-size: .84rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.photo-edit-chevron { transition: transform .2s ease; }
.studio-photo-edit-card[open] .photo-edit-chevron { transform: rotate(180deg); }
.photo-edit-body { display: grid; gap: 10px; padding: 0 10px 12px; }
.photo-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-edit-actions .btn-change-photo-mini { position: static; inset: auto; width: auto; min-height: 36px; padding: 7px 11px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--accent-light); color: var(--primary-color); font-size: .78rem; font-weight: 700; }
.photo-edit-actions .btn-change-photo-mini:hover { background: var(--primary-color); color: #fff; }
.photo-edit-actions .btn-delete-photo { position: static; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 5px; width: auto; min-width: max-content; min-height: 36px; padding: 7px 11px; white-space: nowrap; border: 1px solid rgba(230, 57, 70, .28); border-radius: 8px; background: rgba(230, 57, 70, .08); color: #e63946; font-size: .78rem; font-weight: 700; }
.photo-edit-actions .btn-delete-photo:hover { background: rgba(230, 57, 70, .16); color: #c92f3c; }
@media (max-width: 860px) {
  #creator-studio-view .studio-photo-edit-card { margin-bottom: 8px; }
  #creator-studio-view .photo-edit-body > .photo-edit-inputs > div:last-child { grid-template-columns: 1fr !important; }
}

/* ========================================================
   🌳 CHAPTER 8: LOVETREE & COUPLE EMBRACE FINALE
