:root {
  --sky: #7ec8f0;
  --sky-deep: #5bb0e0;
  --ink: #2f4050;
  --muted: #5a6e82;
  --accent: #ff8a3a;
  --gold: #ffd76a;
  --grass: #7bc96f;
}

* {
  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: #142838;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.stage {
  position: relative;
  width: min(100vw, calc(100dvh * 0.557));
  height: min(100dvh, calc(100vw / 0.557));
  max-width: 420px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  background: var(--sky);
}

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

.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(30, 55, 80, 0.42);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 8px 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  min-width: 96px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

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

.panel b {
  font-size: 16px;
}

.goal-meter {
  position: absolute;
  top: 72px;
  left: 12px;
  right: 12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.goal-meter > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffe27a, #ff9a4a, #7bc96f);
  border-radius: inherit;
  transition: width 0.15s ease;
}

.hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  white-space: nowrap;
}

.hint.show {
  opacity: 1;
}

.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(ellipse at 70% 8%, rgba(255, 230, 140, 0.55), transparent 42%),
    radial-gradient(ellipse at 20% 20%, rgba(255, 255, 255, 0.45), transparent 40%),
    linear-gradient(180deg, rgba(110, 200, 248, 0.92), rgba(200, 236, 170, 0.95) 70%, rgba(255, 244, 210, 0.97));
}

.overlay.hidden {
  display: none;
}

/* floating chick — no square card / frame */
.hero-art {
  width: min(52vw, 196px);
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 6px;
  filter: drop-shadow(0 14px 18px rgba(40, 80, 120, 0.35));
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  margin-bottom: 8px;
}

.badge.soft {
  background: var(--gold);
  color: #5a4018;
}

h1 {
  margin: 0;
  font-family: "Bagel Fat One", "Jua", cursive;
  font-weight: 400;
  font-size: clamp(34px, 9vw, 46px);
  color: var(--accent);
  text-shadow: 0 3px 0 #fff;
}

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

.rank-form {
  width: min(280px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.rank-form label {
  font-size: 13px;
  color: var(--muted);
}

.rank-form input {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.rank-msg {
  min-height: 1.2em;
  font-size: 13px !important;
  color: #2f7a45 !important;
}

.icons {
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--muted);
}

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

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

.btn.soft {
  color: #fff;
  background: linear-gradient(180deg, #9ed4ff, #5b9fff);
  box-shadow: 0 7px 0 #3a78c0;
}

.btn.soft:active {
  box-shadow: 0 4px 0 #3a78c0;
}

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