/* ==========================================================================
   HEBA'S BIRTHDAY EXPERIENCE - DESIGN SYSTEM & STYLESHEET
   Aesthetics: Dark Midnight Violet, Neon Amber Accents, Minimalist UI, R&B/Synthwave
   ========================================================================== */

/* --- Custom Variables & Tokens --- */
:root {
  --bg-dark-base: #07050f;
  --bg-violet-deep: #0b0817;
  --bg-violet-card: #110d24;
  --bg-violet-hover: #181335;
  --glow-amber: #ffb300;
  --glow-amber-muted: rgba(255, 179, 0, 0.4);
  --glow-amber-dim: rgba(255, 179, 0, 0.12);
  --glow-red: #ff3333;
  --text-primary: #f5f4f9;
  --text-secondary: #9c99b0;
  --text-muted: rgba(255, 255, 255, 0.35);
  --text-active-amber: #ffe082;
  
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Cinzel', serif;
  
  --transition-fluid: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Start Screen */
/* Start Screen */
#start-screen {
  position: fixed;
  inset: 0;
  background: rgba(7, 5, 15, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1.5s ease, backdrop-filter 1.5s ease;
  cursor: pointer;
}
#start-screen.hide {
  opacity: 0;
  backdrop-filter: blur(0px);
  pointer-events: none;
}
.start-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  animation: start-float 4s ease-in-out infinite;
}
.start-icon {
  font-size: 2.5rem;
  color: var(--glow-amber);
  animation: start-pulse 2s infinite alternate ease-in-out;
  text-shadow: 0 0 20px rgba(255,179,0,0.6);
}
.start-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
}

@keyframes start-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes start-pulse {
  0% { opacity: 0.5; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* --- Global Resets & Base Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  /* Hide standard cursor for custom desktop cursor */
  cursor: none;
}

/* Ensure interactive elements also hide standard cursor */
a, button, input, select, textarea, [role="button"] {
  cursor: none;
}

/* --- Custom Interactive Follow Cursor --- */
#custom-cursor {
  width: 36px;
  height: 36px;
  border: 1px solid var(--glow-amber-muted);
  border-radius: 50%;
  position: fixed;
  transform: translate3d(-50%, -50%, 0);
  pointer-events: none;
  z-index: 20000;
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}

#custom-cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--glow-amber);
  border-radius: 50%;
  position: fixed;
  transform: translate3d(-50%, -50%, 0);
  pointer-events: none;
  z-index: 20000;
  box-shadow: 0 0 10px var(--glow-amber-muted);
}

/* Hover effects for cursor on interactive elements */
body.interactive-hover #custom-cursor {
  width: 50px;
  height: 50px;
  border-color: var(--glow-amber);
  background-color: rgba(255, 179, 0, 0.05);
}

body.interactive-hover #custom-cursor-dot {
  transform: translate3d(-50%, -50%, 0) scale(1.5);
}

/* --- App Container & Background --- */
#app-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* --- Screen State Machine --- */
.phase {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96) translateY(10px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.8s;
  pointer-events: none;
}

.phase.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

/* --- Phase 0: Login / Registration Portal --- */
#phase-0 {
  background: radial-gradient(circle at center, #110d29 0%, var(--bg-dark-base) 80%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(17, 13, 36, 0.65);
  border: 1px solid rgba(255, 179, 0, 0.08);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  backdrop-filter: blur(30px);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  z-index: 5;
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-subtitle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--glow-amber);
  margin-bottom: 0.6rem;
  text-shadow: 0 0 8px var(--glow-amber-muted);
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-bottom: 1.8rem;
}

/* Tabs switcher styling */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.6rem 0;
  border-radius: 25px;
  transition: var(--transition-fast);
}

.auth-tab.active {
  background: rgba(255, 179, 0, 0.1);
  color: var(--glow-amber);
  border: 1px solid rgba(255, 179, 0, 0.15);
}

/* Input Fields Floating Labels */
.input-group {
  position: relative;
  margin-bottom: 2rem;
}

.input-group input {
  width: 100%;
  padding: 0.8rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}

.input-group label {
  position: absolute;
  top: 0.8rem;
  left: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.8;
}

/* Expanding highlight bar */
.input-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background: var(--glow-amber);
  box-shadow: 0 1px 6px var(--glow-amber-muted);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Focus and Filled input actions */
.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
  top: -1.2rem;
  font-size: 0.75rem;
  color: var(--glow-amber);
  letter-spacing: 0.05em;
}

.input-group input:focus ~ .input-line {
  width: 100%;
}

.input-group input:focus {
  border-bottom-color: transparent;
}

/* Feedback Status message */
.auth-status-message {
  font-size: 0.8rem;
  min-height: 1.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  transition: var(--transition-fast);
}

.auth-status-message.error {
  color: var(--glow-red);
  text-shadow: 0 0 10px rgba(255, 51, 51, 0.2);
}

.auth-status-message.success {
  color: var(--glow-amber);
  text-shadow: 0 0 10px var(--glow-amber-muted);
}

.auth-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* --- Phase 1: The Gateway --- */
#phase-1 {
  background: radial-gradient(circle at center, #100b26 0%, var(--bg-dark-base) 80%);
}

.radial-glow-layer {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 179, 0, 0.04) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.gateway-content {
  text-align: center;
  z-index: 5;
}

.gateway-date {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.4em;
  color: var(--glow-amber);
  margin-bottom: 1.2rem;
  opacity: 0.85;
  text-shadow: 0 0 10px var(--glow-amber-muted);
}

.gateway-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
  margin-bottom: 3.5rem;
  color: var(--text-primary);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

/* Glowing Minimalist Button */
.glow-button {
  position: relative;
  background: rgba(255, 179, 0, 0.03);
  border: 1px solid rgba(255, 179, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1.1rem 2.8rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-primary);
  border-radius: 50px;
  overflow: hidden;
  transition: var(--transition-fast);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.glow-button span {
  position: relative;
  z-index: 2;
  transition: var(--transition-fast);
}

.glow-button .btn-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0px;
  height: 0px;
  background: radial-gradient(circle, var(--glow-amber) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
  z-index: 1;
}

.glow-button:hover {
  border-color: var(--glow-amber);
  color: #000;
  font-weight: 600;
  box-shadow: 0 0 35px var(--glow-amber-muted);
}

.glow-button:hover span {
  color: var(--bg-dark-base);
}

.glow-button:hover .btn-glow {
  width: 300px;
  height: 300px;
  opacity: 1;
}

.glow-button:active {
  transform: scale(0.97);
}

/* --- Phase 2: Constellation of Wishes --- */
#phase-2 {
  background: linear-gradient(135deg, #090615 0%, var(--bg-dark-base) 100%);
}

.wishes-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 5;
}

/* Serif Headline styling */
.elegant-title {
  font-family: var(--font-serif);
  font-size: 3.8rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 40%, #ffd54f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 4px 15px rgba(255, 179, 0, 0.15));
}

.elegant-title.hidden-state {
  opacity: 0;
  transform: translateY(30px);
}

.elegant-title.visible-state {
  opacity: 1;
  transform: translateY(0);
}

/* Poetic Phrases Box */
.poetic-phrases-container {
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5.5rem;
  width: 80%;
  max-width: 600px;
  text-align: center;
}

.poetic-phrase {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: absolute;
}

.poetic-phrase.visible {
  opacity: 1;
  transform: translateY(0);
}

.poetic-phrase.exit {
  opacity: 0;
  transform: translateY(-15px);
}

/* --- Phase 3: The 3D Digital Envelope --- */
.envelope-countdown {
  position: absolute;
  top: -125px; /* Adjust to fit the taller digits */
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(145deg, rgba(20, 15, 35, 0.7), rgba(10, 6, 21, 0.9));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 179, 0, 0.15);
  border-top: 1px solid rgba(255, 179, 0, 0.35);
  border-radius: 16px;
  padding: 16px 28px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 
              inset 0 1px 15px rgba(255, 179, 0, 0.05),
              0 0 20px rgba(255, 179, 0, 0.1);
  z-index: 110;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  user-select: none;
  min-width: 260px;
}

.envelope-countdown.locked-shake-active {
  animation: env-shake-error 0.5s ease-in-out;
  border-color: rgba(255, 68, 68, 0.8);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 68, 68, 0.4);
}

.env-timer-title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.env-timer-title::before,
.env-timer-title::after {
  content: "";
  display: block;
  width: 25px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 213, 79, 0.6), transparent);
}

.envelope-countdown.locked-shake-active .env-timer-title {
  color: #ff4444;
}

.env-timer-digits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.env-time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.env-time-unit span {
  font-family: var(--font-sans);
  font-size: 1.7rem;
  font-weight: 400;
  color: #ffd54f;
  text-shadow: 0 0 15px rgba(255, 213, 79, 0.6);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.envelope-countdown.locked-shake-active .env-time-unit span {
  color: #ff4444;
  text-shadow: 0 0 15px rgba(255, 68, 68, 0.6);
}

.env-time-unit label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 6px;
  font-weight: 500;
}

.env-time-sep {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 300;
  color: rgba(255, 213, 79, 0.7);
  margin-top: -14px;
  animation: pulse-opacity 1.5s infinite alternate;
}

@keyframes pulse-opacity {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}

/* Shake Animation for Countdown Box (Using -50% base offset) */
@keyframes env-shake-error {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  15% { transform: translateX(-55%) rotate(-2deg); }
  30% { transform: translateX(-45%) rotate(2deg); }
  45% { transform: translateX(-53%) rotate(-1deg); }
  60% { transform: translateX(-47%) rotate(1deg); }
  75% { transform: translateX(-51%) rotate(-0.5deg); }
  90% { transform: translateX(-49%) rotate(0.5deg); }
}

.envelope-wrapper.locked-shake-active {
  animation: wrapper-shake-error 0.5s ease-in-out;
}

/* Shake Animation for Envelope Wrapper */
@keyframes wrapper-shake-error {
  0%, 100% { transform: scale(1) translateX(0) rotate(0deg); }
  15% { transform: scale(1) translateX(-8px) rotate(-1.5deg); }
  30% { transform: scale(1) translateX(8px) rotate(1.5deg); }
  45% { transform: scale(1) translateX(-6px) rotate(-1deg); }
  60% { transform: scale(1) translateX(6px) rotate(1deg); }
  75% { transform: scale(1) translateX(-3px) rotate(-0.5deg); }
  90% { transform: scale(1) translateX(3px) rotate(0.5deg); }
}

.envelope-wrapper {
  position: relative;
  width: 280px;
  height: 185px;
  perspective: 1000px;
  z-index: 100;
  transition: opacity 1s, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.envelope-wrapper.hidden-state {
  opacity: 0;
  transform: scale(0.8) translateY(50px);
  pointer-events: none;
}

.envelope-wrapper.visible-state {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

.envelope-glow {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 130%;
  height: 130%;
  background: radial-gradient(circle, rgba(255, 213, 79, 0.22) 0%, rgba(255, 179, 0, 0.05) 50%, transparent 75%);
  filter: blur(25px);
  opacity: 0.85;
  pointer-events: none;
  animation: pulse-glow 4s infinite ease-in-out;
}

/* The 3D Card */
.envelope-card {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #15102d 0%, #0c081c 100%);
  border: 1px solid rgba(255, 179, 0, 0.2);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 
              inset 0 1px 10px rgba(255, 255, 255, 0.05);
  transform-style: preserve-3d;
  transform: rotateX(5deg);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.6s, 
              border-color 0.6s;
}

.envelope-wrapper:hover .envelope-card {
  transform: rotateX(15deg) rotateY(-8deg) translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 179, 0, 0.15);
  border-color: rgba(255, 213, 79, 0.45);
}

/* Envelope Panels */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 140px solid transparent;
  border-right: 140px solid transparent;
  border-top: 95px solid #1c1537;
  transform-origin: top center;
  z-index: 5;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.envelope-wrapper:not(.locked):hover .envelope-flap {
  transform: rotateX(20deg);
}

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

.envelope-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0d091e;
  border-radius: 8px;
  z-index: 2;
}

.envelope-front {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 140px solid #140f2d;
  border-right: 140px solid #140f2d;
  border-bottom: 95px solid #161033;
  border-radius: 0 0 8px 8px;
  z-index: 4;
}

.envelope-seal {
  position: absolute;
  top: 95px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, #ffe082 0%, #ffb300 50%, #b27a00 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 6;
  box-shadow: 0 0 15px rgba(255, 179, 0, 0.4), 0 5px 12px rgba(0, 0, 0, 0.5);
  transition: var(--transition-fast);
  cursor: pointer;
}

.seal-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  background: var(--glow-amber);
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.7;
  animation: pulse-glow-fast 1.5s infinite alternate;
}

.seal-inner {
  font-size: 1.1rem;
  color: #07050f;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 2;
  font-weight: bold;
}

.envelope-wrapper.open .envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  pointer-events: none;
}

/* Letter inside the envelope */
.envelope-letter {
  position: absolute;
  top: 10px;
  left: 15px;
  width: 250px;
  height: 165px;
  background: linear-gradient(185deg, #1d183d 0%, #15102a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  z-index: 3;
  transform: translateY(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.letter-content {
  text-align: center;
}

.letter-monogram {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: var(--glow-amber);
  display: block;
  margin-bottom: 0.2rem;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px var(--glow-amber-muted);
}

.letter-subtext {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.envelope-wrapper.open .envelope-letter {
  transform: translateY(-90px) translateZ(10px) scale(1.05);
  z-index: 6;
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}

.envelope-label {
  display: block;
  text-align: center;
  margin-top: 2.2rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  transition: var(--transition-fast);
  position: relative;
  width: max-content;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 8px;
  user-select: none;
}

.envelope-label::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 25%;
  right: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 213, 79, 0.4), transparent);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.envelope-wrapper:hover + .envelope-label {
  color: #ffd54f;
  text-shadow: 0 0 12px rgba(255, 213, 79, 0.5);
}

.envelope-wrapper:hover + .envelope-label::after {
  left: 10%;
  right: 10%;
  background: linear-gradient(90deg, transparent, #ffd54f, transparent);
}

/* Expansion transition effect */
.envelope-zoom-out {
  animation: zoom-fade-out 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Phase 4: The Canvas Room Dashboard --- */
#phase-4 {
  background-color: var(--bg-dark-base);
}

.dashboard-grid {
  width: 90%;
  max-width: 1200px;
  height: 85%;
  max-height: 750px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2.5rem;
  z-index: 5;
}

/* Left Column - Studio Music Player */
.player-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.studio-card {
  background: rgba(17, 13, 36, 0.55);
  border: 1px solid rgba(255, 179, 0, 0.08);
  border-radius: 20px;
  padding: 2.2rem;
  backdrop-filter: blur(25px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.album-cover-container {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 12px;
  overflow: visible;
  margin-bottom: 2rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Vinyl Record Disk --- */
.vinyl-disk {
  position: absolute;
  top: 50%;
  right: -8px;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #1a1a1a 0%,
    #111 18%,
    #0d0d0d 19%,
    #1a1a1a 26%,
    #111 27%,
    #0d0d0d 34%,
    #1a1a1a 35%,
    #111 42%,
    #0d0d0d 43%,
    #1a1a1a 50%,
    #111 58%,
    #0d0d0d 59%,
    #111 100%
  );
  transform: translate(0, -50%);
  z-index: 0;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              right 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.7);
}

.album-cover-container.playing .vinyl-disk {
  right: -100px;
  animation: spin-vinyl 3.5s linear infinite;
}

.album-cover-container.pausing .vinyl-disk {
  right: -8px;
  animation: none;
}

@keyframes spin-vinyl {
  from { transform: translate(0, -50%) rotate(0deg); }
  to   { transform: translate(0, -50%) rotate(360deg); }
}

.vinyl-grooves {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 85%;
  height: 85%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.03);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 15px rgba(255,255,255,0.015),
    0 0 0 30px rgba(255,255,255,0.01),
    0 0 0 45px rgba(255,255,255,0.008);
}

.vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1020 0%, #0f0a1a 100%);
  border: 1px solid rgba(255, 179, 0, 0.25);
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.1);
}

.vinyl-label-text {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--glow-amber);
  text-shadow: 0 0 8px var(--glow-amber-muted);
  letter-spacing: 0.05em;
}

.vinyl-center-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #07050f;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.album-cover-container:hover {
  transform: translateY(-8px) scale(1.02);
}

/* The actual album img must sit above the vinyl */
#album-img {
  position: relative;
  z-index: 1;
  border-radius: 12px;
}

.cover-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
  z-index: 2;
  pointer-events: none;
}

#album-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  border-radius: 12px;
  position: relative;
}

.neon-border-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 179, 0, 0.25);
  box-shadow: inset 0 0 15px var(--glow-amber-dim);
  z-index: 3;
  pointer-events: none;
  transition: var(--transition-fast);
}

.album-cover-container:hover .neon-border-glow {
  border-color: var(--glow-amber);
  box-shadow: inset 0 0 25px var(--glow-amber-muted);
}

.track-details {
  text-align: center;
  width: 100%;
  margin-bottom: 1.8rem;
}

.track-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.track-artist {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

/* Progress Slider */
.player-progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.time-stamp {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 32px;
}

.progress-bar-outer {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: height 0.2s ease;
}

.progress-bar-outer:hover {
  height: 7px;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--glow-amber-muted) 0%, var(--glow-amber) 100%);
  border-radius: 10px;
  position: absolute;
  top: 0;
  left: 0;
  box-shadow: 0 0 8px var(--glow-amber-muted);
  pointer-events: none;
}

.progress-bar-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) scale(0);
  width: 12px;
  height: 12px;
  background: var(--text-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-bar-outer:hover .progress-bar-handle {
  transform: translate(-50%, -50%) scale(1);
}

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  width: 100%;
  margin-bottom: 1.8rem;
}

.control-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-icon:hover {
  color: var(--glow-amber);
  transform: scale(1.08);
}

.control-icon:active {
  transform: scale(0.95);
}

.play-pause-btn {
  background: var(--text-primary);
  color: var(--bg-dark-base);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.play-pause-btn:hover {
  background: var(--glow-amber);
  color: #000;
  box-shadow: 0 0 25px var(--glow-amber-muted);
  transform: scale(1.05);
}

.play-pause-btn svg {
  display: block;
}

.play-pause-btn .hidden {
  display: none;
}

/* Volume Slider */
.player-volume {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1.5rem;
  margin-bottom: 1.5rem;
}

.volume-icon {
  color: var(--text-secondary);
}

.vol-slider-wrapper {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  position: relative;
}

#vol-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.vol-slider-fill {
  width: 80%;
  height: 100%;
  background: var(--text-secondary);
  border-radius: 10px;
  pointer-events: none;
}

#vol-slider:hover ~ .vol-slider-fill {
  background: var(--glow-amber);
}

/* Live Sound Visualizer */
.visualizer-container {
  width: 100%;
  height: 52px;
  margin-top: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0.9;
  background: rgba(0,0,0,0.2);
}

#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Reset / Logout Footer */
.player-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.reset-btn {
  background: transparent;
  border: none;
  color: rgba(156, 153, 176, 0.35);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0.3rem 0.8rem;
}

.reset-btn:hover {
  color: var(--glow-amber);
}

/* Right Column - Scrolling Lyrics viewport */
.lyrics-column {
  background: rgba(11, 8, 23, 0.45);
  border: 1px solid rgba(255, 179, 0, 0.04);
  border-radius: 20px;
  padding: 2.2rem;
  backdrop-filter: blur(25px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lyrics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.lyrics-header h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--text-secondary);
}

.lyrics-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--glow-amber);
  background: var(--glow-amber-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lyrics-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 0;
  mask-image: linear-gradient(to bottom, transparent 0%, white 15%, white 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, white 15%, white 85%, transparent 100%);
  scrollbar-width: none;
}

.lyrics-viewport::-webkit-scrollbar {
  display: none;
}

.lyrics-scroll-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  padding: 120px 0 200px 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  scroll-behavior: smooth;
}

/* Poetic styling for individual lyric lines */
.lyric-line {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  line-height: 1.55;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              text-shadow 0.4s,
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: left center;
}

.lyric-line:hover {
  color: rgba(255, 255, 255, 0.7);
  transform: scale(1.02);
}

.lyric-line.active {
  color: var(--glow-amber);
  text-shadow: 0 0 15px var(--glow-amber-muted);
  transform: scale(1.06);
}

.lyric-section-marker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-top: 1.2rem;
  pointer-events: none;
  text-transform: uppercase;
}

/* --- 3D Card Tilt (via JS computed CSS vars --rx, --ry) --- */
.auth-card,
.studio-card,
.envelope-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
}

.tilt-active {
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.01) !important;
}

/* Glare overlay for 3D cards */
.card-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, 0.07) 0%,
    transparent 65%
  );
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s;
}

.tilt-active .card-glare {
  opacity: 1;
}

/* --- Typewriter Cursor --- */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--glow-amber);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.8s step-end infinite;
  box-shadow: 0 0 6px var(--glow-amber-muted);
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- ANIMATION KEYFRAMES --- */
@keyframes pulse-glow {
  0% {
    opacity: 0.4;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
  100% {
    opacity: 0.4;
    transform: scale(0.98);
  }
}

@keyframes pulse-glow-fast {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 5px var(--glow-amber-muted);
  }
  100% {
    transform: scale(1.15);
    box-shadow: 0 0 20px var(--glow-amber);
  }
}

@keyframes zoom-fade-out {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  30% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Smooth fade-in classes */
.fade-in-up {
  animation: fade-in-up-anim 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fade-in-up-anim {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: 90%;
    max-height: none;
    overflow-y: auto;
    gap: 2rem;
    padding: 2rem 0;
  }
  
  .dashboard-grid::-webkit-scrollbar {
    display: none;
  }
  
  .player-column {
    align-items: center;
  }
  
  .studio-card {
    width: 100%;
    max-width: 480px;
  }
  
  .lyrics-column {
    height: 450px;
  }
}

@media (max-width: 600px) {
  .poetic-phrases-container {
    margin-bottom: 3.5rem;
  }
  .envelope-countdown {
    transform: translateX(-50%) scale(0.85);
    top: -110px;
  }
  .envelope-countdown.locked-shake-active {
    animation: env-shake-error-mobile 0.5s ease-in-out;
  }
  @keyframes env-shake-error-mobile {
    0%, 100% { transform: translateX(-50%) scale(0.85) rotate(0deg); }
    15% { transform: translateX(-55%) scale(0.85) rotate(-2deg); }
    30% { transform: translateX(-45%) scale(0.85) rotate(2deg); }
    45% { transform: translateX(-53%) scale(0.85) rotate(-1deg); }
    60% { transform: translateX(-47%) scale(0.85) rotate(1deg); }
    75% { transform: translateX(-51%) scale(0.85) rotate(-0.5deg); }
  }
  /* Disable custom cursor on touch devices */
  body, html {
    cursor: auto;
  }
  #custom-cursor, #custom-cursor-dot {
    display: none;
  }
  
  .auth-card {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }

  .gateway-title {
    font-size: 2rem;
  }
  
  .elegant-title {
    font-size: 2.4rem;
  }
  
  .poetic-phrase {
    font-size: 1.15rem;
  }
  
  .studio-card {
    padding: 1.2rem;
  }
  
  .album-cover-container {
    width: 220px;
    height: 220px;
  }
  
  .vinyl-disk {
    width: 210px;
    height: 210px;
  }

  .album-cover-container.playing .vinyl-disk {
    right: -70px;
  }

  .vinyl-label {
    width: 70px;
    height: 70px;
  }

  .vinyl-label-text {
    font-size: 1.0rem;
  }

  .beat-ring {
    width: 230px;
    height: 230px;
  }

  /* Somatic climax button overlay inside album art */
  .somatic-btn {
    width: 60px;
    height: 60px;
    box-shadow: 0 0 15px rgba(255,179,0,0.15);
  }

  .somatic-btn::before {
    inset: -6px;
  }

  .somatic-btn svg {
    width: 26px;
    height: 26px;
  }

  .somatic-label {
    font-size: 0.65rem;
    margin-top: 1rem;
    letter-spacing: 0.3em;
  }

  /* Controls and details spacing */
  .player-controls {
    gap: 1.4rem;
  }

  .player-volume {
    padding: 0 0.5rem;
  }
  
  .lyric-line {
    font-size: 1.2rem;
  }
}

/* --- Celebration & Fireworks Overlay --- */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  background-color: rgba(7, 5, 15, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), visibility 1s;
  pointer-events: none;
}

.celebration-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

#celebration-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.celebration-content {
  text-align: center;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Gold neon text and expansion reveal */
.celebration-title {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.15em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s, 
              transform 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
  text-shadow: 0 0 45px rgba(255, 179, 0, 0.15);
}

.celebration-overlay.active .celebration-title {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.celebration-title .highlight-name {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 700;
  display: inline-block;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 50%, #ffa000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(255, 179, 0, 0.3));
  letter-spacing: 0.05em;
  animation: gold-pulse 3s infinite alternate ease-in-out;
}

.celebration-subtitle {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  color: var(--text-secondary);
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1) 1s, 
              transform 1.5s cubic-bezier(0.16, 1, 0.3, 1) 1s;
}

.celebration-overlay.active .celebration-subtitle {
  opacity: 0.75;
  transform: translateY(0);
}

@keyframes gold-pulse {
  0% {
    filter: drop-shadow(0 0 8px rgba(255, 179, 0, 0.35));
  }
  100% {
    filter: drop-shadow(0 0 22px rgba(255, 179, 0, 0.65));
  }
}

@media (max-width: 600px) {
  .celebration-title {
    font-size: 2.2rem;
    letter-spacing: 0.1em;
  }
  .celebration-title .highlight-name {
    font-size: 3.2rem;
  }
  .celebration-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
  }
}

/* ==========================================================================
   v3.0.0 - Preloader, Aurora, Paint Trail, Beat Ring, Birthday Counter
   ========================================================================== */

/* Cinematic Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background: #07050f;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.9s cubic-bezier(0.4,0,0.2,1), visibility 0.9s;
}
#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}
.preloader-letters {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.pl-letter, .pl-dot {
  font-family: var(--font-mono);
  font-size: 3.8rem;
  font-weight: 700;
  color: var(--glow-amber);
  opacity: 0;
  transform: translateY(40px) scale(0.8);
  transition: opacity 0.55s cubic-bezier(0.16,1,0.3,1), transform 0.55s cubic-bezier(0.16,1,0.3,1);
  text-shadow: 0 0 15px var(--glow-amber), 0 0 40px rgba(255,179,0,0.35), 0 0 80px rgba(255,179,0,0.12);
  letter-spacing: 0.08em;
}
.pl-dot {
  font-size: 2rem;
  color: rgba(255,179,0,0.35);
  transform: translateY(20px) scale(0.8);
}
.pl-letter.show, .pl-dot.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.pl-letter.scatter {
  opacity: 0 !important;
  transition: opacity 0.45s ease, transform 0.65s cubic-bezier(0.4,0,1,1) !important;
}
.preloader-line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow-amber), transparent);
  box-shadow: 0 0 10px rgba(255,179,0,0.5);
  transition: width 1.3s cubic-bezier(0.16,1,0.3,1);
}
.preloader-line.grow { width: 320px; }
.preloader-subtitle {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease 0.5s, transform 0.7s ease 0.5s;
}
.preloader-subtitle.show {
  opacity: 0.55;
  transform: translateY(0);
}

/* Aurora Background */
#aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora-layer {
  position: absolute;
  width: 200%; height: 200%;
  top: -50%; left: -50%;
  border-radius: 40%;
  mix-blend-mode: screen;
  will-change: transform;
}
.aurora-layer-1 {
  background: radial-gradient(ellipse 70% 40% at 30% 40%, rgba(139,92,246,0.10) 0%, transparent 68%);
  animation: aurora-1 28s ease-in-out infinite alternate;
}
.aurora-layer-2 {
  background: radial-gradient(ellipse 55% 35% at 72% 58%, rgba(255,140,0,0.065) 0%, transparent 65%);
  animation: aurora-2 35s ease-in-out infinite alternate;
}
.aurora-layer-3 {
  background: radial-gradient(ellipse 65% 28% at 48% 78%, rgba(56,182,255,0.055) 0%, transparent 70%);
  animation: aurora-3 22s ease-in-out infinite alternate;
}
@keyframes aurora-1 {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); }
  40%  { transform: translate(6%,4%) rotate(12deg) scale(1.08); }
  100% { transform: translate(-4%,9%) rotate(-7deg) scale(0.96); }
}
@keyframes aurora-2 {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); }
  45%  { transform: translate(-9%,-6%) rotate(-14deg) scale(1.07); }
  100% { transform: translate(5%,3%) rotate(9deg) scale(0.93); }
}
@keyframes aurora-3 {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); }
  55%  { transform: translate(4%,-5%) rotate(18deg) scale(1.11); }
  100% { transform: translate(-7%,2%) rotate(-4deg) scale(0.98); }
}

/* Paint Cursor Trail Canvas */
#cursor-trail-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  width: 100%;
  height: 100%;
}

/* Beat-Sync Ring */
.beat-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 296px; height: 296px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,179,0,0);
  transform: translate(-50%,-50%);
  z-index: 0;
  pointer-events: none;
}
.beat-ring.pulse {
  animation: beat-pulse-ring 0.38s ease-out forwards;
}
@keyframes beat-pulse-ring {
  0%   { transform: translate(-50%,-50%) scale(1.0); border-color: rgba(255,179,0,0.85); box-shadow: 0 0 18px rgba(255,179,0,0.45), 0 0 40px rgba(255,179,0,0.2); }
  55%  { transform: translate(-50%,-50%) scale(1.10); border-color: rgba(255,179,0,0.3); }
  100% { transform: translate(-50%,-50%) scale(1.22); border-color: rgba(255,179,0,0); box-shadow: none; }
}

/* Birthday Countdown Counter */
.birthday-counter {
  width: 100%;
  text-align: center;
  margin-bottom: 1.4rem;
  padding: 0.85rem 1rem 0.9rem;
  background: rgba(255,179,0,0.025);
  border: 1px solid rgba(255,179,0,0.09);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}
.counter-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  color: var(--glow-amber);
  opacity: 0.65;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}
.counter-digits {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0.3rem;
}
.counter-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 46px;
}
.counter-num {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--glow-amber);
  text-shadow: 0 0 14px rgba(255,179,0,0.55);
  line-height: 1;
  letter-spacing: 0.04em;
}
.counter-lbl {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  color: var(--text-secondary);
  opacity: 0.55;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
  text-transform: uppercase;
}
.counter-sep {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: rgba(255,179,0,0.35);
  line-height: 1;
  padding-top: 0.06rem;
  user-select: none;
}
.birthday-counter.is-birthday .counter-label {
  color: #ffe082;
  opacity: 1;
  animation: gold-pulse 2.5s infinite alternate ease-in-out;
}
.birthday-counter.is-birthday .counter-num {
  color: #ffe082;
  text-shadow: 0 0 22px rgba(255,224,130,0.75);
}
.counter-num.tick {
  animation: num-tick 0.2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes num-tick {
  0%   { transform: translateY(-5px); opacity: 0.5; }
  100% { transform: translateY(0);    opacity: 1;   }
}
@media (max-width: 600px) {
  .pl-letter { font-size: 2.4rem; }
  .pl-dot    { font-size: 1.3rem; }
  .preloader-line.grow { width: 200px; }
  .counter-num  { font-size: 1.25rem; }
  .counter-unit { min-width: 34px; }
}

/* ==========================================================================
   v4.0.0 - The Masterpiece (Z-Space, Somatic Heartbeat, Synesthetic Canvas)
   ========================================================================== */

/* Z-Space Transitions */
.phase {
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16,1,0.3,1), filter 1.2s ease;
  will-change: transform, filter, opacity;
}
.phase.z-push-out {
  transform: scale(1.4);
  filter: blur(15px);
  opacity: 0;
  pointer-events: none;
}
.phase.z-push-in {
  transform: scale(0.8);
  filter: blur(10px);
  opacity: 0;
}
.phase.active.z-push-in {
  transform: scale(1);
  filter: blur(0);
  opacity: 1;
}

/* Somatic Press-and-Hold Climax Button Overlay inside Album Art */
#somatic-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(7, 5, 15, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#somatic-container.visible {
  opacity: 1;
  pointer-events: auto;
}
.somatic-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,179,0,0.05);
  border: 1px solid rgba(255,179,0,0.3);
  box-shadow: 0 0 20px rgba(255,179,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}
.somatic-btn::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px dashed rgba(255,179,0,0.5);
  animation: somatic-spin 6s linear infinite;
}
.somatic-btn:active, .somatic-btn.holding {
  transform: scale(0.9);
  background: rgba(255,179,0,0.15);
  box-shadow: 0 0 40px rgba(255,179,0,0.6);
}
.somatic-btn svg {
  width: 36px; height: 36px;
  fill: var(--glow-amber);
  opacity: 0.8;
}
.somatic-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--glow-amber);
  margin-top: 1.5rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  animation: somatic-pulse 2s infinite alternate ease-in-out;
}

@keyframes somatic-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes somatic-pulse {
  0% { opacity: 0.4; text-shadow: none; }
  100% { opacity: 1; text-shadow: 0 0 15px rgba(255,179,0,0.8); }
}

/* Global Heartbeat Overlay */
#heartbeat-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(20,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 90;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#heartbeat-overlay.active {
  opacity: 1;
  animation: heartbeat-thump 1.2s infinite ease-out;
}

@keyframes heartbeat-thump {
  0% { transform: scale(1); opacity: 0.5; }
  15% { transform: scale(1.05); opacity: 0.8; box-shadow: inset 0 0 100px rgba(255,0,0,0.2); }
  30% { transform: scale(1); opacity: 0.5; }
  45% { transform: scale(1.02); opacity: 0.6; box-shadow: inset 0 0 50px rgba(255,0,0,0.1); }
  100% { transform: scale(1); opacity: 0.5; }
}

/* The Sunburst Artwork Reveal */
#sunburst-artwork {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8);
  transition: all 1.5s cubic-bezier(0.16,1,0.3,1);
}
#sunburst-artwork.reveal {
  opacity: 1;
  transform: scale(1);
}
#sunburst-artwork .glowing-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-artwork 3s forwards cubic-bezier(0.4,0,0.2,1);
}
@keyframes draw-artwork {
  to { stroke-dashoffset: 0; }
}

/* ==========================================================================
   v6.0.0 - Cinematic Post-Credits Epilogue
   ========================================================================== */

/* Epilogue Fonts & Colors */
:root {
  --font-serif-epilogue: 'Cormorant Garamond', serif;
}

/* Epilogue Overlay - Pure Cinematic Darkness */
.epilogue-overlay {
  position: fixed;
  inset: 0;
  background-color: #000000;
  z-index: 15000; /* Covers everything, including custom cursor if needed */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 2.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 2.5s;
  pointer-events: none;
}

.epilogue-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Drifting Cosmic Stardust Canvas */
#epilogue-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 6s cubic-bezier(0.25, 1, 0.5, 1);
}

.epilogue-overlay.show-text #epilogue-canvas {
  opacity: 0.75;
}

/* Centered content wrapper */
.epilogue-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.5rem;
  padding: 2.5rem;
  text-align: center;
}

/* The Cinematic Final Statement */
.epilogue-text {
  font-family: var(--font-serif-epilogue);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1.85;
  letter-spacing: 0.16em;
  color: rgba(225, 230, 240, 0); /* Invisible initially */
  text-align: center;
  filter: blur(18px);
  transform: scale(0.97);
  transition: color 4s cubic-bezier(0.25, 1, 0.3, 1),
              filter 4s cubic-bezier(0.25, 1, 0.3, 1),
              transform 4s cubic-bezier(0.25, 1, 0.3, 1);
  word-wrap: break-word;
}

/* Triggered reveal: Fades in, removes blur, gentle expand */
.epilogue-overlay.show-text .epilogue-text {
  color: rgba(230, 235, 248, 0.96);
  filter: blur(0px);
  transform: scale(1);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 
               0 0 45px rgba(255, 255, 255, 0.15);
  animation: epilogue-text-glow 6s ease-in-out infinite alternate 4s;
}

/* Slow heartbeat text glow */
@keyframes epilogue-text-glow {
  0% {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 
                 0 0 40px rgba(255, 255, 255, 0.1);
    color: rgba(225, 230, 245, 0.92);
  }
  100% {
    text-shadow: 0 0 35px rgba(255, 255, 255, 0.55), 
                 0 0 65px rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 1);
  }
}

/* Minimalist Glowing Escape Button */
#epilogue-replay-btn {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.5s;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  padding: 0.9rem 2.2rem;
  border-color: rgba(255, 255, 255, 0.15);
}

#epilogue-replay-btn span {
  color: rgba(255, 255, 255, 0.6);
}

#epilogue-replay-btn:hover {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.25);
}

#epilogue-replay-btn:hover span {
  color: #000000;
}

#epilogue-replay-btn .btn-glow {
  background: radial-gradient(circle, #ffffff 0%, transparent 70%);
}

.epilogue-overlay.show-replay #epilogue-replay-btn {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Epilogue Waiting Hint during Transition Gap */
.epilogue-waiting-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  text-align: center;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), 
              visibility 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}

.epilogue-overlay.active .epilogue-waiting-hint {
  opacity: 1;
  visibility: visible;
}

.epilogue-overlay.show-text .epilogue-waiting-hint {
  opacity: 0 !important;
  visibility: hidden !important;
}

.epilogue-waiting-hint .hint-dot {
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
  animation: hint-star-pulse 2.5s infinite ease-in-out alternate;
}

.epilogue-waiting-hint .hint-text {
  font-family: var(--font-serif-epilogue);
  font-style: italic;
  font-size: 1.25rem;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.42);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
  animation: hint-text-fade 2.5s infinite ease-in-out alternate;
}

@keyframes hint-star-pulse {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0.35; }
  100% { transform: scale(1.15) rotate(180deg); opacity: 0.95; }
}

@keyframes hint-text-fade {
  0% { opacity: 0.3; }
  100% { opacity: 0.85; }
}

/* Z-Space Fade Out of all underlying visual assets */
body.epilogue-active #phase-4,
body.epilogue-active #aurora-bg,
body.epilogue-active #bg-canvas,
body.epilogue-active #cursor-trail-canvas,
body.epilogue-active #somatic-container,
body.epilogue-active #sunburst-artwork {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 2.5s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* Change custom cursor to soft silver-white during epilogue */
body.epilogue-active #custom-cursor {
  border-color: rgba(255, 255, 255, 0.25);
  transition: border-color 0.3s, width 0.3s, height 0.3s;
}
body.epilogue-active #custom-cursor-dot {
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transition: background-color 0.3s, box-shadow 0.3s;
}
body.epilogue-active.interactive-hover #custom-cursor {
  border-color: rgba(255, 255, 255, 0.85);
  background-color: rgba(255, 255, 255, 0.08);
}
body.epilogue-active.interactive-hover #custom-cursor-dot {
  background-color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* Responsive adjustment for epilogue typography */
@media (max-width: 768px) {
  .epilogue-text {
    font-size: 1.6rem;
    line-height: 1.7;
    letter-spacing: 0.12em;
  }
  .epilogue-content {
    gap: 2.5rem;
    padding: 1.5rem;
  }
}

/* --- VERTICAL HEIGHT-BASED RESPONSIVENESS --- */
@media (max-height: 820px) and (min-width: 601px) {
  .studio-card {
    padding: 1.5rem;
  }
  .album-cover-container {
    width: 240px;
    height: 240px;
    margin-bottom: 1.2rem;
  }
  .vinyl-disk {
    width: 230px;
    height: 230px;
  }
  .album-cover-container.playing .vinyl-disk {
    right: -80px;
  }
  .vinyl-label {
    width: 76px;
    height: 76px;
  }
  .vinyl-label-text {
    font-size: 1.1rem;
  }
  .beat-ring {
    width: 255px;
    height: 255px;
  }
  .track-details {
    margin-bottom: 1.2rem;
  }
  .player-progress {
    margin-bottom: 1.0rem;
  }
  .player-controls {
    margin-bottom: 1.2rem;
  }
  .player-volume {
    margin-bottom: 1.0rem;
  }
  .birthday-counter {
    margin-bottom: 1.0rem;
    padding: 0.6rem 0.8rem;
  }
  .visualizer-container {
    height: 40px;
  }
}

@media (max-height: 720px) and (min-width: 601px) {
  .studio-card {
    padding: 1rem 1.2rem;
  }
  .album-cover-container {
    width: 190px;
    height: 190px;
    margin-bottom: 0.8rem;
  }
  .vinyl-disk {
    width: 180px;
    height: 180px;
  }
  .album-cover-container.playing .vinyl-disk {
    right: -60px;
  }
  .vinyl-label {
    width: 60px;
    height: 60px;
  }
  .vinyl-label-text {
    font-size: 0.9rem;
  }
  .beat-ring {
    width: 205px;
    height: 205px;
  }
  .track-details {
    margin-bottom: 0.8rem;
  }
  .track-name {
    font-size: 1.3rem;
  }
  .track-artist {
    font-size: 0.75rem;
  }
  .player-progress {
    margin-bottom: 0.8rem;
  }
  .player-controls {
    margin-bottom: 0.8rem;
    gap: 1.5rem;
  }
  .play-pause-btn {
    width: 48px;
    height: 48px;
  }
  .play-pause-btn svg {
    width: 22px;
    height: 22px;
  }
  .control-icon svg {
    width: 20px;
    height: 20px;
  }
  .player-volume {
    margin-bottom: 0.8rem;
  }
  .birthday-counter {
    margin-bottom: 0.8rem;
    padding: 0.5rem 0.6rem;
  }
  .counter-num {
    font-size: 1.35rem;
  }
  .counter-lbl {
    font-size: 0.5rem;
    margin-top: 0.15rem;
  }
  .visualizer-container {
    height: 30px;
  }
}
