/* ==============================================
   RETRO RPG WEDDING INVITATION STYLESHEET
   Theme: 8-Bit Pixel RPG Game Boy Aesthetic
   ============================================== */

:root {
  color-scheme: only light; /* Force light mode - ignore user dark mode preference */
  --primary-blue: #227bd9;
  --dark-blue: #0f4c9c;
  --light-blue: #8fd2ff;
  --border-blue: #113f80;
  --sky-top: #52aff7;
  --sky-bot: #a2daf9;
  --pixel-gold: #fbc638;
  --pixel-gold-dark: #b88614;
  --pixel-green: #59b634;
  --pixel-green-dark: #377d1d;
  --pixel-red: #e63946;
  --bg-cream: #fbf5e5;
  --dialog-bg: #eff0f2;
  --dialog-border: #43adfe;
  --text-dialog: #1f3b76;
  --text-light: #ffffff;
  --text-dark: #222222;
  --font-pixel: 'Press Start 2P', monospace;
  --font-pixel-sans: 'Pixelify Sans', sans-serif;
  --font-calligraphy: 'Great Vibes', cursive;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* =============================================
   FORCE LIGHT MODE - ignore device dark mode
   ============================================= */
html {
  color-scheme: only light;
}

@media (prefers-color-scheme: dark) {
  html, body, * {
    color-scheme: only light;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-body);
  background: #111a24;
  color: var(--text-dark);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Pixel rendering utility */
.pixelated, img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ==============================================
   FLOATING AUDIO CONTROLLER
   ============================================== */
.audio-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999;
  background: #fff;
  border: 3px solid var(--border-blue);
  box-shadow: 3px 3px 0 var(--border-blue);
  border-radius: 20px;
  padding: 6px 12px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--dark-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.audio-btn:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--border-blue);
}
.audio-btn:active {
  transform: translateY(2px);
  box-shadow: 1px 1px 0 var(--border-blue);
}
.audio-btn.muted {
  opacity: 0.6;
  background: #f0f0f0;
}

/* ==============================================
   SCREEN SWITCHER
   ============================================== */
.screen {
  display: none !important;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.active {
  display: flex !important;
}

/* ==============================================
   1. COVER SCREEN (FULL ARTWORK)
   ============================================== */
#cover-screen {
  background: #111a24;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 100;
  transform: translateY(0);
  transition: transform 0.85s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

/* Slide Up Exit Animation */
#cover-screen.slide-up {
  transform: translateY(-100%) !important;
  pointer-events: none;
}

.cover-full-frame {
  position: relative;
  height: 100%;
  width: auto;
  max-width: 100vw;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  margin: 0 auto;
}

.cover-bg-image {
  height: 100%;
  width: auto;
  max-width: 100vw;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* ==============================================
   COVER SCREEN TYPOGRAPHY & BUTTON STYLING
   ============================================== */
.cover-content-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* padding-top: 5.5%; */
  padding-top: 20%;
  z-index: 20;
  text-align: center;
  pointer-events: none;
}

/* 1. Dynamic Guest Name Greeting with Typewriter */
.cover-guest-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 15px;
  min-height: 18px;
}
.pixel-dear-text {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #fdf0a6;
  text-shadow: 
    2px 2px 0 #0d4685, 
    -1px -1px 0 #0d4685, 
    1px -1px 0 #0d4685, 
    -1px 1px 0 #0d4685;
  letter-spacing: 1px;
}
.pixel-guest-text {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #ffffff;
  text-shadow: 
    2px 2px 0 #0d4685, 
    -1px -1px 0 #0d4685, 
    1px -1px 0 #0d4685, 
    -1px 1px 0 #0d4685;
  letter-spacing: 1px;
}
.typing-cursor {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #ffd700;
  display: inline-block;
  margin-left: 2px;
  animation: cursorBlink 0.6s infinite;
  text-shadow: 1.5px 1.5px 0 #0d4685;
}
@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Keyframe for Elements Dropping Down from Top */
@keyframes dropFromTop {
  0% {
    opacity: 0;
    transform: translateY(-35px);
  }
  70% {
    opacity: 1;
    transform: translateY(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2. You're Invited Block (Drop #1 - Delay 0.5s) */
.cover-invited-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2px;
  opacity: 0;

}
.title-youre {
  font-family: var(--font-pixel);
  font-size: 21px;
  color: #ffffff;
  text-shadow: 
    2.5px 2.5px 0 #0f4c9c, 
    -2px -2px 0 #0f4c9c, 
    2px -2px 0 #0f4c9c, 
    -2px 2px 0 #0f4c9c, 
    0 4px 0 #08346e;
  letter-spacing: 2px;
  margin-bottom: 10px;

}
.title-invited {
  /* font-family: var(--font-calligraphy); */
  font-family: var(--font-pixel);
  font-size: 21px;
  color: #ffffff;
  text-shadow: 
    2px 2px 0 #0f4c9c, 
    -2px -2px 0 #0f4c9c, 
    2px -2px 0 #0f4c9c, 
    -2px 2px 0 #0f4c9c, 
    0 4px 6px rgba(0,0,0,0.25);
  /* transform: rotate(-3deg); */
  font-style: italic;
}

/* 3. To The Wedding Of */
.title-to-the-wedding {
  font-family: var(--font-pixel);
  font-size: 9.5px;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #0f4c9c, -1px -1px 0 #0f4c9c;
  letter-spacing: 1.5px;
}

/* 4. Azkal & Amanda with Sparkles (Drop #2 - Delay 1.0s, +0.5s after #1) */
.title-couple-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  opacity: 0;
}
.couple-name-text {
  font-family: var(--font-pixel);
  font-size: 28px;
  color: #ffffff;
  font-weight: 700;
  text-shadow: 
    2.5px 2.5px 0 #0f4c9c, 
    -2px -2px 0 #0f4c9c, 
    2px -2px 0 #0f4c9c, 
    -2px 2px 0 #0f4c9c, 
    0 4px 8px rgba(0,0,0,0.3);
  line-height: 1.1;
  margin: 0;
}
@media (max-width: 500px) {
  .couple-name-text {
    font-size: 20px;
  }
}
.couple-sparkle {
  font-size: 14px;
  color: #ffd700;
  text-shadow: 1px 1px 0 #0f4c9c;
  animation: sparklePulse 1.8s infinite alternate;
}
@keyframes sparklePulse {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0.8; }
  100% { transform: scale(1.3) rotate(45deg); opacity: 1; }
}

/* 5. Wedding Date (Drop #3 - Delay 1.5s, +0.5s after #2) */
.cover-date-banner {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #0f4c9c;
  letter-spacing: 3px;
  margin: 10px 0 12px;
  opacity: 0;
}
.date-dot {
  color: #ffd700;
  margin: 0 4px;
}

/* 6. Press To Start Button (Drop #4 - Delay 2.0s, +0.5s after #3) */
.cover-cta-row {
  pointer-events: auto;
  margin-top: 18px;
  opacity: 0;
}
.btn-retro-cover-start {
  background: linear-gradient(180deg, #6ecb44 0%, #469a25 100%);
  border: 3px solid #1e4e11;
  box-shadow: 0 5px 0 #1b450c, 0 8px 12px rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 10px 22px;
  cursor: pointer;
  outline: none;
  animation: pulseStart 1.6s infinite ease-in-out;
  transition: transform 0.08s, box-shadow 0.08s;
  display: inline-block;
  position: relative;
  z-index: 30;
}
.btn-retro-cover-start:hover {
  background: linear-gradient(180deg, #7ad94f 0%, #4ea82a 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #1b450c, 0 10px 14px rgba(0,0,0,0.35);
}
.btn-retro-cover-start:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #1b450c;
}
.btn-start-text {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #153c09;
  letter-spacing: 1px;
  display: block;
}
@keyframes pulseStart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Floating Hearts in Cover */
.hearts-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}
.floating-heart {
  position: absolute;
  color: #ff5277;
  font-size: 16px;
  opacity: 0.8;
  animation: floatUp 4s ease-in infinite;
}
@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0.6); opacity: 0; }
  20% { opacity: 0.9; }
  100% { transform: translateY(-50px) scale(1.2); opacity: 0; }
}


/* ==============================================
   2. GAME SCREEN (HANDHELD CONSOLE)
   ============================================== */
#game-screen {
  /* background: #f7eed7 url('assets/bg_dear.png') top center / cover no-repeat; */
  background: #111a24 url('assets/bg_dear.png') top center / auto 100% no-repeat;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 90;
  transform: translateY(0);
  will-change: transform;
  padding: 55px 16px 20px;
  box-sizing: border-box;
}

/* Initial state when entering from bottom - slight overlap (-2px) to prevent sub-pixel gap */
#game-screen.entering-from-bottom {
  transform: translateY(100%) !important;
  transition: none !important;
}

/* Slide In Up Animation (synchronized with cover) */
#game-screen.slide-in-up {
  transform: translateY(0) !important;
  transition: transform 0.85s cubic-bezier(0.65, 0, 0.35, 1) !important;
}

.console-wrapper {
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 100%;
  background: #ffffff;
  border: 4px solid var(--border-blue);
  border-radius: 24px;
  box-shadow: 0 10px 25px rgba(17, 63, 128, 0.25), 0 4px 0 var(--border-blue);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Top Bezel Header */
.console-header {
  padding: 10px 14px 6px;
  background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%);
  border-bottom: 4px solid var(--border-blue);
  text-align: center;
  position: relative;
}
.console-title-box {
  background: #ffffff;
  border: 3px solid var(--border-blue);
  border-radius: 12px;
  padding: 6px 8px;
  box-shadow: 0 3px 0 var(--border-blue);
}
.banner-sub {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--primary-blue);
  letter-spacing: 1px;
}
.banner-main {
  font-family: var(--font-calligraphy);
  font-size: 28px;
  color: var(--primary-blue);
  line-height: 1.1;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
  margin: 2px 0;
}
.banner-tagline {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--border-blue);
  letter-spacing: 0.5px;
}



/* ==============================================
   GAME VIEWPORT (2D SCROLLING RPG WORLD)
   ============================================== */
.game-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #58b2f8 0%, #89d1fb 60%, #aae4ff 100%);
  border-bottom: 5px solid var(--border-blue);
}

/* Sky Parallax */
.viewport-sky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  pointer-events: none;
}
.parallax-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}
.p-cloud-1 {
  width: 70px;
  height: 20px;
  top: 15px;
  left: 20%;
}
.p-cloud-2 {
  width: 90px;
  height: 24px;
  top: 50px;
  left: 65%;
}

/* 2D Scrolling World Container */
.game-world {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 2150px; /* Compact world with 2 buildings per frame */
  /* width: 2150px; */
  will-change: transform;
  transition: transform 0.08s ease-out;
}

/* Ground / Pathway Track */
.world-ground-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
  background-image: url('assets/09_Background_Taman.png');
  background-repeat: repeat-x;
  background-size: auto 300px;
  background-position: left bottom;
  z-index: 5;
}

/* Buildings Container */
.world-buildings {
  position: absolute;
  bottom: 130px; /* Sit naturally along the dirt pathway */
  left: 0;
  width: 100%;
  height: 260px;
  z-index: 10;
}

.building-item {
  position: absolute;
  bottom: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.15s ease-out;
}
.building-item:hover {
  transform: translateY(-4px) scale(1.02);
}

.building-sprite {
  max-height: 155px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}
.tower-sprite {
  max-height: 185px;
}
.arch-sprite {
  max-height: 155px;
}

.building-label-tag {
  font-family: var(--font-pixel);
  font-size: 7.5px;
  color: #ffffff;
  background: rgba(17, 63, 128, 0.88);
  border: 1.5px solid #ffd700;
  padding: 2px 6px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 5px;
  white-space: nowrap;
  pointer-events: none;
}

/* Player Character */
.player-character {
  position: absolute;
  bottom: 100px; /* Walking along the road */
  left: 100px;
  width: 90px;
  height: 90px;
  z-index: 20;
  pointer-events: none;
  transform-origin: center bottom;
  transition: left 0.06s linear;
}

.player-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Turn character left */
.player-character.facing-left .player-sprite {
  transform: scaleX(-1);
}

/* Proximity Interaction Bubble */
.interaction-bubble {
  position: absolute;
  top: -46px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 3px solid var(--border-blue);
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 3px 0 var(--border-blue);
  display: none;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  animation: bubbleBounce 0.8s infinite alternate;
  z-index: 30;
}
.interaction-bubble.show {
  display: flex;
}
.bubble-key {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--pixel-green-dark);
  font-weight: bold;
}
.bubble-text {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--dark-blue);
}
@keyframes bubbleBounce {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-6px); }
}

.onscreen-hint {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 9px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 25;
}

/* ==============================================
   BOTTOM CONSOLE CONTROLLER BUTTONS
   ============================================== */
.console-controls {
  padding: 12px 20px 18px;
  background: #fdf6e2;
  border-top: 3px solid #dfc691;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dpad-buttons {
  display: flex;
  gap: 12px;
}

.game-btn {
  outline: none;
  cursor: pointer;
  border-radius: 14px;
  transition: transform 0.08s, box-shadow 0.08s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-arrow {
  width: 58px;
  height: 52px;
  background: #4bb3a4;
  border: 3px solid #144941;
  box-shadow: 0 5px 0 #144941, 0 8px 6px rgba(0,0,0,0.2);
  color: #ffffff;
  font-size: 20px;
}
.btn-arrow:hover {
  background: #5dcab9;
}
.btn-arrow:active, .btn-arrow.active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #144941;
}

.btn-enter {
  width: 120px;
  height: 52px;
  background: var(--pixel-green);
  border: 3px solid var(--pixel-green-dark);
  box-shadow: 0 5px 0 var(--pixel-green-dark), 0 8px 6px rgba(0,0,0,0.25);
}
.btn-enter:hover {
  background: #6ad042;
}
.btn-enter:active, .btn-enter.active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--pixel-green-dark);
}
.btn-enter-inner {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: #ffffff;
  text-shadow: 1px 1px 0 #1b450c;
  letter-spacing: 1px;
}


/* ==============================================
   RETRO RPG DIALOG / POPUP MODAL
   ============================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 15, 29, 0.75);
  backdrop-filter: blur(3px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.modal-overlay.open {
  display: flex;
}

.modal-retro-card {
  color: var(--text-dialog);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  background: var(--dialog-bg);
  border: 5px solid var(--dialog-border);
  box-shadow: 0 12px 30px rgba(0,0,0,0.8), inset 0 0 10px rgba(0,0,0,0.5);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: bold;
}
@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-retro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--dialog-bg);
  border-bottom: 3px solid var(--dialog-border);
}
.modal-header-icon {
  font-size: 25px;
  margin-right: 8px;
}
.modal-header-title {
  font-family: var(--font-pixel);
  font-size: 16px;
  /* color: var(--text-dialog); */
  letter-spacing: 1px;
  justify-content: center;
}
.btn-pixel-close {
  background: #fc808b;
  color: white;
  border: 2px solid #7d0e17;
  box-shadow: 0 2px 0 #7d0e17;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-family: var(--font-pixel);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.btn-pixel-close:active {
  transform: translateY(2px);
  box-shadow: none;
}

.modal-retro-body {
  padding: 16px;
  overflow-y: auto;
  /* color: #1f3b76; */
  font-size: 13px;
  line-height: 1.5;
}

.modal-retro-footer {
  padding: 10px 16px;
  background: var(--dialog-bg);
  border-top: 3px solid var(--dialog-border);
  display: flex;
  justify-content: center;
}
.btn-retro-ok {
  background: var(--primary-blue);
  color: #fff;
  border: 2px solid var(--dark-blue);
  box-shadow: 0 3px 0 var(--dark-blue);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font-pixel);
  font-size: 9px;
  cursor: pointer;
}
.btn-retro-ok:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* ==============================================
   MODAL TEMPLATES & STYLES
   ============================================== */

/* Holy Verse & Scrolls */
.holy-scroll {
  background: #fbf5df;
  /* color: #3b2808; */
  border: 2px dashed #43adfe;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  margin-bottom: 14px;
}
.holy-verse {
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 6px;
}
.holy-surah {
  font-family: var(--font-pixel);
  font-size: 8px;
  /* color: #835a16; */
}

/* Couple Bio Cards */
.couple-bio-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bio-card {
  background: #fbf5df;
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.bio-avatar {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  border: 2px solid #ffd700;
  background: #334e7a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.bio-info h4 {
  font-family: var(--font-pixel);
  font-size: 11px;
  /* color: #ffd700; */
  margin-bottom: 4px;
}
.bio-parents {
  font-size: 11px;
  /* color: #d0e0ff; */
  line-height: 1.3;
}
.bio-instagram {
  display: inline-block;
  margin-top: 6px;
  /* color: #79c0ff; */
  font-size: 11px;
  text-decoration: none;
  font-weight: 600;
}

/* Countdown Clock */
.countdown-container {
  background: #fbf5df;
  border: 2px solid #ffd700;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  margin-bottom: 14px;
}
.countdown-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  /* color: #ffd700; */
  margin-bottom: 10px;
}
.countdown-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: white;
}
.cd-box {
  background: #0f1c34;
  border: 2px solid #227bd9;
  border-radius: 6px;
  padding: 6px 8px;
  min-width: 50px;
}
.cd-val {
  font-family: var(--font-pixel);
  font-size: 16px;
  /* color: #59d643; */
}
.cd-lbl {
  font-size: 9px;
  /* color: #9cb9ec; */
  margin-top: 2px;
}

/* Schedule Card */
.schedule-item {
  background: #fbf5df;
  border-left: 4px solid #ffd700;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 10px;
}
.sched-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  /* color: #ffd700; */
  margin-bottom: 4px;
}
.sched-time {
  font-size: 12px;
  /* color: #fff; */
  font-weight: bold;
}

/* Action Buttons in Modal */
.btn-action-primary {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--pixel-green);
  border: 3px solid var(--pixel-green-dark);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  font-family: var(--font-pixel);
  font-size: 9px;
  text-decoration: none;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 3px 0 var(--pixel-green-dark);
}
.btn-action-primary:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* Venue Info */
.venue-box {
  background: #fbf5df;
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.venue-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  /* color: #ffd700; */
  margin-bottom: 6px;
}
.venue-address {
  font-size: 12px;
  /* color: #dce7fc; */
  line-height: 1.4;
}

/* Story Chapters */
.story-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.story-chapter {
  background: #fbf5df;
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 10px 12px;
}
.chapter-badge {
  font-family: var(--font-pixel);
  font-size: 8px;
  /* color: #ffd700; */
  margin-bottom: 4px;
}
.chapter-heading {
  font-size: 13px;
  font-weight: bold;
  /* color: #fff; */
  margin-bottom: 4px;
}
.chapter-desc {
  font-size: 12px;
  /* color: #c9dbfa; */
  line-height: 1.4;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gallery-card {
  background: #ffffff;
  padding: 6px 6px 12px;
  border-radius: 4px;
  border: 2px solid #ddd;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s;
}
.gallery-card:hover {
  transform: scale(1.04) rotate(1deg);
}
.gallery-img-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 2px;
  background: #d8e5f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.gallery-caption {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: #333;
  margin-top: 6px;
}

/* Love Message & RSVP Form */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-group label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 8px;
  /* color: #ffd700; */
  margin-bottom: 4px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 8px 10px;
  /* background: #0f1c34; */
  border: 2px solid #227bd9;
  border-radius: 6px;
  /* color: #ffffff; */
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: #ffd700;
}
.wishes-list {
  margin-top: 14px;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wish-bubble {
  background: #fbf5df;
  border-radius: 6px;
  padding: 8px 10px;
  border-left: 3px solid #227bd9;
}
.wish-sender {
  font-family: var(--font-pixel);
  font-size: 8px;
  /* color: #ffd700; */
}
.wish-text {
  font-size: 11px;
  /* color: #e3edff; */
  margin-top: 2px;
}

/* Wedding Gift Box */
.gift-card {
  background: #fbf5df;
  border: 2px solid #ffd700;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.bank-badge {
  font-family: var(--font-pixel);
  font-size: 10px;
  /* color: #ffd700; */
  margin-bottom: 6px;
}
.account-number {
  font-family: var(--font-pixel);
  font-size: 14px;
  /* color: #ffffff; */
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.account-holder {
  font-size: 11px;
  color: #adc9f9;
}
.btn-copy-account {
  margin-top: 8px;
  background: #227bd9;
  border: 2px solid #114b8c;
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
}
.btn-copy-account:active {
  transform: translateY(2px);
}

/* Retro Toast */
.retro-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #111e38;
  border: 3px solid #ffd700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  color: #ffd700;
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 20000;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}
.retro-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==============================================
   RESPONSIVE DESIGN (MOBILE ADAPTATION)
   ============================================== */
@media (max-width: 500px) {
  #game-screen {
    height: 100vh;
    height: 100dvh;
    padding: 40px 14px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }
  .console-wrapper {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 20px;
    border: 3.5px solid var(--border-blue);
    box-shadow: 0 8px 20px rgba(17, 63, 128, 0.2), 0 3px 0 var(--border-blue);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .console-header {
    padding: 6px 10px 4px;
    flex-shrink: 0;
  }
  .console-title-box {
    padding: 4px 6px;
  }
  .banner-sub {
    font-size: 7px;
  }
  .banner-main {
    font-size: 22px;
    line-height: 1.1;
  }
  .banner-tagline {
    font-size: 6.5px;
    margin-top: 2px;
  }
  .console-controls {
    padding: 8px 16px 10px;
    flex-shrink: 0;
  }
  .btn-arrow {
    width: 48px;
    height: 42px;
    font-size: 16px;
    border-radius: 10px;
  }
  .btn-enter {
    width: 100px;
    height: 42px;
    border-radius: 10px;
  }
  .btn-enter-inner {
    font-size: 12px;
  }
  .couple-names {
    font-size: 38px;
  }
  .pixel-text-invited {
    font-size: 22px;
  }
  .audio-btn {
    top: 6px;
    right: 8px;
    padding: 4px 8px;
    font-size: 8px;
  }
}



/* ============================= Gated Animations (triggered after typewriter) ============================= */
.cover-content-overlay .cover-invited-block,
.cover-content-overlay .title-couple-row,
.cover-content-overlay .cover-date-banner,
.cover-content-overlay .cover-cta-row {
  opacity: 0;
}
.cover-content-overlay.animations-ready .cover-invited-block {
  animation: dropFromTop 0.6s cubic-bezier(0.2, 0.8, 0.25, 1) both;
  animation-delay: 0s;
}
.cover-content-overlay.animations-ready .title-couple-row {
  animation: dropFromTop 0.6s cubic-bezier(0.2, 0.8, 0.25, 1) both;
  animation-delay: 0.5s;
}
.cover-content-overlay.animations-ready .cover-date-banner {
  animation: dropFromTop 0.6s cubic-bezier(0.2, 0.8, 0.25, 1) both;
  animation-delay: 1.0s;
}
.cover-content-overlay.animations-ready .cover-cta-row {
  animation: dropFromTop 0.6s cubic-bezier(0.2, 0.8, 0.25, 1) both;
  animation-delay: 1.5s;
}

/* ==============================================
   WEDDING CAR & ENDING ANIMATION STYLES
   ============================================== */
.wedding-car-wrapper {
  position: absolute;
  bottom: 95px;
  width: 160px;
  height: auto;
  z-index: 15;
  transition: transform 0.05s linear;
  cursor: pointer;
}

.wedding-car-sprite {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 4px rgba(0,0,0,0.3));
  animation: carIdleVibe 0.6s infinite ease-in-out alternate;
}

@keyframes carIdleVibe {
  0% { transform: translateY(0); }
  100% { transform: translateY(-2px); }
}

/* Car driving away animation */
.wedding-car-wrapper.driving-away {
  transition: transform 2.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform: translateX(800px) !important;
}

.car-bubble {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 2px solid var(--border-blue);
  border-radius: 8px;
  padding: 3px 8px;
  box-shadow: 0 3px 0 var(--border-blue);
  display: none;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  z-index: 20;
  animation: bounceBubble 0.8s infinite alternate ease-in-out;
}
.wedding-car-wrapper.in-proximity .car-bubble {
  display: inline-flex;
}

/* Car smoke puffs */
.car-exhaust {
  position: absolute;
  left: 4px;
  bottom: 24px;
  pointer-events: none;
}
.smoke-puff {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: smokePuff 0.8s forwards ease-out;
}
@keyframes smokePuff {
  0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  100% { transform: translate(-30px, -15px) scale(2.5); opacity: 0; }
}

/* Ending Screen Overlay */
.ending-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(8, 15, 29, 0.85);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ending-overlay.show {
  display: flex !important;
  opacity: 1 !important;
}

.ending-card {
  background: #ffffff;
  border: 4px solid var(--border-blue);
  border-radius: 20px;
  box-shadow: 0 12px 0 var(--border-blue), 0 20px 40px rgba(0,0,0,0.5);
  max-width: 380px;
  width: 100%;
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
  overflow: visible; /* Biarkan karakter wave bisa muncul menonjol di atas kartu */
  transform: translateY(20px) scale(0.95);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Ensure all ending card text and buttons sit above falling flowers */
.ending-card > *:not(.ending-card-flowers) {
  position: relative;
  z-index: 2;
}

/* Falling Flowers Layer inside ending card (bunga.gif) */
.ending-card-flowers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  border-radius: 16px;
  z-index: 1;
}

/* Chibi Couple Wave Animation on Ending Card (Tengah & Tidak Transparan) */
.ending-couple-wave {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -50px auto 8px auto;
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.ending-couple-img {
  width: 120px;
  max-width: 34vw;
  height: auto;
  display: block;
  opacity: 1 !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.ending-flower-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.95;
  display: block;
}

/* Ambient Fullscreen Falling Flowers behind ending card */
.ending-backdrop-flowers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0.55;
}

.ending-backdrop-flower-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ending-overlay.show .ending-card {
  transform: translateY(0) scale(1);
}

.ending-ribbon {
  display: inline-block;
  background: linear-gradient(180deg, #ff6b8b 0%, #d82b52 100%);
  color: #ffffff;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 5px 14px;
  border-radius: 12px;
  border: 2px solid #8c102c;
  letter-spacing: 1px;
  margin-bottom: 12px;
  box-shadow: 0 3px 0 #8c102c;
}

.ending-names {
  font-family: var(--font-calligraphy);
  font-size: 38px;
  color: var(--primary-blue);
  line-height: 1.1;
  margin-bottom: 6px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.ending-heart-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: #ff4d6d;
  font-size: 16px;
  margin-bottom: 14px;
}

.ending-greeting {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #1a365d;
  margin-bottom: 10px;
  line-height: 1.5;
}

.ending-message {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 16px;
}

.ending-date-pill {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #2b6cb0;
  background: #ebf8ff;
  border: 2px dashed #90cdf4;
  padding: 6px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.btn-ending-replay {
  display: inline-block;
  background: linear-gradient(180deg, #48bb78 0%, #2f855a 100%);
  border: 3px solid #1c5436;
  box-shadow: 0 4px 0 #1c5436;
  color: #ffffff;
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-ending-replay:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1c5436;
}
.btn-ending-replay:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1c5436;
}

/* FINISH Banner above car */
.finish-flag-banner {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 2px solid #113f80;
  border-radius: 8px;
  padding: 3px 8px;
  box-shadow: 0 3px 0 #113f80;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #113f80;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  animation: pulseFinish 1.2s infinite ease-in-out alternate;
}

@keyframes pulseFinish {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-3px); }
}

.ending-guest-greet {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #1a365d;
  margin-bottom: 12px;
}

.ending-message-box {
  background: #f7fafc;
  border: 1.5px dashed #cbd5e0;
  border-radius: 12px;
  padding: 14px 12px;
  margin-bottom: 14px;
}

.ending-quote {
  font-family: var(--font-pixel-sans);
  font-weight: 700;
  font-size: 14px;
  color: #2b6cb0;
  line-height: 1.3;
  margin-bottom: 10px;
}

.ending-body-text {
  font-family: var(--font-body);
  font-size: 12px;
  color: #4a5568;
  line-height: 1.5;
  margin-bottom: 8px;
}

.ending-highlight {
  font-family: var(--font-pixel-sans);
  font-weight: 700;
  font-size: 13px;
  color: #e53e3e;
  line-height: 1.3;
  margin-top: 10px;
}

.ending-signoff {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #4a5568;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ending-signoff strong {
  font-size: 10px;
  color: var(--primary-blue);
}

/* =============================================
   GALLERY PHOTO LIGHTBOX (ZOOM PREVIEW)
   ============================================= */
.gallery-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.25, 1), box-shadow 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  border-color: var(--primary-blue);
}

.gallery-card::after {
  content: "🔍 Klik untuk memperbesar";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 76, 156, 0.88);
  color: #ffffff;
  font-family: var(--font-pixel, monospace);
  font-size: 7px;
  padding: 4px 2px;
  text-align: center;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.gallery-card:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.photo-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 12, 24, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
}

.photo-lightbox.open {
  display: flex !important;
  animation: fadeInLightbox 0.2s ease-out;
}

.photo-lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 4px solid #ffffff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
  animation: popInPhoto 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.25);
  background: #0f172a;
}

.photo-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  background: #e63946;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 10;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.photo-lightbox-close:hover {
  transform: scale(1.15) rotate(90deg);
  background: #c52230;
}

.photo-lightbox-hint {
  margin-top: 14px;
  font-family: var(--font-pixel, monospace);
  font-size: 8px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  text-align: center;
}

@keyframes fadeInLightbox {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popInPhoto {
  0% { transform: scale(0.75); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}