/* classroomGames/frogjump.css */

.frogjump-game {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  color: #000;
  font-family: "Fredoka", Arial, sans-serif;
}

.frogjump-top-panel {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 230px 150px;
  gap: 12px;
  align-items: center;
  background: #f0e6ff;
  border: 7px solid #000;
  border-radius: 22px;
  padding: 12px 16px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.22);
}

.frogjump-title-box h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.frogjump-title-box p {
  margin: 5px 0 0;
  font-size: 15px;
  font-weight: 900;
}

.frogjump-leader-box {
  background: #d3ff00;
  border: 5px solid #000;
  border-radius: 16px;
  padding: 8px 12px;
  text-align: center;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.22);
}

.frogjump-leader-box span {
  display: block;
  font-size: 12px;
  font-weight: 900;
}

.frogjump-leader-box strong {
  display: block;
  font-size: 18px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.frogjump-reset-btn {
  width: 100%;
  height: 56px;
  background: #ff9b42;
  font-size: 18px;
  font-weight: 900;
}

.frogjump-name-controls {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 9px;
  -webkit-overflow-scrolling: touch;
}

.frogjump-name-btn {
  flex: 0 0 auto;
  min-width: 160px;
  height: 66px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  background: #4cff7b;
  border: 5px solid #000;
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.25);
  font-family: "Fredoka", Arial, sans-serif;
  font-weight: 900;
  touch-action: manipulation;
}

.frogjump-name-btn strong {
  font-size: 20px;
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: left;
}

.frogjump-name-btn span {
  min-width: 52px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 4px solid #000;
  border-radius: 12px;
  font-size: 16px;
}

.frogjump-name-btn:hover:not(:disabled) {
  background: #23d8ff;
  transform: translateY(-3px) scale(1.02);
}

.frogjump-name-btn.just-jumped {
  animation: frogjumpButtonPop 0.34s ease;
}

.frogjump-name-btn.finished {
  background: #fff0a8;
  opacity: 0.9;
}

.frogjump-pond-panel {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,0.5), transparent 8%),
    radial-gradient(circle at 72% 12%, rgba(255,255,255,0.36), transparent 9%),
    radial-gradient(circle at 84% 82%, rgba(255,255,255,0.4), transparent 8%),
    linear-gradient(180deg, #83e9ff 0%, #32c6e2 50%, #2ba7d8 100%);
  border: 8px solid #000;
  border-radius: 26px;
  box-shadow: inset -7px -7px 0 rgba(0,0,0,0.13);
}

.frogjump-water-shine {
  position: absolute;
  width: 170px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,0.48);
  border: 4px solid rgba(0,0,0,0.25);
  opacity: 0.42;
  pointer-events: none;
  animation: frogjumpWaterFloat 9s ease-in-out infinite;
}

.shine-one { left: 8%; top: 12%; animation-delay: -1s; }
.shine-two { left: 45%; top: 18%; animation-delay: -4s; transform: scale(0.7); }
.shine-three { left: 20%; bottom: 11%; animation-delay: -6s; transform: scale(0.85); }

.frogjump-finish-gate {
  position: absolute;
  right: 2.2%;
  top: 7%;
  bottom: 7%;
  width: 86px;
  z-index: 4;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: repeating-linear-gradient(
    45deg,
    #fff 0 14px,
    #d3ff00 14px 28px
  );
  border: 7px solid #000;
  border-radius: 20px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.frogjump-finish-gate span {
  font-size: 38px;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.25));
}

.frogjump-finish-gate strong {
  transform: rotate(90deg);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  background: #fff;
  border: 4px solid #000;
  border-radius: 12px;
  padding: 6px 10px;
}

.frogjump-lanes {
  position: absolute;
  inset: 22px 116px 22px 22px;
  display: grid;
  grid-template-rows: repeat(auto-fit, minmax(112px, 1fr));
  gap: 12px;
  z-index: 5;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.frogjump-lane {
  position: relative;
  min-height: 112px;
  background:
    linear-gradient(90deg, hsla(var(--lane-hue), 95%, 84%, 0.8), rgba(255,255,255,0.5));
  border: 6px solid #000;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.18);
}

.frogjump-lane.finished {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.55), transparent 26%),
    linear-gradient(90deg, #fff0a8, #d3ff00);
}

.frogjump-lane-name {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 7;
  max-width: 170px;
  background: #fff;
  border: 4px solid #000;
  border-radius: 14px;
  padding: 5px 9px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

.frogjump-stones {
  position: absolute;
  left: 70px;
  right: 34px;
  top: 52%;
  height: 54px;
  transform: translateY(-50%);
  z-index: 3;
}

.frogjump-stones::before {
  content: "";
  position: absolute;
  left: 3%;
  right: 5%;
  top: 50%;
  height: 9px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
  border: 3px solid rgba(0,0,0,0.25);
}

.frogjump-stone {
  position: absolute;
  left: var(--stone-left);
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: #bbf7aa;
  border: 4px solid #000;
  border-radius: 50% 46% 53% 44%;
  font-size: 13px;
  font-weight: 900;
  color: rgba(0,0,0,0.72);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

.frogjump-stone:nth-child(2n) {
  border-radius: 47% 55% 44% 53%;
  background: #d3ff00;
}

.frogjump-stone.passed {
  background: #47ff75;
}

.frogjump-stone.active {
  background: #fff0a8;
  animation: frogjumpStonePulse 0.7s ease infinite alternate;
}

.frogjump-stone.finish {
  width: 52px;
  height: 52px;
  font-size: 22px;
  background: #ffe066;
}

.frogjump-frog {
  position: absolute;
  left: var(--frog-x);
  top: 50%;
  width: 86px;
  height: 92px;
  transform: translate(-50%, -54%);
  z-index: 8;
  transition: left 0.46s cubic-bezier(.18,.9,.22,1.25);
}

.frogjump-frog.jumping {
  animation: frogjumpHop 0.48s ease;
}

.frogjump-frog.finished {
  animation: frogjumpWinnerWiggle 0.95s ease-in-out infinite;
}

.frogjump-frog-shadow {
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 72px;
  height: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.26);
  border-radius: 50%;
  filter: blur(1px);
}

.frogjump-frog-body {
  position: absolute;
  left: 50%;
  top: 0;
  width: 78px;
  height: 70px;
  transform: translateX(-50%);
  background: #4cff7b;
  border: 6px solid #000;
  border-radius: 45% 45% 38% 38%;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.25);
}

.frogjump-frog-body::before,
.frogjump-frog-body::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 19px;
  height: 17px;
  background: #38d861;
  border: 4px solid #000;
  border-radius: 50%;
  z-index: -1;
}

.frogjump-frog-body::before { left: -14px; transform: rotate(-25deg); }
.frogjump-frog-body::after { right: -14px; transform: rotate(25deg); }

.frogjump-frog-eyes {
  position: absolute;
  left: 50%;
  top: -18px;
  width: 64px;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.frogjump-frog-eyes span {
  width: 26px;
  height: 26px;
  background: #fff;
  border: 5px solid #000;
  border-radius: 50%;
  position: relative;
}

.frogjump-frog-eyes span::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
}

.frogjump-frog-face {
  position: absolute;
  left: 50%;
  top: 17px;
  width: 44px;
  height: 44px;
  transform: translateX(-50%);
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 4px solid #000;
  display: grid;
  place-items: center;
}

.frogjump-student-photo {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  background: #fff !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
}

.frogjump-student-photo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.frogjump-student-photo span {
  font-size: 23px;
}

.frogjump-frog-feet {
  position: absolute;
  left: 50%;
  bottom: -15px;
  width: 86px;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
}

.frogjump-frog-feet span {
  width: 29px;
  height: 18px;
  background: #38d861;
  border: 4px solid #000;
  border-radius: 50%;
}

.frogjump-frog.jumping .frogjump-frog-feet span:first-child {
  animation: frogjumpFootLeft 0.42s ease;
}

.frogjump-frog.jumping .frogjump-frog-feet span:last-child {
  animation: frogjumpFootRight 0.42s ease;
}

.frogjump-frog-name {
  position: absolute;
  left: 50%;
  bottom: -21px;
  transform: translateX(-50%);
  max-width: 120px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

.frogjump-score-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 8;
  min-width: 58px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 4px solid #000;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

.frogjump-celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  overflow: hidden;
  background: rgba(171, 255, 217, 0.24);
  animation: frogjumpOverlayPop 0.22s ease;
}

.frogjump-celebration-overlay.fade-out {
  animation: frogjumpOverlayFade 1s ease forwards;
}

.frogjump-celebration-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 82vw);
  background: #fff0a8;
  border: 9px solid #000;
  border-radius: 34px;
  padding: 30px;
  text-align: center;
  box-shadow: 18px 18px 0 rgba(0,0,0,0.28);
  animation: frogjumpCelebrationCard 0.7s cubic-bezier(.18,.85,.18,1.25);
}

.frogjump-celebration-frog {
  font-size: 74px;
  line-height: 1;
  animation: frogjumpWinnerWiggle 0.72s ease-in-out infinite;
}

.frogjump-celebration-place {
  position: absolute;
  right: 24px;
  top: 20px;
  background: #4cff7b;
  border: 6px solid #000;
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 30px;
  font-weight: 900;
}

.frogjump-celebration-card h2 {
  margin: 8px 0 8px;
  font-size: clamp(36px, 5vw, 66px);
  font-weight: 900;
  line-height: 0.95;
}

.frogjump-celebration-card p {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}

.frogjump-celebration-piece {
  position: absolute;
  top: -10%;
  left: var(--left);
  font-size: calc(32px * var(--scale));
  animation: frogjumpConfettiFall var(--duration) linear var(--delay) forwards;
  transform: rotate(var(--rotate));
}

@keyframes frogjumpButtonPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.08) rotate(-1.5deg); }
  100% { transform: scale(1); }
}

@keyframes frogjumpWaterFloat {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(28px) scale(1.06); }
}

@keyframes frogjumpStonePulse {
  from { transform: translate(-50%, -50%) scale(1); }
  to { transform: translate(-50%, -50%) scale(1.12); }
}

@keyframes frogjumpHop {
  0% { transform: translate(-50%, -54%) scale(1); }
  32% { transform: translate(-50%, -104%) scale(1.08, 0.92) rotate(-3deg); }
  65% { transform: translate(-50%, -75%) scale(0.95, 1.08) rotate(3deg); }
  100% { transform: translate(-50%, -54%) scale(1); }
}

@keyframes frogjumpWinnerWiggle {
  0%, 100% { transform: translate(-50%, -54%) rotate(-3deg); }
  50% { transform: translate(-50%, -61%) rotate(3deg); }
}

@keyframes frogjumpFootLeft {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(25deg) translateX(-4px); }
}

@keyframes frogjumpFootRight {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(-25deg) translateX(4px); }
}

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

@keyframes frogjumpOverlayFade {
  to { opacity: 0; }
}

@keyframes frogjumpCelebrationCard {
  0% { transform: translate(-50%, -50%) scale(0.45) rotate(-8deg); }
  70% { transform: translate(-50%, -50%) scale(1.08) rotate(3deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes frogjumpConfettiFall {
  0% { transform: translateY(-10vh) rotate(0deg) scale(var(--scale)); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(115vh) rotate(var(--rotate)) scale(var(--scale)); opacity: 0.92; }
}

@media (max-width: 900px) {
  .frogjump-top-panel {
    grid-template-columns: 1fr 160px;
  }

  .frogjump-reset-btn {
    grid-column: 1 / -1;
  }

  .frogjump-lanes {
    inset: 18px 100px 18px 16px;
  }

  .frogjump-lane-name {
    max-width: 120px;
    font-size: 14px;
  }
}

@media (max-width: 650px) {
  .frogjump-top-panel {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .frogjump-title-box h2 {
    font-size: 24px;
  }

  .frogjump-title-box p {
    font-size: 13px;
  }

  .frogjump-name-btn {
    min-width: 138px;
    height: 60px;
  }

  .frogjump-name-btn strong {
    font-size: 17px;
  }

  .frogjump-finish-gate {
    width: 64px;
  }

  .frogjump-lanes {
    inset: 14px 78px 14px 12px;
  }

  .frogjump-frog {
    width: 72px;
    height: 78px;
  }

  .frogjump-frog-body {
    width: 64px;
    height: 58px;
  }

  .frogjump-frog-eyes {
    width: 54px;
  }

  .frogjump-frog-eyes span {
    width: 22px;
    height: 22px;
  }

  .frogjump-frog-face {
    top: 14px;
    width: 35px;
    height: 35px;
  }

  .frogjump-stone {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }

  .frogjump-stone.finish {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}
