:root {
  --white: #ffffff;
  --mint: #eafbf1;
  --mint-2: #d8f5e4;
  --green-light: #a8f0c6;
  --green: #4fd88a;
  --green-dark: #1f9d5c;
  --green-deep: #146b40;
  --ink: #163a2b;
  --ink-soft: #4d6f5f;
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-strong: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.75);
  --shadow-green: rgba(31, 157, 92, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--white) 0%, var(--mint) 55%, var(--mint-2) 100%);
  overflow-x: hidden;
  position: relative;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
}

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--green-dark);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ---------- Floating bubble background ---------- */
.bubbles {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bubble {
  position: absolute;
  bottom: -140px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(168, 240, 198, 0.45) 55%,
      rgba(79, 216, 138, 0.12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(31, 157, 92, 0.08);
  animation: rise var(--dur) linear infinite;
  animation-delay: var(--delay);
  opacity: 0;
}

@keyframes rise {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: 0.9;
  }
  50% {
    transform: translate(var(--dx), -60vh) rotate(180deg);
  }
  92% {
    opacity: 0.7;
  }
  100% {
    transform: translate(calc(var(--dx) * -1), -125vh) rotate(360deg);
    opacity: 0;
  }
}

/* ---------- Layout ---------- */
.wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 48px 20px;
}

.glass-panel {
  width: 100%;
  max-width: 640px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  box-shadow: 0 12px 36px var(--shadow-green), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: 44px 40px;
  text-align: center;
}

/* ---------- Hero ---------- */
.eyebrow {
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  color: var(--green-dark);
  text-transform: uppercase;
}

.digits {
  margin: 6px 0 10px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: clamp(4.5rem, 17vw, 8.5rem);
  line-height: 1;
  color: var(--green-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 14px);
}

.digit {
  display: inline-block;
  animation: bob 3.4s ease-in-out infinite;
  animation-delay: calc(var(--d) * 0.18s);
  text-shadow: 0 6px 18px rgba(31, 157, 92, 0.25);
}

.bubble-o {
  width: 0.95em;
  height: 0.95em;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, var(--green-light) 55%, var(--green) 100%);
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.7), 0 10px 20px rgba(31, 157, 92, 0.25);
  color: transparent;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.04); }
}

.tagline {
  margin: 0 0 6px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
}

.subtext {
  margin: 0 0 30px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* ---------- Glass CTA button ---------- */
.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 34px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 26px var(--shadow-green), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 1rem;
  color: var(--green-dark);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn-home .btn-icon {
  transition: transform 0.25s ease;
}

.btn-home:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--green);
  box-shadow: 0 16px 34px rgba(31, 157, 92, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.btn-home:hover .btn-icon {
  transform: translateY(-2px);
}

.btn-home:active {
  transform: translateY(-1px) scale(0.98);
}

/* ---------- Game card ---------- */
.game-card {
  padding: 32px 28px 28px;
}

.game-head h2 {
  margin: 0 0 6px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
}

.game-sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

kbd {
  background: rgba(31, 157, 92, 0.12);
  border: 1px solid rgba(31, 157, 92, 0.3);
  border-radius: 6px;
  padding: 1px 7px;
  font-family: inherit;
  font-size: 0.85em;
  color: var(--green-dark);
}

.canvas-shell {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 0 0 1px rgba(31, 157, 92, 0.08), 0 8px 22px rgba(31, 157, 92, 0.12);
  line-height: 0;
}

#game {
  display: block;
  width: 100%;
  max-width: 700px;
  height: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.score-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green-deep);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.score-divider {
  opacity: 0.4;
}

.score-label {
  opacity: 0.55;
  font-size: 0.65rem;
}

.game-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.btn-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(216, 245, 228, 0.75));
  backdrop-filter: blur(10px);
  color: var(--green-dark);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 8px 18px var(--shadow-green);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-jump:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(31, 157, 92, 0.28);
}

.btn-jump:active {
  transform: translateY(0) scale(0.96);
}

.game-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .glass-panel {
    padding: 32px 22px;
    border-radius: 26px;
  }

  .digits {
    gap: 6px;
  }

  .btn-home {
    padding: 14px 26px;
    width: 100%;
    justify-content: center;
  }

  .game-card {
    padding: 26px 18px 22px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bubble {
    animation: none;
    opacity: 0.35;
  }

  .digit {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
