/* vcrush · polish — final pass over the soda-fountain counter.
   Additive only: screen entrances, sheet and rescue presentation, button
   feel, toast placement, safe-area padding. Transform and opacity only, no
   per-frame layout work, no filters that animate. Loaded after every other
   sheet so it wins ties; removing this file returns the game to its prior look. */

/* screens slide in instead of snapping */
.screen:not([hidden]) { animation: vc-screen-in 240ms var(--ease) both; }
@keyframes vc-screen-in { from { opacity: 0; transform: translateY(10px); } }

/* result and rescue sheets: backdrop fades, plate drops in with a small settle */
.overlay:not([hidden]) {
  animation: vc-veil-in 180ms ease-out both;
  padding-top: calc(20px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  padding-left: calc(20px + env(safe-area-inset-left));
  padding-right: calc(20px + env(safe-area-inset-right));
}
@keyframes vc-veil-in { from { opacity: 0; } }
.overlay .sheet { animation: vc-sheet-in 340ms var(--ease-drop) both; max-height: calc(100vh - 40px); overflow-y: auto; }
@keyframes vc-sheet-in { 0% { transform: translateY(22px) scale(.95); opacity: 0; } 100% { transform: none; opacity: 1; } }
.overlay .sheet h2 { text-wrap: balance; }
.overlay .sheet .row .btn { min-height: 48px; }

/* result score reads as the headline of the card */
.sheet .big-score { color: var(--walnut-3); letter-spacing: -.01em; animation: vc-count-in 420ms var(--ease-drop) 120ms both; }
@keyframes vc-count-in { from { transform: scale(.8); opacity: 0; } }
.stars.big i { filter: drop-shadow(0 2px 0 rgba(196,16,72,.25)); }

/* the rescue offer: one ring on the primary button, drawn with opacity only */
.sheet:has([data-act="rescue"]) .btn:not(.ghost) { position: relative; isolation: isolate; }
.sheet:has([data-act="rescue"]) .btn:not(.ghost)::after {
  content: ''; position: absolute; inset: -5px; z-index: -1;
  border: 2px solid var(--walnut-2); border-radius: 999px;
  animation: vc-ring 1.6s ease-out 500ms infinite;
  pointer-events: none;
}
@keyframes vc-ring { 0% { opacity: .85; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.12); } }

/* buttons: crisp press, no 300ms tap delay, no accidental text selection */
.btn, .icon-btn, .node { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.btn:active { transition-duration: 40ms; }
.btn:focus-visible, .icon-btn:focus-visible, .node:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 3px;
}
.icon-btn { min-width: var(--tap); min-height: var(--tap); }

/* toasts sit above the home indicator and overshoot a little on the way in */
.toasts { bottom: calc(24px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
.toast { white-space: normal; text-align: center; max-width: 100%; }

/* narrow phones: keep the sheet buttons stacked and full width */
@media (max-width: 380px) {
  .row .btn { flex-basis: 100%; }
  .sheet { padding-left: 16px; padding-right: 16px; }
  .sheet .eyebrow { margin-left: -16px; margin-right: -16px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen:not([hidden]), .overlay:not([hidden]), .overlay .sheet, .sheet .big-score { animation: none !important; }
  .sheet:has([data-act="rescue"]) .btn:not(.ghost)::after { display: none; }
}

.next-star { margin: 4px 0 0; font-size: .85rem; color: var(--ink-soft); text-align: center; }

/* a soft glass sheen and rim shadow over the board; static, drawn once, never repainted per frame */
.board { box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35), inset 0 -14px 22px -16px rgb(11 70 90 / .35); }
.board::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(160deg, rgb(255 255 255 / .22) 0%, rgb(255 255 255 / 0) 34%);
}
