/* =========================================================
   SOLID GAME: SHARK TIMER
========================================================= */

.shark-timer-game {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  font-family: "Fredoka", Arial, sans-serif;
  color: #000;
  overflow: hidden;
}

.shark-timer-top {
  background: #bff1ea;
  border: 7px solid #000;
  border-radius: 24px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 7px 7px 0 rgba(0,0,0,0.24);
}

.shark-timer-top h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 900;
}

.shark-timer-top p {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 900;
}

.shark-timer-clock {
  min-width: 105px;
  height: 72px;
  background: #d3ff00;
  border: 6px solid #000;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.25);
}

.shark-scene {
  --shark-left: 5%;
  --danger-progress: 0;
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 8px solid #000;
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 24%, rgba(255,255,255,0.42) 0 5%, transparent 6%),
    radial-gradient(circle at 72% 18%, rgba(255,255,255,0.25) 0 4%, transparent 5%),
    linear-gradient(180deg, #55d9ff 0%, #0a9bd3 48%, #00679b 100%);
  box-shadow: 10px 10px 0 rgba(0,0,0,0.27);
}

.shark-water-lines {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.16) 0 4px,
      transparent 4px 46px
    );
  opacity: 0.7;
  animation: sharkWaterMove 3s linear infinite;
}

@keyframes sharkWaterMove {
  from { transform: translateY(0); }
  to { transform: translateY(46px); }
}

.shark-bubbles {
  position: absolute;
  color: rgba(255,255,255,0.9);
  font-size: 28px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
  animation: bubbleFloat 2.6s ease-in-out infinite;
  pointer-events: none;
}

.bubble-one { left: 17%; top: 62%; }
.bubble-two { left: 43%; top: 30%; animation-delay: 0.4s; }
.bubble-three { left: 70%; top: 70%; animation-delay: 0.9s; }

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0) scale(0.9); opacity: 0.45; }
  50% { transform: translateY(-16px) scale(1.1); opacity: 1; }
}

.fish-safe-zone {
  position: absolute;
  right: 5%;
  top: 50%;
  width: min(210px, 20vw);
  height: min(210px, 28vh);
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 7px dashed rgba(255,255,255,0.72);
  border-radius: 50%;
  background: rgba(211, 255, 0, 0.16);
  z-index: 3;
}

.safe-label {
  position: absolute;
  top: -20px;
  background: #d3ff00;
  border: 5px solid #000;
  border-radius: 14px;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 900;
}

.fish-sprite {
  font-size: clamp(72px, 9vw, 140px);
  filter: drop-shadow(6px 6px 0 rgba(0,0,0,0.32));
  animation: fishIdle 1.2s ease-in-out infinite;
}

@keyframes fishIdle {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

.shark-sprite {
  position: absolute;
  left: var(--shark-left);
  top: 51%;
  z-index: 4;
  transform: translate(-50%, -50%) scaleX(-1);
  font-size: clamp(95px, 15vw, 220px);
  filter: drop-shadow(8px 8px 0 rgba(0,0,0,0.35));
  transition: left 0.08s linear;
}

.game-running .shark-sprite {
  animation: sharkSwim 0.55s ease-in-out infinite;
}

@keyframes sharkSwim {
  0%, 100% { transform: translate(-50%, -50%) scaleX(-1) rotate(-2deg); }
  50% { transform: translate(-50%, -53%) scaleX(-1) rotate(2deg); }
}

.shark-attack {
  animation: sharkAttack 0.45s ease-in-out 3 !important;
}

@keyframes sharkAttack {
  0%, 100% { transform: translate(-50%, -50%) scaleX(-1) scale(1); }
  50% { transform: translate(-42%, -50%) scaleX(-1) scale(1.16); }
}

.fish-celebrate {
  animation: fishCelebrate 0.55s ease-in-out 5 !important;
}

@keyframes fishCelebrate {
  0%, 100% { transform: translateY(0) rotate(-12deg) scale(1); }
  50% { transform: translateY(-22px) rotate(14deg) scale(1.18); }
}

.shark-result-card {
  position: absolute;
  left: 50%;
  top: 8%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(620px, 74%);
  background: rgba(255,255,255,0.92);
  border: 7px solid #000;
  border-radius: 22px;
  padding: 14px 18px;
  text-align: center;
  box-shadow: 7px 7px 0 rgba(0,0,0,0.22);
}

.shark-result-card h3 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
}

.shark-result-card p {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 900;
}

.shark-result-card.running {
  background: #fff0a8;
}

.shark-result-card.fish-win {
  background: #b9ffb9;
}

.shark-result-card.shark-win {
  background: #ffb4b4;
}

.shark-control-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(260px, 0.8fr);
  gap: 14px;
  align-items: stretch;
}

.shark-slider-box,
.shark-action-buttons,
.shark-score-strip {
  background: #bff1ea;
  border: 7px solid #000;
  border-radius: 22px;
  padding: 13px;
  box-shadow: 7px 7px 0 rgba(0,0,0,0.22);
}

.shark-slider-box label {
  display: block;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 8px;
}

.shark-slider-box input[type="range"] {
  width: 100%;
  accent-color: #ff4fd8;
}

.shark-action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.shark-action-buttons button {
  min-width: 130px;
  height: 54px;
  font-size: 17px;
  font-weight: 900;
}

.shark-start-btn {
  background: #23d8ff;
}

.shark-save-btn {
  background: #78ff4f;
}

.shark-save-btn:disabled,
.shark-start-btn:disabled {
  background: #aaa;
  opacity: 0.65;
  cursor: not-allowed;
}

.shark-reset-btn {
  background: #ff9b42;
}

.shark-score-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fish-score-card,
.shark-score-card {
  background: #fff;
  border: 5px solid #000;
  border-radius: 16px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
}

.fish-score-card strong,
.shark-score-card strong {
  min-width: 36px;
  height: 36px;
  background: #d3ff00;
  border: 4px solid #000;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

@media (max-width: 1050px) {
  .shark-control-panel {
    grid-template-columns: 1fr;
  }

  .shark-action-buttons {
    flex-wrap: wrap;
  }

  .shark-result-card {
    width: min(520px, 86%);
  }
}

@media (max-width: 650px) {
  .shark-timer-top {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .fish-safe-zone {
    right: 3%;
    width: 130px;
    height: 130px;
  }

  .shark-result-card {
    top: 5%;
  }

  .shark-result-card h3 {
    font-size: 24px;
  }

  .shark-result-card p {
    font-size: 15px;
  }
}

/* =========================================================
   CONTROLS AT TOP FIX
   Keeps timer controls above the shark/fish scene.
========================================================= */

.shark-timer-game {
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

.shark-timer-top {
  grid-row: 1 !important;
}

.shark-control-panel {
  grid-row: 2 !important;
}

.shark-scene {
  grid-row: 3 !important;
}

/* Compact controls so the scene still gets more space */
.shark-control-panel {
  gap: 10px !important;
}

.shark-slider-box,
.shark-action-buttons,
.shark-score-strip {
  padding: 10px 12px !important;
}

.shark-action-buttons button {
  height: 48px !important;
}

.shark-slider-box label {
  margin-bottom: 4px !important;
}

@media (max-width: 1050px) {
  .shark-timer-game {
    grid-template-rows: auto auto minmax(0, 1fr) !important;
  }
}


/* backup for timer number box */
.timer-time-left,
.solid-timer-time-left,
.timer-count-box {
  width: 110px !important;
  min-width: 110px !important;
  height: 72px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px !important;
  line-height: 1 !important;
}