/* ===== Variables ===== */
:root {
  --pink: #ff6b9d;
  --pink-light: #ffb3d1;
  --pink-dark: #e84393;
  --purple: #c77dff;
  --purple-dark: #9b59b6;
  --lavender: #f0e6ff;
  --gold: #ffd93d;
  --mint: #7bed9f;
  --white: #fff;
  --text: #4a1942;
  --shadow: 0 8px 32px rgba(232, 67, 147, 0.25);
  --radius: 20px;
  --font: 'Fredoka', sans-serif;
  --font-script: 'Pacifico', cursive;
  --nav-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(135deg, #fff0f6 0%, #f0e6ff 40%, #ffeef8 100%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

body.nav-open {
  overflow: hidden;
}

/* ===== Loader ===== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-cake {
  font-size: 5rem;
  animation: bounce 0.8s ease infinite;
}

.loader-text {
  color: white;
  font-size: 1.3rem;
  margin: 1rem 0;
}

.loader-bar {
  width: 200px;
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 10px;
  animation: loadBar 2s ease forwards;
}

@keyframes loadBar {
  to { width: 100%; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* ===== Confetti Canvas ===== */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
}

/* ===== Floating Deco ===== */
.floating-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-deco::before,
.floating-deco::after {
  content: '✨ 🎀 🌸 ⭐ 🦄 💖';
  position: absolute;
  font-size: 1.5rem;
  white-space: nowrap;
  animation: floatAcross 25s linear infinite;
  opacity: 0.15;
  top: 20%;
}

.floating-deco::after {
  top: 60%;
  animation-duration: 30s;
  animation-direction: reverse;
}

@keyframes floatAcross {
  from { transform: translateX(-100%); }
  to { transform: translateX(100vw); }
}

/* ===== Navigation ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1020;
  min-height: var(--nav-h);
  padding: calc(0.5rem + var(--safe-top)) calc(0.75rem + var(--safe-right)) 0.5rem calc(0.75rem + var(--safe-left));
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 20px rgba(232, 67, 147, 0.15);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: calc(var(--nav-h) - 1rem);
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pink-dark);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-links a:hover {
  background: var(--pink-light);
  color: var(--pink-dark);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1010;
  background: rgba(74, 25, 66, 0.45);
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  background: var(--pink);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.music-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pink);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.music-btn.playing {
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== Buttons ===== */
.btn {
  font-family: var(--font);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(232, 67, 147, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--pink-dark);
  border: 2px solid var(--pink-light);
}

.btn-secondary:hover {
  background: var(--lavender);
}

.btn-small {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 3rem;
  position: relative;
  text-align: center;
}

.hero-stars {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(2px 2px at 20% 30%, var(--gold), transparent),
    radial-gradient(2px 2px at 60% 70%, var(--pink), transparent),
    radial-gradient(1px 1px at 80% 20%, var(--purple), transparent);
  background-size: 200px 200px;
  animation: twinkle 4s ease infinite alternate;
  opacity: 0.5;
}

@keyframes twinkle {
  to { opacity: 0.8; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-badge {
  display: inline-block;
  background: white;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.8s ease;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.title-line {
  display: block;
  animation: fadeInUp 0.8s ease backwards;
}

.title-line:nth-child(2) { animation-delay: 0.15s; }
.title-big { font-size: 1.3em; color: var(--pink-dark); }
.title-name {
  font-family: var(--font-script);
  font-size: 1.4em;
  color: var(--purple);
  animation-delay: 0.3s;
}

.hero-sub {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.85;
  animation: fadeInUp 0.8s ease 0.45s backwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s ease 0.6s backwards;
}

.hero-stats {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.75s backwards;
}

.stat-card {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 100px;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--pink-dark);
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.7;
}

.hero-cake {
  position: absolute;
  bottom: 2rem;
  right: 5%;
  font-size: 6rem;
  animation: bounce 2s ease infinite;
  opacity: 0.9;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Sections ===== */
.section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  scroll-margin-top: calc(var(--nav-h) + var(--safe-top) + 12px);
}

.section-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--pink-dark);
}

.section-desc {
  text-align: center;
  margin-bottom: 2rem;
  opacity: 0.8;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.about-card, .about-facts, .countdown-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.about-avatar {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 1rem;
}

.about-card h3, .about-facts h3, .countdown-card h3 {
  margin-bottom: 1rem;
  color: var(--purple-dark);
}

.fact-list {
  list-style: none;
  margin-bottom: 1rem;
}

.fact-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--pink-light);
}

.countdown {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cd-unit {
  background: linear-gradient(135deg, var(--pink-light), var(--lavender));
  padding: 1rem;
  border-radius: 12px;
  min-width: 70px;
  text-align: center;
}

.cd-unit span {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--pink-dark);
}

.cd-unit small {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ===== Gallery ===== */
.section.gallery {
  overflow: visible;
  position: relative;
  z-index: 2;
}

.section.games {
  position: relative;
  z-index: 1;
  clear: both;
}

.gallery-empty {
  text-align: center;
  margin-bottom: 1rem;
  opacity: 0.8;
  font-size: 0.95rem;
}

.gallery-empty a {
  color: var(--pink-dark);
  font-weight: 600;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.gallery-item {
  aspect-ratio: 4 / 3;
  min-height: 0;
  background: linear-gradient(135deg, var(--pink-light), var(--lavender));
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.25s, z-index 0s;
  box-shadow: var(--shadow);
  font-size: 3rem;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (hover: hover) {
  .gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 36px rgba(232, 67, 147, 0.35);
    z-index: 3;
  }

  .gallery-item--emoji:hover {
    transform: scale(1.05) rotate(2deg);
  }
}

.gallery-item:active {
  transform: scale(0.98);
}

.gallery-item--photo {
  padding: 0;
  font-size: 0;
}

.gallery-item--slot {
  border: 2px dashed var(--pink-light);
  background: linear-gradient(145deg, #fff8fc 0%, var(--lavender) 100%);
  cursor: pointer;
  font-size: 1rem;
}

.gallery-item--slot .gallery-slot-icon {
  font-size: 2rem;
  opacity: 0.45;
  line-height: 1;
}

.gallery-item--slot .gallery-slot-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pink-dark);
  opacity: 0.45;
  margin-top: 0.4rem;
}

@media (hover: hover) {
  .gallery-item--slot:hover {
    border-color: var(--pink);
    background: linear-gradient(145deg, #fff0f6, #f5e8ff);
  }

  .gallery-item--slot:hover .gallery-slot-icon,
  .gallery-item--slot:hover .gallery-slot-text {
    opacity: 0.75;
  }
}

.gallery-item-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery-item-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.75rem 0.5rem 0.5rem;
  background: linear-gradient(transparent, rgba(74, 25, 66, 0.75));
  z-index: 1;
}

.gallery-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-item--emoji span.gallery-emoji-label {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* Lightbox galeri */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
}

.gallery-modal.open {
  display: flex;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 10, 28, 0.85);
}

.gallery-modal-box {
  position: relative;
  z-index: 1;
  width: min(92vw, 720px);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  background: #fff;
}

.gallery-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  touch-action: manipulation;
}

.gallery-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.gallery-modal-body--photo img {
  width: 100%;
  max-height: 65dvh;
  object-fit: contain;
  display: block;
  background: #111;
}

.gallery-modal-caption {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 1rem;
}

.gallery-modal-caption strong {
  color: var(--pink-dark);
  display: block;
  margin-bottom: 0.35rem;
}

.gallery-modal-caption p {
  margin: 0;
  opacity: 0.85;
  line-height: 1.45;
}

.gallery-modal-body--emoji {
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
}

.gallery-modal-emoji {
  font-size: clamp(3rem, 15vw, 5rem);
  line-height: 1;
}

.gallery-modal-emoji-label {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1rem;
  color: var(--pink-dark);
}

body.gallery-modal-open {
  overflow: hidden;
}

/* ===== Games ===== */
.game-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
  position: relative;
  z-index: 1;
}

.game-tab {
  font-family: var(--font);
  padding: 0.5rem 1rem;
  border: 2px solid var(--pink-light);
  background: white;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.game-tab:hover, .game-tab.active {
  background: var(--pink);
  color: white;
  border-color: var(--pink);
}

.game-panel {
  display: none;
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.game-panel.active {
  display: block;
}

.game-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.game-header h3 {
  color: var(--purple-dark);
}

.game-info {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.game-hint {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.5rem;
}

/* Memory Game */
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  perspective: 600px;
  cursor: pointer;
}

.memory-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-front, .memory-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.memory-front {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  font-size: 1.5rem;
}

.memory-back {
  background: white;
  border: 3px solid var(--pink-light);
  transform: rotateY(180deg);
}

.memory-card.matched .memory-back {
  background: var(--mint);
  border-color: var(--mint);
}

/* Catch Game */
.catch-area {
  position: relative;
  height: 350px;
  background: linear-gradient(180deg, #e8f4ff 0%, #fff0f6 100%);
  border-radius: 12px;
  overflow: hidden;
  border: 3px dashed var(--pink-light);
}

.catch-basket {
  position: absolute;
  bottom: 10px;
  font-size: 3rem;
  transform: translateX(-50%);
  transition: left 0.05s linear;
  z-index: 10;
}

.catch-item {
  position: absolute;
  font-size: 2rem;
  top: -40px;
  animation: fall linear forwards;
}

@keyframes fall {
  to { top: 100%; }
}

/* Balloon Game */
.balloon-area {
  position: relative;
  height: 350px;
  background: linear-gradient(180deg, #87ceeb 0%, #ffeef8 100%);
  border-radius: 12px;
  overflow: hidden;
}

.balloon {
  position: absolute;
  font-size: 2.5rem;
  cursor: pointer;
  transition: transform 0.1s;
  animation: floatBalloon 3s ease-in-out infinite;
}

.balloon:hover {
  transform: scale(1.2);
}

.balloon.popped {
  animation: popBalloon 0.3s ease forwards;
}

@keyframes floatBalloon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes popBalloon {
  to { transform: scale(2); opacity: 0; }
}

/* Wheel */
.wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 1.5rem;
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--pink-dark);
  z-index: 10;
}

#wheel-canvas {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.wheel-result {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--purple-dark);
  min-height: 2rem;
}

/* Quiz */
.quiz-box {
  max-width: 500px;
  margin: 0 auto;
}

.quiz-question {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  padding: 1rem;
  background: var(--lavender);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  text-align: left;
  transition: all 0.2s;
  touch-action: manipulation;
  min-height: 44px;
}

.quiz-option:hover {
  border-color: var(--pink);
}

.quiz-option.correct {
  background: #d4edda;
  border-color: var(--mint);
}

.quiz-option.wrong {
  background: #f8d7da;
  border-color: #e74c3c;
}

.hidden { display: none !important; }

/* Scramble */
.scramble-box {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.scramble-hint {
  margin-bottom: 1rem;
  font-style: italic;
  opacity: 0.8;
}

.scramble-letters, .scramble-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  min-height: 50px;
}

.scramble-letter {
  width: 48px;
  height: 48px;
  background: var(--pink);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.2s;
}

.scramble-letter:hover {
  transform: scale(1.1);
}

.scramble-answer .scramble-letter {
  background: var(--purple);
}

.scramble-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Simon */
.simon-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 280px;
  margin: 0 auto 1.5rem;
}

.simon-btn {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--radius);
  background: var(--simon-color);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.simon-btn.active {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--simon-color);
}

.simon-msg {
  text-align: center;
  margin-top: 1rem;
}

/* Treasure */
.treasure-scene {
  position: relative;
  min-height: 300px;
  background: linear-gradient(180deg, #87ceeb 0%, #90ee90 60%, #8b7355 100%);
  border-radius: 12px;
  overflow: hidden;
  padding: 2rem;
}

.treasure-story {
  text-align: center;
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  font-weight: 600;
}

.treasure-star {
  position: absolute;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.3;
  transition: all 0.3s;
  animation: starPulse 2s ease infinite;
}

.treasure-star:hover {
  opacity: 0.8;
  transform: scale(1.3);
}

.treasure-star.found {
  opacity: 1;
  animation: starFound 0.5s ease;
  pointer-events: none;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes starFound {
  0% { transform: scale(1); }
  50% { transform: scale(2); }
  100% { transform: scale(1); }
}

/* Badges */
.badges-section {
  margin-top: 2rem;
}

.badges-section h3 {
  text-align: center;
  margin-bottom: 1rem;
}

.badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.badge {
  background: white;
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  min-width: 100px;
  box-shadow: var(--shadow);
  opacity: 0.4;
  filter: grayscale(1);
  transition: all 0.3s;
}

.badge.unlocked {
  opacity: 1;
  filter: none;
  animation: badgeUnlock 0.5s ease;
}

@keyframes badgeUnlock {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.badge-icon {
  font-size: 2rem;
  display: block;
}

.badge-name {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ===== Wishes ===== */
.wish-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.wish-form input[type="text"],
.wish-form textarea,
#card-input {
  font-family: var(--font);
  padding: 1rem;
  border: 2px solid var(--pink-light);
  border-radius: 12px;
  font-size: 1rem;
  resize: vertical;
}

.wish-form input:focus,
.wish-form textarea:focus,
#card-input:focus {
  outline: none;
  border-color: var(--pink);
}

.wish-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wish-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.25rem;
  border: 2px dashed var(--pink);
  border-radius: 12px;
  background: var(--lavender);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.wish-upload-label:hover {
  background: #e8d5ff;
  border-color: var(--purple);
}

.wish-upload-icon {
  font-size: 2rem;
}

.wish-upload-text {
  font-weight: 600;
  color: var(--pink-dark);
}

.wish-processing {
  text-align: center;
  font-size: 0.9rem;
  color: var(--purple-dark);
  font-weight: 600;
  animation: pulse 1s ease infinite;
}

.wish-image-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}

.wish-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.wish-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.wishes-loading {
  display: none;
}

.wishes-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.wish-card {
  background: white;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--pink);
  animation: fadeInUp 0.4s ease;
  overflow: hidden;
}

.wish-card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--lavender);
}

.wish-card-body {
  padding: 1.25rem;
}

.wish-card .wish-author {
  font-weight: 700;
  color: var(--pink-dark);
  margin-bottom: 0.5rem;
}

.wish-card-date {
  display: block;
  margin-top: 0.5rem;
  opacity: 0.5;
  font-size: 0.8rem;
}

.wishes-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  opacity: 0.7;
}

#wish-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Surprises ===== */
.surprise-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.surprise-box {
  width: 90px;
  height: 90px;
  font-size: 2.5rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--pink-light), white);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.surprise-box:hover {
  transform: scale(1.1) rotate(5deg);
}

.surprise-box.opened {
  animation: openBox 0.5s ease;
}

@keyframes openBox {
  0% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1); }
}

.surprise-message {
  text-align: center;
  font-size: 1.2rem;
  padding: 1.5rem;
  background: white;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  min-height: 80px;
}

.card-maker {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 500px;
  margin: 0 auto 2rem;
}

.card-maker h3 {
  text-align: center;
  margin-bottom: 1rem;
}

.card-preview {
  background: linear-gradient(135deg, #fff0f6, #f0e6ff);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 2px dashed var(--pink);
  text-align: center;
}

.card-to, .card-from {
  font-size: 0.9rem;
  opacity: 0.8;
}

.card-body {
  font-size: 1.2rem;
  margin: 1rem 0;
  font-weight: 600;
  color: var(--pink-dark);
}

#card-input {
  width: 100%;
  margin-bottom: 1rem;
}

.card-maker .btn {
  margin: 0.25rem;
}

/* Secret code (mobile + desktop) */
.secret-code-box {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.secret-code-box h3 {
  color: var(--purple-dark);
  margin-bottom: 0.5rem;
}

.secret-slots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.secret-slot {
  width: 48px;
  height: 48px;
  border: 2px dashed var(--pink-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pink-dark);
  background: var(--lavender);
}

.secret-slot.filled {
  border-style: solid;
  border-color: var(--pink);
  background: white;
}

.secret-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.secret-key {
  font-family: var(--font);
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0.75rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
}

.secret-key:active {
  transform: scale(0.95);
}

.secret-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.secret-input {
  flex: 1;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 0.75rem;
  border: 2px solid var(--pink-light);
  border-radius: 12px;
}

.secret-input:focus {
  outline: none;
  border-color: var(--pink);
}

.hero-cake {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hero-cake.tap-hint {
  animation: bounce 0.4s ease;
}

kbd {
  background: var(--lavender);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
}

/* ===== Secret Overlay ===== */
.secret-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.secret-content {
  background: white;
  padding: 3rem;
  border-radius: var(--radius);
  text-align: center;
  max-width: 400px;
  animation: fadeInUp 0.5s ease;
}

.secret-content h2 {
  color: var(--pink-dark);
  margin-bottom: 1rem;
}

.secret-content p {
  margin-bottom: 1.5rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--pink-dark), var(--purple-dark));
  color: white;
}

.footer-year {
  opacity: 0.7;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  z-index: 6000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Responsive — Tablet & Mobile ===== */
@media (max-width: 768px) {
  .site-header {
    display: block;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-brand {
    flex: 1;
    text-align: center;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.25rem;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: calc(var(--nav-h) + var(--safe-top));
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem calc(1.5rem + var(--safe-bottom));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1015;
    gap: 0.35rem;
    list-style: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 1rem 1.1rem;
    font-size: 1.05rem;
    border-radius: 14px;
    background: var(--lavender);
  }

  .nav-links a:active {
    background: var(--pink-light);
  }

  .nav-overlay.visible {
    display: block;
  }

  .nav-toggle.open {
    background: var(--pink-dark);
  }

  /* Hero */
  .hero {
    flex-direction: column;
    justify-content: center;
    min-height: 100dvh;
    padding: calc(var(--nav-h) + var(--safe-top) + 1.5rem) 1rem 2rem;
  }

  .hero-sub {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }

  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .title-name {
    font-size: 1.2em;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    gap: 0.75rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-stats {
    width: 100%;
    gap: 0.5rem;
  }

  .stat-card {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 0.5rem;
  }

  .stat-num {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .hero-cake {
    position: static;
    transform: none;
    font-size: 3.5rem;
    margin-top: 0.5rem;
    opacity: 1;
  }

  /* Sections */
  .section {
    padding: 3rem 1rem;
    scroll-margin-top: calc(var(--nav-h) + var(--safe-top) + 8px);
  }

  .section-title {
    font-size: 1.65rem;
  }

  .section-desc {
    font-size: 0.9rem;
    padding: 0 0.25rem;
  }

  /* About */
  .about-card,
  .about-facts,
  .countdown-card {
    padding: 1.25rem;
  }

  .countdown {
    gap: 0.4rem;
  }

  .cd-unit {
    min-width: 0;
    flex: 1;
    padding: 0.65rem 0.35rem;
  }

  .cd-unit span {
    font-size: 1.35rem;
  }

  .cd-unit small {
    font-size: 0.65rem;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
  }

  .gallery-item {
    font-size: 2.25rem;
  }

  .gallery-item span {
    font-size: 0.75rem;
  }

  .gallery-modal {
    padding: calc(0.5rem + var(--safe-top)) 0.5rem calc(0.5rem + var(--safe-bottom));
  }

  .gallery-modal-box {
    width: 100%;
    max-height: 92dvh;
  }

  .gallery-modal-close {
    top: calc(0.35rem + var(--safe-top));
    right: calc(0.35rem + var(--safe-right));
  }

  /* Games */
  .section.games {
    margin-top: 0.5rem;
  }

  .game-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.5rem 0 1rem;
    margin: 1rem 0 1.25rem;
    scroll-snap-type: x proximity;
  }

  .game-tabs::-webkit-scrollbar {
    display: none;
  }

  .game-tab {
    flex-shrink: 0;
    scroll-snap-align: start;
    font-size: 0.8rem;
    padding: 0.55rem 0.85rem;
    white-space: nowrap;
  }

  .game-panel {
    padding: 1rem;
    border-radius: 16px;
  }

  .game-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .game-header h3 {
    font-size: 1rem;
    line-height: 1.35;
  }

  .game-info {
    width: 100%;
    font-size: 0.85rem;
    gap: 0.5rem 1rem;
  }

  .memory-board {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    max-width: 100%;
  }

  .memory-front,
  .memory-back {
    font-size: 1.25rem;
    border-radius: 8px;
  }

  .memory-front {
    font-size: 1rem;
  }

  .catch-area,
  .balloon-area {
    height: min(280px, 45dvh);
    touch-action: none;
  }

  .catch-basket {
    font-size: 2.5rem;
  }

  .wheel-container {
    width: min(280px, 85vw);
    height: min(280px, 85vw);
    margin-left: auto;
    margin-right: auto;
  }

  #wheel-spin {
    width: 100%;
    max-width: 320px;
  }

  .simon-board {
    max-width: 100%;
    gap: 0.65rem;
  }

  .scramble-letter {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .treasure-scene {
    min-height: 240px;
    padding: 1rem;
  }

  .treasure-story {
    font-size: 0.85rem;
  }

  .badges-grid {
    gap: 0.65rem;
  }

  .badge {
    min-width: 80px;
    padding: 0.75rem 0.5rem;
  }

  /* Wishes */
  .wish-form {
    max-width: 100%;
  }

  .wishes-wall {
    grid-template-columns: 1fr;
  }

  .wish-card-photo {
    aspect-ratio: 16 / 10;
  }

  /* Surprises */
  .surprise-grid {
    gap: 0.65rem;
  }

  .surprise-box {
    width: calc(33.333% - 0.5rem);
    height: auto;
    aspect-ratio: 1;
    font-size: 2rem;
    min-width: 72px;
  }

  .surprise-message {
    font-size: 1rem;
    padding: 1rem;
  }

  .card-maker {
    padding: 1.25rem;
    margin-left: 0;
    margin-right: 0;
  }

  .card-maker .btn {
    display: block;
    width: 100%;
    margin: 0.35rem 0;
  }

  .card-preview {
    padding: 1.25rem;
  }

  .card-body {
    font-size: 1rem;
  }

  .secret-code-box {
    max-width: 100%;
    padding: 1.25rem;
  }

  .secret-slot {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }

  .secret-key {
    font-size: 1.2rem;
    min-height: 48px;
    padding: 0.6rem;
  }

  .secret-input-row {
    flex-wrap: wrap;
  }

  .secret-input {
    width: 100%;
    min-width: 0;
    letter-spacing: 0.2em;
    font-size: 1rem;
  }

  #secret-reset {
    width: 100%;
  }

  .secret-content {
    margin: 1rem;
    padding: 1.5rem 1.25rem;
    max-width: calc(100% - 2rem);
  }

  /* Footer & toast */
  .footer {
    padding: 1.5rem 1rem calc(1.5rem + var(--safe-bottom));
    font-size: 0.9rem;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + var(--safe-bottom));
    transform: translateY(100px);
    max-width: none;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
  }

  .toast.show {
    transform: translateY(0);
  }

  .loader-cake {
    font-size: 4rem;
  }

  .loader-text {
    font-size: 1.1rem;
  }
}

/* HP kecil (iPhone SE, dll) */
@media (max-width: 380px) {
  .memory-board {
    gap: 0.3rem;
  }

  .memory-front,
  .memory-back {
    font-size: 1rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .nav-brand {
    font-size: 0.85rem;
  }

  .game-tab {
    font-size: 0.75rem;
    padding: 0.5rem 0.7rem;
  }
}

/* Desktop */
@media (min-width: 769px) {
  .site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .nav {
    flex-shrink: 0;
  }

  .nav-toggle {
    display: none !important;
  }

  .nav-brand {
    text-align: left;
  }

  .nav-overlay {
    display: none !important;
  }

  .nav-links {
    display: flex !important;
    position: static;
    flex: 1;
    justify-content: center;
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .nav-links a {
    background: transparent;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}
