/* =========================================================
   CHIARA 18 - LUXURY BIRTHDAY SHOWCASE & RESPONSIVE DESIGN
   (Optimized for iPhone, iPad, Safari Mobile & Desktop)
   ========================================================= */

:root {
  --bg-dark: #07070a;
  --bg-surface: #0e0e14;
  --bg-card: rgba(19, 19, 28, 0.82);
  --bg-card-hover: rgba(28, 28, 42, 0.92);
  --glass-border: rgba(224, 169, 109, 0.2);
  --glass-border-active: rgba(224, 169, 109, 0.7);
  
  --gold-light: #fce5c8;
  --gold-primary: #e0a96d;
  --gold-dark: #b87b41;
  --rose-gold: #e8988a;
  --purple-accent: #a855f7;
  --purple-glow: rgba(168, 85, 247, 0.35);
  
  --gold-gradient: linear-gradient(135deg, #fce5c8 0%, #e0a96d 50%, #b87b41 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(247, 223, 184, 0.15) 0%, rgba(224, 169, 109, 0.06) 100%);
  --gold-glow: 0 0 35px rgba(224, 169, 109, 0.25);
  --gold-glow-strong: 0 0 60px rgba(224, 169, 109, 0.45);
  
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --font-display: 'Cinzel', serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-handwriting: 'Caveat', cursive;
  --font-script: 'Alex Brush', cursive;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  position: relative;
  background: radial-gradient(circle at 50% -10%, #22162b 0%, #07070a 55%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #272733;
  border-radius: 4px;
}

/* Canvas particelle di sfondo */
#sparkle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* Ambient glow */
.ambient-glow {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(700px, 90vw);
  height: min(450px, 60vh);
  background: radial-gradient(circle, rgba(224, 169, 109, 0.12) 0%, rgba(168, 85, 247, 0.06) 40%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  transition: background 0.8s ease;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right, 20px)) 0 max(20px, env(safe-area-inset-left, 20px));
  position: relative;
  z-index: 1;
}

/* Utilities */
.gold-gradient-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gold-text {
  color: var(--gold-primary);
}

.purple-heart {
  display: inline-block;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.6));
  animation: heartBeat 2s infinite ease-in-out;
}

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

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */
.site-header {
  padding: max(16px, env(safe-area-inset-top, 16px)) 0 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 7, 10, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.crown-icon {
  font-size: 1.35rem;
  filter: drop-shadow(0 0 10px rgba(224, 169, 109, 0.6));
  animation: crownHover 3s ease-in-out infinite alternate;
}

@keyframes crownHover {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-3px) rotate(4deg); }
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #fff;
}

.brand-text span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.25rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 9999px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-light);
  background: rgba(224, 169, 109, 0.12);
}

.celebrate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  min-height: 42px;
  border-radius: 9999px;
  background: var(--gold-gradient-soft);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(224, 169, 109, 0.15);
  transition: all var(--transition-smooth);
}

.celebrate-btn:hover, .celebrate-btn:active {
  transform: translateY(-2px) scale(1.03);
  background: var(--gold-gradient);
  color: #1a1005;
  box-shadow: var(--gold-glow);
}

/* Bottom Navigation Bar for Mobile Phones */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(14, 14, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(224, 169, 109, 0.25);
  padding: 6px 16px max(8px, env(safe-area-inset-bottom, 8px));
  z-index: 50;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.6);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  min-width: 65px;
  transition: all var(--transition-fast);
}

.mobile-nav-btn .m-icon {
  font-size: 1.25rem;
}

.mobile-nav-btn.active, .mobile-nav-btn:active {
  color: var(--gold-light);
  background: rgba(224, 169, 109, 0.15);
}

.m-celebrate-btn {
  background: var(--gold-gradient-soft);
  border: 1px solid rgba(224, 169, 109, 0.4);
  color: var(--gold-light);
}

/* =========================================================
   LETTER SHOWCASE SECTION (HERO & IN PRIMO PIANO)
   ========================================================= */
.letter-showcase-section {
  padding: 35px 0 50px;
  text-align: center;
}

.hero-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: #d8b4fe;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.badge-sparkle {
  color: var(--gold-light);
  font-size: 0.85rem;
}

.main-page-title {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  color: #fff;
}

.main-page-subtitle {
  font-size: clamp(0.98rem, 1.6vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 660px;
  margin: 0 auto 30px;
  font-weight: 400;
}

/* Master Card Layout */
.letter-master-card {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1.5px solid rgba(224, 169, 109, 0.32);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75), 0 0 45px rgba(168, 85, 247, 0.15);
  background: linear-gradient(135deg, rgba(22, 18, 30, 0.9) 0%, rgba(12, 12, 18, 0.96) 100%);
}

.letter-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #e0a96d 0%, #a855f7 50%, #e0a96d 100%);
}

.letter-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 0;
}

/* Visual Left Side */
.letter-visual-side {
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.45);
  border-right: 1px solid rgba(224, 169, 109, 0.15);
}

.letter-frame {
  position: relative;
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(224, 169, 109, 0.2);
  border: 2px solid rgba(224, 169, 109, 0.4);
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.letter-frame:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--gold-light);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), var(--gold-glow-strong);
}

.letter-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.letter-frame:hover .letter-img {
  transform: scale(1.03);
}

.letter-zoom-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 14, 20, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.letter-frame:hover .letter-zoom-badge {
  background: var(--gold-gradient);
  color: #120b02;
  border-color: transparent;
}

.letter-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin-top: 18px;
}

.btn-letter-zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(224, 169, 109, 0.3);
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.btn-letter-zoom:hover, .btn-letter-zoom:active {
  background: rgba(224, 169, 109, 0.15);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.btn-goto-videos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--gold-gradient);
  color: #120b02;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(224, 169, 109, 0.25);
  transition: all var(--transition-smooth);
}

.btn-goto-videos:hover, .btn-goto-videos:active {
  transform: translateY(-2px);
  box-shadow: var(--gold-glow);
}

/* Text Right Side */
.letter-text-side {
  padding: 40px 42px 35px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.letter-header-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold-primary);
  margin-bottom: 14px;
}

.heart-icon {
  font-size: 0.85rem;
}

.letter-salutation {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 18px;
}

.letter-content-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.letter-p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: #e4e4e7;
  letter-spacing: 0.1px;
}

.letter-p strong {
  color: var(--gold-light);
  font-weight: 700;
}

.letter-p em {
  color: #fce5c8;
  font-style: italic;
}

.letter-highlight-box {
  background: linear-gradient(135deg, rgba(224, 169, 109, 0.08) 0%, rgba(168, 85, 247, 0.06) 100%);
  border-left: 3.5px solid var(--gold-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 4px 0;
}

.highlight-p {
  font-size: 1.03rem;
  line-height: 1.75;
  color: #f5f5f7;
}

.letter-closing-p {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-top: 8px;
}

.letter-signature-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(224, 169, 109, 0.2);
  display: flex;
  flex-direction: column;
}

.sig-pre {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--text-secondary);
}

.sig-name {
  font-family: var(--font-handwriting);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.2;
  margin-top: -4px;
}

/* Scroll To Videos Banner */
.scroll-to-videos-banner {
  margin-top: 35px;
  display: flex;
  justify-content: center;
}

.jump-video-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  background: rgba(19, 19, 28, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--gold-primary);
  border-radius: 9999px;
  color: var(--gold-light);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(224, 169, 109, 0.15);
  transition: all var(--transition-smooth);
}

.jump-video-pill:hover, .jump-video-pill:active {
  transform: translateY(-3px) scale(1.03);
  background: var(--gold-gradient);
  color: #120b02;
  box-shadow: var(--gold-glow);
}

.pill-arrow {
  font-size: 1.2rem;
  animation: bounceDown 1.8s infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* =========================================================
   CINEMA PLAYER SECTION
   ========================================================= */
.cinema-section {
  padding: 50px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section-badge-center {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(224, 169, 109, 0.08);
  border: 1px solid rgba(224, 169, 109, 0.25);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.2px;
  color: var(--gold-primary);
  margin: 0 auto 14px;
  text-transform: uppercase;
}

.cinema-section .container {
  text-align: center;
}

.section-heading-cinema {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.section-sub-cinema {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 30px;
}

.player-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 25px;
  border-radius: var(--radius-xl);
}

.player-backlight {
  position: absolute;
  top: 5%;
  left: 5%;
  right: 5%;
  bottom: 5%;
  background: radial-gradient(circle, rgba(224, 169, 109, 0.3) 0%, rgba(232, 152, 138, 0.15) 50%, transparent 80%);
  filter: blur(45px);
  z-index: 0;
  opacity: 0.6;
  transition: all 0.6s ease;
  pointer-events: none;
}

.player-wrapper.playing .player-backlight {
  opacity: 0.85;
  filter: blur(60px);
}

.player-screen {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(224, 169, 109, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(224, 169, 109, 0.15);
}

#mainVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  cursor: pointer;
}

/* Big Play Overlay */
.big-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(68px, 12vw, 84px);
  height: clamp(68px, 12vw, 84px);
  background: rgba(14, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--gold-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  cursor: pointer;
  box-shadow: 0 0 35px rgba(224, 169, 109, 0.4);
  transition: all var(--transition-bounce);
  z-index: 10;
}

.big-play-overlay:hover, .big-play-overlay:active {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--gold-gradient);
  color: #120b02;
  box-shadow: var(--gold-glow-strong);
}

.big-play-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.7);
}

.play-triangle {
  width: clamp(26px, 5vw, 32px);
  height: clamp(26px, 5vw, 32px);
  margin-left: 4px;
}

/* Toast Notifications */
.toast-notification {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(14, 14, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-width: 80%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

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

/* Custom Controls Bar */
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(7, 7, 10, 0.96) 0%, rgba(7, 7, 10, 0.65) 75%, transparent 100%);
  padding: 16px 18px 12px;
  z-index: 12;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.player-wrapper.idle .custom-controls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* Progress Bar */
.progress-bar-container {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: height 0.15s ease;
  touch-action: none;
}

.progress-bar-container:hover, .progress-bar-container:active {
  height: 10px;
}

.progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  width: 0%;
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 3px;
  width: 0%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.progress-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold-dark);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  transform: scale(0.9);
  transition: transform 0.15s ease;
  margin-right: -7px;
}

.progress-bar-container:hover .progress-thumb,
.progress-bar-container:active .progress-thumb {
  transform: scale(1.2);
}

/* Controls Bottom Row */
.controls-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ctrl-btn:hover, .ctrl-btn:active {
  color: var(--gold-primary);
  background: rgba(255, 255, 255, 0.12);
}

.ctrl-btn svg {
  width: 22px;
  height: 22px;
}

.ctrl-btn.hidden, .hidden {
  display: none !important;
}

/* Volume */
.volume-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 65px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold-primary);
  cursor: pointer;
}

.time-display {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
  white-space: nowrap;
}

.time-display span:first-child {
  color: #fff;
  font-weight: 600;
}

/* Badge traccia corrente */
.current-track-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(224, 169, 109, 0.25);
  border-radius: 9999px;
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 500;
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Speed selector */
.speed-selector {
  position: relative;
}

.speed-btn {
  font-size: 0.82rem;
  font-weight: 700;
  width: 42px;
  border-radius: 8px;
}

.speed-menu {
  position: absolute;
  bottom: 45px;
  right: 0;
  background: rgba(19, 19, 28, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 75px;
  z-index: 25;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.speed-option {
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.speed-option:hover, .speed-option.active {
  background: rgba(224, 169, 109, 0.2);
  color: var(--gold-light);
  font-weight: 700;
}

/* Active Video Details Bar */
.active-video-details {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
}

.chapter-tag {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold-primary);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.active-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: #fff;
  margin-bottom: 6px;
}

.active-description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 580px;
  line-height: 1.5;
}

.details-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.replay-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.replay-btn:hover, .replay-btn:active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.next-btn {
  background: var(--gold-gradient);
  border: none;
  color: #120b02;
  box-shadow: 0 4px 15px rgba(224, 169, 109, 0.25);
}

.next-btn:hover, .next-btn:active {
  transform: translateY(-2px);
  box-shadow: var(--gold-glow);
}

/* =========================================================
   VIDEO SELECTOR GRID
   ========================================================= */
.video-selector-section {
  padding: 40px 0 70px;
}

.section-header {
  text-align: center;
  margin-bottom: 35px;
}

.section-sub {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.section-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.video-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.video-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-5px);
  border-color: rgba(224, 169, 109, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(224, 169, 109, 0.18);
}

.video-card.active {
  border-color: var(--gold-primary);
  background: rgba(30, 26, 38, 0.88);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), var(--gold-glow);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #09090f;
  overflow: hidden;
}

.card-video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  filter: brightness(0.9);
}

.video-card:hover .card-video-preview {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.video-card:hover .card-overlay {
  background: rgba(0, 0, 0, 0.15);
}

.play-chip {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(14, 14, 20, 0.85);
  border: 1.5px solid var(--gold-primary);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  transition: all var(--transition-bounce);
}

.video-card:hover .play-chip, .video-card:active .play-chip {
  transform: scale(1.12);
  background: var(--gold-gradient);
  color: #120b02;
  box-shadow: var(--gold-glow);
}

.card-number-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.card-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(224, 169, 109, 0.3);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  transition: all 0.3s ease;
}

.video-card.active .card-status-badge {
  background: var(--gold-gradient);
  color: #120b02;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(224, 169, 109, 0.5);
}

.card-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-chapter {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-primary);
}

.shortcut-tag {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.35;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
  flex-grow: 1;
}

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

.watch-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  transition: transform var(--transition-fast);
}

.video-card:hover .watch-text {
  transform: translateX(4px);
  color: var(--gold-primary);
}

/* =========================================================
   LIGHTBOX MODALE PER LA LETTERA
   ========================================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 4, 7, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: max(16px, env(safe-area-inset-top, 16px)) max(16px, env(safe-area-inset-right, 16px)) max(16px, env(safe-area-inset-bottom, 16px)) max(16px, env(safe-area-inset-left, 16px));
}

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

.modal-wrapper {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.open .modal-wrapper {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(22, 18, 30, 0.96);
  border: 1.5px solid var(--gold-primary);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
  z-index: 10;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover, .modal-close-btn:active {
  transform: scale(1.1) rotate(90deg);
  background: var(--gold-gradient);
  color: #120b02;
}

.modal-content {
  overflow: auto;
  max-height: 84vh;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95), 0 0 50px rgba(168, 85, 247, 0.3);
  border: 2px solid rgba(224, 169, 109, 0.5);
  -webkit-overflow-scrolling: touch;
}

.modal-letter-img {
  max-height: 82vh;
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: var(--radius-md);
}

.modal-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* =========================================================
   DEDICATION & WISHES SECTION
   ========================================================= */
.dedication-section {
  padding: 10px 0 70px;
}

.dedication-card {
  max-width: 840px;
  margin: 0 auto;
  padding: 40px 30px;
  text-align: center;
  background: linear-gradient(135deg, rgba(30, 24, 40, 0.85) 0%, rgba(15, 15, 22, 0.9) 100%);
  border: 1px solid rgba(224, 169, 109, 0.3);
}

.dedication-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.dedication-header h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-light);
}

.reactions-box {
  padding-top: 8px;
}

.reactions-label {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.reaction-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.reaction-btn {
  min-height: 44px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.reaction-btn:hover, .reaction-btn:active {
  background: var(--gold-gradient-soft);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  transform: translateY(-2px) scale(1.04);
}

/* Floating reaction animation */
.floating-emoji {
  position: fixed;
  bottom: 60px;
  font-size: 2.2rem;
  pointer-events: none;
  z-index: 1000;
  animation: floatUpAndFade 2.4s forwards ease-out;
}

@keyframes floatUpAndFade {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 0.9;
    transform: translateY(-140px) scale(1.3) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-280px) scale(1) rotate(-15deg);
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  padding: 24px 0 max(30px, env(safe-area-inset-bottom, 30px));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 5, 8, 0.8);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-brand .sub-text {
  color: var(--text-secondary);
}

/* =========================================================
   THEATER MODE
   ========================================================= */
body.theater-mode {
  overflow: hidden;
}

body.theater-mode .site-header,
body.theater-mode .letter-showcase-section,
body.theater-mode .active-video-details,
body.theater-mode .video-selector-section,
body.theater-mode .dedication-section,
body.theater-mode .site-footer {
  opacity: 0.08;
  filter: blur(4px);
  pointer-events: none;
  transition: all 0.5s ease;
}

body.theater-mode .cinema-section {
  position: relative;
  z-index: 100;
  border-top: none;
}

body.theater-mode .player-wrapper {
  max-width: 1140px;
}

/* =========================================================
   IPAD & TABLET ADAPTATIONS (768px - 1024px)
   ========================================================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .letter-grid {
    grid-template-columns: 380px 1fr;
  }

  .letter-visual-side {
    padding: 24px;
  }

  .letter-text-side {
    padding: 30px 28px;
  }

  .letter-p {
    font-size: 1rem;
    line-height: 1.7;
  }

  .video-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .player-wrapper {
    max-width: 100%;
  }
}

/* =========================================================
   IPHONE & SMARTPHONE ADAPTATIONS (< 768px)
   ========================================================= */
@media (max-width: 768px) {
  body {
    padding-bottom: 75px; /* Spazio per la bottom bar */
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .header-nav .nav-link {
    display: none; /* Rimpiazzato dalla mobile bottom bar */
  }

  .letter-showcase-section {
    padding: 20px 0 35px;
  }

  .main-page-title {
    font-size: 2rem;
  }

  .letter-grid {
    grid-template-columns: 1fr;
  }

  .letter-visual-side {
    border-right: none;
    border-bottom: 1px solid rgba(224, 169, 109, 0.2);
    padding: 20px 16px;
  }

  .letter-frame {
    max-width: 320px;
  }

  .letter-actions-bar {
    max-width: 320px;
  }

  .letter-text-side {
    padding: 24px 18px;
  }

  .letter-salutation {
    font-size: 1.7rem;
    margin-bottom: 14px;
  }

  .letter-p {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .highlight-p {
    font-size: 0.96rem;
    line-height: 1.65;
  }

  .sig-name {
    font-size: 2.3rem;
  }

  .desktop-only-btn {
    display: none !important;
  }

  .current-track-badge {
    display: none;
  }

  .volume-slider {
    width: 45px;
  }

  .active-video-details {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    gap: 16px;
  }

  .active-title {
    font-size: 1.25rem;
  }

  .details-actions {
    width: 100%;
    justify-content: space-between;
  }

  .action-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .video-cards-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .dedication-card {
    padding: 25px 18px;
  }

  .reaction-btn {
    flex: 1 1 calc(33.33% - 8px);
    min-width: 90px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .modal-close-btn {
    top: -10px;
    right: -10px;
    width: 38px;
    height: 38px;
  }

  .modal-letter-img {
    max-height: 75vh;
  }
}

/* =========================================================
   SMALL IPHONE (iPhone SE, 5, 12/13 Mini <= 380px)
   ========================================================= */
@media (max-width: 380px) {
  .brand-text {
    font-size: 1rem;
    letter-spacing: 1.5px;
  }

  .celebrate-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .main-page-title {
    font-size: 1.75rem;
  }

  .letter-text-side {
    padding: 18px 14px;
  }

  .reaction-btn {
    flex: 1 1 calc(50% - 6px);
  }

  .time-display {
    font-size: 0.72rem;
  }
}
