/* ==========================================================================
   Wedding Interactive Party System - Modern Luxurious Theme
   Color Palette: Champagne Gold (#D4AF37), Rose Gold (#E8A598), Velvet Dark (#160811)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Noto+Sans+TC:wght@400;500;700;900&family=Outfit:wght@400;500;600;800;900&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

:root {
  --bg-dark: #12050E;
  --bg-gradient: radial-gradient(circle at 50% 20%, #2E0F23 0%, #160712 60%, #0B0309 100%);
  --gold-main: #F4C465;
  --gold-light: #FFF0B8;
  --gold-dark: #B8860B;
  --gold-gradient: linear-gradient(135deg, #FFE899 0%, #F4C465 50%, #C49226 100%);
  --gold-glow: 0 0 25px rgba(244, 196, 101, 0.4);
  
  --rose-gold: #E8A598;
  --rose-gradient: linear-gradient(135deg, #FFD1C9 0%, #E8A598 50%, #BD685A 100%);
  --rose-glow: 0 0 20px rgba(232, 165, 152, 0.35);

  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(244, 196, 101, 0.25);
  --glass-border-hover: rgba(244, 196, 101, 0.6);
  --glass-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);

  --text-white: #FFFFFF;
  --text-gold: #F7E3A1;
  --text-pink: #FFDFE5;
  --text-muted: #BFA5B5;

  --font-header: 'Cinzel', 'Noto Sans TC', 'Roboto', 'Microsoft JhengHei', serif;
  --font-body: 'Outfit', 'Noto Sans TC', 'Roboto', 'PingFang TC', 'Microsoft JhengHei', sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Base Styles for Android & iOS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html {
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-white);
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Lighting & Floating Sparkles Canvas */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Bullet Wall Overlay */
#bullet-container {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100vh - 160px);
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.bullet-item {
  position: absolute;
  white-space: nowrap;
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFF;
  padding: 10px 22px;
  background: rgba(22, 7, 18, 0.75);
  border: 1px solid var(--gold-main);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4), var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: bulletMove 12s linear forwards;
}

.bullet-item .bullet-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #12050E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

@keyframes bulletMove {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

/* App Container Layout */
#app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation Header */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(12, 3, 10, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(244, 196, 101, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.room-game-note {
  margin: 0 auto 12px;
  max-width: 680px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.blessings-empty {
  grid-column: 1 / -1;
  padding: 22px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
}
.envelope-card {
  min-height: 110px;
  padding: 10px;
  border: 2px solid var(--gold-main);
  border-radius: 12px;
  background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
  color: var(--gold-light);
  font: 800 0.85rem var(--font-body);
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}
.envelope-card.opened {
  background: radial-gradient(circle, #2E0F23 0%, #12050E 100%);
  border-color: #2ECC71;
  cursor: default;
}

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

.brand-icon {
  font-size: 1.7rem;
  filter: drop-shadow(0 0 12px rgba(244, 196, 101, 0.75));
  animation: heartPulse 2.5s infinite alternate ease-in-out;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

.brand-text h1 {
  font-family: var(--font-header);
  font-size: 1.1rem;
  letter-spacing: 3px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.brand-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  opacity: 0.75;
}

/* Right-Side Collapsible Side Drawer & Backdrop Overlay */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 290px;
  max-width: 82vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(22, 7, 18, 0.96);
  backdrop-filter: blur(25px);
  border-left: 2px solid var(--gold-main);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8), var(--gold-glow);
  z-index: 10001;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
}

.side-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 12px;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: #FFF;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-user-info {
  background: rgba(244, 196, 101, 0.12);
  border: 1px solid var(--gold-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: #FFF;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.drawer-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-4px);
}

.drawer-nav-item.active {
  background: var(--gold-gradient);
  color: #12050E;
  font-weight: 800;
  border-color: #FFE899;
  box-shadow: 0 0 15px rgba(244, 196, 101, 0.6);
}

.drawer-nav-item .item-icon {
  font-size: 1.4rem;
}

/* Controls Header (Simulator, Sound, View Mode) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-gold);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(244, 196, 101, 0.15);
  border-color: var(--gold-main);
  box-shadow: var(--gold-glow);
  transform: translateY(-2px);
}

.icon-btn.active {
  background: var(--rose-gradient);
  color: #FFF;
  border-color: transparent;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 20px 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Section Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
  display: block;
}

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

/* Glass Card Component */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(244, 196, 101, 0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-main), transparent);
  animation: shimmer 4s infinite;
}

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

/* Section Header Titles */
.section-header {
  text-align: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-header);
  font-size: 1.7rem;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Buttons */
.btn-primary {
  background: var(--gold-gradient);
  color: #12050E;
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: var(--gold-glow);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px rgba(244, 196, 101, 0.7);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-white);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--gold-main);
  color: var(--gold-light);
}

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

.btn-rose {
  background: var(--rose-gradient);
  color: #FFF;
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--rose-glow);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-rose:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px rgba(232, 165, 152, 0.7);
}

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

/* ==========================================================================
   GAME 1: QA TRIVIA QUIZ STYLES
   ========================================================================== */
.quiz-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  gap: 20px !important;
  box-sizing: border-box !important;
}

.quiz-main {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-height: auto !important;
}

.quiz-badge {
  display: inline-block;
  background: rgba(244, 196, 101, 0.15);
  border: 1px solid var(--gold-main);
  color: var(--gold-light);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.question-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  margin-bottom: 24px;
  text-align: center;
}

.question-box h3 {
  font-size: 1.8rem;
  line-height: 1.4;
  color: var(--text-white);
}

/* Timer Circle Bar */
.timer-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--gold-gradient);
  transition: width 1s linear, background-color 0.3s;
}

/* Quiz Options Grid */
.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.quiz-option {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-white);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.quiz-option .opt-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option .opt-key {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(244, 196, 101, 0.2);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.quiz-option:hover {
  border-color: var(--gold-main);
  background: rgba(244, 196, 101, 0.1);
  transform: translateY(-2px);
}

.quiz-option.selected {
  border-color: var(--gold-main);
  background: rgba(244, 196, 101, 0.25);
  box-shadow: var(--gold-glow);
}

.quiz-option.correct {
  border-color: #2ECC71 !important;
  background: rgba(46, 204, 113, 0.25) !important;
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.4);
}

.quiz-option.wrong {
  border-color: #E74C3C !important;
  background: rgba(231, 76, 60, 0.25) !important;
}

.quiz-option .opt-count {
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: var(--text-gold);
}

/* Leaderboard Full-Width Section Below Quiz */
.quiz-leaderboard {
  width: 100% !important;
  box-sizing: border-box !important;
  background: linear-gradient(145deg, rgba(255, 232, 153, 0.1) 0%, rgba(20, 5, 16, 0.85) 100%) !important;
  border-radius: 20px !important;
  padding: 18px 20px !important;
  border: 1.5px solid rgba(244, 196, 101, 0.5) !important;
  display: flex !important;
  flex-direction: column !important;
  margin-top: 14px !important;
}

.quiz-leaderboard h4 {
  font-family: var(--font-header);
  color: var(--gold-main);
  font-size: 1.2rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 400px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 4px solid transparent;
}

.leaderboard-item.rank-1 { border-left-color: #FFD700; background: rgba(255, 215, 0, 0.15); }
.leaderboard-item.rank-2 { border-left-color: #C0C0C0; background: rgba(192, 192, 192, 0.1); }
.leaderboard-item.rank-3 { border-left-color: #CD7F32; background: rgba(205, 127, 50, 0.1); }

.leaderboard-item .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-item .rank-badge {
  font-weight: 800;
  width: 24px;
}

.leaderboard-item .user-score {
  font-weight: 800;
  color: var(--gold-light);
}

/* ==========================================================================
   GAME 2: HEART TAPPER STYLES
   ========================================================================== */
.tapper-container {
  text-align: center;
}

.tapper-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}

.stat-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  padding: 16px 32px;
  border-radius: var(--radius-md);
  min-width: 180px;
}

/* Full-Screen 3-2-1 Arcade Countdown Overlay */
.countdown-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 5, 14, 0.92);
  backdrop-filter: blur(20px);
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.countdown-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.countdown-card {
  text-align: center;
}

.countdown-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.countdown-num {
  font-size: 6.5rem;
  font-weight: 900;
  font-family: var(--font-header);
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(244, 196, 101, 0.8));
  line-height: 1;
  margin-bottom: 20px;
}

.countdown-sub {
  font-size: 1.1rem;
  color: var(--text-pink);
  font-weight: 700;
}

/* Prominent Glowing 15-Second Match Countdown Badge */
.tapper-timer-banner {
  background: linear-gradient(135deg, rgba(244, 196, 101, 0.2) 0%, rgba(232, 165, 152, 0.2) 100%);
  border: 2px solid var(--gold-main);
  border-radius: var(--radius-pill);
  padding: 8px 24px;
  margin: 0 auto 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFF;
  box-shadow: var(--gold-glow);
  transition: all 0.3s;
}

.tapper-timer-banner .timer-number {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold-light);
  font-family: var(--font-header);
  line-height: 1;
}

.tapper-timer-banner.urgent {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.5) 0%, rgba(192, 57, 43, 0.7) 100%);
  border-color: #FF4D4D;
  box-shadow: 0 0 30px rgba(255, 77, 77, 0.85);
  animation: urgentPulse 0.5s infinite alternate;
}

@keyframes urgentPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}
/* Global Floating Celebration Cannon FAB & Particles */
.global-cheer-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 9999;
  background: var(--gold-gradient);
  color: #12050E;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(244, 196, 101, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.global-cheer-fab:active {
  transform: scale(0.92);
}

.cheer-particle {
  position: fixed;
  font-size: 2.2rem;
  z-index: 10000;
  pointer-events: none;
  animation: cheerFlyUp 1.8s ease-out forwards;
}

@keyframes cheerFlyUp {
  0% {
    transform: translateY(0) scale(0.5) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: translateY(-50vh) scale(1.4) rotate(180deg);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-90vh) scale(1.8) rotate(360deg);
    opacity: 0;
  }
}

/* Animated Tug-of-War Battle Arena (100% Mobile Full-Width Rope) */
.tug-of-war-arena {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 20px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.tug-status-banner {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gold-light);
  background: rgba(244, 196, 101, 0.15);
  border: 1px solid var(--gold-main);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.tug-avatars-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
}

.tug-team-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.tug-team-badge.groom {
  background: rgba(52, 152, 219, 0.18);
  border: 1px solid rgba(52, 152, 219, 0.5);
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.25);
}

.tug-team-badge.bride {
  background: rgba(231, 76, 60, 0.18);
  border: 1px solid rgba(231, 76, 60, 0.5);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.25);
}

.tug-team-badge .avatar-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.6));
}

.tug-team-badge .team-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.tug-team-badge.bride .team-meta {
  text-align: right;
}

.tug-team-badge .t-name {
  font-weight: 800;
  font-size: 0.85rem;
}

.tug-team-badge.groom .t-name { color: #5DADE2; }
.tug-team-badge.bride .t-name { color: #F1948A; }

.tug-team-badge .t-score {
  font-size: 0.78rem;
  font-weight: 800;
  color: #FFF;
}

.tug-vs-badge {
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--gold-main);
  background: rgba(0,0,0,0.5);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-main);
  flex-shrink: 0;
}

/* 100% Full-Width Mobile Braided Rope & Flag Stage */
.tug-full-rope-stage {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 8px;
  width: 100%;
}

.rope-anchor {
  font-size: 1.2rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.tug-rope-track-full {
  flex: 1;
  height: 44px;
  position: relative;
  display: flex;
  align-items: center;
}

.tug-rope-line-full {
  width: 100%;
  height: 20px;
  background: repeating-linear-gradient(
    45deg,
    #F4C465 0px,
    #F4C465 14px,
    #8B5A2B 14px,
    #8B5A2B 28px
  );
  border-radius: 10px;
  border: 2px solid #FFE899;
  box-shadow: 0 0 18px rgba(244, 196, 101, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.6);
  position: relative;
}

.tug-rope-line-full::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%);
}

.tug-flag-full {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 10;
  filter: drop-shadow(0 0 12px rgba(255, 0, 0, 0.9));
  line-height: 1;
}

.tug-progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 800;
}

.team-score-label.groom-color { color: #3498DB; }
.team-score-label.bride-color { color: #E74C3C; }

.tug-progress-bar {
  flex: 1;
  height: 16px;
  background: #E74C3C;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(255,255,255,0.2);
}

.bar-groom {
  height: 100%;
  background: linear-gradient(90deg, #2980B9, #3498DB);
  transition: width 0.3s ease-out;
}

.bar-bride {
  height: 100%;
  background: linear-gradient(90deg, #E74C3C, #C0392B);
  transition: width 0.3s ease-out;
}

.stat-box .stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Big Interactive Tap Heart Button */
.tap-heart-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FF85A1 0%, #FF3366 50%, #C00038 100%);
  border: 4px solid #FFE899;
  color: #FFF;
  font-size: 4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 35px rgba(255, 51, 102, 0.9), 0 0 70px rgba(244, 196, 101, 0.6);
  transition: transform 0.08s ease-out;
  margin: 12px auto;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  animation: heartPulseAnimation 1.5s infinite alternate ease-in-out;
}

@keyframes heartPulseAnimation {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.tap-heart-btn:active {
  transform: scale(0.86) !important;
  box-shadow: 0 0 60px rgba(255, 51, 102, 1) !important;
}

/* Tapper Race Progress Bars */
.tapper-race {
  margin-top: 30px;
  background: rgba(0, 0, 0, 0.3);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.race-bar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.race-name {
  width: 100px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-track {
  flex: 1;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.race-progress {
  height: 100%;
  width: 0%;
  background: var(--gold-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.2s ease-out;
  position: relative;
}

.race-progress::after {
  content: '❤️';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

.race-score {
  width: 60px;
  font-weight: 800;
  color: var(--gold-light);
}

/* ==========================================================================
   GAME 3: LUXURY LUCKY WHEEL STYLES
   ========================================================================== */
.wheel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.wheel-canvas-container {
  position: relative;
  width: 440px;
  height: 440px;
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6));
}

.wheel-pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 35px solid var(--gold-main);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
  z-index: 10;
}

.wheel-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gold-gradient);
  border: 4px solid #12050E;
  color: #12050E;
  font-weight: 900;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11;
  transition: transform 0.2s;
}

.wheel-center-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.wheel-controls {
  flex: 1;
  min-width: 300px;
  background: rgba(0, 0, 0, 0.3);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.winner-display {
  margin-top: 20px;
  padding: 20px;
  background: rgba(244, 196, 101, 0.15);
  border: 2px dashed var(--gold-main);
  border-radius: var(--radius-md);
  text-align: center;
  display: none;
}

.winner-display h3 {
  color: var(--gold-light);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.winner-display .winner-name {
  font-size: 2.2rem;
  font-weight: 900;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   GAME 4: SCRATCH CARD STYLES
   ========================================================================== */
.scratch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.scratch-card-box {
  position: relative;
  width: 360px;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), var(--gold-glow);
  border: 3px solid var(--gold-main);
  background: var(--gold-gradient);
}

.scratch-underlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #2E0F23 0%, #12050E 100%);
  padding: 20px;
  text-align: center;
}

.scratch-underlay .prize-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.scratch-underlay .prize-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-light);
}

#scratch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* ==========================================================================
   GAME 5: BULLET WALL CONTROL & BLESSINGS
   ========================================================================== */
.bullet-form {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 30px;
}

.form-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  color: var(--text-white);
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--gold-main);
  box-shadow: var(--gold-glow);
}

.blessings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 196, 101, 0.4) transparent;
}

.blessings-grid::-webkit-scrollbar {
  width: 4px;
}
.blessings-grid::-webkit-scrollbar-track { background: transparent; }
.blessings-grid::-webkit-scrollbar-thumb {
  background: rgba(244, 196, 101, 0.4);
  border-radius: 99px;
}

.blessing-card {
  background: linear-gradient(135deg, rgba(244, 196, 101, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(244, 196, 101, 0.35);
  padding: 14px 16px;
  border-radius: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.4s ease-out;
}

.blessing-card:hover {
  border-color: rgba(244, 196, 101, 0.7);
  background: linear-gradient(135deg, rgba(244, 196, 101, 0.18) 0%, rgba(255, 255, 255, 0.07) 100%);
}

.blessing-card .bless-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE899 0%, #F4C465 100%);
  color: #12050E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(244, 196, 101, 0.5);
}

.blessing-card .bless-info h5 {
  color: #FFE899;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 4px;
  opacity: 0.9;
}

.blessing-card .bless-info p {
  color: #FFFFFF;
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
}

/* ==========================================================================
   SETTINGS & QUESTION EDITOR
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.editor-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.editor-box h4 {
  font-family: var(--font-header);
  color: var(--gold-main);
  margin-bottom: 16px;
}

.textarea-input {
  width: 100%;
  height: 180px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  color: var(--text-white);
  padding: 14px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 12px;
}

/* ==========================================================================
   MOBILE SIMULATOR FRAME / MODAL
   ========================================================================== */
.mobile-simulator-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.mobile-simulator-modal.active {
  display: flex;
}

.phone-frame {
  width: 375px;
  height: 720px;
  background: #12050E;
  border-radius: 40px;
  border: 10px solid #2A2A2A;
  box-shadow: 0 25px 60px rgba(0,0,0,0.9), 0 0 30px rgba(244, 196, 101, 0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  width: 140px;
  height: 24px;
  background: #2A2A2A;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  z-index: 100;
}

.phone-content {
  flex: 1;
  overflow-y: auto;
  padding: 36px 16px 20px;
  display: flex;
  flex-direction: column;
}

.close-sim-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Item List & Visual Manager Styles */
.items-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.item-chip {
  background: rgba(244, 196, 101, 0.15);
  border: 1px solid var(--gold-main);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s;
}

.item-chip .del-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #FFF;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition);
}

.item-chip .del-btn:hover {
  background: #E74C3C;
}

.add-item-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

/* Admin Auth Modal & Lock Styles */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
}

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

/* 100% Horizontal Full-Width Blessing Form & Inputs */
.bullet-full-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}

.bullet-full-form {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin: 0 0 16px !important;
  box-sizing: border-box !important;
}

/* Global Ultra-Luxury Golden Capsule Inputs (No White Square Boxes!) */
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea,
.form-input,
.reg-input {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  width: 100% !important;
  background: linear-gradient(135deg, rgba(255, 232, 153, 0.14) 0%, rgba(25, 8, 20, 0.92) 100%) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 2px solid rgba(244, 196, 101, 0.85) !important;
  border-radius: 99px !important;
  color: #FFFFFF !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif !important;
  padding: 16px 22px !important;
  box-sizing: border-box !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 18px rgba(244, 196, 101, 0.2), 0 0 20px rgba(244, 196, 101, 0.25) !important;
  transition: all 0.25s ease !important;
  outline: none !important;
}

/* Fix iOS Autofill White Background Override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #FFFFFF !important;
  -webkit-box-shadow: 0 0 0px 1000px #1E0719 inset !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

input[type="text"]:focus,
select:focus,
textarea:focus,
.form-input:focus,
.reg-input:focus {
  border-color: #FFE899 !important;
  background: linear-gradient(135deg, rgba(255, 232, 153, 0.22) 0%, rgba(35, 10, 28, 0.95) 100%) !important;
  box-shadow: 0 0 35px rgba(244, 196, 101, 0.85), inset 0 0 22px rgba(244, 196, 101, 0.3) !important;
}

input::placeholder,
textarea::placeholder,
.form-input::placeholder,
.reg-input::placeholder {
  color: rgba(255, 232, 153, 0.75) !important;
  font-size: 0.98rem !important;
  font-weight: 400 !important;
  -webkit-text-fill-color: rgba(255, 232, 153, 0.75) !important;
}

/* Bullet Wall Full-Width Textarea Specific Overrides (Large Rounded Box) */
.bullet-full-input-box {
  width: 100% !important;
  background: linear-gradient(145deg, rgba(255, 232, 153, 0.16) 0%, rgba(20, 5, 16, 0.92) 100%) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 2.5px solid rgba(244, 196, 101, 0.9) !important;
  border-radius: 24px !important;
  padding: 18px 20px !important;
  box-sizing: border-box !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), inset 0 0 22px rgba(244, 196, 101, 0.25), 0 0 30px rgba(244, 196, 101, 0.35) !important;
  transition: all 0.25s ease !important;
}

.bullet-full-input-box:focus-within {
  border-color: #FFE899 !important;
  background: linear-gradient(145deg, rgba(255, 232, 153, 0.24) 0%, rgba(35, 10, 28, 0.95) 100%) !important;
  box-shadow: 0 0 45px rgba(244, 196, 101, 0.9), inset 0 0 28px rgba(244, 196, 101, 0.4) !important;
}

.bullet-full-textarea {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #FFFFFF !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif !important;
  resize: none !important;
  line-height: 1.6 !important;
  box-sizing: border-box !important;
  min-height: 95px !important;
}

.form-input:focus {
  border-color: rgba(244, 196, 101, 0.85) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 0 14px rgba(244, 196, 101, 0.35) !important;
}

/* ==========================================================================
   STEP 1: VISUAL-FIRST REGISTRATION — Animation > Image > Text
   ========================================================================== */

/* Full-screen registration page — must be position:relative so petals stay inside */
.step1-registration-page {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: radial-gradient(ellipse at 50% 20%, #3D1030 0%, #1A0715 55%, #0D030A 100%) !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  margin: 0 !important;
}

/* `display: flex !important` above and in the mobile layout must never trap guests on entry. */
#guest-login-modal[hidden] {
  display: none !important;
}

/* Floating petals — positioned inside step1-registration-page */
.reg-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.reg-petals span {
  position: absolute;
  font-size: 1.25rem;
  opacity: 0;
  top: -50px;
  animation: petalFall var(--dur, 7s) var(--delay, 0s) infinite linear;
}

.reg-petals span:nth-child(1) { left:  5%; --delay: 0s;   --dur: 7s; }
.reg-petals span:nth-child(2) { left: 18%; --delay: 1.3s; --dur: 5.5s; }
.reg-petals span:nth-child(3) { left: 35%; --delay: 0.6s; --dur: 8s; }
.reg-petals span:nth-child(4) { left: 52%; --delay: 2.1s; --dur: 6.5s; }
.reg-petals span:nth-child(5) { left: 67%; --delay: 0.9s; --dur: 7.5s; }
.reg-petals span:nth-child(6) { left: 80%; --delay: 1.8s; --dur: 6s; }
.reg-petals span:nth-child(7) { left: 44%; --delay: 3.2s; --dur: 9s; }
.reg-petals span:nth-child(8) { left: 12%; --delay: 2.7s; --dur: 7s; }

@keyframes petalFall {
  0%   { transform: translateY(0)     rotate(0deg)   scale(0.8); opacity: 0; }
  10%  { opacity: 0.7; }
  85%  { opacity: 0.5; }
  100% { transform: translateY(110vh) rotate(380deg) scale(1.1); opacity: 0; }
}

/* Registration card — centered, z-index above petals */
.registration-card {
  position: relative;
  z-index: 1;
  width: 100% !important;
  max-width: 360px !important;
  background: linear-gradient(160deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.04) 100%) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border: 1px solid rgba(244, 196, 101, 0.5) !important;
  border-radius: 28px !important;
  padding: 30px 24px 24px !important;
  box-sizing: border-box !important;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 40px rgba(244,196,101,0.2) !important;
  text-align: center !important;
  animation: cardGlow 4s ease-in-out infinite alternate !important;
}

@keyframes cardGlow {
  0%   { box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 25px rgba(244,196,101,0.15); }
  100% { box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 50px rgba(244,196,101,0.4); }
}

/* Hero section — animation first */
.reg-hero {
  text-align: center;
  margin-bottom: 16px;
}

.reg-rings {
  display: block;
  font-size: 3.8rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 24px rgba(244,196,101,0.95));
  animation: ringFloat 3s ease-in-out infinite;
}

@keyframes ringFloat {
  0%, 100% { transform: translateY(0)    scale(1);    filter: drop-shadow(0 0 22px rgba(244,196,101,0.85)); }
  50%       { transform: translateY(-8px) scale(1.07); filter: drop-shadow(0 0 38px rgba(244,196,101,1)); }
}

.reg-title {
  font-family: 'Cinzel', serif;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFE899 45%, #F4C465 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  line-height: 1.2;
}

.reg-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 232, 153, 0.5);
  letter-spacing: 0.5px;
  font-weight: 400;
}

/* Gold divider */
.reg-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244,196,101,0.5), transparent);
  margin: 16px 0;
}

/* Form fields — left-aligned inside centered card */
.reg-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  text-align: left;
}

.reg-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.reg-field:focus-within {
  border-color: rgba(244,196,101,0.75);
  box-shadow: 0 0 18px rgba(244,196,101,0.25);
  background: rgba(255,255,255,0.1);
}

.reg-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1;
  width: 22px;
  text-align: center;
}

.reg-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  -webkit-text-fill-color: #FFFFFF;
}

.reg-input::placeholder {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.85rem;
  font-weight: 400;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.38);
}

.reg-helper {
  font-size: 0.78rem;
  color: #FFE899;
  font-weight: 700;
  min-height: 18px;
  padding: 0 2px;
  text-align: left;
}

.reg-select {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.reg-select:focus {
  border-color: rgba(244,196,101,0.75);
  box-shadow: 0 0 18px rgba(244,196,101,0.25);
}

.reg-select option {
  background: #1A0715;
  color: #FFFFFF;
}

/* Submit button */
.reg-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #FFE899 0%, #F4C465 50%, #C49226 100%);
  color: #12050E;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 900;
  padding: 14px;
  cursor: pointer;
  letter-spacing: 1.5px;
  box-shadow: 0 8px 28px rgba(244,196,101,0.5), 0 0 0 0 rgba(244,196,101,0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: block;
  text-align: center;
}

.reg-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(244,196,101,0.7);
}

.reg-submit-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(244,196,101,0.35);
}

/* ==========================================================================
   MOBILE PERFECT CENTERING & FULL-WIDTH BALANCED LAYOUT OVERRIDES
   ========================================================================== */
@media screen and (max-width: 768px) {
  html, body {
    width: 100vw !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    overflow-x: hidden !important;
  }

  /* Step 1 Full-Width Mobile Card */
  .step1-registration-page {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    padding: 12px !important;
    width: 100vw !important;
    box-sizing: border-box !important;
  }

  .registration-card {
    margin: 0 auto !important;
    width: 95vw !important;
    max-width: 95vw !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 28px 18px !important;
    border-radius: 24px !important;
  }

  .reg-hero {
    text-align: center !important;
    margin: 0 auto 16px !important;
  }

  .reg-fields {
    width: 100% !important;
    margin: 0 auto 18px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .reg-field, .reg-select {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .reg-submit-btn {
    width: 100% !important;
    margin: 0 auto !important;
    padding: 15px !important;
  }

  /* Step 2 App & Layout Full Width on Mobile */
  #app {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  .navbar {
    width: 100vw !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    gap: 8px;
  }


  .main-content {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 auto !important;
    padding: 12px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  .tab-pane {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .section-header {
    text-align: center !important;
    margin: 0 auto 12px !important;
    width: 100% !important;
  }

  .glass-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 18px 14px !important;
    border-radius: 18px !important;
  }

  /* Bullet Form 100% Full Width on Mobile */
  .bullet-full-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .bullet-full-form {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 16px !important;
  }

  .bullet-full-input-box {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 14px !important;
    box-sizing: border-box !important;
  }

  .bullet-full-send-btn {
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px 0 0 !important;
    padding: 16px !important;
    font-size: 1.15rem !important;
    border-radius: 16px !important;
  }

  /* Game 1: Quiz Centering */
  .quiz-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    gap: 16px !important;
  }

  .quiz-main {
    width: 100% !important;
    text-align: center !important;
  }

  .question-box {
    text-align: center !important;
    margin: 0 auto 16px !important;
    padding: 16px 12px !important;
  }

  .quiz-options {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .quiz-leaderboard {
    width: 100% !important;
    margin-top: 16px !important;
    text-align: center !important;
  }

  /* Game 2: Tapper Centering */
  .tapper-container {
    text-align: center !important;
    margin: 0 auto !important;
    width: 100% !important;
    padding: 16px 12px !important;
  }

  .tap-heart-btn {
    margin: 14px auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 130px !important;
    height: 130px !important;
  }

  .tug-full-rope-stage {
    margin: 12px auto !important;
    width: 100% !important;
  }

  /* Game 3: Wheel Centering */
  .wheel-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    width: 100% !important;
    gap: 18px !important;
  }

  .wheel-canvas-container {
    margin: 0 auto 16px !important;
    width: min(320px, 85vw) !important;
    height: min(320px, 85vw) !important;
  }

  .wheel-controls {
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 16px 12px !important;
  }

  /* Game 4: Scratch Centering */
  .scratch-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    gap: 18px !important;
  }

  .scratch-card-box {
    margin: 0 auto 14px !important;
    width: min(330px, 90vw) !important;
    height: 185px !important;
  }

  #red-envelope-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin: 0 auto !important;
    justify-content: center !important;
  }

  /* Game 5: Bullet Wall Centering */
  .blessings-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 auto !important;
    max-height: 280px !important;
  }

  /* Settings centering */
  .settings-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    gap: 16px !important;
  }

  .editor-box {
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding: 16px 12px !important;
  }
}

/* ==========================================================================
   3D ROCKET BLAST OFF LAUNCH ANIMATION (發送祝福火箭彈射升空動畫)
   ========================================================================== */
.rocket-launch-wrapper {
  position: fixed;
  left: 50%;
  bottom: -60px;
  transform: translateX(-50%);
  z-index: 999999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rocketBlastOff 1.6s cubic-bezier(0.15, 0.85, 0.35, 1.2) forwards;
}

.rocket-body {
  font-size: 5.5rem;
  filter: drop-shadow(0 0 35px rgba(244, 196, 101, 1)) drop-shadow(0 0 55px rgba(255, 100, 50, 0.95));
  transform: rotate(-10deg);
  animation: rocketWobble 0.2s infinite alternate ease-in-out;
}

.rocket-flame {
  font-size: 3.2rem;
  margin-top: -20px;
  filter: drop-shadow(0 0 25px #FF4500);
  animation: flameFlicker 0.15s infinite alternate;
}

.rocket-sparks {
  display: flex;
  gap: 14px;
  margin-top: -12px;
}

.rocket-sparks span {
  font-size: 1.8rem;
  animation: sparkFall 0.8s ease-out infinite;
}

@keyframes rocketBlastOff {
  0% {
    bottom: -80px;
    opacity: 0.2;
    transform: translateX(-50%) scale(0.6);
  }
  20% {
    bottom: 18vh;
    opacity: 1;
    transform: translateX(-50%) scale(1.35);
  }
  70% {
    bottom: 75vh;
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    bottom: 120vh;
    opacity: 0;
    transform: translateX(-50%) scale(0.6);
  }
}

@keyframes rocketWobble {
  0% { transform: rotate(-12deg) scale(1); }
  100% { transform: rotate(-8deg) scale(1.06); }
}

@keyframes flameFlicker {
  0% { transform: scaleY(1); opacity: 0.85; }
  100% { transform: scaleY(1.45); opacity: 1; }
}

@keyframes sparkFall {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(45px) scale(0.2); opacity: 0; }
}

/* Guest name lookup and wedding seating chart */
.guest-seat-preview {
  min-height: 22px;
  margin-top: 9px;
  color: rgba(255, 232, 153, 0.72);
  font-size: 0.82rem;
  line-height: 1.55;
}

.guest-seat-preview.is-matched { color: #baf0d2; font-weight: 800; }
.guest-seat-preview.is-unmatched, .guest-seat-preview.is-error { color: #ffc0c0; }
.guest-seat-preview.is-loading { color: #ffe899; }
.guest-entry-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(244, 196, 101, 0.72);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 232, 153, 0.055);
  color: rgba(255, 232, 153, 0.72);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: left;
}

#pane-seating { width: 100%; }
#pane-seating .section-header { margin-bottom: 20px; }

.seating-personal-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: min(100%, 740px);
  min-height: 112px;
  margin: 0 auto 22px;
  padding: 20px 24px;
  border: 1px solid rgba(244, 196, 101, 0.36);
  border-radius: 22px;
  color: #fff;
  background: radial-gradient(ellipse at 50% 0%, rgba(244, 196, 101, 0.16), rgba(28, 7, 23, 0.92) 72%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  text-align: center;
}

.seating-result-eyebrow { color: #ffe899; font-size: 0.9rem; font-weight: 700; }
.seating-personal-result strong { color: #ffe899; font-size: clamp(1.75rem, 5vw, 2.35rem); line-height: 1.2; letter-spacing: 0.04em; }
.seating-personal-result > span:not(.seating-result-eyebrow) { color: rgba(255, 255, 255, 0.78); font-size: 0.9rem; }
.seating-personal-result .seating-result-extras { color: #baf0d2 !important; font-weight: 700; }
.seating-personal-result.is-not-found strong { color: #ffc0c0; font-size: 1.45rem; }

.seating-controls {
  width: min(100%, 980px);
  margin: 0 auto 18px;
  padding: 16px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.seating-controls > label { display: block; margin-bottom: 8px; color: var(--gold-light); font-weight: 800; }
.seating-search-row { display: flex; align-items: center; gap: 10px; }
.seating-search-row input { min-width: 0; flex: 1; }
.seating-search-row .btn-secondary { flex: 0 0 auto; padding: 12px 16px; font-size: 0.88rem; }
.seating-search-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--text-muted); font-size: 0.78rem; }
.seating-no-results, .seating-load-error { width: min(100%, 980px); margin: 12px auto 20px; color: #ffc0c0; text-align: center; }

.seating-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  align-items: start;
  gap: 14px;
  width: 100%;
}

.seating-table-card {
  min-width: 0;
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.085), rgba(25, 5, 20, 0.88));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.seating-table-card.is-main-table { background: linear-gradient(155deg, rgba(244, 196, 101, 0.15), rgba(25, 5, 20, 0.92)); }
.seating-table-card.is-my-table { border-color: var(--gold-main); box-shadow: 0 0 0 2px rgba(244, 196, 101, 0.28), 0 10px 30px rgba(244, 196, 101, 0.13); }
.seating-table-card.is-over-capacity { border-color: rgba(255, 128, 128, 0.72); }
.seating-table-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.seating-table-heading h3 { margin: 0; color: #fff2bd; font-size: 1.08rem; font-weight: 900; }
.seating-table-count { color: rgba(255, 255, 255, 0.78); font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.seating-table-badges { display: flex; flex-wrap: wrap; gap: 5px; min-height: 20px; margin-top: 5px; }
.seating-table-badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 3px 7px; font-size: 0.68rem; line-height: 1.2; font-weight: 800; }
.seating-table-badge.is-vegetarian { color: #c4f2c7; background: rgba(68, 142, 85, 0.22); border: 1px solid rgba(145, 219, 154, 0.33); }
.seating-table-badge.is-child-seat { color: #ffe0a8; background: rgba(178, 124, 46, 0.2); border: 1px solid rgba(255, 204, 121, 0.28); }
.seating-table-badge.is-over-capacity { color: #ffd0d0; background: rgba(176, 57, 57, 0.25); border: 1px solid rgba(255, 147, 147, 0.36); }

.seating-table-ring { display: block; width: min(100%, 188px); margin: 4px auto 2px; overflow: visible; }
.seating-heart { stroke: rgba(255, 255, 255, 0.18); stroke-width: 1.3; }
.seating-heart.is-filled { fill: var(--seat-color); stroke: rgba(255, 255, 255, 0.57); }
.seating-heart.is-empty { fill: rgba(255, 255, 255, 0.035); }
.seating-table-center { fill: rgba(20, 5, 16, 0.94); stroke: rgba(244, 196, 101, 0.35); stroke-width: 1; }
.seating-table-center-title { fill: #ffe899; font-size: 16px; font-weight: 900; }
.seating-table-center-count { fill: rgba(255, 255, 255, 0.78); font-size: 10px; font-weight: 700; }

.seating-table-roster { border-top: 1px solid rgba(255, 255, 255, 0.11); padding-top: 8px; }
.seating-table-roster summary { color: rgba(255, 232, 153, 0.9); font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.seating-table-roster ul { display: grid; grid-template-columns: 1fr; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; text-align: left; }
.seating-roster-item { display: flex; align-items: center; min-width: 0; gap: 6px; color: rgba(255, 255, 255, 0.83); }
.seating-roster-item.is-search-match { color: #fff2bd; font-weight: 900; }
.seating-roster-swatch { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 3px; background: var(--seat-color); }
.seating-roster-name { min-width: 0; overflow-wrap: anywhere; font-size: 0.72rem; }
.seating-roster-seats { flex: 0 0 auto; margin-left: auto; color: rgba(255, 255, 255, 0.62); font-size: 0.68rem; white-space: nowrap; }
.seating-tag { flex: 0 0 auto; padding: 2px 5px; border-radius: 5px; font-size: 0.62rem; line-height: 1.2; font-weight: 800; white-space: nowrap; }
.seating-tag.is-vegetarian { color: #c4f2c7; background: rgba(68, 142, 85, 0.24); }
.seating-tag.is-child-seat { color: #ffe0a8; background: rgba(178, 124, 46, 0.24); }
.seating-footnote { width: min(100%, 980px); margin: 16px auto 6px; color: var(--text-muted); font-size: 0.78rem; line-height: 1.5; text-align: center; }
.seating-legend { margin: 0 auto 14px; color: rgba(255, 255, 255, 0.73); font-size: 0.76rem; line-height: 1.5; text-align: center; }
.seating-legend-heart { display: inline-block; margin-right: 5px; color: #f0a58f; font-size: 1rem; }

@media (max-width: 620px) {
  .seating-personal-result { padding: 17px 12px; }
  .seating-search-row { align-items: stretch; flex-direction: column; }
  .seating-search-row .btn-secondary { width: 100%; justify-content: center; }
  .seating-search-meta { flex-direction: column; gap: 3px; text-align: left; }
  .seating-table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .seating-table-card { padding: 11px 9px 10px; border-radius: 16px; }
  .seating-table-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .seating-table-heading h3 { font-size: 0.95rem; }
  .seating-table-count { font-size: 0.72rem; }
  .seating-table-badge { font-size: 0.6rem; }
  .seating-table-ring { width: min(100%, 155px); }
  .seating-roster-name { font-size: 0.66rem; }
  .seating-roster-seats { font-size: 0.62rem; }
}

@media (max-width: 360px) {
  .seating-table-grid { grid-template-columns: 1fr; }
  .seating-table-card { width: min(100%, 330px); justify-self: center; }
  .seating-table-heading { align-items: baseline; flex-direction: row; }
  .seating-table-ring { width: min(100%, 180px); }
}

/* Cohesive visual system and responsive layout refresh */
:root {
  --bg-dark: #140d14;
  --bg-gradient: radial-gradient(ellipse at 50% 0%, #342333 0%, #1c121c 44%, #100b11 100%);
  --gold-main: #e8c885;
  --gold-light: #f8e8c2;
  --gold-dark: #ad8548;
  --gold-gradient: linear-gradient(135deg, #f7e6bd 0%, #e8c885 56%, #bd9658 100%);
  --gold-glow: 0 6px 20px rgba(205, 165, 98, 0.17);
  --rose-gold: #d99b9b;
  --rose-gradient: linear-gradient(135deg, #e5b6b0, #c98084);
  --rose-glow: 0 6px 18px rgba(217, 155, 155, 0.16);
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(239, 218, 180, 0.17);
  --glass-border-hover: rgba(239, 218, 180, 0.42);
  --glass-shadow: 0 16px 38px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --text-white: #fffaf4;
  --text-gold: #f2dfb9;
  --text-pink: #f5dce0;
  --text-muted: #c7b9c3;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --transition: 180ms ease;
  color-scheme: dark;
}

html {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  background-color: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-white);
  line-height: 1.55;
  text-align: left;
}

input, textarea, select, [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

button, input, textarea, select {
  font: inherit;
}

button, .btn-primary, .btn-secondary, .btn-rose, .icon-btn, .drawer-nav-item {
  touch-action: manipulation;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(248, 232, 194, 0.92);
  outline-offset: 3px;
}

#app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.navbar {
  min-height: 68px;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  gap: 16px;
  background: rgba(20, 13, 20, 0.91);
  border-bottom-color: rgba(239, 218, 180, 0.13);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.brand { min-width: 0; gap: 10px; }
.brand-icon { font-size: 1.45rem; filter: none; }
.brand-text h1 { font-size: 1rem; letter-spacing: 0.16em; }
.menu-toggle-btn { min-height: 44px; padding: 9px 15px !important; color: #241a20 !important; box-shadow: none !important; }

.main-content {
  width: min(100%, 1240px);
  padding: clamp(18px, 3vw, 36px) clamp(16px, 3vw, 32px) 48px;
  gap: 24px;
}

.tab-pane { width: 100%; min-width: 0; }
.section-header { margin-bottom: 22px; }
.section-header h2 { margin-bottom: 8px; font-size: clamp(1.45rem, 2.3vw, 1.9rem); letter-spacing: 0.025em; }
.section-header p { max-width: 720px; margin-inline: auto; color: #d0c2cc; font-size: 0.94rem; }
.glass-card {
  border-color: var(--glass-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.028));
  box-shadow: var(--glass-shadow);
  padding: clamp(18px, 2.4vw, 30px);
}
.glass-card::before { left: 0; width: 100%; opacity: .38; animation: none; }

.btn-primary, .btn-secondary, .btn-rose, .icon-btn, .drawer-close-btn {
  min-height: 44px;
  box-shadow: none;
}
.btn-primary { color: #241a20; }
.btn-primary:hover, .btn-secondary:hover, .btn-rose:hover, .icon-btn:hover { transform: translateY(-1px); }
.btn-primary:active, .btn-secondary:active, .btn-rose:active { transform: scale(.98); }
.btn-secondary { border-color: rgba(239,218,180,.24); background: rgba(255,255,255,.065); }
.btn-rose { background: var(--rose-gradient); box-shadow: none; }

.side-drawer {
  width: min(340px, 88vw);
  max-height: 100vh;
  max-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: rgba(27, 18, 27, 0.98);
  border-left: 1px solid var(--glass-border);
  box-shadow: -18px 0 44px rgba(0,0,0,.34);
}
.drawer-nav-item { min-height: 48px; border-color: rgba(239,218,180,.12); }
.drawer-nav-item.active { border-color: transparent; box-shadow: none; }

/* Calm, legible forms. 16px prevents automatic zoom when focusing fields on iOS. */
input[type="text"], input[type="number"], input[type="password"], input[type="search"],
select, textarea, .form-input, .reg-input {
  width: 100% !important;
  min-width: 0;
  min-height: 48px;
  padding: 12px 15px !important;
  border: 1px solid rgba(239,218,180,.24) !important;
  border-radius: 13px !important;
  background: rgba(16, 11, 17, .48) !important;
  color: var(--text-white) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.16) !important;
  font-size: 16px !important;
  line-height: 1.4;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
textarea, .textarea-input { min-height: 110px; border-radius: 14px !important; resize: vertical; }
input::placeholder, textarea::placeholder, .form-input::placeholder, .reg-input::placeholder {
  color: rgba(226, 212, 222, .66) !important;
  font-size: 0.93rem !important;
  -webkit-text-fill-color: rgba(226, 212, 222, .66) !important;
}
input:focus, select:focus, textarea:focus, .form-input:focus, .reg-input:focus {
  border-color: rgba(248,232,194,.72) !important;
  background: rgba(24, 16, 24, .88) !important;
  box-shadow: 0 0 0 3px rgba(232,200,133,.13) !important;
}
select.form-input { padding-right: 30px !important; }

.step1-registration-page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 8%, #3d2a3a 0%, #211522 50%, #120d13 100%) !important;
}
.registration-card {
  width: min(100%, 420px) !important;
  max-width: 420px !important;
  padding: clamp(22px, 6vw, 34px) clamp(18px, 5vw, 30px) !important;
  border-color: rgba(239,218,180,.32) !important;
  border-radius: 24px !important;
  background: rgba(39, 27, 39, .86) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,.4) !important;
  animation: none !important;
}
.reg-rings { filter: drop-shadow(0 5px 12px rgba(232,200,133,.24)) !important; }
.reg-title { letter-spacing: .16em !important; }
.reg-fields { gap: 10px; }
.reg-submit-btn { min-height: 50px; box-shadow: 0 8px 20px rgba(205,165,98,.18); }

/* Seating directory */
#pane-seating .section-header { margin-bottom: 20px; }
.seating-personal-result {
  border-color: rgba(239,218,180,.24);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(232,200,133,.11), rgba(37,24,37,.82));
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.seating-controls { border-color: var(--glass-border); background: rgba(255,255,255,.035); }
.seating-table-card { border-color: rgba(239,218,180,.15); background: linear-gradient(155deg, rgba(255,255,255,.075), rgba(24,15,24,.78)); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.seating-table-card.is-my-table { box-shadow: 0 0 0 2px rgba(232,200,133,.23), 0 8px 22px rgba(0,0,0,.18); }

/* Game views and host tools */
.quiz-container { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(230px, .85fr); gap: 24px; align-items: start; }
.quiz-main, .quiz-leaderboard, .editor-box { min-width: 0; }
.quiz-main { text-align: left; }
.quiz-main > div:last-child { display: flex; flex-wrap: wrap; gap: 10px !important; justify-content: flex-start !important; }
.quiz-leaderboard { margin: 0; padding: 18px; border: 1px solid var(--glass-border); border-radius: 16px; background: rgba(0,0,0,.12); text-align: left; }
.quiz-leaderboard h4 { margin-bottom: 10px; color: var(--gold-light); }
.quiz-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.question-box { border-radius: 16px; }
.settings-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.editor-box { width: 100%; padding: 20px; border: 1px solid var(--glass-border); border-radius: 18px; background: rgba(255,255,255,.035); text-align: left; }
.editor-box h4 { margin-bottom: 12px; color: var(--gold-light); line-height: 1.4; }
.add-item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 10px 0 14px; }
.add-item-row > button { white-space: nowrap; padding-inline: 15px !important; }
.add-item-row > select.form-input { width: 92px !important; }
.items-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tapper-container { max-width: 780px; margin-inline: auto !important; }
.wheel-wrapper { justify-content: center; gap: clamp(24px, 5vw, 56px); }
.wheel-canvas-container { flex: 0 1 390px; width: min(100%, 390px); aspect-ratio: 1; height: auto; }
.wheel-canvas-container canvas { width: 100%; height: 100%; }
.wheel-controls { width: min(100%, 330px); }
.scratch-card-box { width: min(100%, 380px); }
.blessings-grid { max-height: min(52vh, 480px); overflow-y: auto; }
#red-envelope-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 10px !important; }
.envelope-card { min-width: 0; min-height: 96px; }
#ceremony-podium-box { gap: clamp(8px, 2vw, 20px) !important; }

@media (max-width: 900px) {
  .quiz-container { grid-template-columns: minmax(0, 1.4fr) minmax(200px, .9fr); gap: 16px; }
  .settings-grid { gap: 12px; }
}

@media (max-width: 768px) {
  html, body {
    width: 100% !important;
    min-width: 320px;
    display: block !important;
    align-items: initial !important;
    text-align: left !important;
  }
  #app {
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
  }
  .navbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100% !important;
    padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)) !important;
    gap: 6px 10px;
  }
  .brand-text h1 { font-size: .88rem; letter-spacing: .12em; }
  .brand-icon { font-size: 1.25rem; }
  .menu-toggle-btn { grid-column: 2; grid-row: 2; justify-self: end; padding: 7px 12px !important; font-size: .84rem !important; }
  .main-content {
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
    gap: 20px;
    padding: 18px max(12px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
  }
  .tab-pane {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
  }
  .section-header { width: 100%; margin: 0 0 16px !important; text-align: left !important; }
  .section-header h2 { font-size: 1.4rem; }
  .section-header p { margin: 0; font-size: .9rem; }
  .glass-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 16px 14px !important;
    border-radius: 18px;
    text-align: left !important;
  }
  .registration-card { width: min(100%, 420px) !important; max-width: 420px !important; }
  .quiz-container { display: grid !important; grid-template-columns: minmax(0, 1fr); align-items: stretch !important; gap: 14px !important; }
  .quiz-main { text-align: left !important; }
  .quiz-main > div:last-child { justify-content: stretch !important; }
  .quiz-main > div:last-child > button { flex: 1 1 145px; }
  .quiz-options { grid-template-columns: minmax(0, 1fr) !important; }
  .quiz-leaderboard { width: 100% !important; margin: 0 !important; text-align: left !important; }
  .question-box { text-align: left !important; }
  .settings-grid { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; width: 100% !important; align-items: stretch !important; gap: 12px !important; }
  .editor-box { width: 100% !important; padding: 16px 14px !important; text-align: left !important; }
  .editor-box[style*="grid-column"] { grid-column: auto !important; }
  .add-item-row { grid-template-columns: minmax(0, 1fr) auto; }
  #pane-settings .editor-box > div[style*="max-width: 450px"] { display: grid !important; grid-template-columns: minmax(0, 1fr); max-width: none !important; }
  #pane-settings .editor-box > div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #pane-settings .editor-box > div[style*="justify-content: space-between"] { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #pane-settings .editor-box > div[style*="justify-content: space-between"] > div { display: flex; align-items: center; gap: 10px; }
  #pane-settings .editor-box > div[style*="justify-content: space-between"] select { max-width: 130px; }
  .tapper-container { text-align: left !important; }
  .tapper-container > div:first-child { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; font-size: .78rem !important; }
  .tapper-timer-banner { justify-self: center; }
  .tug-team-badge { padding-inline: 8px !important; font-size: .9rem !important; }
  .tug-team-badge b { font-size: .95rem !important; }
  .tug-full-rope-stage { gap: 3px; }
  .tap-heart-btn { width: 116px !important; height: 116px !important; font-size: 3.2rem !important; }
  .wheel-wrapper, .scratch-container { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 18px !important; }
  .wheel-canvas-container { width: min(82vw, 340px) !important; height: auto !important; aspect-ratio: 1; margin: 0 auto !important; }
  .wheel-controls { width: 100% !important; padding: 0 !important; }
  .scratch-card-box { width: min(100%, 380px) !important; height: 185px; margin-inline: auto !important; }
  #red-envelope-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  .envelope-card { min-height: 82px; padding: 6px; font-size: .77rem; }
  .blessings-grid { grid-template-columns: minmax(0, 1fr) !important; max-height: 360px !important; }
  .bullet-full-wrapper { padding: 0 !important; }
  .bullet-full-send-btn { width: 100% !important; max-width: none !important; min-height: 50px; padding: 12px !important; border-radius: 14px !important; font-size: 1rem !important; letter-spacing: .04em !important; box-shadow: 0 8px 18px rgba(205,165,98,.18) !important; }
  .bullet-full-input-box { padding: 10px 12px !important; border-width: 1px !important; border-radius: 14px !important; box-shadow: none !important; }
  .bullet-full-textarea { min-height: 96px !important; font-size: 16px !important; }
  .seating-controls { padding: 14px; }
  .seating-table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #ceremony-podium-box { align-items: flex-end !important; overflow-x: auto; justify-content: flex-start !important; min-height: 190px !important; margin: 24px -4px 20px !important; padding: 0 4px 4px; }
}

@media (max-width: 380px) {
  .navbar { padding-inline: 10px !important; }
  .brand { gap: 6px; }
  .brand-text h1 { font-size: .76rem; letter-spacing: .08em; }
  .menu-toggle-btn { padding-inline: 9px !important; }
  .main-content { padding-inline: 10px !important; }
  .seating-table-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .seating-table-card { width: min(100%, 360px); justify-self: center; }
  .add-item-row { grid-template-columns: minmax(0, 1fr); }
  .add-item-row > button { width: 100%; }
  .add-item-row > select.form-input { width: 100% !important; }
  #pane-settings .editor-box > div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: minmax(0, 1fr) !important; }
  #pane-settings .editor-box > div[style*="grid-template-columns: 1fr 1fr"] > input:first-child { grid-column: auto !important; }
  #red-envelope-grid { gap: 6px !important; }
  .envelope-card { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Final editorial polish: fewer effects, clearer identity, steadier controls */
#ambient-canvas { opacity: .16; }
.navbar { background: rgba(20, 13, 20, .96); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.brand-text h1 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 800; letter-spacing: .1em; }
.brand-text p { margin-top: 1px; color: rgba(226,212,222,.62); font-size: .58rem; letter-spacing: .19em; }
.brand-icon { animation: none; }
.menu-toggle-btn { border-radius: 12px !important; font-weight: 700 !important; letter-spacing: .02em; }
.drawer-close-btn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; }
.drawer-header { min-height: 48px; }
.drawer-nav-item { border-radius: 12px; background: rgba(255,255,255,.025); }
.drawer-nav-item .item-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid rgba(232,200,133,.13); border-radius: 10px; background: rgba(232,200,133,.06); font-size: 1.08rem; }
.drawer-nav-item.active { color: #f5e7cd; background: rgba(232,200,133,.12); border-color: rgba(232,200,133,.22); box-shadow: inset 3px 0 #e8c885; }
.drawer-nav-item.active .item-icon { border-color: rgba(232,200,133,.28); background: rgba(232,200,133,.12); }
.reg-kicker { display: block; margin: 0 0 8px; color: rgba(248,232,194,.7); font-size: .62rem; font-weight: 700; letter-spacing: .25em; }
.reg-rings { margin-bottom: 8px !important; font-size: 3rem !important; filter: drop-shadow(0 4px 12px rgba(232,200,133,.22)) !important; }
.reg-title { margin-bottom: 8px !important; font-family: var(--font-body) !important; font-size: clamp(1.7rem, 7vw, 2.1rem) !important; font-weight: 800 !important; letter-spacing: .08em !important; text-transform: none !important; }
.reg-subtitle { color: #d3c3cf !important; font-size: .92rem !important; }
.reg-divider { margin: 20px 0 !important; background: linear-gradient(90deg, transparent, rgba(232,200,133,.27), transparent) !important; }
.reg-fields label { color: #e8d8b8 !important; font-size: .84rem !important; }
.registration-card { border-color: rgba(239,218,180,.24) !important; background: linear-gradient(145deg, rgba(49,35,49,.96), rgba(32,22,32,.96)) !important; }
.section-header { margin-bottom: 24px; }
.section-header h2 { display: table; margin: 0 auto 8px; padding-bottom: 10px; border-bottom: 1px solid rgba(232,200,133,.2); font-family: var(--font-body); font-weight: 800; letter-spacing: .045em; }
.section-header p { color: #d0c3cd; }
.glass-card { border-color: rgba(239,218,180,.13); background: rgba(255,255,255,.038); box-shadow: 0 14px 34px rgba(0,0,0,.19); }
.glass-card::before { display: none; }
.editor-box { border-color: rgba(239,218,180,.12); background: rgba(255,255,255,.025); }
.btn-primary, .btn-secondary, .btn-rose, .icon-btn { border-radius: 12px !important; box-shadow: none !important; font-weight: 700; letter-spacing: 0; }
.btn-primary { border: 1px solid rgba(248,232,194,.36) !important; background: linear-gradient(135deg, #ead7ae, #d9bd84) !important; color: #251b20 !important; }
.btn-secondary { border-color: rgba(239,218,180,.2); background: rgba(255,255,255,.045); }
.btn-rose { border: 1px solid rgba(239,192,187,.2) !important; background: linear-gradient(135deg, #d9a3a1, #bd8187) !important; color: #27171c !important; }
.btn-primary:hover, .btn-secondary:hover, .btn-rose:hover, .icon-btn:hover { box-shadow: 0 5px 16px rgba(0,0,0,.14) !important; }
.bullet-full-input-box { border: 1px solid rgba(239,218,180,.2) !important; border-radius: 15px !important; background: rgba(16,11,17,.42) !important; box-shadow: none !important; }
.bullet-full-input-box:focus-within { border-color: rgba(248,232,194,.62) !important; background: rgba(24,16,24,.8) !important; box-shadow: 0 0 0 3px rgba(232,200,133,.1) !important; }
.bullet-full-send-btn { min-height: 50px; border: 1px solid rgba(248,232,194,.36) !important; border-radius: 12px !important; background: linear-gradient(135deg, #ead7ae, #d9bd84) !important; color: #251b20 !important; box-shadow: none !important; font-size: 1rem !important; font-weight: 750 !important; letter-spacing: .025em !important; }
.seating-table-card { border-color: rgba(239,218,180,.12); }
.seating-table-card.is-main-table { background: linear-gradient(155deg, rgba(232,200,133,.1), rgba(25,18,25,.8)); }
.seating-table-heading h3 { font-family: var(--font-body); letter-spacing: .02em; }
.seating-table-roster summary, .editor-box summary { display: flex; align-items: center; min-height: 44px; }
.drawer-open { overflow: hidden; }
.settings-grid .editor-box { padding: 22px; text-align: left !important; }
.settings-grid .editor-box > p { max-width: 62ch; line-height: 1.65; }
.settings-grid .editor-box > div[style*="background: rgba(0,0,0,0.4)"] { border: 1px solid rgba(239,218,180,.18) !important; border-radius: 14px !important; background: rgba(0,0,0,.16) !important; }
.envelope-card { border: 1px solid rgba(248,232,194,.5); border-radius: 14px; background: linear-gradient(145deg, #a54d50, #793641); box-shadow: 0 6px 14px rgba(0,0,0,.16); }
.envelope-card.opened { border-color: rgba(143,190,160,.65); background: linear-gradient(145deg, #2d4738, #1b2c24); }
.tap-heart-btn, #tap-heart-btn { border-color: rgba(248,232,194,.74) !important; background: radial-gradient(circle at 36% 30%, #e9a5ad, #bd657d 66%, #854255) !important; box-shadow: 0 10px 24px rgba(117,46,69,.25) !important; }
.wheel-center-btn { box-shadow: 0 4px 14px rgba(0,0,0,.24); }

@media (max-width: 768px) {
  body { background-attachment: scroll; }
  .section-header { margin-bottom: 16px !important; }
  .section-header h2 { margin: 0 0 7px !important; padding-bottom: 8px; font-size: 1.36rem; }
  .brand-text h1 { font-size: .9rem; letter-spacing: .08em; }
  .brand-text p { font-size: .52rem; letter-spacing: .15em; }
  .reg-title { font-size: clamp(1.7rem, 8vw, 2rem) !important; }
  .drawer-nav-item { min-height: 50px; }
  .settings-grid .editor-box { padding: 16px 14px !important; }
  .bullet-full-send-btn { width: 100% !important; max-width: none !important; }
}

@media (max-width: 380px) {
  .brand-text h1 { font-size: .78rem; }
  .brand-text p { font-size: .47rem; }
  .reg-kicker { letter-spacing: .18em; }
}

/* Seat labels stay readable at a glance; seat count still maps one-to-one to hearts. */
.seating-table-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.seating-table-card { padding: 16px 14px 14px; }
.seating-table-ring { width: min(100%, 290px); margin: 8px auto 6px; overflow: visible; }
.seating-heart { stroke: rgba(255,255,255,.82); stroke-width: 1.3; }
.seating-heart.is-filled { stroke: rgba(54,34,45,.3); }
.seating-heart-label { pointer-events: none; }
.seating-heart-label-name, .seating-heart-label-count { fill: #2b1d26; font-family: var(--font-body); text-anchor: middle; paint-order: stroke; stroke: rgba(255,250,244,.74); stroke-width: 1.15px; stroke-linejoin: round; }
.seating-heart-label-name { font-size: 8.2px; font-weight: 900; }
.seating-heart-label-count { font-size: 8px; font-weight: 800; }
.seating-heart-child-seat { pointer-events: none; }
.seating-child-seat-bg { fill: #fff9ed; stroke: #8b6941; stroke-width: 1.2; }
.seating-child-seat-head { fill: #7b5b3e; }
.seating-child-seat-drawing { fill: none; stroke: #7b5b3e; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.seating-child-seat-icon { display: inline-block; width: 15px; height: 15px; flex: 0 0 15px; vertical-align: -3px; }
.seating-legend-chair { margin: 0 3px 0 6px; }
.seating-table-badge.is-child-seat, .seating-tag.is-child-seat { display: inline-flex; align-items: center; gap: 3px; }
.seating-table-badge.is-child-seat { color: #f4dfba; }
.seating-tag.is-child-seat { color: #f4dfba; }
.seating-table-card.is-my-table .seating-heart-label-name,
.seating-table-card.is-my-table .seating-heart-label-count { fill: #20151e; }

@media (max-width: 620px) {
  .seating-table-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px; }
  .seating-table-card { width: min(100%, 480px); justify-self: center; padding: 14px 12px 12px; }
  .seating-table-heading { align-items: baseline; flex-direction: row; }
  .seating-table-heading h3 { font-size: 1rem; }
  .seating-table-ring { width: min(100%, 320px); }
  .seating-table-badge { font-size: .68rem; }
  .seating-legend { font-size: .75rem; line-height: 1.8; }
}
