/*
 * Base: the page itself, plain elements, small utilities and shared animations.
 * Uses tokens only (tokens.css).
 */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-on-bg);
  background: var(--color-bg);
  -webkit-tap-highlight-color: transparent;
}

/* Page content sits above the stage decorations (the wavy band and the stickers).
   Clipped sideways: a card stamped on at 2x its size must not widen the page, or a phone
   zooms the whole page out. clip, unlike hidden, keeps the sticky bars working. */
body,
#app {
  overflow-x: clip;
}

#app {
  position: relative;
  z-index: var(--z-content);
}

button,
input {
  font: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  line-height: var(--line-height-tight);
  margin: 0;
}

[hidden] {
  display: none !important;
}

/* --- Utilities ------------------------------------------------------------------------ */

.muted {
  color: var(--color-on-bg-soft);
}

.small {
  font-size: 0.85em;
}

.center {
  text-align: center;
}

/* Links and codes: left-to-right inside right-to-left text. */
.mono {
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: isolate;
  word-break: break-all;
}

.waiting {
  text-align: center;
  padding: var(--space-11) 0;
  color: var(--color-on-bg-soft);
}

/* --- Motion ----------------------------------------------------------------------------
 * Entrances, ticks, count-ups and confetti are played by js/ui/motion.js with Motion.
 * CSS only keeps the endless idle loops (stickers floating, eyes looking around) and a few
 * small state changes, because those never need JavaScript.
 */

@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

/* An idle sticker bobbing up and down with a little turn. */
@keyframes float {
  50% {
    transform: translateY(calc(var(--float-distance) * -1)) rotate(6deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* The cartoon pupils glance one way, then the other. */
@keyframes look {
  0%,
  30%,
  100% {
    transform: translate(0, 0);
  }

  40%,
  60% {
    transform: translate(-25%, -10%);
  }

  70%,
  90% {
    transform: translate(20%, 5%);
  }
}

/* The cartoon eyes close for a moment. */
@keyframes eye-blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }

  96% {
    transform: scaleY(0.1);
  }
}

/* The countdown in its last seconds. */
@keyframes throb {
  50% {
    transform: scale(1.15);
  }
}

/* Animation always plays, whatever the device's reduced-motion setting: the host asked for
   that on 2026-12-03 ("ignore any reduce motion option"), since the motion is part of the
   party. js/ui/motion.js and js/ui/celebrate.js follow the same rule. */
