:root {
  --pink: #ff6b9d;
  --ink: #3d2a45;
  --muted: #6a8068;
  --grass: #a8e6a0;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: "Jua", system-ui, sans-serif;
  background: linear-gradient(180deg, #7ec8ff 0%, #b8e8ff 40%, #c8f5b8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.stage {
  position: relative;
  width: min(100vw, calc(100dvh * 0.629));
  height: min(100dvh, calc(100vw / 0.629));
  max-width: 420px;
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 24px 70px rgba(80, 140, 180, 0.35),
    0 0 0 6px rgba(118, 200, 130, 0.18);
  background: var(--grass);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 3;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
  min-width: 96px;
  box-shadow:
    0 4px 0 rgba(74, 158, 66, 0.2),
    0 8px 20px rgba(60, 100, 60, 0.14);
}

.panel.right {
  align-items: flex-end;
}

.panel b {
  color: #4a9e42;
  font-size: 16px;
}

.controls {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 4;
}

.pad-btn {
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  width: 58px;
  height: 52px;
  font-family: inherit;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(180deg, #ffb8d2, var(--pink));
  box-shadow:
    0 6px 0 #d93f74,
    0 10px 22px rgba(217, 63, 116, 0.22);
  cursor: pointer;
}

.pad-btn.big {
  width: 88px;
  font-size: 28px;
  background: linear-gradient(180deg, #c9ffad, #6fc86a);
  box-shadow:
    0 6px 0 #4a9e42,
    0 10px 22px rgba(74, 158, 66, 0.24);
}

.pad-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #d93f74;
}

.pad-btn.big:active {
  box-shadow: 0 2px 0 #4a9e42;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.65), transparent 24%),
    radial-gradient(circle at 82% 30%, rgba(255, 226, 122, 0.4), transparent 25%),
    linear-gradient(180deg, rgba(161, 230, 255, 0.97), rgba(221, 255, 204, 0.98));
}

.overlay.hidden {
  display: none;
}

.badge {
  display: inline-block;
  background: linear-gradient(180deg, #ff9ec4, var(--pink));
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  margin-bottom: 8px;
  box-shadow: 0 4px 0 #d93f74;
}

.badge.soft {
  background: linear-gradient(180deg, #b5ff9a, #6fc86a);
  box-shadow: 0 4px 0 #4a9e42;
}

.title-mascot {
  width: 116px;
  height: 116px;
  object-fit: contain;
  margin: -2px 0 -8px;
  filter: drop-shadow(0 10px 12px rgba(80, 110, 50, 0.2));
  animation: mascot-float 1.8s ease-in-out infinite;
}

@keyframes mascot-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-7px) rotate(2deg);
  }
}

h1 {
  margin: 0;
  font-family: "Bagel Fat One", "Jua", cursive;
  font-weight: 400;
  font-size: clamp(28px, 8vw, 40px);
  color: #388d4c;
  text-shadow:
    0 3px 0 #fff,
    0 8px 20px rgba(56, 141, 76, 0.2);
}

.overlay p {
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.title-controls {
  display: grid;
  gap: 5px;
  margin: -2px 0 14px;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 13px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 13px 32px;
  font: inherit;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(180deg, #ff9ec4, var(--pink));
  box-shadow: 0 6px 0 #d93f74;
  cursor: pointer;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #d93f74;
}

a {
  margin-top: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
