:root {
  --pink: #ff8eb0;
  --mint: #a5e6ba;
  --gold: #ffe14d;
  --ink: #3a5a4a;
  --muted: #5a7a6a;
}

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

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: "Jua", system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% 8%, #d0f0fd 0%, transparent 42%),
    radial-gradient(circle at 18% 78%, rgba(165, 230, 186, 0.4), transparent 34%),
    linear-gradient(160deg, #7eb8d8, #4a8a78);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.stage {
  position: relative;
  width: min(100vw, 430px, calc(100dvh * 0.629));
  aspect-ratio: 390 / 620;
  height: auto;
  max-height: 100dvh;
  max-width: 420px;
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.4),
    0 0 0 7px rgba(165, 230, 186, 0.22);
  background: #7ed89a;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  top: 10px;
  left: 8px;
  right: 8px;
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 6px;
  pointer-events: none;
  z-index: 3;
}

.panel {
  background: rgba(40, 90, 70, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  padding: 7px 9px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  box-shadow:
    0 4px 0 rgba(255, 225, 77, 0.4),
    0 10px 24px rgba(20, 60, 50, 0.16);
}

.panel.mid {
  align-items: center;
  text-align: center;
}

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

.panel b {
  color: var(--gold);
  text-shadow: 0 1px 8px rgba(255, 225, 77, 0.45);
}

.club-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  z-index: 4;
}

.club {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  padding: 10px 4px;
  font: inherit;
  font-size: 12px;
  min-height: 44px;
  color: #fff;
  background: rgba(40, 90, 70, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.club.on {
  background: linear-gradient(180deg, #c8f5d8, var(--mint));
  color: #2a5a3a;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 0 #5aaa78;
}

.club:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.power-bar {
  position: absolute;
  bottom: 14px;
  left: 24px;
  right: 24px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(30, 70, 55, 0.4);
  overflow: hidden;
  z-index: 3;
  pointer-events: none;
}

.power-bar.hidden {
  display: none;
}

.power-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--gold));
  border-radius: inherit;
  transition: width 0.04s linear;
}

.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 50% 10%, rgba(255, 255, 255, 0.85), transparent 26%),
    radial-gradient(circle at 15% 75%, rgba(165, 230, 186, 0.55), transparent 30%),
    radial-gradient(circle at 86% 30%, rgba(255, 225, 77, 0.35), transparent 27%),
    linear-gradient(180deg, rgba(208, 240, 253, 0.97), rgba(232, 250, 240, 0.98));
}

.overlay.hidden {
  display: none;
}

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

.badge.soft {
  background: linear-gradient(180deg, #ffe27a, #f0c040);
  color: #5a4a10;
  box-shadow: 0 4px 0 #c8a020;
}

.title-mascot {
  width: 140px;
  height: 160px;
  object-fit: contain;
  margin: -6px 0 -12px;
  filter: drop-shadow(0 14px 18px rgba(50, 100, 80, 0.28));
  animation: mascot-float 2s ease-in-out infinite;
}

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

h1 {
  margin: 0;
  font-family: "Bagel Fat One", "Jua", cursive;
  font-weight: 400;
  font-size: clamp(32px, 8.5vw, 44px);
  color: #3a9a6a;
  text-shadow:
    0 3px 0 #fff,
    0 9px 24px rgba(90, 180, 130, 0.22);
}

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

.tip {
  font-size: 15px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 13px 32px;
  font: inherit;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(180deg, #8edcb0, #4aaa78);
  box-shadow: 0 7px 0 #2a8060;
  cursor: pointer;
}

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

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