/* ==========================================================================
   SINH NHẬT VÂN - MASTER STYLESHEET
   Aesthetic: Romantic Pastel Pink, Glassmorphism, Festive Birthday Celebration
   ========================================================================== */

:root {
  --primary: #ff4d79;
  --primary-hover: #ff2a5f;
  --primary-light: #ff7597;
  --primary-subtle: #ffe5ec;
  --bg-gradient: linear-gradient(135deg, #fff0f5 0%, #ffe4ec 40%, #ffd1dc 100%);
  --accent-gold: #ffb703;
  --accent-purple: #c77dff;
  --accent-peach: #ff9e7d;
  --accent-mint: #80ed99;
  --text-main: #2b2b2b;
  --text-muted: #6c757d;
  --text-pink: #c9184a;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(255, 182, 193, 0.5);
  --shadow-sm: 0 4px 12px rgba(255, 77, 121, 0.08);
  --shadow-md: 0 8px 24px rgba(255, 77, 121, 0.14);
  --shadow-lg: 0 16px 40px rgba(255, 77, 121, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.6);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --font-main: 'Be Vietnam Pro', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hand: 'Dancing Script', 'Caveat', cursive;
  --font-heading: 'Be Vietnam Pro', 'Montserrat', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Background floating elements (Balloons & Sparkles) */
.balloon-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-balloon {
  position: absolute;
  bottom: -150px;
  width: 60px;
  height: 75px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  opacity: 0.65;
  animation: floatUp 16s linear infinite;
  box-shadow: inset -6px -6px 12px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(255, 105, 180, 0.2);
}

.floating-balloon::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 28px;
  background: rgba(180, 150, 150, 0.5);
}

.floating-balloon::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 14px;
  width: 12px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: rotate(-30deg);
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-120vh) rotate(15deg) translateX(40px);
    opacity: 0;
  }
}

/* App Header & Navigation Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 4px 20px rgba(255, 77, 121, 0.08);
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon {
  font-size: 2rem;
  animation: bounce 2s infinite ease-in-out;
}

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

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(120deg, #ff2a5f, #c77dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-pink);
  font-weight: 500;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 229, 236, 0.6);
  padding: 5px;
  border-radius: 40px;
  border: 1px solid rgba(255, 182, 193, 0.4);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: #555;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.nav-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.6);
}

.nav-btn.active {
  background: linear-gradient(135deg, #ff4d79, #ff7597);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 77, 121, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: white;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.action-btn-circle:hover {
  transform: scale(1.08);
  background: var(--primary-subtle);
  border-color: var(--primary);
}

/* Main Container */
.main-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
}

/* View Sections */
.view-section {
  display: none;
  animation: fadeIn 0.35s ease-out;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================================
   MODULE 1: PUZZLE GAME (GAME GHÉP HÌNH ĐOÁN ẢNH BÍ ẨN 9x9)
   ========================================================================== */

.puzzle-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 980px) {
  .puzzle-layout {
    grid-template-columns: 1fr;
  }
}

.puzzle-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.puzzle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.puzzle-title h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-pink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.puzzle-title p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.turns-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fff0f5, #ffe0e9);
  border: 1px solid #ffb6c1;
  padding: 8px 16px;
  border-radius: 40px;
  font-weight: 700;
  color: #c9184a;
  box-shadow: 0 2px 8px rgba(201, 24, 74, 0.1);
}

.turns-badge .count {
  font-size: 1.25rem;
  color: #ff2a5f;
}

/* The Board Area */
.puzzle-board-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 20px 0;
}

.puzzle-board {
  position: relative;
  width: 100%;
  max-width: 580px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15), 0 0 0 4px #fff, 0 0 0 7px #ff8da1;
  background-color: #2b2b2b;
  overflow: hidden;
  user-select: none;
}

/* Underlying Secret Image */
.puzzle-secret-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Grid of Puzzle Tiles Overlay */
.puzzle-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  gap: 1.5px;
  background: rgba(255, 255, 255, 0.35);
  padding: 0;
}

/* Dynamic grid template applied via JS (default 9x9) */
.puzzle-grid.grid-9 {
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
}

.puzzle-grid.grid-6 {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
}

.puzzle-grid.grid-4 {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

/* Puzzle Piece / Tile */
.puzzle-tile {
  position: relative;
  cursor: pointer;
  perspective: 600px;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.puzzle-tile:hover:not(.revealed) {
  transform: scale(1.05);
  z-index: 10;
}

.tile-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
  transform-style: preserve-3d;
}

.tile-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: linear-gradient(135deg, #ff7597 0%, #ff4d79 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.78rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.tile-front::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25) 0%, transparent 70%);
  pointer-events: none;
}

/* Tile Revealed State */
.puzzle-tile.revealed .tile-inner {
  transform: rotateY(90deg) scale(0.8);
  opacity: 0;
  pointer-events: none;
}

/* Selected / highlight */
.puzzle-tile.highlight .tile-front {
  background: linear-gradient(135deg, #ffd166, #ffb703);
  animation: pulseHighlight 0.8s infinite alternate;
}

@keyframes pulseHighlight {
  from { filter: brightness(1); }
  to { filter: brightness(1.3); }
}

/* Admin / Side Panel */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.panel-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-pink);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form controls & Buttons */
.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #ff4d79, #ff2a5f);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 77, 121, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff2a5f, #c9184a);
  box-shadow: 0 6px 18px rgba(255, 77, 121, 0.4);
}

.btn-outline {
  background: white;
  color: var(--text-pink);
  border: 1.5px solid #ffb6c1;
}

.btn-outline:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
}

.btn-gold {
  background: linear-gradient(135deg, #ffb703, #fb8500);
  color: white;
  box-shadow: 0 4px 14px rgba(251, 133, 0, 0.3);
}

.btn-full {
  width: 100%;
}

.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-control {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #ffd1dc;
  background: white;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 77, 121, 0.15);
}

/* Quick Tile Picker Bar */
.tile-quick-jump {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Stat progress bar */
.progress-container {
  margin: 12px 0 6px 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #ffe0e9;
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7597, #ff2a5f);
  border-radius: 20px;
  transition: width 0.4s ease;
}

/* Guess Answer Card / Host Callout */
.guess-box {
  background: linear-gradient(135deg, #fff5f7, #ffe9ee);
  border: 2px dashed #ff8da1;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  margin-top: 10px;
}

.guess-box h4 {
  color: var(--text-pink);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.guess-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ==========================================================================
   MODULE 2: ANNI WALL (BỨC TƯỜNG KỶ NIỆM & LỜI CHÚC SINH NHẬT VÂN)
   ========================================================================== */

.wall-hero {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  padding: 24px 16px;
}

.wall-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ffb6c1;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.wall-hero h2 {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ff2a5f 0%, #c77dff 50%, #ff8da1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.wall-hero p {
  font-size: 1.1rem;
  color: #666;
  max-width: 650px;
  margin: 0 auto 20px auto;
}

.wall-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

.wall-search {
  flex: 1;
  min-width: 260px;
  max-width: 450px;
  position: relative;
}

.wall-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 30px;
  border: 1.5px solid #ffd1dc;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  background: white;
}

.wall-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 77, 121, 0.12);
}

.wall-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #ff8da1;
  font-size: 1rem;
}

.wall-stats {
  display: flex;
  align-items: center;
  gap: 18px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #555;
}

.stat-item .num {
  font-weight: 800;
  color: var(--primary);
}

.wall-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* The Anni Wall Grid Layout (Masonry / Corkboard feel) */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 26px;
  align-items: start;
}

/* Individual Polaroid / Wish Card */
.wish-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(255, 77, 121, 0.08);
  border: 1px solid rgba(255, 182, 193, 0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  overflow: visible;
}

.wish-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 16px 36px rgba(255, 77, 121, 0.22);
  z-index: 20;
}

/* Random natural tilt for lively polaroid wall look */
.wish-card:nth-child(4n+1) { transform: rotate(-1.5deg); }
.wish-card:nth-child(4n+2) { transform: rotate(1.2deg); }
.wish-card:nth-child(4n+3) { transform: rotate(-0.8deg); }
.wish-card:nth-child(4n+4) { transform: rotate(1.8deg); }

/* Washi Tape / Pushpin decoration */
.card-pin {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 20px;
  background: rgba(255, 182, 193, 0.65);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 2px;
  z-index: 5;
  clip-path: polygon(0% 0%, 100% 0%, 96% 100%, 4% 100%);
}

.pin-style-heart {
  top: -14px;
  width: 28px;
  height: 28px;
  background: #ff4d79;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  clip-path: none;
}

/* Color theme variations */
.wish-card.theme-peach { background: #fff8f0; border-color: #ffd8be; }
.wish-card.theme-lavender { background: #fbf7ff; border-color: #e2caff; }
.wish-card.theme-mint { background: #f4fbf7; border-color: #b7e4c7; }
.wish-card.theme-gold { background: #fffcf2; border-color: #ffe49e; }
.wish-card.theme-pink { background: #fff5f8; border-color: #ffccd5; }

/* Card Photo Container */
.card-photo-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  background: #ffeef2;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
}

.card-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.wish-card:hover .card-photo-box img {
  transform: scale(1.06);
}

.card-sticker-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  animation: gentleWiggle 3s infinite ease-in-out;
}

@keyframes gentleWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

/* Card Content */
.card-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.sender-info h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #222;
  line-height: 1.2;
}

.sender-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 77, 121, 0.12);
  color: #c9184a;
  font-weight: 700;
  margin-top: 4px;
}

.card-date {
  font-size: 0.78rem;
  color: #999;
}

.card-message {
  font-size: 0.96rem;
  color: #444;
  line-height: 1.55;
  margin-bottom: 16px;
  word-break: break-word;
  white-space: pre-line;
  max-height: 140px;
  overflow: hidden;
  position: relative;
}

.card-message.handwritten {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: #c9184a;
  line-height: 1.4;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 182, 193, 0.6);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid #ffd1dc;
  padding: 6px 14px;
  border-radius: 20px;
  color: #ff2a5f;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.like-btn:hover {
  background: #ffe5ec;
  transform: scale(1.08);
}

.like-btn.liked {
  background: #ff4d79;
  color: white;
  border-color: #ff4d79;
}

.view-more-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}

.view-more-link:hover {
  color: var(--primary);
}

/* ==========================================================================
   MODULE 2 (PART B): SUBMISSION FORM (GIAO DIỆN NGƯỜI CHƠI GỬI LỜI CHÚC)
   ========================================================================== */

.submit-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .submit-layout {
    grid-template-columns: 1fr;
  }
}

.form-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.form-header {
  margin-bottom: 24px;
}

.form-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-pink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-field {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
  color: #333;
}

.form-label span.req {
  color: var(--primary);
}

/* Image Upload Area */
.image-upload-dropzone {
  border: 2px dashed #ff8da1;
  background: #fff8fa;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.image-upload-dropzone:hover,
.image-upload-dropzone.dragover {
  background: #ffeef3;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon {
  font-size: 2.2rem;
  color: var(--primary);
}

.dropzone-text {
  font-weight: 600;
  color: #555;
  font-size: 0.95rem;
}

.dropzone-hint {
  font-size: 0.8rem;
  color: #999;
}

.upload-preview-container {
  display: none;
  position: relative;
  width: 100%;
  max-height: 240px;
  border-radius: 12px;
  overflow: hidden;
}

.upload-preview-container img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.btn-remove-photo {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-remove-photo:hover {
  background: #ff2a5f;
}

/* Quick Birthday Wishes Pills */
.wishes-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.quick-pick-pill {
  font-size: 0.8rem;
  padding: 6px 12px;
  background: #fff0f5;
  border: 1px solid #ffd1dc;
  border-radius: 20px;
  cursor: pointer;
  color: #c9184a;
  transition: all 0.2s;
}

.quick-pick-pill:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Style / Theme pickers */
.theme-picker-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-radio {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
  position: relative;
}

.color-radio:hover {
  transform: scale(1.15);
}

.color-radio.active {
  box-shadow: 0 0 0 3px var(--primary);
  transform: scale(1.1);
}

/* Sticker pickers */
.sticker-picker-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sticker-opt {
  font-size: 1.5rem;
  padding: 6px 10px;
  border-radius: 12px;
  background: white;
  border: 1px solid #ffd1dc;
  cursor: pointer;
  transition: all 0.2s;
}

.sticker-opt:hover {
  background: #ffeef2;
  transform: scale(1.15);
}

.sticker-opt.active {
  background: #ffe5ec;
  border-color: var(--primary);
  transform: scale(1.12);
}

/* Live Preview Side Box */
.preview-sticky {
  position: sticky;
  top: 90px;
}

.preview-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-pink);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   MODAL DIALOGS (Detail Modal, Slideshow Mode, Settings Modal)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 182, 193, 0.5);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ffccd5;
  color: #555;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #ff2a5f;
  color: white;
  transform: rotate(90deg);
}

.modal-body {
  padding: 28px;
}

/* Slideshow Modal */
.slideshow-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #2e081f 0%, #11020b 100%);
  z-index: 2000;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  color: white;
}

.slideshow-modal.active {
  display: flex;
}

.slideshow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.slideshow-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.slide-item {
  max-width: 800px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  padding: 36px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.6s ease;
}

.slide-item img {
  max-height: 380px;
  max-width: 100%;
  border-radius: 18px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.slide-sender {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ff9ebb;
  margin-bottom: 12px;
}

.slide-text {
  font-size: 1.35rem;
  line-height: 1.6;
  color: #fff;
  white-space: pre-line;
}

.slideshow-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
  padding-bottom: 10px;
}

.slide-nav-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.slide-nav-btn:hover {
  background: var(--primary);
  transform: scale(1.1);
}

/* Fullscreen Confetti Canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2b2b2b;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 99999;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-notice.success {
  background: linear-gradient(135deg, #ff2a5f, #c9184a);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .header-container {
    padding: 10px 14px;
  }
  .brand-text h1 {
    font-size: 1.15rem;
  }
  .nav-tabs {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }
  .nav-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  .puzzle-card {
    padding: 16px;
  }
  .puzzle-board {
    max-width: 100%;
  }
  .tile-front {
    font-size: 0.65rem;
  }
  .wall-hero h2 {
    font-size: 1.8rem;
  }
}
