/* ============================================================================
 * XƯỞNG TẠO WEB QUÀ TẶNG 3D, TỎ TÌNH, SINH NHẬT & XIN LỖI NGƯỜI YÊU (QUA-TANG-3D)
 * Giao diện Trái Tim 3D, Pháo Hoa Lung Linh & Thiệp Nhạc Theo Tên Riêng
 * ============================================================================ */

:root {
  --bg-night: #080312;
  --bg-card: rgba(24, 11, 44, 0.82);
  --pink-neon: #ff2a85;
  --pink-soft: #ff85b3;
  --gold: #fbbf24;
  --purple: #a855f7;
  --cyan: #22d3ee;
  --text-white: #fffafc;
  --text-muted: #e2c8dc;
  --border-pink: rgba(255, 42, 133, 0.36);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-night);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255, 42, 133, 0.25), transparent 42%),
    radial-gradient(circle at 80% 18%, rgba(168, 85, 247, 0.24), transparent 42%),
    radial-gradient(circle at 50% 85%, rgba(251, 191, 36, 0.16), transparent 45%);
  color: var(--text-white);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}

/* Fullscreen Interactive 3D Heart & Fireworks Canvas */
#stage-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 16px 80px;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(18, 7, 34, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-pink);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  margin-bottom: 16px;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff2a85, #a855f7, #fbbf24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 20px rgba(255, 42, 133, 0.55);
}

.brand-name {
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(90deg, #ffffff, #ff85b3, #fde68a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 11.5px;
  color: var(--text-muted);
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn-pink {
  background: linear-gradient(135deg, #ff2a85 0%, #db2777 50%, #9333ea 100%);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  border: none;
  padding: 11px 20px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 42, 133, 0.45);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn-pink:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(255, 42, 133, 0.65);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  color: #ffe4f1;
  border: 1px solid var(--border-pink);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-glass:hover {
  background: rgba(255, 42, 133, 0.22);
  border-color: #ff85b3;
}

/* 4 Mode Switcher Pills */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 780px) {
  .mode-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mode-tab-btn {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 12px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.mode-tab-btn .m-icon {
  font-size: 25px;
}

.mode-tab-btn strong {
  display: block;
  font-size: 13.5px;
}

.mode-tab-btn small {
  font-size: 11px;
  color: var(--text-muted);
}

.mode-tab-btn.active,
.mode-tab-btn:hover {
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.34), rgba(168, 85, 247, 0.3));
  border-color: #ff85b3;
  box-shadow: 0 8px 24px rgba(255, 42, 133, 0.3);
  transform: translateY(-2px);
}

/* Main Interactive 3D Stage Card */
.stage-card {
  position: relative;
  min-height: 450px;
  background: radial-gradient(circle at 50% 35%, rgba(65, 16, 86, 0.55), rgba(14, 5, 28, 0.82));
  backdrop-filter: blur(12px);
  border: 2px solid var(--border-pink);
  border-radius: 26px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.65);
  margin-bottom: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.recipient-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 99px;
  background: rgba(255, 42, 133, 0.2);
  border: 1px solid #ff85b3;
  color: #ffe4f1;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.stage-title {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #ffffff, #ff9ec6, #fde68a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(255, 42, 133, 0.35);
}

.typewriter-box {
  max-width: 680px;
  margin: 0 auto 22px;
  font-size: 16px;
  color: #fff5f9;
  background: rgba(12, 4, 24, 0.65);
  border: 1px solid rgba(255, 133, 179, 0.3);
  border-radius: 16px;
  padding: 16px 20px;
  min-height: 82px;
  box-shadow: inset 0 0 18px rgba(255, 42, 133, 0.15);
}

/* Pulsing 3D Heart Emblem */
.heart-3d-emblem {
  font-size: 68px;
  margin-bottom: 10px;
  display: inline-block;
  animation: pulseHeart 1.25s infinite ease-in-out;
  filter: drop-shadow(0 0 25px rgba(255, 42, 133, 0.85));
}

@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.16); }
}

/* Interactive Dodge Button Playground */
.dodge-arena {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 110px;
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.btn-runaway {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 10px 18px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.15s ease, left 0.18s ease, top 0.18s ease;
}

/* Birthday Cake Visual (Mode 2) */
.cake-container {
  margin: 12px auto 18px;
  position: relative;
  width: 180px;
  padding-top: 32px;
}

.candles-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: -4px;
}

.candle {
  width: 12px;
  height: 36px;
  background: repeating-linear-gradient(45deg, #fff, #fff 4px, #ff2a85 4px, #ff2a85 8px);
  border-radius: 4px;
  position: relative;
}

.flame {
  width: 14px;
  height: 22px;
  background: radial-gradient(circle, #fff 10%, #fde047 50%, #f97316 90%);
  border-radius: 50% 50% 35% 35%;
  position: absolute;
  top: -22px;
  left: -1px;
  box-shadow: 0 0 18px #facc15, 0 0 30px #f97316;
  animation: flicker 0.25s infinite alternate;
}

.flame.blown-out {
  display: none;
}

@keyframes flicker {
  from { transform: scale(1) rotate(-3deg); }
  to { transform: scale(1.12) rotate(3deg); }
}

.cake-top {
  height: 36px;
  background: linear-gradient(180deg, #fbcfe8, #f472b6);
  border-radius: 14px 14px 4px 4px;
  border-bottom: 4px solid #db2777;
}

.cake-bottom {
  height: 48px;
  background: linear-gradient(180deg, #f472b6, #be185d);
  border-radius: 4px 4px 16px 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

/* Mode 4: Lucky Love Wheel */
.wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
}

/* Customizer Panel */
.customizer-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-pink);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 760px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #ffc2df;
  margin-bottom: 6px;
}

.text-input,
.select-input,
.area-input {
  width: 100%;
  background: rgba(10, 4, 20, 0.85);
  border: 1px solid rgba(255, 133, 179, 0.35);
  color: #fff;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
}

.text-input:focus,
.select-input:focus,
.area-input:focus {
  border-color: var(--pink-neon);
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.35);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 2, 14, 0.84);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #17092b;
  border: 2px solid #ff85b3;
  border-radius: 22px;
  max-width: 490px;
  width: 100%;
  padding: 24px;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
