@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Outfit:wght@300;400;500;600;700&family=Great+Vibes&display=swap');

:root {
  --bg-dark: #0a0008;
  --bg-gradient: linear-gradient(135deg, #1a0011 0%, #0a0008 30%, #1a0015 60%, #0d0008 100%);
  --primary: #ff2d55;
  --primary-glow: rgba(255, 45, 85, 0.4);
  --secondary: #ff6b8a;
  --accent: #ff85a2;
  --gold: #ffd700;
  --text: #fff0f5;
  --text-soft: rgba(255, 240, 245, 0.7);
  --glass-bg: rgba(255, 45, 85, 0.08);
  --glass-border: rgba(255, 107, 138, 0.2);
}

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

/* ===== PASSWORD SCREEN ===== */
#password-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: radial-gradient(ellipse at center, #1a0011 0%, #0a0008 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#password-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pw-content {
  text-align: center;
  padding: 40px 30px;
  max-width: 400px;
  width: 90%;
}

.pw-hearts {
  font-size: 2rem;
  margin-bottom: 20px;
  animation: heartPulse 1.2s ease-in-out infinite;
}

.pw-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--primary);
  line-height: 1.4;
  text-shadow: 0 0 30px var(--primary-glow);
  margin-bottom: 8px;
}

.pw-author {
  font-family: 'Dancing Script', cursive;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 35px;
}

.pw-input {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pw-input::placeholder {
  color: var(--text-soft);
}

.pw-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.pw-btn {
  width: 100%;
  margin-top: 15px;
  padding: 14px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 5px 25px var(--primary-glow);
}

.pw-btn:hover {
  transform: scale(1.03);
}

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

.pw-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

.shake {
  animation: shake 0.4s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== ENTRANCE SCREEN ===== */
#entrance {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(ellipse at center, #1a0011 0%, #0a0008 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 1s ease, visibility 1s ease;
}

#entrance.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entrance-heart {
  width: 120px;
  height: 120px;
  animation: heartPulse 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 30px var(--primary-glow));
}

.entrance-text {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--primary);
  margin-top: 30px;
  text-shadow: 0 0 30px var(--primary-glow);
  animation: fadeInUp 1.5s ease;
}

.entrance-sub {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-top: 15px;
  animation: blink 2s ease-in-out infinite;
}

@keyframes heartPulse {

  0%,
  100% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.3);
  }

  30% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.2);
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== FLOATING HEARTS ===== */
.floating-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.float-heart {
  position: absolute;
  bottom: -80px;
  font-size: 20px;
  opacity: 0;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) scale(0.5);
  }

  10% {
    opacity: 0.8;
  }

  90% {
    opacity: 0.3;
  }

  100% {
    opacity: 0;
    transform: translateY(-110vh) rotate(720deg) scale(1.2);
  }
}

/* ===== MAIN CONTENT ===== */
main {
  position: relative;
  z-index: 2;
  background: var(--bg-gradient);
}

section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  position: relative;
}

/* ===== HERO ===== */
.hero-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.5rem, 8vw, 5rem);
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--gold), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px var(--primary-glow));
  animation: fadeInUp 1s ease 0.5s both;
}

.hero-subtitle {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--accent);
  margin-top: 15px;
  text-align: center;
  animation: fadeInUp 1s ease 1s both;
}

.hero-date {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-top: 25px;
  padding: 10px 25px;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  animation: fadeInUp 1s ease 1.5s both;
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  animation: bounce 2s ease-in-out infinite;
  font-size: 1.5rem;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2rem, 6vw, 3.5rem);
  text-align: center;
  color: var(--primary);
  margin-bottom: 40px;
  text-shadow: 0 0 20px var(--primary-glow);
}

/* ===== COUNTER SECTION ===== */
.counters-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  width: 100%;
  max-width: 800px;
}

.counter-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 30px 25px;
  text-align: center;
  flex: 1 1 340px;
  max-width: 380px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.counter-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(255, 45, 85, 0.15);
}

.counter-label {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 5px;
}

.counter-date-info {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 20px;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.counter-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.counter-number {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.counter-unit {
  font-size: 0.7rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== LOVE LETTER ===== */
.letter-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(15px);
  border-radius: 25px;
  padding: 40px 30px;
  max-width: 600px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.letter-card::before {
  content: '💌';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 4rem;
  opacity: 0.1;
  transform: rotate(15deg);
}

.letter-text {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  line-height: 2;
  color: var(--text);
}

.letter-signature {
  font-family: 'Great Vibes', cursive;
  font-size: 1.8rem;
  color: var(--primary);
  margin-top: 25px;
}

/* ===== GAME SECTION ===== */
.game-container {
  width: 100%;
  max-width: 500px;
  text-align: center;
}

.game-description {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: 25px;
  line-height: 1.6;
}

.game-canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  max-height: 500px;
  background: rgba(255, 45, 85, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  touch-action: none;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 20px;
}

.game-ui {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 8px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.game-ui span {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

.game-score,
.game-lives,
.game-timer {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
}

.game-start-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 14px 40px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 5px 25px var(--primary-glow);
}

.game-start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 35px var(--primary-glow);
}

.game-start-btn:active {
  transform: scale(0.98);
}

.game-message {
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
  color: var(--gold);
  margin-top: 15px;
  min-height: 40px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* ===== MEMORY GAME ===== */
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 70px);
  grid-template-rows: repeat(3, 70px);
  gap: 10px;
  justify-content: center;
  margin: 0 auto 15px;
}

.memory-card {
  width: 70px;
  height: 70px;
  perspective: 600px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.memory-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.5s ease;
  border-radius: 12px;
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.memory-card-front {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.memory-card-back {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.memory-card.matched .memory-card-back {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* ===== BALLOON POP GAME ===== */
.balloon-area {
  width: 100%;
  height: 400px;
  background: rgba(255, 45, 85, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.balloon-heart {
  position: absolute;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-size: 32px;
  line-height: 1;
  padding: 8px;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.balloon-pop {
  animation: popAnim 0.3s ease forwards !important;
  pointer-events: none;
}

@keyframes balloonFloat {
  0% {
    transform: translateY(100%) scale(0.5);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translateY(80%) scale(1);
  }

  90% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(-120%) scale(0.8);
    opacity: 0;
  }
}

@keyframes popAnim {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.8);
    opacity: 0.5;
  }

  100% {
    transform: scale(0);
    opacity: 0;
  }
}

footer {
  text-align: center;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.footer-heart {
  font-size: 2rem;
  animation: heartPulse 1.2s ease-in-out infinite;
  display: inline-block;
}

.footer-text {
  font-family: 'Dancing Script', cursive;
  font-size: 1.2rem;
  color: var(--accent);
  margin-top: 10px;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 8px;
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SPARKLE CURSOR ===== */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 12px;
  animation: sparkleFade 0.8s ease forwards;
}

@keyframes sparkleFade {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  100% {
    opacity: 0;
    transform: scale(0) translateY(-30px);
  }
}

/* ===== MUSIC TOGGLE ===== */
.music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  color: var(--primary);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.music-toggle:hover {
  transform: scale(1.1);
}

.music-toggle.playing {
  animation: musicPulse 1s ease-in-out infinite;
}

@keyframes musicPulse {

  0%,
  100% {
    box-shadow: 0 0 10px var(--primary-glow);
  }

  50% {
    box-shadow: 0 0 25px var(--primary-glow);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  section {
    padding: 40px 15px;
    min-height: auto;
  }

  section:first-of-type {
    min-height: 100vh;
  }

  .counter-card {
    padding: 20px 15px;
    flex: 1 1 100%;
  }

  .counter-grid {
    gap: 5px;
  }

  .counter-number {
    font-size: 1.4rem;
  }

  .letter-card {
    padding: 25px 20px;
  }

  .game-canvas-wrapper {
    aspect-ratio: 3/4;
  }

  .game-container {
    max-width: 100%;
    padding: 0 5px;
  }

  .game-ui {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 8px;
  }

  .game-ui span {
    font-size: 0.85rem;
  }

  .memory-board {
    grid-template-columns: repeat(4, 60px);
    grid-template-rows: repeat(3, 60px);
    gap: 8px;
  }

  .memory-card {
    width: 60px;
    height: 60px;
  }

  .memory-card-front,
  .memory-card-back {
    font-size: 1.5rem;
  }

  .balloon-area {
    height: 350px;
  }

  .balloon-heart {
    font-size: 30px;
    padding: 10px;
  }

  .game-start-btn {
    padding: 12px 30px;
    font-size: 1rem;
  }

  .music-toggle {
    width: 44px;
    height: 44px;
    bottom: 15px;
    right: 15px;
  }
}