/*
  Tokens from Erica Zambrano's "Zerinho ou um" design system (Figma), plus the
  ink and court colours of the hand and padel illustrations.
  The system is light only, so the page commits to that look in every theme.
  Layout: a blue court header where the hands point at the title and a racket
  sends the ball across, numbered steps on the off-white page, and the result
  on a blue band that runs into the footer where the hands rise again.
*/
:root {
  color-scheme: light;
  --primary-500: #4e61f6;
  --primary-600: #3a4cd9;
  --primary-700: #2f3db3;
  --primary-400: #6b7bf8;
  --primary-50: #eef0fe;
  --lime-500: #c4e10d;
  --lime-600: #a3bd06;
  --ink: #2b1610;
  --bg: #fffdfa;
  --white: #ffffff;
  --grey-50: #f9fafb;
  --grey-200: #e5e7ea;
  --grey-400: #9ea2ae;
  --grey-600: #5d6170;
  --text-black: #131927;
  --on-blue: #ffffff;
  --on-blue-muted: rgba(255, 255, 255, .78);
  --court-line: rgba(255, 255, 255, .22);
  --error-text: #b4231f;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-band: 32px;

  --font-body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text-black);
  font-family: var(--font-body); font-size: 16px; line-height: 24px;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--primary-500); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--lime-500); outline-offset: 2px; }

.gutter {
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Court lines drawn on any blue band: centre line plus the two service lines. */
.court-bg {
  background-color: var(--primary-500);
  background-image:
    linear-gradient(to right, transparent calc(50% - 1px), var(--court-line) calc(50% - 1px), var(--court-line) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to bottom, transparent 30%, var(--court-line) 30%, var(--court-line) calc(30% + 2px), transparent calc(30% + 2px)),
    linear-gradient(to bottom, transparent 70%, var(--court-line) 70%, var(--court-line) calc(70% + 2px), transparent calc(70% + 2px));
}

.blue-band { background-color: var(--primary-500); }

/* ---------- Hero ---------- */
/* --hw is the hand width; every hand position is a multiple of it so the
   composition holds from small phones to desktop. A hand image is about 2.5x
   as tall as it is wide. */
.hero, .site-footer { --hw: clamp(50px, 15vw, 86px); }
.hero { position: relative; overflow: hidden; border-radius: 0 0 var(--radius-band) var(--radius-band); color: var(--on-blue); }
.hero-inner {
  position: relative; max-width: 464px; margin: 0 auto;
  padding-block: calc(var(--hw) * 1.25 + 40px) 140px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
/* The hand images have forearms extended 360px past the original drawing (and
   hands 7 and 9 extra room on the left), so arms always run off the edge.
   Sizes, offsets and rotation origins below compensate, keeping each hand where
   the original 208px-wide drawing put it. */
.hand { position: absolute; width: var(--hw); max-width: none; height: auto; pointer-events: none; user-select: none; transform-origin: 50% 29.55%; }
.hand-top { left: 50%; top: calc(var(--hw) * -2.8); transform: translateX(-50%); }
.hand-left { width: calc(var(--hw) * 1.577); left: calc(var(--hw) * -0.727); top: calc(var(--hw) * -0.62); transform: rotate(90.99deg); transform-origin: 68.29% 29.55%; }
.hand-right { right: calc(var(--hw) * -0.15); top: calc(var(--hw) * -0.78); transform: rotate(-107.2deg); }
.hero-racket { position: absolute; width: 84px; right: 4px; bottom: -146px; transform: rotate(-58deg); pointer-events: none; }
.ball-track { position: absolute; left: 28px; right: 104px; bottom: 30px; height: 34px; pointer-events: none; }
.hero-ball { position: absolute; width: 34px; left: 0; bottom: 0; }
.hero-inner::after {
  /* dotted flight of the ball, from the racket on the right to the ball on the left */
  content: ""; position: absolute; left: 54px; right: 100px; bottom: 20px; height: 48px;
  border-top: 3px dotted rgba(255, 255, 255, .7); border-radius: 50% 50% 0 0; pointer-events: none;
}
.eyebrow {
  font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink); background: var(--lime-500); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px;
}
h1 {
  margin: 0; font-weight: 800; letter-spacing: 0.01em;
  font-size: 44px; line-height: 42px; color: var(--on-blue); text-wrap: balance;
  text-shadow: 0 3px 0 var(--primary-700);
}
.lede { margin: 0; color: var(--on-blue-muted); max-width: 32ch; }

/* ---------- Page column ---------- */
.wrap { max-width: 464px; margin: 0 auto; padding-block: 28px 32px; display: flex; flex-direction: column; gap: 24px; }
section.step { display: flex; flex-direction: column; gap: 14px; }
section.step + section.step { border-top: 1.5px dashed var(--grey-200); padding-top: 24px; }
h2 { margin: 0; display: flex; align-items: center; font-size: 20px; line-height: 26px; font-weight: 600; color: var(--primary-500); text-wrap: balance; }
h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text-black); }
.hint { margin: 0; font-size: 14px; line-height: 20px; color: var(--grey-600); }
label { font-size: 16px; line-height: 24px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Step numbers are little padel balls. */
.step-num {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; margin-right: 10px;
  border-radius: 50%; background: var(--lime-500); border: 2px solid var(--ink); color: var(--ink);
  font-size: 15px; line-height: 1; font-weight: 800;
  background-image: radial-gradient(circle at 135% 50%, transparent 58%, rgba(255,255,255,.9) 59%, rgba(255,255,255,.9) 64%, transparent 65%);
}

/* ---------- Inputs ---------- */
input[type="number"], input[type="text"] {
  font: inherit; color: var(--text-black); background: var(--grey-50);
  border: 1.5px solid var(--grey-200); border-radius: var(--radius-sm);
  padding: 11px 12px; width: 100%; min-height: 48px;
}
input:focus { border-color: var(--primary-500); outline: none; }
input::placeholder { color: var(--grey-400); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 16px 10px; }
.chip {
  font: inherit; font-size: 16px; line-height: 20px; font-weight: 600; cursor: pointer;
  min-height: 48px; padding: 12px 18px;
  border: 1.5px solid var(--primary-500); background: var(--white); color: var(--primary-500);
  border-radius: var(--radius-sm); box-shadow: 0 2px 0 var(--primary-50);
  transition: transform .12s ease, box-shadow .12s ease;
}
.chip[aria-pressed="true"] { background: var(--primary-500); color: var(--white); box-shadow: 0 3px 0 var(--primary-700); }
.chip:active { transform: translateY(2px); box-shadow: none; }
.chips-strong .chip[aria-pressed="true"] { background: var(--lime-500); border-color: var(--ink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }

.title-badge { margin-left: auto; }

/* ---------- Husbands group inside step 1 ---------- */
.extra-group summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--primary-500); padding: 4px 0; }
.extra-group summary::-webkit-details-marker { display: none; }
.extra-group[open] summary { margin-bottom: 10px; }

/* ---------- Optional step ---------- */
details.step-optional { border-top: 1.5px dashed var(--grey-200); padding-top: 24px; }
details.step-optional summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
details.step-optional summary::-webkit-details-marker { display: none; }
.summary-title { display: flex; align-items: center; font-size: 20px; line-height: 26px; font-weight: 600; color: var(--primary-500); }
.summary-meta { flex: none; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--grey-600); background: var(--grey-50); border: 1px solid var(--grey-200); border-radius: 999px; padding: 4px 10px; }
.summary-meta.on { background: var(--lime-500); border-color: var(--ink); color: var(--ink); }
/* Rounded chevron, drawn with round caps and joins to match the 12px radius. */
details.step-optional summary::after, .extra-group summary::after { content: ""; flex: none; width: 22px; height: 22px; margin-left: -4px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234e61f6' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .2s; }
details.step-optional[open] summary::after, .extra-group[open] summary::after { transform: rotate(180deg); }
.step-body { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-size: 16px; line-height: 20px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); padding: 10px 16px; min-height: 48px;
  border: 1.5px solid var(--primary-500); background: var(--white); color: var(--primary-500);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--primary-50); }
.btn-filled { background: var(--primary-500); color: var(--white); box-shadow: 0 3px 0 var(--primary-700); }
.btn-filled:hover { background: var(--primary-600); }
.btn-primary {
  width: 100%; min-height: 56px; font: inherit; font-size: 18px; line-height: 24px; font-weight: 800; cursor: pointer;
  background: var(--lime-500); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius-sm);
  box-shadow: 0 4px 0 var(--ink); padding: 12px 20px; transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:active, .btn-filled:active, .btn-icon:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary .count { font-weight: 600; opacity: .75; }

/* ---------- Bottom action bar ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 253, 250, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1.5px solid var(--grey-200);
  padding-block: 12px calc(14px + env(safe-area-inset-bottom, 0px));
}
.action-inner { max-width: 464px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.bar-buttons { display: flex; gap: 8px; }
.bar-buttons > * { flex: 1 1 0; }
.bar-buttons .btn { min-height: 56px; font-size: 15px; padding: 8px 10px; white-space: nowrap; }
.bar-buttons .btn-icon { flex: none; width: 56px; padding: 0; color: var(--primary-500); border-width: 2px; }
.btn-wa { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.bar-note { margin: 0; font-size: 14px; line-height: 20px; color: var(--error-text); text-align: center; }

/* ---------- Result band ---------- */
#result-section {
  position: relative; margin-inline: calc(50% - 50vw); margin-bottom: -32px;
  padding: 36px max(20px, env(safe-area-inset-right, 0px)) 40px max(20px, env(safe-area-inset-left, 0px));
  border-radius: var(--radius-band) var(--radius-band) 0 0; color: var(--on-blue);
}
#result { max-width: 464px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.result-head { position: relative; display: flex; flex-direction: column; gap: 4px; }
.result-head h2 { font-weight: 800; letter-spacing: 0.01em; font-size: 38px; line-height: 40px; color: var(--on-blue); text-shadow: 0 3px 0 var(--primary-700); }
.result-ball { position: absolute; right: 4px; top: -8px; width: 48px; }
#result .hint { color: var(--on-blue-muted); }

.scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.scenario {
  font: inherit; text-align: left; cursor: pointer; color: var(--on-blue);
  border: 1.5px solid rgba(255,255,255,.45); background: rgba(255,255,255,.08); border-radius: var(--radius-sm);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.scenario strong { font-size: 18px; line-height: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.scenario .sub { font-size: 13px; line-height: 18px; color: var(--on-blue-muted); }
.scenario[aria-pressed="true"] { background: var(--lime-500); border: 2px solid var(--ink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.scenario[aria-pressed="true"] .sub { color: var(--ink); opacity: .8; }

.round { display: flex; flex-direction: column; gap: 8px; }
.round-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 18px; line-height: 24px; font-weight: 800; color: var(--on-blue); }
.round-title small { font-size: 14px; font-weight: 400; color: var(--on-blue-muted); font-variant-numeric: tabular-nums; }

/* A padel court from above: glass walls, service lines, the net in the middle. */
.court {
  position: relative; display: grid; grid-template-columns: 1fr 12px 1fr; min-height: 92px; overflow: hidden;
  background: var(--primary-400); border: 2px solid var(--ink); border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.28), 0 4px 0 var(--primary-700);
  color: var(--on-blue);
}
.court::before {
  content: ""; position: absolute; inset: 5px; pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(24% - 1px), rgba(255,255,255,.55) calc(24% - 1px), rgba(255,255,255,.55) calc(24% + 1px), transparent calc(24% + 1px)),
    linear-gradient(to right, transparent calc(76% - 1px), rgba(255,255,255,.55) calc(76% - 1px), rgba(255,255,255,.55) calc(76% + 1px), transparent calc(76% + 1px)),
    linear-gradient(to bottom, transparent calc(50% - 1px), rgba(255,255,255,.55) calc(50% - 1px), rgba(255,255,255,.55) calc(50% + 1px), transparent calc(50% + 1px));
}
.court .side { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; padding: 14px 8px; text-align: center; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.court .side span { background: var(--primary-500); border-radius: 6px; padding: 1px 8px; }
.court .net { z-index: 1; width: 6px; justify-self: center; background: var(--ink); border-left: 2px solid var(--white); border-right: 2px solid var(--white); }
.court-tag { display: block; margin-bottom: -2px; font-size: 12px; line-height: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lime-500); }
.resting { font-size: 14px; line-height: 20px; color: var(--on-blue-muted); }
.resting b { color: var(--on-blue); font-weight: 600; }

/* ---------- Court timer ---------- */
.btn-timer { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-timer .play { width: 0; height: 0; border-left: 12px solid var(--ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.timer {
  position: fixed; inset: 0; z-index: 35; overflow-y: auto; color: var(--on-blue);
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
}
.timer-open { overflow: hidden; }
.timer-inner { max-width: 464px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; gap: 14px; }
.timer-top { display: flex; justify-content: space-between; align-items: center; }
.timer-title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 800; }
.timer-close { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); background: transparent; color: var(--on-blue); font-size: 26px; line-height: 1; cursor: pointer; }
.timer-phase { margin: 8px 0 0; text-align: center; font-size: 20px; line-height: 26px; font-weight: 800; color: var(--lime-500); }
.timer[data-phase="swap"] .timer-phase, .timer[data-phase="done"] .timer-phase { font-size: 44px; line-height: 48px; color: var(--on-blue); text-shadow: 0 3px 0 var(--primary-700); margin: 24px 0 8px; }
.timer-clock {
  margin: 0; text-align: center; font-size: clamp(84px, 28vw, 120px); line-height: 1; font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em; text-shadow: 0 5px 0 var(--primary-700);
}
.timer.warn .timer-clock { color: var(--lime-500); }
.timer-games { display: flex; flex-direction: column; gap: 8px; }
.timer-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.timer-skip { font: inherit; font-size: 15px; font-weight: 600; color: var(--on-blue-muted); background: none; border: 0; padding: 10px; cursor: pointer; }

/* ---------- Zerinho ou um (plays on each draw) ---------- */
.zerinho {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: var(--primary-500); color: var(--on-blue);
  padding-bottom: 120px;
}
.zerinho-word {
  margin: 0; font-size: 48px; line-height: 52px; font-weight: 800; letter-spacing: -0.02em;
  text-shadow: 0 4px 0 var(--primary-700);
}
.zerinho-hands { position: absolute; left: 0; right: 0; bottom: -220px; display: flex; justify-content: center; gap: 4px; }
.zh { display: block; width: 104px; }
.zh img { display: block; width: 100%; max-width: none; transform: rotate(var(--r, 0deg)); transform-origin: 50% 29.55%; }
.zh:nth-child(2) img:not(.finger) { transform-origin: 50% 70.45%; }
.zh:nth-child(1) img { --r: -14deg; }
.zh:nth-child(2) img { --r: 180deg; }
.zh:nth-child(3) img { --r: 14deg; }
.zh img.finger { --r: -18deg; width: 157.7%; margin-left: -57.7%; transform-origin: 68.29% 29.55%; }
.zerinho.out { opacity: 0; transition: opacity .2s ease; }

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: hidden; height: calc(var(--hw) * 1.3 + 96px); border-radius: var(--radius-band) var(--radius-band) 0 0; margin-top: 8px; }
.has-result .site-footer { border-radius: 0; margin-top: 0; }
.site-footer .credit { position: relative; z-index: 1; max-width: 300px; margin: 0 auto; padding-top: 28px; text-align: center; font-size: 15px; line-height: 22px; color: var(--on-blue); font-weight: 600; }
.site-footer .hands { position: absolute; inset: 0; max-width: 464px; margin: 0 auto; }
.hand-bottom-left { width: calc(var(--hw) * 1.721); left: calc(var(--hw) * -0.621); bottom: calc(var(--hw) * -2.281); transform: rotate(42.81deg); transform-origin: 70.95% 29.55%; }
.hand-bottom { left: 50%; bottom: calc(var(--hw) * -2.981); transform: translateX(-50%) rotate(2.86deg); }
.hand-bottom-right { right: calc(var(--hw) * 0.1); bottom: calc(var(--hw) * -2.331); transform: rotate(-58.77deg); }

@media (min-width: 560px) {
  .hero-inner { padding-bottom: 148px; }
  .hero-racket { width: 100px; right: -10px; bottom: -156px; }
  h1 { font-size: 58px; line-height: 56px; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Header entrance: hands slide in and keep pointing at the title. */
  .hand-top { animation: drop .7s cubic-bezier(.3, 1.5, .5, 1) .05s both, nudge-down 1.4s ease-in-out 1s infinite alternate; }
  .hand-left { animation: from-left .7s cubic-bezier(.3, 1.5, .5, 1) .15s both, nudge-right 1.4s ease-in-out 1s infinite alternate; }
  .hand-right { animation: from-right .7s cubic-bezier(.3, 1.5, .5, 1) .25s both, nudge-left 1.4s ease-in-out 1.2s infinite alternate; }
  @keyframes drop { from { translate: 0 -110px; } to { translate: 0 0; } }
  @keyframes from-left { from { translate: -120px 0; } to { translate: 0 0; } }
  @keyframes from-right { from { translate: 120px 0; } to { translate: 0 0; } }
  @keyframes nudge-down { to { translate: 0 6px; } }
  @keyframes nudge-right { to { translate: 6px 2px; } }
  @keyframes nudge-left { to { translate: -6px 2px; } }
  .eyebrow { animation: pop-in .5s cubic-bezier(.3, 1.6, .5, 1) .35s both; }
  h1 { animation: pop-in .6s cubic-bezier(.3, 1.6, .5, 1) .45s both; }
  .lede { animation: fade-up .5s ease .65s both; }
  @keyframes pop-in { from { scale: .5; opacity: 0; } to { scale: 1; opacity: 1; } }
  @keyframes fade-up { from { translate: 0 10px; opacity: 0; } to { translate: 0 0; opacity: 1; } }

  /* Three plays in a 12s loop: a rally along the dotted line, a lob ("balão")
     over the title, and a smash that bounces off the glass wall. */
  .hero-racket { animation: swing 12s ease-in-out 1s infinite; }
  @keyframes swing {
    0%, 5%, 33%, 38%, 66%, 70%, 100% { transform: rotate(-58deg); }
    1.5% { transform: rotate(-84deg); }
    3% { transform: rotate(-48deg); }
    34.5% { transform: rotate(-28deg); }
    36% { transform: rotate(-66deg); }
    66.8% { transform: rotate(-104deg); }
    68% { transform: rotate(-30deg); }
  }
  .hero-ball { animation: plays 12s linear 1s infinite; }
  @keyframes plays {
    /* rally */
    0% { left: 100%; translate: 0 0; rotate: 0deg; opacity: 1; }
    3% { left: 80%; translate: 0 -44px; }
    6% { left: 50%; translate: 0 -64px; }
    9% { left: 20%; translate: 0 -44px; }
    12% { left: 0%; translate: 0 0; rotate: -540deg; }
    14% { translate: 0 -16px; }
    16% { translate: 0 0; }
    17.5% { translate: 0 -5px; }
    19% { left: 0%; translate: 0 0; rotate: -600deg; }
    28% { left: 0%; opacity: 1; }
    30% { left: 0%; opacity: 0; }
    31% { left: 100%; opacity: 0; translate: 0 0; rotate: 0deg; }
    33% { left: 100%; opacity: 1; translate: 0 0; }
    /* lob */
    36% { left: 84%; translate: 0 -120px; }
    40% { left: 62%; translate: 0 -175px; }
    44% { left: 42%; translate: 0 -120px; }
    48% { left: 30%; translate: 0 0; rotate: -420deg; }
    50% { left: 27%; translate: 0 -38px; }
    52% { left: 24%; translate: 0 0; }
    53.5% { left: 22%; translate: 0 -12px; }
    55% { left: 21%; translate: 0 0; rotate: -500deg; }
    61% { left: 21%; opacity: 1; }
    63% { left: 21%; opacity: 0; }
    64% { left: 100%; opacity: 0; translate: 0 0; rotate: 0deg; }
    66% { left: 100%; opacity: 1; translate: 0 0; }
    /* smash off the glass */
    68% { left: 48%; translate: 0 -12px; rotate: -320deg; }
    70% { left: 0%; translate: 0 -6px; }
    72% { left: 22%; translate: 0 -26px; }
    74% { left: 34%; translate: 0 0; rotate: -520deg; }
    76% { left: 41%; translate: 0 -9px; }
    78% { left: 46%; translate: 0 0; }
    85% { left: 54%; translate: 0 0; rotate: -660deg; }
    94% { left: 54%; opacity: 1; }
    96% { left: 54%; opacity: 0; }
    98% { left: 100%; opacity: 0; rotate: 0deg; }
    100% { left: 100%; opacity: 1; translate: 0 0; }
  }

  /* The steps arrive one after another. */
  .wrap > * { animation: fade-up .5s ease both; }
  .wrap > :nth-child(1) { animation-delay: .7s; }
  .wrap > :nth-child(2) { animation-delay: .8s; }
  .wrap > :nth-child(3) { animation-delay: .9s; }
  .wrap > :nth-child(4) { animation-delay: 1s; }
  .wrap > :nth-child(5) { animation-delay: 1.1s; }

  /* Chips and buttons react to the finger. */
  .chip.pop { animation: chip-pop .35s cubic-bezier(.3, 1.8, .5, 1); }
  @keyframes chip-pop { 0% { scale: .9; } 60% { scale: 1.1; } 100% { scale: 1; } }
  .summary-meta.pop { animation: chip-pop .35s cubic-bezier(.3, 1.8, .5, 1); }
  #draw.ready { animation: ready .6s cubic-bezier(.3, 1.6, .5, 1); }
  @keyframes ready { 0% { scale: 1; } 30% { scale: 1.05; rotate: -1.5deg; } 60% { rotate: 1.5deg; } 100% { scale: 1; rotate: 0deg; } }

  /* Zerinho ou um: fists shake three times. */
  .zerinho.play .zh { animation: shake .38s ease-in-out 3; }
  .zerinho.play .zh:nth-child(2) { animation-delay: .04s; }
  .zerinho.play .zh:nth-child(3) { animation-delay: .08s; }
  @keyframes shake { 0%, 100% { translate: 0 0; } 50% { translate: 0 -34px; } }
  .zerinho.play .zerinho-word { animation: word-pop .38s cubic-bezier(.3, 1.6, .5, 1) 3; }
  @keyframes word-pop { from { scale: .7; } to { scale: 1; } }
  .zh img.finger { animation: finger-up .3s cubic-bezier(.3, 1.8, .5, 1); }
  @keyframes finger-up { from { scale: .7; } to { scale: 1; } }

  /* Result reveal: courts drop in, names spin, the ball lands on the title. */
  .is-drawing .result-ball { animation: pop .7s cubic-bezier(.3, 1.6, .5, 1); }
  @keyframes pop { from { translate: 0 -80px; rotate: -200deg; scale: .6; } to { translate: 0 0; rotate: 0deg; scale: 1; } }
  .is-drawing .round { animation: court-in .45s cubic-bezier(.3, 1.4, .5, 1) both; }
  .is-drawing .round:nth-child(4) { animation-delay: .08s; }
  .is-drawing .round:nth-child(5) { animation-delay: .16s; }
  .is-drawing .round:nth-child(6) { animation-delay: .24s; }
  .is-drawing .round:nth-child(n+7) { animation-delay: .32s; }
  @keyframes court-in { from { translate: 0 24px; scale: .94; opacity: 0; } to { translate: 0 0; scale: 1; opacity: 1; } }
  .timer.warn .timer-clock { animation: pulse 1s ease-in-out infinite; }
  @keyframes pulse { 50% { scale: 1.04; } }
  .court .side span.spinning { opacity: .75; filter: blur(.4px); }
  .court .side span.landed { animation: land .3s cubic-bezier(.3, 1.8, .5, 1); }
  @keyframes land { from { scale: 1.25; background: var(--lime-500); color: var(--ink); } to { scale: 1; } }

  /* Footer hands keep the game going and celebrate each draw. */
  .site-footer .hand { animation: idle-bob 2.2s ease-in-out infinite alternate; }
  .site-footer .hand-bottom { animation-delay: .4s; }
  .site-footer .hand-bottom-right { animation-delay: .8s; }
  @keyframes idle-bob { to { translate: 0 -6px; } }
  .is-drawing .site-footer .hand { animation: wiggle .45s ease-in-out 3; }
  @keyframes wiggle { 50% { translate: 0 -18px; } }
}
