:root {
  --cherry: #edafb8;
  --petal: #f7e1d7;
  --dust: #dedbd2;
  --ash: #b0c4b1;
  --iron: #4a5759;
  --cherry-dark: #d9909b;
  --font: 'Fredoka', 'Varela Round', ui-rounded, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--petal) 0%, #efd6d3 60%, var(--dust) 100%);
  color: var(--iron);
  font-family: var(--font);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* ---------- screens & cards ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  pointer-events: auto;
  overflow-y: auto;
}

#screen-results,
#screen-lost {
  background: rgba(74, 87, 89, 0.25);
  backdrop-filter: blur(3px);
}

.card {
  width: 100%;
  max-width: 360px;
  background: rgba(247, 225, 215, 0.94);
  border: 3px solid #fff;
  border-radius: 32px;
  padding: 26px 22px 22px;
  box-shadow: 0 10px 0 rgba(74, 87, 89, 0.12), 0 20px 40px rgba(74, 87, 89, 0.15);
  text-align: center;
  animation: pop-in 0.35s cubic-bezier(0.3, 1.6, 0.6, 1);
}

@keyframes pop-in {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}

.logo {
  font-size: 54px;
  font-weight: 700;
  margin: 0;
  color: var(--cherry-dark);
  letter-spacing: 1px;
  text-shadow: 0 4px 0 #fff, 0 6px 0 rgba(74, 87, 89, 0.12);
  animation: wobble 3s ease-in-out infinite;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg) scale(1.03); }
}

.sub {
  margin: 4px 0 22px;
  opacity: 0.7;
}

h2 {
  margin: 0 0 14px;
  font-size: 30px;
  font-weight: 600;
}

.label {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.6;
}

.hint {
  font-size: 14px;
  opacity: 0.65;
  margin: 10px 0 0;
}

.error {
  color: #c1546a;
  min-height: 1.2em;
  margin: 10px 0 0;
}

/* ---------- inputs & buttons ---------- */
input {
  width: 100%;
  font: inherit;
  font-size: 20px;
  color: var(--iron);
  text-align: center;
  padding: 13px 14px;
  border-radius: 18px;
  border: 3px solid var(--dust);
  background: #fff;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

input:focus {
  border-color: var(--cherry);
}

#code {
  text-transform: uppercase;
  letter-spacing: 6px;
  font-weight: 600;
}

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 18px;
  color: var(--iron);
  border: none;
  border-radius: 18px;
  padding: 13px 18px;
  background: var(--cherry);
  box-shadow: 0 5px 0 var(--cherry-dark);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  pointer-events: auto;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--cherry-dark);
}

.btn:disabled {
  opacity: 0.5;
}

.btn.big {
  width: 100%;
  font-size: 22px;
  padding: 16px;
  margin-top: 14px;
}

.btn.alt {
  background: var(--ash);
  box-shadow: 0 5px 0 #8fa690;
}

.btn.small {
  font-size: 15px;
  padding: 9px 14px;
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  opacity: 0.75;
  margin-top: 8px;
}

.row {
  display: flex;
  gap: 10px;
}

.row input {
  flex: 1;
  min-width: 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
  opacity: 0.55;
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--dust);
  border-radius: 2px;
}

#name {
  margin-bottom: 0;
}

/* ---------- lobby ---------- */
.code {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 10px;
  margin: 2px 0 0 10px;
  color: var(--iron);
}

.link {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: 0.55;
}

.players {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  text-align: left;
}

.players li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: #fff;
  border-radius: 16px;
  border: 2px solid var(--dust);
  animation: pop-in 0.3s cubic-bezier(0.3, 1.6, 0.6, 1);
}

.blob {
  position: relative;
  flex: none;
  width: 34px;
  height: 28px;
  border-radius: 50% 50% 46% 46%;
  background: var(--c);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
}

.blob::before,
.blob::after {
  content: '';
  position: absolute;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 60%, var(--iron) 0 2.6px, #fff 3px);
}

.blob::before {
  left: 7px;
}

.blob::after {
  right: 7px;
}

.pname {
  font-weight: 500;
  font-size: 18px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  font: inherit;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--dust);
  color: var(--iron);
  border: none;
}

.tag.me {
  background: var(--cherry);
}

button.tag {
  pointer-events: auto;
  cursor: pointer;
}

.pscore {
  font-weight: 600;
  min-width: 2ch;
  text-align: right;
}

/* ---------- intro (gesture animation) ---------- */
.intro {
  text-align: center;
  background: rgba(247, 225, 215, 0.94);
  border: 3px solid #fff;
  border-radius: 32px;
  padding: 22px 24px 24px;
  box-shadow: 0 10px 0 rgba(74, 87, 89, 0.12), 0 20px 40px rgba(74, 87, 89, 0.15);
  animation: pop-in 0.4s cubic-bezier(0.3, 1.6, 0.6, 1);
}

.intro h2 {
  font-size: 44px;
  margin: 4px 0 18px;
  color: var(--iron);
  text-shadow: 0 3px 0 #fff;
}

.intro-hint {
  font-size: 19px;
  max-width: 280px;
  margin: 18px auto 0;
}

.phone {
  position: relative;
  width: 200px;
  height: 130px;
  margin: 0 auto;
  border-radius: 26px;
  border: 6px solid var(--iron);
  background: var(--petal);
  display: flex;
  overflow: hidden;
  box-shadow: 0 8px 0 rgba(74, 87, 89, 0.2);
}

.phone .half {
  flex: 1;
  transition: background 0.1s;
}

.phone .half.l {
  border-right: 2px dashed var(--dust);
  animation: half-l 1.6s infinite;
}

.phone .half.r {
  animation: half-r 1.6s infinite;
}

.finger {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--iron);
  top: 44px;
  animation: finger 1.6s infinite;
}

@keyframes finger {
  0% { left: 34px; transform: scale(1); }
  5% { left: 34px; transform: scale(0.75); }
  15% { left: 34px; transform: scale(1); }
  45% { left: 34px; transform: scale(1); }
  50% { left: 120px; transform: scale(1); }
  55% { left: 120px; transform: scale(0.75); }
  65% { left: 120px; transform: scale(1); }
  95% { left: 120px; transform: scale(1); }
  100% { left: 34px; transform: scale(1); }
}

@keyframes half-l {
  0%, 4% { background: var(--petal); }
  6%, 18% { background: var(--cherry); }
  30%, 100% { background: var(--petal); }
}

@keyframes half-r {
  0%, 54% { background: var(--petal); }
  56%, 68% { background: var(--cherry); }
  80%, 100% { background: var(--petal); }
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pill {
  background: rgba(247, 225, 215, 0.92);
  border: 3px solid #fff;
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 24px;
  font-weight: 600;
  box-shadow: 0 4px 0 rgba(74, 87, 89, 0.12);
  min-width: 64px;
  text-align: center;
}

.pill.small {
  font-size: 18px;
  display: flex;
  align-items: center;
}

.flash {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  opacity: 0;
  pointer-events: none;
}

.flash.l {
  left: 0;
  background: linear-gradient(90deg, rgba(237, 175, 184, 0.55), transparent);
}

.flash.r {
  right: 0;
  background: linear-gradient(270deg, rgba(237, 175, 184, 0.55), transparent);
}

.flash.on {
  animation: flash 0.25s ease-out;
}

@keyframes flash {
  from { opacity: 1; }
  to { opacity: 0; }
}

#countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 6px 0 var(--cherry-dark), 0 10px 20px rgba(74, 87, 89, 0.3);
}

#countdown.go {
  animation: count 0.9s cubic-bezier(0.3, 1.6, 0.6, 1) forwards;
}

@keyframes count {
  0% { transform: scale(0.3); opacity: 0; }
  25% { transform: scale(1.1); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}

.toast {
  position: absolute;
  left: 50%;
  bottom: max(40px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(247, 225, 215, 0.95);
  border: 3px solid #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(74, 87, 89, 0.12);
  animation: pop-in 0.3s cubic-bezier(0.3, 1.6, 0.6, 1);
}

#ping {
  position: absolute;
  right: 10px;
  bottom: max(6px, env(safe-area-inset-bottom));
  font-size: 11px;
  opacity: 0.45;
}

/* ---------- results ---------- */
.results li {
  gap: 8px;
}

.medal {
  width: 1.6em;
  text-align: center;
  font-size: 20px;
}

.plus {
  color: #6f8f72;
  font-weight: 600;
}

.fruit-count {
  font-size: 13px;
  opacity: 0.6;
}

/* ---------- game picker ---------- */
.small-gap {
  margin-top: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 6px 0 4px;
}

.chip {
  font: inherit;
  font-size: 15px;
  padding: 7px 12px;
  border-radius: 14px;
  border: 2px solid var(--dust);
  background: #fff;
  color: var(--iron);
  pointer-events: auto;
}

.chip.on {
  background: var(--cherry);
  border-color: var(--cherry-dark);
}

.chip:disabled {
  opacity: 1;
}

.chip:disabled:not(.on) {
  opacity: 0.5;
}

/* ---------- intro: hold & release ---------- */
.phone .charge {
  display: none;
}

.phone[data-gesture='hold'] .half {
  animation: none;
}

.phone[data-gesture='hold'] .half.l {
  border-right: none;
}

.phone[data-gesture='hold'] .finger {
  left: 77px;
  animation: finger-hold 1.8s infinite;
}

.phone[data-gesture='hold'] .charge {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  border-radius: 50%;
  border: 5px solid var(--cherry);
  animation: charge 1.8s infinite;
}

@keyframes finger-hold {
  0% { transform: scale(1); }
  8%, 65% { transform: scale(0.75); }
  70%, 100% { transform: scale(1); }
}

@keyframes charge {
  0%, 8% { transform: scale(0.3); opacity: 0; }
  12% { transform: scale(0.35); opacity: 1; }
  65% { transform: scale(1); opacity: 1; border-color: var(--cherry-dark); }
  70% { transform: scale(1.4); opacity: 0.8; border-color: #fff; }
  85%, 100% { transform: scale(1.8); opacity: 0; }
}

/* ---------- spectator banner ---------- */
.spectate {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 54px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  animation: pop-in 0.3s cubic-bezier(0.3, 1.6, 0.6, 1);
}

/* ---------- intro: drag & release ---------- */
.phone[data-gesture='drag'] .half {
  animation: none;
}

.phone[data-gesture='drag'] .half.l {
  border-right: none;
}

.phone[data-gesture='drag'] .finger {
  animation: finger-drag 2s infinite;
}

.phone[data-gesture='drag'] .charge {
  display: block;
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cherry-dark);
  animation: shot 2s infinite;
}

@keyframes finger-drag {
  0% { left: 100px; top: 30px; transform: scale(1); }
  10% { left: 100px; top: 30px; transform: scale(0.8); }
  55% { left: 40px; top: 70px; transform: scale(0.8); }
  62%, 100% { left: 40px; top: 70px; transform: scale(1); opacity: 0.4; }
}

@keyframes shot {
  0%, 57% { left: 109px; top: 39px; opacity: 0; }
  60% { left: 109px; top: 39px; opacity: 1; }
  85% { left: 200px; top: -10px; opacity: 1; }
  86%, 100% { opacity: 0; }
}

.summary {
  margin: -6px 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--cherry-dark);
}

.results .pname {
  white-space: normal;
}

.results .fruit-count {
  white-space: nowrap;
}

/* ---------- intro: simple tap ---------- */
.phone[data-gesture='tap'] .half {
  animation: none;
}

.phone[data-gesture='tap'] .half.l {
  border-right: none;
}

.phone[data-gesture='tap'] .finger {
  left: 77px;
  animation: finger-tap 0.5s infinite;
}

@keyframes finger-tap {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(0.72); }
}

/* ---------- rhythm overlay ---------- */
#game-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rh {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rh-title {
  margin-top: calc(max(12px, env(safe-area-inset-top)) + 64px);
  font-size: 32px;
  font-weight: 700;
  color: var(--iron);
  text-shadow: 0 3px 0 #fff;
}

.rh-count {
  font-size: 90px;
  font-weight: 700;
  color: #fff;
  height: 110px;
  text-shadow: 0 5px 0 var(--cherry-dark), 0 10px 20px rgba(74, 87, 89, 0.25);
}

.rh-count.bump {
  animation: count-bump 0.4s cubic-bezier(0.3, 1.6, 0.6, 1);
}

@keyframes count-bump {
  from { transform: scale(0.4); opacity: 0.3; }
}

.rh-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: max(24px, env(safe-area-inset-bottom));
  background: rgba(247, 225, 215, 0.94);
  border: 3px solid #fff;
  border-radius: 24px;
  padding: 14px 16px 10px;
  box-shadow: 0 6px 0 rgba(74, 87, 89, 0.12);
}

.rh-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rh-tag {
  font-size: 20px;
  width: 26px;
}

.rh-lane {
  position: relative;
  flex: 1;
  height: 34px;
  border-radius: 17px;
  background: #fff;
  border: 2px solid var(--dust);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.rh-dot {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: var(--cherry-dark);
  animation: pop-in 0.25s cubic-bezier(0.3, 1.6, 0.6, 1);
}

.rh-dot.mine {
  background: var(--ash);
  border: 3px solid #8fa690;
}

.rh-ghost {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px dashed var(--dust);
}

.rh-sub {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  min-height: 1.3em;
}

.rh-lanes {
  position: relative;
}

.rh-head {
  display: none;
  position: absolute;
  top: -4px;
  bottom: 4px;
  width: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--iron);
  opacity: 0.55;
}

.rh-dot.faint {
  background: var(--dust);
  animation: none;
}

/* ---------- big centered UI (clock, reaction) ---------- */
.big-ui {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(max(12px, env(safe-area-inset-top)) + 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 16px;
}

.big-title {
  font-size: 26px;
  font-weight: 600;
  text-shadow: 0 3px 0 #fff;
}

.big-clock {
  font-size: 76px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 5px 0 var(--cherry-dark), 0 10px 20px rgba(74, 87, 89, 0.25);
  min-height: 1.2em;
}

.big-clock.hidden-time {
  color: var(--dust);
  text-shadow: 0 5px 0 rgba(74, 87, 89, 0.3);
}

.big-sub {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 600;
  background: rgba(247, 225, 215, 0.92);
  border-radius: 16px;
  padding: 4px 14px;
}

.big-sub:empty {
  display: none;
}

.react-bg {
  position: absolute;
  inset: 0;
  transition: background 0.05s;
}

.react-bg.wait {
  background: rgba(237, 175, 184, 0.25);
}

.react-bg.go {
  background: rgba(124, 198, 141, 0.55);
  transition: none;
}

/* ---------- light (green/red) ---------- */
.light-pill {
  font-size: 30px;
  font-weight: 700;
  padding: 6px 22px;
  border-radius: 24px;
  border: 3px solid #fff;
  color: #fff;
  box-shadow: 0 5px 0 rgba(74, 87, 89, 0.15);
}

.light-pill:empty {
  display: none;
}

.light-pill.green {
  background: #7cc68d;
}

.light-pill.red {
  background: #d9606f;
  animation: pop-in 0.2s cubic-bezier(0.3, 1.6, 0.6, 1);
}

/* ---------- rockets fuel gauge ---------- */
.fuel {
  display: none;
  position: absolute;
  right: 18px;
  top: 30%;
  width: 46px;
  height: 40%;
  border-radius: 23px;
  border: 4px solid #fff;
  background: linear-gradient(0deg, rgba(222, 219, 210, 0.9) 0 70%, rgba(237, 175, 184, 0.9) 70% 100%);
  overflow: hidden;
  box-shadow: 0 5px 0 rgba(74, 87, 89, 0.15);
}

.fuel-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, #e6c56f, #f0a97f 60%, #d9606f);
}

.fuel-pct {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--iron);
}

/* ---------- chairs ---------- */
.chairs-big {
  font-size: 54px;
}

.chairs-big.go {
  color: #fff;
  animation: pop-in 0.25s cubic-bezier(0.3, 1.6, 0.6, 1);
}

/* ---------- sequence pads ---------- */
.pads {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: max(20px, env(safe-area-inset-bottom));
  height: 44%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  opacity: 0.55;
  transition: opacity 0.2s;
}

.pads.active {
  opacity: 1;
}

.pad {
  border-radius: 26px;
  background: var(--pc);
  border: 4px solid #fff;
  box-shadow: 0 6px 0 rgba(74, 87, 89, 0.18);
  filter: saturate(0.7) brightness(0.95);
  transition: transform 0.08s, filter 0.08s;
}

.pad.lit {
  filter: saturate(1.2) brightness(1.25);
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--pc), 0 6px 0 rgba(74, 87, 89, 0.18);
}

/* ---------- screens taller than the phone: start at the top and scroll ---------- */
.screen {
  align-items: flex-start;
}

.screen > .card,
.screen > .intro {
  margin: auto 0;
}

/* ---------- compact game picker (many games) ---------- */
.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  line-height: 1.15;
  padding: 7px 4px;
  border-radius: 14px;
}

.chip .ic {
  font-size: 22px;
}

#screen-lobby .code {
  font-size: 46px;
}

#screen-lobby .card {
  padding-top: 20px;
}

/* ---------- moles ---------- */
.holes {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: max(20px, env(safe-area-inset-bottom));
  height: 50%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hole {
  position: relative;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 70%, #6f5f58 0 45%, #9c7b6b 46% 56%, rgba(176, 196, 177, 0.9) 57%);
  overflow: hidden;
}

.mole {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -70%;
  height: 62%;
  border-radius: 50% 50% 40% 40%;
  background: #c9a08f;
  transition: bottom 0.1s ease-out;
}

.mole::before,
.mole::after {
  content: '';
  position: absolute;
  top: 28%;
  width: 18%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 55% 60%, var(--iron) 0 35%, #fff 38%);
}

.mole::before { left: 22%; }
.mole::after { right: 22%; }

.hole.up .mole { bottom: 18%; }
.hole[data-kind='g'] .mole { background: #e6c56f; box-shadow: 0 0 16px #ffe9a8; }
.hole[data-kind='x'] .mole { background: #8a8f8f; border: 4px dashed #5e6363; }

.hole.bonk {
  animation: bonk 0.15s;
}

@keyframes bonk {
  50% { transform: scale(0.92); }
}

.hole .pop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  opacity: 0;
  text-shadow: 0 2px 0 #fff;
}

.hole .pop.show {
  animation: popup 0.8s ease-out;
}

@keyframes popup {
  0% { opacity: 1; transform: translateY(10px) scale(0.6); }
  40% { opacity: 1; transform: translateY(-10px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-30px); }
}

/* ---------- row beat ---------- */
.beat {
  font-size: 56px;
  transition: transform 0.05s;
}

/* ---------- climb hints ---------- */
.side-hints {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
}

.side-hints span {
  background: rgba(247, 225, 215, 0.9);
  border: 3px solid #fff;
  border-radius: 16px;
  padding: 6px 12px;
  font-weight: 600;
}

/* ---------- one vs all zones ---------- */
.zones {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: max(20px, env(safe-area-inset-bottom));
  height: 38%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  opacity: 0.5;
}

.zones.active {
  opacity: 1;
}

.zone {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.85);
  border: 4px solid var(--dust);
  font-weight: 600;
  font-size: 15px;
}

.zone.picked {
  background: #86b9ba;
  border-color: #fff;
  color: #fff;
}

.zone.hit {
  background: #d9606f;
  border-color: #fff;
  color: #fff;
  animation: pop-in 0.3s cubic-bezier(0.3, 1.6, 0.6, 1);
}
