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

html,
body {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
}

body {
  background-image: url('images/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
}

.birthday-title {
  position: fixed;
  top: clamp(5px, 1vh, 10px);
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 100;
  margin: 0;
  padding: 0;
}

.title-line1 {
  color: hsl(54, 100%, 62%);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-family: 'Courier New', monospace;
  font-weight: bold;
  text-shadow: 3px 3px 0px #000, -2px -2px 0px #000, 2px -2px 0px #000,
    -2px 2px 0px #000;
  letter-spacing: clamp(2px, 0.3vw, 3px);
  margin: 0;
  line-height: 0.9;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.title-line2 {
  color: #ffeb3b;
  font-size: clamp(2.2rem, 6.5vw, 4rem);
  font-family: 'Courier New', monospace;
  font-weight: bold;
  text-shadow: 3px 3px 0px #000, -2px -2px 0px #000, 2px -2px 0px #000,
    -2px 2px 0px #000;
  letter-spacing: clamp(4px, 1vw, 12px);
  margin: 1px 1px 0 0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.instruction-text {
  width: 100%;
  color: #010b12;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-family: 'Courier New', monospace;
  text-align: center;
  font-weight: bold;
  z-index: 100;
  position: absolute;
  top: clamp(80px, 10vh, 120px);
  left: 0;
  margin-top: clamp(10px, 2vh, 20px);
}
.wish-counter {
  position: fixed;
  bottom: clamp(20px, 3vh, 30px);
  right: clamp(15px, 2vw, 30px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

#counter {
  color: #ffeb3b;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: bold;
  font-family: 'Courier New', monospace;
  text-shadow: 3px 3px 0px #000, -2px -2px 0px #000, 2px -2px 0px #000,
    -2px 2px 0px #000;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.counter-label {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: #ffffff;
  text-transform: lowercase;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  text-shadow: 2px 2px 0px #000;
}

/* Flash animation for wish discovery */
@keyframes flash {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(2) drop-shadow(0 0 30px #ffeb3b);
  }
}

.wish-counter.flash {
  animation: flash 1s ease;
}

.game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.character {
  position: absolute;
  width: clamp(158px, 15.84vw, 257px);
  height: clamp(158px, 15.84vw, 257px);
  object-fit: contain;
  cursor: pointer;
  filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.6));
  transition: all 0.3s ease;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.character:hover,
.character:active {
  transform: scale(1.15) rotate(5deg);
}

.character.discovered {
  width: clamp(190px, 19.14vw, 309px);
  height: clamp(190px, 19.14vw, 309px);
  border: clamp(5px, 0.55vw, 8px) solid #ffeb3b;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(255, 235, 59, 0.8);
  filter: drop-shadow(0 0 15px rgba(255, 235, 59, 0.6));
}

.fish,
.flatfish,
.blue,
.green {
  top: 52%;
  left: -100px;
}

.fish {
  width: clamp(238px, 23.76vw, 396px);
  height: clamp(238px, 23.76vw, 396px);
}

.racoon {
  bottom: 20%;
  left: 0;
  width: clamp(264px, 26.4vw, 442px);
  height: clamp(264px, 26.4vw, 442px);
}

.racoon.discovered {
  width: clamp(290px, 29.04vw, 482px);
  height: clamp(290px, 29.04vw, 482px);
}

.porpoise {
  bottom: 0;
  left: 5%;
  width: clamp(321px, 32.18vw, 536px);
  height: clamp(321px, 32.18vw, 536px);
  transition: all 2s ease-in-out;
}

.porpoise.discovered {
  width: clamp(364px, 36.46vw, 601px);
  height: clamp(364px, 36.46vw, 601px);
}

.blue {
  width: clamp(172px, 17.16vw, 284px);
  height: clamp(172px, 17.16vw, 284px);
}

.blue.discovered {
  width: clamp(205px, 20.46vw, 339px);
  height: clamp(205px, 20.46vw, 339px);
}

.hidden {
  display: none !important;
}

.wish-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.95);
  padding: clamp(20px, 3vw, 40px);
  border-radius: 20px;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: #333;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  z-index: 200;
  text-align: center;
  max-width: 80%;
  animation: fadeIn 0.5s ease;
}

.final-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 300;
  animation: fadeIn 1s ease;
}

.together-image {
  max-width: 80%;
  max-height: 50%;
  margin-bottom: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.final-screen h2 {
  color: #ffffff;
  font-size: clamp(1.8rem, 5vw, 3rem);
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
  margin: 20px 0;
}

.final-screen p {
  color: #ffffff;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 481px) {
  .instruction-text {
    top: clamp(70px, 8vh, 100px);
  }

  .fish {
    width: clamp(211px, 21.12vw, 330px);
    height: clamp(211px, 21.12vw, 330px);
  }

  .racoon {
    bottom: 18%;
  }
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .title-line1 {
    font-size: clamp(1.4rem, 8vw, 2rem);
    padding: 0 2vw;
  }

  .title-line2 {
    font-size: clamp(2rem, 10vw, 2.8rem);
    padding: 0 2vw;
  }

  .instruction-text {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    top: clamp(60px, 12vh, 90px);
    margin-top: 5%;
    padding: 0 4vw;
  }

  .wish-counter {
    bottom: 20px;
    right: 10px;
  }

  .fish {
    width: clamp(185px, 46.2vw, 238px);
    height: clamp(185px, 46.2vw, 238px);
  }

  .flatfish {
    width: clamp(158px, 39.6vw, 211px);
    height: clamp(158px, 39.6vw, 211px);
  }

  .green {
    width: clamp(145px, 36.96vw, 198px);
    height: clamp(145px, 36.96vw, 198px);
  }

  .racoon {
    bottom: 18%;
    width: clamp(238px, 59.4vw, 290px);
    height: clamp(238px, 59.4vw, 290px);
  }

  .racoon.discovered {
    width: clamp(264px, 63.36vw, 317px);
    height: clamp(264px, 63.36vw, 317px);
  }

  .porpoise {
    width: clamp(280px, 68.64vw, 364px);
    height: clamp(280px, 68.64vw, 364px);
    bottom: 2%;
    left: -5%;
  }

  .porpoise.discovered {
    width: clamp(321px, 75.08vw, 408px);
    height: clamp(321px, 75.08vw, 408px);
  }

  .blue {
    width: clamp(145px, 36.96vw, 185px);
    height: clamp(145px, 36.96vw, 185px);
  }

  .blue.discovered {
    width: clamp(172px, 42.24vw, 218px);
    height: clamp(172px, 42.24vw, 218px);
  }

  .birthday-title {
    top: 1vh;
    padding: 0 2vw;
  }

  .game-container {
    padding-top: 15vh;
  }
}

/* Prevent text selection on touch devices */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
