/* Cup Hunt — Sesame-like chunky preschool UI */

.cup-root {
  --ink: #263238;
  --white: #ffffff;
  --yellow: #ffd54f;
  --red: #e53935;
  --blue: #1e88e5;
  --green: #43a047;
  --pink: #f48fb1;
  --orange: #ff9800;
  --sky: #81d4fa;
  --outline: 5px;
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #4fb8f5;
  overflow: hidden;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  color: white;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cup-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.55rem;
  padding: max(0.85rem, env(safe-area-inset-top)) 0.9rem 0.4rem;
  pointer-events: none;
}

.cup-chrome > * {
  pointer-events: auto;
}

.cup-exit {
  display: grid;
  place-items: center;
  justify-self: start;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 999px;
  background: var(--orange);
  border: var(--outline) solid var(--white);
  color: var(--white);
  font-size: 1.55rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.18);
}

.cup-exit:active {
  transform: translateY(3px) scale(0.92);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

.cup-level {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 2.85rem;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  background: var(--blue);
  border: var(--outline) solid var(--white);
  font-weight: 700;
  font-size: clamp(1.05rem, 3.8vw, 1.3rem);
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.16);
}

.cup-hud-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cup-hearts {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  min-height: 2.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #fff3f3;
  border: var(--outline) solid var(--white);
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.16);
  font-size: 1.65rem;
  line-height: 1;
}

.cup-hearts.is-compact {
  gap: 0.2rem;
  padding: 0.25rem 0.75rem 0.25rem 0.55rem;
}

.cup-heart-count {
  color: var(--red);
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cup-heart {
  display: inline-block;
  color: var(--red);
  -webkit-text-stroke: 2.5px #fff;
  paint-order: stroke fill;
}

.cup-heart.is-empty {
  color: #ffcdd2;
  opacity: 0.7;
}

.cup-heart.is-lost {
  animation: heart-lost 0.45s var(--ease-pop);
}

@keyframes heart-lost {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35) rotate(-8deg);
  }
  100% {
    transform: scale(1);
  }
}

.cup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.85rem;
  padding: 0.3rem 0.85rem 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--yellow);
  border: var(--outline) solid var(--white);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.16);
}

.cup-coin-icon {
  flex-shrink: 0;
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  overflow: visible;
}

.cup-shop__btn-cost .cup-coin-icon .coin-mid,
.cup-shop__btn-cost .cup-coin-icon .coin-shadow,
.cup-shop__balance .cup-coin-icon .coin-mid,
.cup-shop__balance .cup-coin-icon .coin-shadow {
  display: none;
}

.cup-shop__btn-cost .cup-coin-icon .coin-body,
.cup-shop__balance .cup-coin-icon .coin-body {
  stroke-width: 1.5;
}

.cup-shop__btn-cost .cup-coin-icon .coin-face,
.cup-shop__btn-cost .cup-coin-icon .coin-star,
.cup-shop__balance .cup-coin-icon .coin-face,
.cup-shop__balance .cup-coin-icon .coin-star {
  stroke-width: 0.85;
}

.cup-badge [data-hud-coins] {
  min-width: 1.1ch;
  font-variant-numeric: tabular-nums;
}

.cup-badge.is-pulse {
  animation: coin-pulse 0.55s var(--ease-pop);
}

@keyframes coin-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.14);
  }
}

.cup-prompt {
  position: absolute;
  top: calc(max(0.85rem, env(safe-area-inset-top)) + 4.3rem);
  left: 50%;
  z-index: 15;
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  max-width: min(92vw, 26rem);
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: var(--white);
  border: var(--outline) solid var(--white);
  box-shadow: 0 7px 0 rgba(38, 50, 56, 0.16);
  color: var(--ink);
  font-size: clamp(1.2rem, 4.5vw, 1.65rem);
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.45s var(--ease-out),
    top 0s,
    font-size 0s,
    padding 0s;
}

.cup-prompt.is-shown {
  opacity: 1;
}

/* Math / word: sit above the cups (no overlap), a bit larger than classic */
.cup-prompt.is-near-cups {
  top: 30%;
  max-width: min(92vw, 28rem);
  padding: 0.65rem 1.35rem;
  font-size: clamp(1.35rem, 5.2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 0 rgba(38, 50, 56, 0.16);
  transform: translateX(-50%) translateY(-20px) scale(0.9);
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.5s var(--ease-pop);
}

.cup-prompt.is-near-cups.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.cup-prompt[hidden] {
  display: none !important;
}

.cup-stage {
  flex: 1;
  position: relative;
  min-height: 0;
}

#cup-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.cup-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(38, 50, 56, 0.42);
  opacity: 0;
  transition: opacity 260ms var(--ease-out);
}

.cup-overlay.is-shown {
  opacity: 1;
}

.cup-overlay[hidden] {
  display: none !important;
}

.cup-overlay__card {
  width: min(100%, 26rem);
  padding: 1.7rem 1.3rem 1.4rem;
  border-radius: 2rem;
  text-align: center;
  background: var(--blue);
  border: 7px solid var(--white);
  box-shadow: 0 12px 0 rgba(38, 50, 56, 0.22);
  transform: scale(0.86) translateY(16px);
  opacity: 0;
  transition:
    transform 400ms var(--ease-pop),
    opacity 260ms var(--ease-out);
}

.cup-overlay.is-shown .cup-overlay__card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.cup-overlay[data-mode="gameover"] .cup-overlay__card {
  background: #78909c;
}

.cup-overlay__title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 700;
  text-shadow: 0 3px 0 rgba(38, 50, 56, 0.18);
}

.cup-overlay__sub,
.cup-overlay__extra {
  margin: 0.45rem 0 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.cup-overlay__hint {
  margin: 0.85rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--yellow);
}

.cup-shop {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 4px solid rgba(255, 255, 255, 0.45);
}

.cup-shop[hidden] {
  display: none !important;
}

.cup-shop__label {
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.cup-shop__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.cup-shop__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-height: 4.2rem;
  padding: 0.5rem 0.3rem;
  border: var(--outline) solid var(--white);
  border-radius: 1.25rem;
  background: var(--yellow);
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.18);
}

.cup-shop__btn[data-upgrade="heart"] {
  background: #ffcdd2;
}
.cup-shop__btn[data-upgrade="cup_skin"] {
  background: var(--pink);
}

.cup-shop__btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

.cup-shop__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.cup-shop__btn-title {
  font-size: 1rem;
}

.cup-shop__btn-cost {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.95rem;
  color: #ef6c00;
}

.cup-shop__btn.is-maxed .cup-coin-icon {
  display: none;
}

.cup-shop__btn-cost .cup-coin-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.cup-shop__balance {
  margin: 0.8rem 0 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
}

.cup-shop__balance .cup-coin-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.cup-overlay__action {
  margin-top: 1.15rem;
  min-height: 3.15rem;
  padding: 0.55rem 1.5rem;
  border: var(--outline) solid var(--white);
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 7px 0 rgba(38, 50, 56, 0.2);
}

.cup-overlay__action:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .cup-overlay,
  .cup-overlay__card,
  .cup-badge.is-pulse,
  .cup-heart.is-lost,
  .cup-prompt {
    animation: none !important;
    transition: none !important;
  }
  .cup-overlay.is-shown .cup-overlay__card {
    transform: none;
    opacity: 1;
  }
  .cup-prompt.is-shown {
    opacity: 1;
  }
  .cup-prompt.is-near-cups.is-shown {
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ── Birds counter ── */
.cup-bird-icon {
  width: 1.9rem;
  height: 1.9rem;
  margin: -0.2rem 0 -0.2rem -0.15rem;
}

.cup-badge--coins {
  background: #e1f5fe;
}

/* ── Tower meter + My Style (bottom of the screen) ── */
.cup-towerbar {
  position: absolute;
  left: 50%;
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  z-index: 18;
  display: flex;
  gap: 0.45rem;
  transform: translateX(-50%);
}

.cup-tower-meter,
.cup-style-btn,
.cup-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.8rem;
  border-radius: 999px;
  border: 4px solid var(--white);
  box-shadow: 0 5px 0 rgba(38, 50, 56, 0.18);
  color: var(--white);
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}

.cup-tower-meter {
  padding: 0.2rem 0.85rem 0.2rem 0.5rem;
  background: #ef6c00;
}

.cup-tower-meter__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.cup-tower-meter__pips {
  display: inline-flex;
  gap: 0.2rem;
}

.cup-tower-meter__pips i {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid var(--white);
}

.cup-tower-meter__pips i.on {
  background: #4fc3f7;
}

.cup-tower-meter.is-bump {
  animation: coin-pulse 0.5s var(--ease-pop);
}

.cup-tower-meter.is-ready {
  animation: tower-ready 0.4s ease-in-out infinite;
}

.cup-style-btn {
  width: 2.8rem;
  padding: 0;
  background: #7e57c2;
  font-size: 1.3rem;
}

.cup-settings-btn {
  width: 2.85rem;
  height: 2.85rem;
  min-height: 0;
  padding: 0;
  background: #7e57c2;
  border-width: var(--outline);
  font-size: 1.35rem;
  flex: none;
}

.cup-tower-meter:active,
.cup-style-btn:active,
.cup-settings-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(38, 50, 56, 0.18);
}

@keyframes tower-ready {
  0%, 100% { transform: rotate(-3deg) scale(1.04); }
  50% { transform: rotate(3deg) scale(1.1); }
}

/* level-complete hero */
.cup-celebrate {
  font-size: clamp(3rem, 12vw, 4rem);
  line-height: 1;
  margin: -0.3rem 0 0.2rem;
  filter: drop-shadow(0 5px 0 rgba(38, 50, 56, 0.18));
}

.cup-overlay.is-shown .cup-celebrate {
  animation: hero-bounce 0.7s var(--ease-pop) 0.1s both;
}

@keyframes hero-bounce {
  0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(4deg); opacity: 1; }
  100% { transform: scale(1); }
}

/* Narrow phones: keep the top bar on one row */
@media (max-width: 430px) {
  .cup-chrome {
    gap: 0.35rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
  .cup-hud-right {
    gap: 0.3rem;
  }
  .cup-exit,
  .cup-settings-btn {
    width: 2.6rem;
    height: 2.6rem;
    --outline: 4px;
  }
  .cup-level {
    min-height: 2.6rem;
    padding: 0.25rem 0.7rem;
    font-size: 1rem;
    --outline: 4px;
  }
  .cup-hearts,
  .cup-badge {
    min-height: 2.6rem;
    --outline: 4px;
  }
  .cup-badge {
    padding: 0.2rem 0.6rem 0.2rem 0.4rem;
    font-size: 1.05rem;
  }
  .cup-prompt {
    top: calc(max(0.85rem, env(safe-area-inset-top)) + 3.9rem);
  }
}

/* ── Settings pop-up ── */
.cup-settings {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(38, 50, 56, 0.45);
}

.cup-settings[hidden] {
  display: none !important;
}

.cup-settings__card {
  width: min(23rem, 100%);
  max-height: 100%;
  overflow: auto;
  border-radius: 1.5rem;
  background: #fff8e7;
  border: var(--outline) solid var(--white);
  box-shadow: 0 12px 0 rgba(38, 50, 56, 0.25);
  color: var(--ink);
  animation: settings-pop 0.45s var(--ease-pop) both;
}

.cup-settings__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.7rem 0.7rem 1.1rem;
  background: #7e57c2;
  color: var(--white);
}

.cup-settings__head h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
}

.cup-settings__close {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  background: var(--orange);
  border: 4px solid var(--white);
  color: var(--white);
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.cup-settings__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  padding: 0.9rem 0.9rem 0.2rem;
}

.cup-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.15rem;
  border-radius: 1rem;
  background: var(--white);
  border: 3px solid #eadfc8;
}

.cup-stat b {
  font-size: 1.2rem;
  font-weight: 800;
}

.cup-stat span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #78909c;
}

.cup-settings__section {
  padding: 0.7rem 1rem 0.3rem;
  text-align: center;
}

.cup-settings__section + .cup-settings__section {
  border-top: 3px dashed #eadfc8;
  margin-top: 0.4rem;
  padding-bottom: 1rem;
}

.cup-settings__label {
  margin: 0.2rem 0 0.15rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.cup-settings__help,
.cup-settings__hint {
  margin: 0;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #546e7a;
}

.cup-settings__hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.cup-settings__restart,
.cup-hold {
  position: relative;
  width: 100%;
  min-height: 3.1rem;
  margin-top: 0.7rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: var(--outline) solid var(--white);
  font-family: inherit;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 6px 0 rgba(38, 50, 56, 0.22);
  cursor: pointer;
}

.cup-settings__restart {
  background: var(--yellow);
  color: var(--ink);
}

.cup-hold {
  background: var(--red);
  color: var(--white);
  overflow: hidden;
  touch-action: none;
}

.cup-hold__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #b71c1c;
}

.cup-hold.is-holding .cup-hold__fill {
  width: 100%;
  transition: width 2s linear;
}

.cup-hold__text {
  position: relative;
}

.cup-hold.is-done {
  background: var(--green);
}

.cup-hold.is-done .cup-hold__fill {
  display: none;
}

@keyframes settings-pop {
  from { opacity: 0; transform: scale(0.72) translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .cup-settings__card {
    width: min(40rem, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .cup-settings__head,
  .cup-settings__stats {
    grid-column: 1 / -1;
  }
  .cup-settings__section + .cup-settings__section {
    border-top: 0;
    border-left: 3px dashed #eadfc8;
    margin-top: 0;
  }
  .cup-towerbar {
    left: auto;
    right: 0.8rem;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cup-tower-meter.is-ready,
  .cup-overlay.is-shown .cup-celebrate {
    animation: none;
  }
}

/* Short landscape: a slimmer prompt so lifted cups stay clear of it */
@media (max-height: 500px) and (orientation: landscape) {
  .cup-prompt:not(.is-near-cups) {
    top: calc(max(0.85rem, env(safe-area-inset-top)) + 4rem);
    padding: 0.3rem 1rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 0 rgba(38, 50, 56, 0.16);
  }
}

/* ── Shuffle! start button (before the cups drop over the bird) ── */
.cup-go {
  position: absolute;
  z-index: 16;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.6rem 0.8rem;
  min-height: 3.6rem;
  font: inherit;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 0 #263238;
  white-space: nowrap;
  background: linear-gradient(180deg, #7ee27f, #43a047);
  border: 4px solid #263238;
  border-radius: 999px;
  box-shadow:
    0 6px 0 #263238,
    0 0 0 5px #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.35s cubic-bezier(0.2, 1.6, 0.4, 1),
    opacity 0.2s ease-out;
}
.cup-go[hidden] {
  display: none;
}
.cup-go.is-shown {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: cup-go-bounce 1.1s ease-in-out 0.4s infinite;
}
.cup-go:active,
.cup-go.is-pressed {
  animation: none;
  transform: translate(-50%, -50%) translateY(4px) scale(0.96);
  box-shadow:
    0 2px 0 #263238,
    0 0 0 5px #fff;
}
.cup-go__icon {
  font-size: 1.3rem;
  text-shadow: none;
}
@keyframes cup-go-bounce {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) translateY(-6px) scale(1.05); }
}
@media (max-width: 380px) {
  .cup-go {
    font-size: 1.35rem;
    padding: 0.6rem 1.3rem 0.7rem;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .cup-go {
    font-size: 1.2rem;
    min-height: 3rem;
    padding: 0.45rem 1.1rem 0.55rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cup-go.is-shown {
    animation: none;
  }
}

/* ── Word card: the word with slots for the missing letters ── */
.cup-prompt {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.12em;
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  padding: 0.35rem 1.1rem 0.5rem;
  letter-spacing: 0;
}
.cup-ch {
  display: inline-block;
  min-width: 0.62em;
  text-align: center;
  text-transform: lowercase;
}
.cup-ch.is-blank {
  color: transparent;
  border-bottom: 0.12em solid var(--ink);
  border-radius: 0.08em;
  background: #fff3c4;
  box-shadow: inset 0 -0.05em 0 rgba(38, 50, 56, 0.12);
  padding: 0 0.06em;
  animation: cup-blank-pulse 1.4s ease-in-out infinite;
}
.cup-ch.is-filled {
  color: #2e7d32;
  background: #c8e6c9;
  border-bottom-color: #2e7d32;
  animation: cup-letter-pop 0.45s cubic-bezier(0.2, 1.8, 0.4, 1);
}
.cup-prompt.is-complete {
  background: #c8e6c9;
  border-color: #fff;
  animation: cup-word-cheer 0.7s ease-out;
}
.cup-prompt.is-complete .cup-ch {
  color: #1b5e20;
}
@keyframes cup-blank-pulse {
  50% { background: #ffe082; }
}
@keyframes cup-letter-pop {
  0% { transform: translateY(-0.5em) scale(0.4); }
  70% { transform: translateY(0.05em) scale(1.2); }
  100% { transform: none; }
}
@keyframes cup-word-cheer {
  30% { transform: translateX(-50%) scale(1.15) rotate(-2deg); }
  60% { transform: translateX(-50%) scale(0.97) rotate(1deg); }
  100% { transform: translateX(-50%) scale(1); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .cup-prompt:not(.is-near-cups) {
    font-size: 1.6rem;
    padding: 0.15rem 0.9rem 0.3rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cup-ch.is-blank,
  .cup-ch.is-filled,
  .cup-prompt.is-complete {
    animation: none;
  }
}

/* Birds flying letters into the word sit above the header and word card */
.cup-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  pointer-events: none;
}

/* Level: small plain label right of the ✕ (no pill) */
.cup-chrome {
  grid-template-columns: auto auto 1fr;
}
.cup-level {
  justify-self: start;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
    0 3px 0 var(--ink);
}
.cup-hud-right {
  justify-self: end;
}

/* Word card: bigger; its top is set in JS so it sits between the top bar
   and the raised cups */
.cup-prompt {
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  padding: 0.35rem 1.3rem 0.55rem;
  border-radius: 1.4rem;
}
@media (max-height: 500px) and (orientation: landscape) {
  .cup-prompt:not(.is-near-cups) {
    font-size: 2rem;
    padding: 0.15rem 1rem 0.3rem;
  }
}

/* Level / game-over card: padding and border count inside its width */
.cup-overlay__card {
  box-sizing: border-box;
}
