/* ----------------------------
   Global & Page Base Styles
---------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Fredoka", system-ui, sans-serif;
  background-color: #8fd2ff; /* light blue pond feel */
  color: #0f172a; /* dark navy text */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 16px;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ----------------------------
   Header Layout
---------------------------- */

.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left | center | right */
  align-items: center;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  gap: 12px;
}

.status {
  justify-self: start;
  font-size: 1.1rem;
  font-weight: 400;
}

.title-block {
  justify-self: center;
  color: #000;
}

.restart-btn {
  justify-self: end;
  background-color: #f54501;
  color: #ffffff;
  font-weight: 400;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hidden {
  display: none;
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 6px #07406623;
}

/* ----------------------------
   Game Board
---------------------------- */

.board {
  position: relative; /* container for absolutely positioned children */
  width: 90vw; /* responsive width */
  max-width: 720px; /* limit on larger screens */
  aspect-ratio: 16 / 9; /* keeps consistent shape */
  border: 4px solid #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  background-color: #38bdf8; /* fallback color behind pond */
  margin-top: 20px;
}

.pond {
  position: absolute;
  inset: 0; /* shorthand for top/right/bottom/left: 0 */
  width: 100%;
  height: 100%;
  object-fit: cover; /* ensures it scales properly */
  pointer-events: none; /* allows clicks to pass through */
  user-select: none;
}

.fish {
  background-color: transparent;
  position: absolute;
  width: 80px;
  height: 80px;
  background-image: url("fish.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.fish.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.net {
  position: absolute;
  width: 100px;
  height: 100px;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
  transition: transform 0.05s linear; /* quick follow motion */
}

.fish:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.fish:active {
  transform: translate(-50%, -50%) scale(0.95);
}

@media (max-width: 600px) {
  .header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 8px;
  }
  .restart-btn {
    justify-self: center;
  }
}

/* ---------------------------------------
   Fish "fly out of pond" animation
--------------------------------------- */

.fish.fly {
  animation: flyAway 0.2s ease-out forwards;
}

@keyframes flyAway {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  60% {
    transform: translate(-50%, -80%) scale(1.1) rotate(15deg);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -250%) scale(0.8) rotate(30deg);
    opacity: 0;
  }
}
