@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@700;900&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: radial-gradient(ellipse at top, #0d3320 0%, #060f08 70%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', cursive;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

/* ── Game wrapper ── */
#game-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 420px;
  padding: 16px 12px 24px;
}

/* ── Header ── */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

h1 {
  font-size: 1.9rem;
  color: #52b788;
  text-shadow: 0 3px 0 #1b4332, 0 0 24px rgba(82,183,136,0.45);
  letter-spacing: 1px;
}

#score-panel { display: flex; gap: 10px; }

.sbox {
  background: rgba(82,183,136,0.1);
  border: 2px solid #52b788;
  border-radius: 12px;
  padding: 4px 14px;
  text-align: center;
  min-width: 64px;
}

.slabel {
  font-family: 'Nunito', sans-serif;
  font-size: 0.58rem;
  color: #74c69d;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 900;
}

.sval {
  font-size: 1.4rem;
  color: #fff;
  line-height: 1.2;
}

/* ── Status bar ── */
#status-bar {
  background: rgba(82,183,136,0.08);
  border: 1.5px solid rgba(82,183,136,0.3);
  border-radius: 50px;
  padding: 8px 24px;
  width: 100%;
  text-align: center;
}

#status-text {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  color: #b7e4c7;
  font-weight: 900;
  letter-spacing: 0.3px;
}

/* ── Lily pad grid ── */
#pad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.pad {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid rgba(82,183,136,0.3);
  background: radial-gradient(circle at 35% 35%, #1b4332, #0d2218);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s, border-color 0.08s;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 -4px 12px rgba(0,0,0,0.4),
    0 4px 20px rgba(0,0,0,0.4);
}

/* Each pad has its own colour accent */
#pad-0 { border-color: rgba(74,222,128,0.35);  }
#pad-1 { border-color: rgba(251,191,36,0.35);  }
#pad-2 { border-color: rgba(96,165,250,0.35);  }
#pad-3 { border-color: rgba(251,113,133,0.35); }

/* Lily pad texture overlay */
.pad::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 70% 70%, rgba(82,183,136,0.08) 0%, transparent 60%),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06) 0%, transparent 40%);
  pointer-events: none;
}

/* Notch on each pad */
.pad::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, #0d2218 60%, transparent 100%);
  pointer-events: none;
}

.pad-emoji {
  font-size: 2.8rem;
  line-height: 1;
  z-index: 1;
  transition: transform 0.12s;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* ── Lit state (shown during sequence & correct tap) ── */
.pad.lit-0 {
  background: radial-gradient(circle at 35% 35%, #16a34a, #14532d);
  border-color: #4ade80;
  box-shadow: 0 0 30px rgba(74,222,128,0.7), inset 0 0 20px rgba(74,222,128,0.2);
  transform: scale(1.06);
}
.pad.lit-1 {
  background: radial-gradient(circle at 35% 35%, #d97706, #92400e);
  border-color: #fbbf24;
  box-shadow: 0 0 30px rgba(251,191,36,0.7), inset 0 0 20px rgba(251,191,36,0.2);
  transform: scale(1.06);
}
.pad.lit-2 {
  background: radial-gradient(circle at 35% 35%, #2563eb, #1e3a8a);
  border-color: #60a5fa;
  box-shadow: 0 0 30px rgba(96,165,250,0.7), inset 0 0 20px rgba(96,165,250,0.2);
  transform: scale(1.06);
}
.pad.lit-3 {
  background: radial-gradient(circle at 35% 35%, #e11d48, #881337);
  border-color: #fb7185;
  box-shadow: 0 0 30px rgba(251,113,133,0.7), inset 0 0 20px rgba(251,113,133,0.2);
  transform: scale(1.06);
}

/* Wrong flash */
.pad.wrong {
  background: radial-gradient(circle at 35% 35%, #7f1d1d, #450a0a) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 30px rgba(239,68,68,0.8) !important;
  transform: scale(0.95) !important;
}

/* Disabled during sequence */
.pad.disabled {
  pointer-events: none;
  opacity: 0.75;
}

/* ── Frog display ── */
#frog-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 72px;
}

#frog-emoji {
  font-size: 3rem;
  line-height: 1;
  transition: transform 0.15s;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4));
}

#frog-emoji.hop {
  transform: translateY(-12px) scale(1.15);
}

#frog-emoji.wobble {
  animation: wobble 0.4s ease;
}

@keyframes wobble {
  0%   { transform: rotate(0deg);    }
  20%  { transform: rotate(-14deg);  }
  40%  { transform: rotate(14deg);   }
  60%  { transform: rotate(-8deg);   }
  80%  { transform: rotate(8deg);    }
  100% { transform: rotate(0deg);    }
}

#frog-msg {
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: #74c69d;
  font-weight: 900;
  text-align: center;
  min-height: 22px;
}

/* ── Progress dots ── */
#progress-bar {
  display: flex;
  justify-content: center;
  min-height: 16px;
}

#progress-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(82,183,136,0.25);
  border: 1.5px solid rgba(82,183,136,0.4);
  transition: background 0.2s, transform 0.15s;
}

.dot.done {
  background: #52b788;
  border-color: #4ade80;
  transform: scale(1.2);
}

.dot.active {
  background: #ffd166;
  border-color: #fbbf24;
  transform: scale(1.3);
}

/* ── Overlay ── */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6,15,8,0.92);
  z-index: 30;
  gap: 12px;
  padding: 28px 24px;
  backdrop-filter: blur(5px);
  border-radius: 16px;
}

#ov-emoji { font-size: 3.6rem; line-height: 1; }

#ov-title {
  font-size: 2.3rem;
  color: #52b788;
  text-shadow: 0 3px 0 #1b4332;
  text-align: center;
}

#ov-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: #b7e4c7;
  text-align: center;
  line-height: 1.6;
  font-weight: 700;
}

#result-box {
  display: none;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(82,183,136,0.35);
  border-radius: 14px;
  padding: 10px 32px;
  gap: 3px;
  margin: 4px 0;
}

#res-round {
  font-size: 1.8rem;
  color: #ffd166;
}

#res-best {
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  color: #b7e4c7;
  font-weight: 700;
}

#play-btn {
  background: #52b788;
  color: #1b4332;
  border: none;
  border-radius: 50px;
  padding: 13px 40px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #2d6a4f, 0 10px 24px rgba(0,0,0,0.35);
  transition: transform 0.1s, box-shadow 0.1s;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
}

#play-btn:active { transform: translateY(3px);  box-shadow: 0 3px 0 #2d6a4f; }