/* ═══════════════════════════════════════
   pigucodu.libinfaby.dev - Stylesheet
   Theme: Midnight Rose & Romantic Shadows
   ═══════════════════════════════════════ */

:root {
  --bg-color: #0b0813;
  --bg-color-rgb: 11, 8, 19;
  --card-bg: rgba(22, 17, 36, 0.45);
  --border-color: rgba(200, 120, 138, 0.15);
  --border-focus: rgba(232, 164, 184, 0.4);
  
  --primary: #c8788a;      /* Rose Gold */
  --primary-rgb: 200, 120, 138;
  --primary-hover: #e8a4b8;
  --primary-light: #f5d0e0;
  
  --text-main: #f5f3f7;
  --text-muted: rgba(245, 243, 247, 0.6);
  --text-dark: #0b0813;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, sans-serif;
  --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.25s ease;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ─── Ambient Starfield and Orbs ─── */
#starfield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.grain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3联%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.25;
  mix-blend-mode: plus-lighter;
}
.orb-1 {
  top: -10%;
  right: 10%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.6) 0%, transparent 80%);
  animation: floatOrb 25s infinite alternate ease-in-out;
}
.orb-2 {
  bottom: -15%;
  left: -5%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(106, 68, 122, 0.5) 0%, transparent 80%);
  animation: floatOrb 35s infinite alternate-reverse ease-in-out;
}
.orb-3 {
  top: 40%;
  left: 30%;
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.3) 0%, transparent 80%);
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 8%) scale(1.1); }
}

/* ─── App Shell ─── */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 3;
}

/* ─── Screen Transition System ─── */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  filter: blur(10px);
  transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1),
              transform 1.2s cubic-bezier(0.25, 1, 0.5, 1),
              filter 1s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 1s;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  filter: blur(0);
}

.screen-inner {
  width: 100%;
  max-width: 650px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ─── Buttons & Inputs ─── */
.btn-primary {
  position: relative;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--text-main);
  padding: 0.9rem 2.2rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.05);
}

.btn-primary span {
  z-index: 2;
}

.btn-primary svg {
  transition: transform 0.4s ease;
  z-index: 2;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.btn-primary:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-primary:hover {
  color: var(--text-dark);
  box-shadow: 0 4px 30px rgba(var(--primary-rgb), 0.25);
  border-color: var(--primary-hover);
}

.btn-primary:hover svg {
  transform: translateX(4px);
  stroke: var(--text-dark);
}

.btn-primary.small {
  padding: 0.6rem 1.4rem;
  font-size: 0.85rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--primary);
  padding: 0.7rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  border-radius: 4px;
}

.btn-ghost:hover {
  color: var(--primary-hover);
  border-color: rgba(var(--primary-rgb), 0.25);
  background-color: rgba(var(--primary-rgb), 0.05);
}

/* ─── Screen: Landing ─── */
.landing-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.9;
  margin-bottom: 1rem;
  animation: fadeInDown 1.5s ease;
}

.landing-title {
  font-family: var(--font-serif);
  font-size: 4.8rem;
  font-weight: 300;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 1.8s ease;
}

.landing-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text-muted);
  max-width: 450px;
  margin: 0 auto 3rem auto;
  animation: fadeInUp 2s ease;
}

/* ─── Screen: Secret Code ─── */
.screen-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 300;
  margin-bottom: 0.75rem;
}

.screen-subtitle {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.code-icon {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  opacity: 0.8;
  animation: pulse 3s infinite ease-in-out;
}

.code-form {
  width: 100%;
  max-width: 400px;
}

.input-group {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
  transition: var(--transition-fast);
}

.input-group:focus-within {
  border-color: var(--border-focus);
}

.secret-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
}

.secret-input::placeholder {
  color: rgba(245, 243, 247, 0.25);
  font-style: italic;
}

.btn-submit {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-submit:hover {
  color: var(--primary-hover);
  transform: translateX(3px);
}

.code-feedback {
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.25rem;
  color: var(--primary);
  font-style: italic;
  opacity: 0.9;
}

/* ─── Screen: Questions ─── */
.progress-bar-wrap {
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--primary);
  transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

.progress-text {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 3rem;
}

.question-card {
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 3rem 2.5rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.question-memory-image {
  width: 100%;
  max-height: 220px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2rem;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.question-memory-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.question-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--primary-hover);
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.question-text {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 300;
  line-height: 1.3;
  margin-bottom: 2.5rem;
}

.answer-choices {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.choice-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.choice-btn:hover {
  background: rgba(var(--primary-rgb), 0.07);
  border-color: rgba(var(--primary-rgb), 0.3);
  padding-left: 1.4rem;
}

.choice-btn.correct {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.choice-btn.incorrect {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.answer-text-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.answer-feedback-wrap {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.answer-feedback {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--primary-light);
}

/* ─── Screen: Gallery ─── */
.gallery-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 3rem;
}

.gallery-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 5;
  margin: 0 auto 3rem auto;
}

.gallery-slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.polaroid-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f5f3f7;
  padding: 1rem 1rem 3rem 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: rotate(var(--rot, 0deg)) scale(0.95);
  visibility: hidden;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1),
              transform 1s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0.8s;
  pointer-events: none;
}

.polaroid-card.active {
  opacity: 1;
  visibility: visible;
  transform: rotate(var(--rot, 0deg)) scale(1);
  pointer-events: auto;
  z-index: 5;
}

.polaroid-image {
  flex: 1;
  overflow: hidden;
  background: #000;
  position: relative;
  border-radius: 2px;
}

.polaroid-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid-caption {
  font-family: var(--font-serif);
  color: #3b3543;
  font-style: italic;
  font-size: 1.15rem;
  text-align: center;
  margin-top: 1rem;
  font-weight: 500;
}

.gallery-nav {
  position: absolute;
  bottom: -2.5rem;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.gallery-nav-btn:hover {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

.gallery-dots {
  display: flex;
  gap: 0.4rem;
}

.gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.gallery-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

/* ─── Screen: Proposal ─── */
.proposal-eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2rem;
}

.proposal-message {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 3rem auto;
  min-height: 6rem;
}

.proposal-big-question {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 300;
  color: var(--text-main);
  margin-bottom: 4rem;
  line-height: 1.2;
}

.proposal-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.btn-yes {
  background: var(--primary);
  color: var(--text-dark);
  border: 1px solid var(--primary);
  padding: 1.1rem 3rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.4);
}

.btn-yes:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.6);
}

.btn-maybe {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.1rem 2.2rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-maybe:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
}

.proposal-hearts {
  position: relative;
  height: 50px;
  margin-bottom: 1rem;
}

.floating-heart {
  position: absolute;
  font-size: 1.5rem;
  animation: floatHeart 4s infinite ease-in-out;
}
.floating-heart:nth-child(1) { left: -40px; animation-delay: 0s; }
.floating-heart:nth-child(2) { left: 0px; animation-delay: 1.5s; font-size: 1.8rem; }
.floating-heart:nth-child(3) { left: 40px; animation-delay: 0.8s; }

@keyframes floatHeart {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  20% { opacity: 0.8; }
  80% { opacity: 0.8; }
  100% { transform: translateY(-40px) scale(0.9); opacity: 0; }
}

/* ─── Screen: Celebration ─── */
#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.celebration-emoji {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.celebration-title {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
  color: var(--primary-light);
}

.celebration-date {
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2rem;
}

.celebration-message {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 450px;
  margin: 0 auto 3rem auto;
}

.celebration-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.celebration-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.card-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
}

.card-names {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card-date-display {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Music Toggle ─── */
.music-toggle {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(22, 17, 36, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-fast);
  backdrop-filter: blur(8px);
}

.music-toggle:hover {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
  transform: scale(1.05);
}

/* ─── Animations ─── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* ─── Responsiveness ─── */
@media (max-width: 600px) {
  .screen-inner {
    padding: 1.5rem;
  }
  .landing-title {
    font-size: 3.4rem;
  }
  .landing-subtitle {
    font-size: 1.1rem;
  }
  .question-card {
    padding: 2rem 1.5rem;
  }
  .question-text {
    font-size: 1.7rem;
    margin-bottom: 2rem;
  }
  .proposal-big-question {
    font-size: 2.6rem;
  }
  .celebration-title {
    font-size: 2.4rem;
  }
  .proposal-actions {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
  .btn-yes, .btn-maybe {
    width: 100%;
  }
  .music-toggle {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}
