* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =====================================================
   HOP TO FOREVER
   Wedding Mini Game
===================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: Arial, sans-serif;

  background: #fff4f7;

  color: #713247;

  overflow-x: hidden;
}

/* =====================================================
   PAGE
===================================================== */

.game-page {
  min-height: 100vh;

  position: relative;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 10% 15%,
      rgba(238, 148, 173, 0.18),
      transparent 25%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(199, 93, 123, 0.14),
      transparent 25%
    ),
    linear-gradient(180deg, #fff9fa, #ffedf2);
}

/* =====================================================
   BACKGROUND DECORATIONS
===================================================== */

.bg-decoration {
  position: fixed;

  pointer-events: none;

  color: rgba(199, 93, 123, 0.12);

  z-index: 0;

  animation: floatingDecoration 6s ease-in-out infinite;
}

.heart-1 {
  top: 15%;
  left: 4%;

  font-size: 80px;
}

.heart-2 {
  right: 4%;
  top: 40%;

  font-size: 100px;

  animation-delay: 1.5s;
}

.flower-1 {
  left: 12%;
  bottom: 15%;

  font-size: 50px;

  animation-delay: 2s;
}

.flower-2 {
  right: 12%;
  bottom: 10%;

  font-size: 60px;

  animation-delay: 3s;
}

@keyframes floatingDecoration {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-18px) rotate(10deg);
  }
}

/* =====================================================
   HEADER
===================================================== */

.game-header {
  position: relative;

  z-index: 10;

  width: min(1100px, 94%);

  margin: 0 auto;

  padding: 25px 0;

  display: flex;

  align-items: center;

  justify-content: space-between;
}

.game-brand {
  display: flex;

  align-items: center;

  gap: 12px;
}

.brand-heart {
  width: 44px;
  height: 44px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  background: linear-gradient(135deg, #c75d7b, #e99aae);

  color: white;

  font-size: 17px;

  box-shadow: 0 8px 20px rgba(199, 93, 123, 0.2);
}

.game-brand small {
  display: block;

  margin-bottom: 3px;

  font-size: 7px;

  letter-spacing: 2.5px;

  color: #b16b7e;
}

.game-brand strong {
  display: block;

  font-family: Georgia, serif;

  font-size: 18px;

  font-weight: 400;

  color: #713247;
}

.game-stats {
  display: flex;

  gap: 10px;
}

.stat {
  min-width: 80px;

  padding: 8px 13px;

  border: 1px solid rgba(199, 93, 123, 0.15);

  border-radius: 12px;

  background: rgba(255, 255, 255, 0.65);

  text-align: center;

  backdrop-filter: blur(10px);
}

.stat span {
  display: block;

  font-size: 7px;

  letter-spacing: 2px;

  color: #ad7181;
}

.stat strong {
  display: block;

  margin-top: 3px;

  font-family: Georgia, serif;

  font-size: 20px;

  font-weight: 400;

  color: #8c3551;
}

/* =====================================================
   GAME WRAPPER
===================================================== */

.game-wrapper {
  position: relative;

  z-index: 2;

  width: min(900px, 94%);

  margin: 0 auto;

  padding-bottom: 30px;
}

/* =====================================================
   GAME CONTAINER
===================================================== */

.game-container {
  position: relative;

  width: 100%;

  height: min(700px, 75vh);

  min-height: 550px;

  overflow: hidden;

  border-radius: 28px;

  background: linear-gradient(180deg, #ffeef3 0%, #fbdde6 55%, #f5c9d7 100%);

  border: 1px solid rgba(199, 93, 123, 0.18);

  box-shadow: 0 30px 80px rgba(111, 42, 63, 0.15);
}

/* Canvas */

#gameCanvas {
  position: absolute;

  inset: 0;

  width: 100%;

  height: 100%;

  display: block;
}

/* =====================================================
   OVERLAYS
===================================================== */

.game-overlay {
  position: absolute;

  inset: 0;

  z-index: 20;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 25px;

  background: rgba(255, 240, 245, 0.45);

  backdrop-filter: blur(8px);

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  transition: 0.35s ease;
}

.game-overlay.active {
  opacity: 1;

  visibility: visible;

  pointer-events: auto;
}

.overlay-card {
  width: min(450px, 100%);

  padding: 45px 40px;

  border: 1px solid rgba(199, 93, 123, 0.2);

  border-radius: 25px;

  background: rgba(255, 255, 255, 0.91);

  box-shadow: 0 25px 70px rgba(118, 47, 70, 0.16);

  text-align: center;
}

.game-icon,
.game-over-heart {
  width: 62px;

  height: 62px;

  margin: 0 auto 18px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  background: linear-gradient(135deg, #f5b4c4, #c75d7b);

  color: white;

  font-size: 24px;

  box-shadow: 0 10px 25px rgba(199, 93, 123, 0.2);
}

.game-over-heart {
  background: linear-gradient(135deg, #e99aaa, #9b3b59);
}

.overlay-kicker {
  display: block;

  margin-bottom: 12px;

  font-size: 8px;

  letter-spacing: 3px;

  color: #c05a78;
}

.overlay-card h1,
.overlay-card h2 {
  margin: 0;

  font-family: Georgia, serif;

  font-size: 48px;

  line-height: 0.95;

  font-weight: 400;

  color: #713247;
}

.overlay-card h1 em {
  display: block;

  margin-top: 6px;

  font-family: "Brush Script MT", "Segoe Script", cursive;

  font-size: 1.1em;

  color: #c75d7b;

  font-weight: 400;
}

.overlay-card > p {
  max-width: 340px;

  margin: 18px auto 25px;

  font-family: Georgia, serif;

  font-size: 13px;

  line-height: 1.7;

  color: #8d626e;
}

/* =====================================================
   HOW TO
===================================================== */

.how-to {
  display: flex;

  justify-content: center;

  gap: 15px;

  margin: 25px 0 30px;
}

.how-to div {
  width: 62px;

  height: 62px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 3px;

  border: 1px solid rgba(199, 93, 123, 0.15);

  border-radius: 14px;

  background: #fff5f7;
}

.how-to span {
  font-size: 19px;

  color: #bd5371;
}

.how-to small {
  font-size: 6px;

  letter-spacing: 1.5px;

  color: #a36b7a;
}

/* =====================================================
   BUTTONS
===================================================== */

.primary-button {
  width: 100%;

  padding: 15px 20px;

  border: none;

  border-radius: 50px;

  background: linear-gradient(135deg, #8d304d, #c75d7b);

  color: white;

  font-family: Arial, sans-serif;

  font-size: 9px;

  letter-spacing: 2px;

  cursor: pointer;

  box-shadow: 0 10px 25px rgba(141, 48, 77, 0.22);

  transition: 0.3s ease;
}

.primary-button span {
  margin-left: 10px;

  font-size: 15px;
}

.primary-button:hover {
  transform: translateY(-3px);

  box-shadow: 0 15px 30px rgba(141, 48, 77, 0.28);
}

.secondary-button {
  width: 100%;

  margin-top: 10px;

  padding: 13px 20px;

  border: 1px solid rgba(199, 93, 123, 0.3);

  border-radius: 50px;

  background: transparent;

  color: #8d304d;

  font-size: 8px;

  letter-spacing: 1.5px;

  cursor: pointer;
}

/* =====================================================
   COUNTDOWN
===================================================== */

.countdown {
  position: absolute;

  z-index: 30;

  top: 50%;

  left: 50%;

  transform: translate(-50%, -50%) scale(0.5);

  font-family: Georgia, serif;

  font-size: 110px;

  color: white;

  text-shadow: 0 10px 30px rgba(118, 47, 70, 0.3);

  opacity: 0;

  pointer-events: none;
}

.countdown.show {
  animation: countdownAnimation 0.8s ease;
}

@keyframes countdownAnimation {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  30% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* =====================================================
   MOBILE CONTROLS
===================================================== */

.mobile-controls {
  position: absolute;

  z-index: 15;

  bottom: 20px;

  left: 50%;

  transform: translateX(-50%);

  display: none;

  gap: 12px;
}

.mobile-controls button {
  width: 58px;

  height: 58px;

  border: 1px solid rgba(255, 255, 255, 0.5);

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.72);

  color: #8d304d;

  font-size: 22px;

  box-shadow: 0 8px 20px rgba(118, 47, 70, 0.12);

  backdrop-filter: blur(8px);

  touch-action: manipulation;

  cursor: pointer;
}

.mobile-controls button:active {
  transform: scale(0.9);
}

#hopButton {
  background: linear-gradient(135deg, #8d304d, #c75d7b);

  color: white;
}

/* =====================================================
   INSTRUCTION
===================================================== */

.game-instruction {
  position: absolute;

  top: 20px;

  left: 50%;

  transform: translateX(-50%);

  z-index: 5;

  padding: 8px 15px;

  border-radius: 30px;

  background: rgba(255, 255, 255, 0.55);

  color: #8d4c60;

  font-size: 7px;

  letter-spacing: 2px;

  backdrop-filter: blur(8px);

  opacity: 0;

  transition: 0.3s ease;
}

.game-instruction.visible {
  opacity: 1;
}

/* =====================================================
   FINAL SCORE
===================================================== */

.final-score {
  margin: 25px 0 15px;

  padding: 15px;

  border-radius: 15px;

  background: #fff3f6;
}

.final-score span {
  display: block;

  font-size: 7px;

  letter-spacing: 2px;

  color: #a56a79;
}

.final-score strong {
  display: block;

  margin-top: 5px;

  font-family: Georgia, serif;

  font-size: 55px;

  line-height: 1;

  font-weight: 400;

  color: #8d304d;
}

.new-best {
  display: none;

  margin: 10px 0;

  font-size: 9px;

  letter-spacing: 1px;

  color: #c75d7b;
}

.new-best.show {
  display: block;
}

/* =====================================================
   GAME OVER BUTTONS
===================================================== */

.game-over-buttons {
  margin-top: 15px;
}

/* =====================================================
   FAMILY SCORE
===================================================== */

.game-footer {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 35px;

  margin-top: 18px;

  padding: 15px;

  border: 1px solid rgba(199, 93, 123, 0.13);

  border-radius: 20px;

  background: rgba(255, 255, 255, 0.7);

  box-shadow: 0 8px 25px rgba(118, 47, 70, 0.05);
}

.family-score {
  display: flex;

  align-items: center;

  gap: 12px;
}

.family-score span {
  font-size: 9px;

  letter-spacing: 1px;

  color: #8f5969;
}

.family-score strong {
  min-width: 45px;

  font-family: Georgia, serif;

  font-size: 20px;

  font-weight: 400;

  color: #8d304d;
}

.versus {
  font-family: Georgia, serif;

  font-size: 11px;

  color: #bd7b8c;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 700px) {
  .game-header {
    padding: 15px 0;
  }

  .game-brand strong {
    font-size: 15px;
  }

  .brand-heart {
    width: 38px;

    height: 38px;
  }

  .stat {
    min-width: 62px;

    padding: 7px 9px;
  }

  .stat strong {
    font-size: 17px;
  }

  .game-container {
    height: calc(100vh - 150px);

    min-height: 570px;

    max-height: 750px;

    border-radius: 20px;
  }

  .mobile-controls {
    display: flex;
  }

  .game-instruction {
    top: 18px;
  }

  .game-footer {
    gap: 10px;

    padding: 10px;
  }

  .family-score {
    flex-direction: column;

    gap: 2px;

    text-align: center;
  }

  .family-score span {
    font-size: 6px;
  }

  .family-score strong {
    font-size: 18px;
  }

  .versus {
    font-size: 9px;
  }

  .overlay-card {
    padding: 35px 25px;

    border-radius: 20px;
  }

  .overlay-card h1,
  .overlay-card h2 {
    font-size: 40px;
  }

  .how-to div {
    width: 55px;

    height: 55px;
  }

  .bg-decoration {
    display: none;
  }
}

@media (max-width: 400px) {
  .game-stats {
    gap: 5px;
  }

  .stat {
    min-width: 55px;
  }

  .game-brand small {
    font-size: 6px;
  }

  .game-brand strong {
    font-size: 13px;
  }

  .game-container {
    min-height: 540px;
  }

  .mobile-controls button {
    width: 52px;

    height: 52px;
  }
}
