:root {
  --pink: #ff2d95;
  --pink-hot: #ff0a7a;
  --pink-soft: #ff8cc6;
  --ink: #2a0a22;
  --cream: #fff4fa;
  --mint: #3cf0c4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--ink);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--cream);
}

.stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--ink);
}

@media (min-width: 520px) {
  .stage {
    height: min(100dvh, 860px);
    margin-top: max(0px, calc((100dvh - 860px) / 2));
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(255, 45, 149, .25), 0 0 0 1px rgba(255, 140, 198, .15);
  }
}

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

.hud {
  position: absolute;
  inset: 0 0 auto 0;
  padding-top: calc(env(safe-area-inset-top) + 28px);
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
}
.hud.show { opacity: 1; }

.score {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  color: #fff;
  text-shadow: 0 4px 0 var(--pink-hot), 0 8px 24px rgba(0,0,0,.35);
  font-variant-numeric: tabular-nums;
}
.score.bump { animation: bump .22s ease-out; }
@keyframes bump { 40% { transform: scale(1.25); } }

.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .3s, transform .3s cubic-bezier(.2,1.4,.4,1);
}
.panel.show { opacity: 1; pointer-events: auto; transform: none; }

.logo {
  font-size: 68px;
  font-weight: 900;
  letter-spacing: -3px;
  line-height: .9;
  color: #fff;
  text-shadow: 0 5px 0 var(--pink-hot), 0 12px 30px rgba(255, 10, 122, .5);
  animation: wobble 2.4s ease-in-out infinite;
}
.logo span:last-child { color: var(--pink-soft); }
@keyframes wobble {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.04, .97); }
}

.tag {
  font-size: 16px;
  font-weight: 600;
  opacity: .8;
  margin-bottom: 150px;
}

.btn {
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: var(--pink);
  border: 0;
  border-radius: 999px;
  padding: 16px 38px;
  box-shadow: 0 6px 0 #b8005a, 0 14px 30px rgba(255, 45, 149, .45);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b8005a, 0 8px 18px rgba(255, 45, 149, .4); }

.best, .hint { font-size: 14px; opacity: .7; font-weight: 600; }
.best b { color: var(--pink-soft); }

#over { background: rgba(42, 10, 34, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

.dead {
  font-size: 76px;
  font-weight: 900;
  letter-spacing: -3px;
  color: var(--pink);
  text-shadow: 0 5px 0 #7a0040, 0 0 40px rgba(255, 45, 149, .6);
  transform: rotate(-6deg);
}
.panel.show .dead { animation: splatIn .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes splatIn { from { transform: rotate(-6deg) scale(2.2, .3); opacity: 0; } }

.quip { font-size: 16px; font-weight: 600; opacity: .85; min-height: 20px; }

.cards { display: flex; gap: 12px; }
.card {
  width: 118px;
  padding: 14px 10px;
  border-radius: 20px;
  background: rgba(255, 244, 250, .1);
  border: 1px solid rgba(255, 140, 198, .3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card small { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; opacity: .7; font-weight: 700; }
.card b { font-size: 40px; font-weight: 900; font-variant-numeric: tabular-nums; }

.medal { font-size: 15px; font-weight: 800; color: var(--mint); min-height: 18px; }
