/* O cartaz do postômetro. Medidas, cores e fontes vêm do protótipo aprovado
   (docs/superpowers/specs/prototipo/Copo.dc.html); as medidas do copo são as
   de src/glass.ts: coluna de 170 × 294 px, boca em y = 56, vidro de 230 px. */

@font-face {
  font-family: 'Caveat Brush';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/caveat-brush-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/barlow-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/barlow-600-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/barlow-800-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Courier Prime';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/courier-prime-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Courier Prime';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/courier-prime-700-latin.woff2') format('woff2');
}

:root {
  --paper: #f6f1e4;
  --paper-asleep: #eaeae4;
  --ink: #1f2233;
  --faded: #5e6276;
  --red: #d8232a;
  --red-text: #c01f26;
  --stroke: #3b2414;
  --beer-dark: #e08a0c;
  --beer: #f5a81c;
  --beer-light: #fbc544;
  --glass-tint: #eef5f4;
  --foam: #fffdf6;
  /* O marca-texto da linha escolhida na "Quanto tá". */
  --highlight: #f8e3a8;
  --marker: 'Caveat Brush', 'Comic Sans MS', cursive;
  --printer: 'Courier Prime', 'Courier New', monospace;
  /* O movimento do copo: sai rápido e assenta devagar. */
  --slide: 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  /* Só modo claro: o papel é creme mesmo com o aparelho no escuro. */
  color-scheme: light;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html:has([data-mode='asleep']) {
  background: var(--paper-asleep);
}
body {
  margin: 0;
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
}
[hidden] {
  display: none !important;
}
::selection {
  background: var(--beer-light);
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
/* Avisos que recebem o foco pelo JavaScript só para serem lidos. */
[tabindex='-1']:focus {
  outline: none;
}
.filters {
  position: absolute;
}

/* ---------- a folha ---------- */

main {
  position: relative;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  /* Uma coluna de até 430 px no meio da tela, com 20 px de respiro. */
  padding: 26px max(20px, (100% - 430px) / 2) 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--paper);
}
main[data-mode='asleep'] {
  background: var(--paper-asleep);
}
.tape {
  position: absolute;
  left: calc(50% - 45px);
  top: -7px;
  width: 90px;
  height: 24px;
  background: rgba(226, 196, 120, 0.75);
  transform: rotate(-2deg);
}

/* ---------- título, data e faixa ---------- */

.masthead {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 {
  margin: 0;
  font-family: var(--marker);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
}
.stamp {
  padding: 4px 10px;
  border: 3px solid var(--red);
  border-radius: 6px 9px 5px 10px;
  color: var(--red-text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  transform: rotate(5deg);
}
.resting {
  flex: none;
  font-family: var(--marker);
  font-size: 19px;
  line-height: 1;
  color: var(--faded);
  transform: rotate(-3deg);
}
.date,
.subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  color: var(--faded);
  text-wrap: balance;
}
.tier {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tier-text {
  margin: 0;
  font-family: var(--marker);
  /* 56 px a partir de 360 de largura; abaixo disso encolhe para a faixa não
     quebrar em duas linhas. */
  font-size: clamp(44px, 15.6vw, 56px);
  line-height: 0.95;
}
.underline {
  stroke: var(--red);
}
[data-mode='asleep'] .tier-text {
  color: var(--faded);
}
[data-mode='asleep'] .underline {
  stroke: #9a9dac;
}

/* As abas "Quem vai" e "Quanto tá", nas duas páginas. A aberta é sublinhada de
   vermelho, como a faixa. */
.tabs {
  display: flex;
  gap: 20px;
}
.tabs a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-family: var(--marker);
  font-size: 22px;
  line-height: 1;
  color: var(--faded);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.tabs a[aria-current='page'] {
  color: var(--ink);
  text-decoration: underline 3px var(--red);
  text-underline-offset: 6px;
}
[data-mode='asleep'] .tabs a[aria-current='page'] {
  text-decoration-color: #9a9dac;
}

/* ---------- o copo, os rótulos e o total ---------- */

.meter {
  flex: none;
  /* Referência de posição e de largura para o rótulo "Outros", que mora fora
     das colunas dos rótulos. */
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr);
  grid-template-rows: 294px auto;
}
[data-mode='asleep'] .meter {
  filter: grayscale(1) opacity(0.7);
}
/* No celular os rótulos avançam 10 px sobre a margem da folha, para os nomes
   dos cursos caberem ao lado do copo. */
@media (max-width: 469px) {
  .meter {
    margin-inline: -10px;
  }
}
.glass {
  grid-area: 1 / 2;
  position: relative;
  /* Por cima das linhas de ligação: a espuma cobre a ponta das que chegam nela. */
  z-index: 1;
}
/* A região dos rótulos envolve os dois lados e o total, mas quem os põe no
   lugar é a grade do postômetro. */
.labels {
  display: contents;
}
.labels-side {
  grid-row: 1;
  position: relative;
  min-width: 0;
  container-type: inline-size;
  font-family: var(--marker);
  line-height: 1;
}
.labels-left {
  grid-column: 1;
}
.labels-right {
  grid-column: 3;
}
.label {
  position: absolute;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.labels-left .label {
  left: 0;
  right: 18px;
  align-items: flex-end;
}
.labels-right .label {
  left: 18px;
  right: 0;
  align-items: flex-start;
}
.label-name {
  max-width: 100%;
  /* O recorte das reticências também corta por baixo; a folga devolve as
     pernas das letras (p, ç, g, Q). */
  padding: 4px 0;
  margin: -4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  /* Em tela estreita o nome encolhe um pouco antes de ser cortado: 17 px com
     a coluna do protótipo (100 px), 14 px no mínimo. */
  font-size: clamp(14px, 17cqw, 17px);
}
.label-ml {
  font-size: 22px;
}

/* "Outros" é um <details>: o <summary> é o rótulo de sempre (nome e ml, sem
   fundo, borda nem setinha), posto na altura da camada dele; a lista abre
   embaixo do copo e do total, empurrando o resto da página. */
.others {
  grid-area: 3 / 1 / auto / -1;
  font-family: var(--marker);
  line-height: 1;
}
.others > summary {
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.others > summary::-webkit-details-marker {
  display: none;
}
/* As mesmas medidas das colunas dos rótulos, contadas a partir do meio: a
   coluna do copo tem 170 px e o rótulo fica a 18 px dela. A caixa do botão é
   do tamanho do texto (e no máximo a coluna), para o contorno do foco abraçar
   só o rótulo. */
.others > summary {
  max-width: calc(50% - 103px);
}
.others-left > summary {
  right: calc(50% + 103px);
  align-items: flex-end;
}
.others-right > summary {
  left: calc(50% + 103px);
  align-items: flex-start;
}
/* O nome encolhe como o dos outros rótulos: 17% da largura da coluna, que
   aqui é metade do que sobra do postômetro depois do copo. */
.others > summary .label-name {
  font-size: clamp(14px, (100cqw - 170px) * 0.085, 17px);
}
@media (hover: hover) {
  .others > summary:hover {
    color: var(--red-text);
  }
}
.others > summary:focus-visible {
  color: var(--red-text);
  outline: 2px solid var(--red-text);
  outline-offset: 3px;
  border-radius: 4px;
}
.others-list {
  margin: 12px 0 2px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.others-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
/* Na lista o nome não disputa espaço com o copo: tamanho cheio, sem recorte. */
.others-list .label-name {
  max-width: none;
  padding: 0;
  margin: 0;
  overflow: visible;
  font-size: 17px;
}
.leading {
  position: absolute;
  right: 12px;
  /* 76 px com a letra de 16: cabe "puxando o" numa linha e "postinho" na outra. */
  width: 4.75em;
  margin: 0;
  text-align: right;
  font-size: 16px;
  /* Encolhe junto com os nomes em tela estreita, para não sair da folha. */
  font-size: clamp(13px, 16cqw, 16px);
  line-height: 0.95;
  color: var(--red-text);
  transform: rotate(-3deg);
}
.connector {
  position: absolute;
  top: 0;
  width: 16px;
  height: 294px;
  overflow: visible;
  fill: none;
  stroke: var(--stroke);
  stroke-width: 1.8;
  stroke-linecap: round;
}
/* Cada linha é um traço de comprimento 1 esticado por uma matriz até o lugar
   dela; a espessura do traço não estica junto. */
.connector path {
  vector-effect: non-scaling-stroke;
}
.labels-left .connector {
  right: 0;
}
.labels-right .connector {
  left: 0;
}
.total {
  grid-area: 2 / 1 / auto / -1;
  margin: 6px 0 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-family: var(--marker);
  line-height: 1;
}
.total-number {
  font-size: 46px;
}
.total-text {
  font-size: 23px;
}
.no-glass {
  grid-area: 1 / 1 / auto / -1;
  align-self: start;
  margin: 96px 30px 0;
  text-align: center;
  font-family: var(--marker);
  font-size: 30px;
  line-height: 1.1;
  text-wrap: balance;
  transform: rotate(-2deg);
}

/* O copo. As peças que acompanham o nível leem `--level` (topo da cerveja),
   `--built` (até onde o copo existe), `--rim-left` e `--rim-width` (a borda
   que fecha o topo) do `style` de `[data-glass-mover]`. */
.glass-built,
.strokes {
  position: absolute;
  left: 0;
  top: 0;
  width: 170px;
  height: 294px;
}
.glass-built {
  clip-path: inset(var(--built) -12px -12px -12px);
  transition: clip-path var(--slide);
}
.glass-body {
  position: absolute;
  left: 0;
  top: 56px;
  width: 170px;
  height: 230px;
  clip-path: polygon(5px 0, 165px 0, 140px 100%, 30px 100%);
  background: var(--glass-tint);
}
.beer {
  position: absolute;
  left: 0;
  right: 0;
  /* 3 px acima da superfície, escondidos sob o colarinho: quando ele inclina,
     a fresta que abre junto à parede mostra cerveja, e não vidro. */
  top: calc(var(--level) - 59px);
  bottom: 20px;
  background: linear-gradient(
    90deg,
    var(--beer-dark) 0 12%,
    var(--beer) 12% 36%,
    var(--beer-light) 36% 48%,
    var(--beer) 48% 80%,
    var(--beer-dark) 80% 100%
  );
  transition: top var(--slide);
}
/* Divisas e bolhinhas só aparecem onde já tem cerveja, inclusive durante a
   subida: o recorte acompanha o nível. */
.layers,
.bubbles {
  position: absolute;
  inset: 0;
  clip-path: inset(calc(var(--level) - 56px) 0 0 0);
  transition: clip-path var(--slide);
}
/* A divisa entre duas camadas: um zigue-zague miúdo e claro, no lugar da
   linha reta de 2 px do protótipo. O desenho é um SVG embutido (dentes de 6 px
   de largura por 2,5 de altura, na cor do traço), repetido na horizontal; por
   ser vetor, continua nítido com o copo ampliado. A caixa tem 4 px e sobe 1 px
   para o zigue-zague ficar centrado onde a linha reta ficava. */
.divider {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  margin-top: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 4'%3E%3Cpath d='M-3 .75 0 3.25 3 .75 6 3.25 9 .75' fill='none' stroke='%233b2414' stroke-width='1.2'/%3E%3C/svg%3E")
    0 0 / 6px 4px repeat-x;
  opacity: 0.25;
}
.bubble {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid #ffe7a3;
  border-radius: 50%;
}
.beer-head {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--level) - 65px);
  height: 11px;
  box-sizing: border-box;
  border-top: 3px solid var(--stroke);
  background: var(--foam);
  transition: top var(--slide);
}
.glass-base {
  position: absolute;
  left: 0;
  right: 0;
  top: 210px;
  height: 20px;
  box-sizing: border-box;
  border-top: 4px solid var(--stroke);
  background: linear-gradient(180deg, #d9e8ea 0 55%, #b9ced3 55% 100%);
}
/* O reflexo que atravessa o vidro de tempos em tempos: uma faixa clara e
   inclinada, que fica guardada fora do vidro, à esquerda. */
.glint {
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 0;
  width: 22px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-70px) skewX(-18deg);
}
.strokes {
  overflow: visible;
  fill: none;
  stroke: var(--stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.facets {
  stroke-width: 2;
  opacity: 0.4;
}
.highlights {
  stroke: #fff;
  stroke-width: 6;
  opacity: 0.85;
}
.outline {
  stroke-width: 5;
}
/* As trincas têm o traço dos gomos. A transparência vai no desenho inteiro
   para duas trincas que se cruzem não escurecerem no cruzamento. */
[data-swap='cracks'] {
  stroke-width: 2;
  stroke-linejoin: miter;
  opacity: 0.4;
}
/* Cada trinca tem `pathLength="1"`: um traço de comprimento 1 é ela inteira,
   e deslocá-lo de 1 a 0 é riscá-la do começo ao fim. */
.crack {
  stroke-dasharray: 1 2;
}
.rim {
  position: absolute;
  left: var(--rim-left);
  top: calc(var(--built) - 2.5px);
  width: var(--rim-width);
  height: 5px;
  border-radius: 3px;
  background: var(--stroke);
  transition:
    top var(--slide),
    left var(--slide),
    width var(--slide);
}
/* A espuma ocupa a caixa do copo, para poder pulsar a partir da boca. */
.foam {
  position: absolute;
  inset: 0;
  transform-origin: 85px 60px;
}
/* A nuvem num grupo só. Ela se forma bola por bola: cada uma cresce a partir
   da própria base (os traços ficam todos atrás dos miolos, então o contorno
   só aparece por fora). */
.foam-cloud {
  position: absolute;
  inset: 0;
}
.foam-outline,
.foam-core,
.foam-shadow,
.foam-bubble {
  position: absolute;
  box-sizing: border-box;
  border-radius: 50%;
  transform-origin: 50% 100%;
}
/* Cada bola cresce a partir de um ponto só, a base do seu contorno: o miolo
   fica 4 px acima dela e a sombra, 10 px, e assim as três camadas crescem
   juntas, sem anel marrom só embaixo. */
.foam-core {
  transform-origin: 50% calc(100% + 4px);
}
.foam-shadow {
  transform-origin: 50% calc(100% + 10px);
}
/* Bolhinhas que estouram na superfície da espuma. Paradas, ficam escondidas:
   só existem enquanto borbulham. */
.foam-bubble {
  border: 1.5px solid rgba(59, 36, 20, 0.45);
  transform-origin: 50% 50%;
  opacity: 0;
}
/* A gota que de vez em quando escorre pela parede de fora: nasce escondida
   debaixo da ponta da espuma e só aparece quando a animação a solta. */
.foam-drip {
  position: absolute;
  left: 8px;
  top: 99px;
  width: 11px;
  height: 13px;
  box-sizing: border-box;
  border: 2.5px solid var(--stroke);
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--foam);
  opacity: 0;
}
.foam-outline {
  background: var(--stroke);
}
.foam-core {
  background: var(--foam);
}
.foam-shadow {
  border: 2.5px solid transparent;
  border-bottom-color: rgba(59, 36, 20, 0.28);
}

/* ---------- o voto ---------- */

.vote {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
button,
select,
[data-retry] {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#vote {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#vote button {
  height: 58px;
  box-sizing: border-box;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--marker);
  font-size: 30px;
  transition: transform 0.12s ease-out;
}
#vote button[value='going'] {
  border: 3px solid var(--red);
  border-radius: 14px 18px 12px 20px / 18px 12px 20px 14px;
  background: var(--red);
  color: #fff;
}
#vote button[value='not_going'] {
  border: 2.5px solid var(--ink);
  border-radius: 18px 12px 20px 14px / 14px 20px 12px 18px;
  background: transparent;
  color: var(--ink);
}
/* Votou "Vou": o botão ganha o contorno da tinta. */
#vote[data-vote='going'] button[value='going'] {
  border-color: var(--ink);
}
/* Votou "Não vou": ele enche de tinta e o "Vou" fica vazado. */
#vote[data-vote='not_going'] button[value='not_going'] {
  border-width: 3px;
  background: var(--ink);
  color: #fff;
}
#vote[data-vote='not_going'] button[value='going'] {
  border: 2.5px solid var(--red-text);
  background: transparent;
  color: var(--red-text);
}
@media (hover: hover) {
  #vote button:hover:not(:disabled) {
    transform: rotate(-1.5deg);
  }
}
#vote button:active:not(:disabled) {
  transform: scale(0.97);
}
button:disabled,
select:disabled {
  cursor: progress;
  opacity: 0.6;
}

[data-error] {
  box-sizing: border-box;
  padding: 4px 4px 4px 12px;
  border: 2.5px solid var(--red);
  border-radius: 10px 14px 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}
[data-retry] {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px 10px 7px 11px;
  display: flex;
  align-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}
.rollover {
  padding: 10px 14px;
  border-radius: 10px 14px 9px 13px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
/* O widget do Turnstile, acima dos botões. Fica escondido (`hidden`) e só
   aparece quando a Cloudflare pede um toque; escondido, não ocupa espaço. */
.turnstile {
  display: flex;
  justify-content: center;
}
.plus-one {
  margin: 0;
  font-family: var(--marker);
  font-size: 28px;
  line-height: 1;
  color: var(--red-text);
  text-wrap: balance;
  transform: rotate(-1.5deg);
}

/* ---------- o comprovante ---------- */

.receipt {
  margin-top: 6px;
  font-family: var(--printer);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  transform: rotate(-1.2deg);
  /* drop-shadow, e não box-shadow, para a sombra seguir a serrilha. */
  filter: drop-shadow(0 8px 9px rgba(31, 34, 51, 0.16));
}
.receipt-paper {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}
.receipt p {
  margin: 0;
}
.receipt-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.receipt-store {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.12em;
}
.receipt-type {
  font-size: 12px;
  letter-spacing: 0.06em;
}
.perforation {
  border-top: 2px dashed var(--ink);
}
.row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.dots {
  flex: 1;
  min-width: 12px;
  border-bottom: 2px dotted #7c7f8e;
  transform: translateY(-3px);
}
.receipt-course,
.receipt-course label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.receipt-course label {
  flex: 1;
  min-width: 0;
}
.receipt select,
.receipt button {
  min-height: 44px;
  box-sizing: border-box;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  font-weight: 700;
}
.receipt select {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
}
.receipt button {
  padding: 0 12px;
  letter-spacing: 0.06em;
}
.receipt :focus-visible {
  outline-offset: 2px;
}
[data-save-course] {
  text-transform: uppercase;
}
/* Com `vote.js` rodando a escolha do curso é enviada na hora, sem botão de
   salvar; sem ele não há como compartilhar nem copiar, e fica só a frase.
   Quem põe `vote-js` é o próprio `vote.js`: se ele não carregar, os controles
   ficam como na página sem JavaScript. */
.vote-js [data-save-course],
:root:not(.vote-js) [data-share] {
  display: none;
}
[data-share][data-copied] {
  background: var(--ink);
  color: #fff;
}
.receipt-fine,
.receipt-phrase {
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
}
.receipt-phrase {
  color: #4a4d5e;
}
.serration {
  height: 10px;
  background-image:
    linear-gradient(135deg, #fff 7px, transparent 7px), linear-gradient(225deg, #fff 7px, transparent 7px);
  background-size: 14px 10px;
  background-repeat: repeat-x;
}

/* ---------- movimento ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* Ao abrir a tela (e quando o primeiro voto da noite faz o copo existir), o
     copo parte de vazio, na linha da base, e sobe até o nível da noite. */
  .js:not(.mounted) [data-glass-mover],
  [data-glass-mover][data-empty] {
    --level: 266px !important;
    --built: 286px !important;
    --rim-left: 27.5px !important;
    --rim-width: 115px !important;
    visibility: hidden;
  }
  /* Os rótulos entram no fim da subida do copo. */
  .labels-side {
    transition: opacity 0.5s ease-out 0.6s;
  }
  .js:not(.mounted) :is(.labels-side, .others > summary) {
    opacity: 0;
  }
  /* Quando a contagem muda, rótulos e linhas de ligação deslizam para o lugar
     novo junto com o nível, e esperam o respingo como ele. */
  .label,
  .leading {
    transition: top var(--slide);
  }
  .others > summary {
    transition:
      top var(--slide),
      opacity 0.5s ease-out 0.6s;
  }
  .connector path {
    transition: transform var(--slide);
  }
  .glass[data-splash] ~ .labels :is(.label, .leading, .connector path) {
    transition-delay: 0.45s;
  }
  /* A espuma se forma depois que a cerveja chega à boca, como cerveja sendo
     servida: bola por bola, na vez de cada uma (`--i`), crescendo a partir da
     base e passando um pouco do tamanho antes de assentar. Vale ao abrir a
     tela e no voto que enche o copo. */
  .foam-outline,
  .foam-core,
  .foam-shadow {
    animation: form 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) calc(1.25s + var(--i) * 80ms) both;
  }
  @keyframes form {
    from {
      transform: scale(0);
    }
  }
  /* Depois de formada, a espuma borbulha: cada bolhinha cresce, fica um
     instante e estoura, em ritmos desencontrados. */
  .foam-bubble {
    animation: pop calc((3.2s + var(--i) * 0.5s) * var(--pace)) ease-out calc(2.6s + var(--i) * 0.7s) infinite;
  }
  @keyframes pop {
    0% {
      transform: scale(0);
      opacity: 0;
    }
    45%,
    80% {
      transform: scale(1);
      opacity: 1;
    }
    92%,
    100% {
      transform: scale(1.6);
      opacity: 0;
    }
  }

  /* O copo não fica parado: movimentos lentos, pequenos e em ritmos
     desencontrados. Só animam `transform`, `opacity` e o traço das trincas,
     que o navegador move sem refazer o layout. `--pace` estica as durações;
     no modo dormindo tudo fica mais lento. */
  main {
    --pace: 1;
  }
  main[data-mode='asleep'] {
    --pace: 1.8;
  }

  /* 1. Bolhinhas subindo até a superfície, onde somem. A distância é a de cada
     uma: da própria altura (`--y`) até o topo da cerveja (`--level`). O recorte
     de `.bubbles` garante que nenhuma aparece acima do líquido. */
  .bubble {
    animation: rise calc(9s * var(--pace)) linear infinite;
  }
  .bubble:nth-child(3n + 2) {
    animation-duration: calc(12s * var(--pace));
  }
  .bubble:nth-child(3n) {
    animation-duration: calc(15s * var(--pace));
  }
  .bubble:nth-child(4n + 1) {
    animation-delay: -2s;
  }
  .bubble:nth-child(4n + 2) {
    animation-delay: -5.5s;
  }
  .bubble:nth-child(4n + 3) {
    animation-delay: -8.2s;
  }
  .bubble:nth-child(4n) {
    animation-delay: -11s;
  }
  @keyframes rise {
    0% {
      transform: translateY(0);
      opacity: 0;
    }
    10%,
    85% {
      opacity: 1;
    }
    100% {
      transform: translateY(calc(var(--level) - 52px - var(--y)));
      opacity: 0;
    }
  }

  /* 2. A superfície balança, como cerveja recém-servida. */
  .beer-head {
    animation: sway calc(3s * var(--pace)) ease-in-out infinite alternate;
  }
  @keyframes sway {
    from {
      transform: translateY(1px) rotate(-2deg);
    }
    to {
      transform: translateY(-1px) rotate(2deg);
    }
  }

  /* 3. Com o copo cheio, a espuma respira e, a cada 8 s, uma gota escorre pela
     parede de fora (a primeira logo depois de a espuma terminar de se formar). */
  .foam {
    animation: breathe calc(5s * var(--pace)) ease-in-out infinite alternate;
  }
  @keyframes breathe {
    from {
      transform: scale(1);
    }
    to {
      transform: scale(1.03);
    }
  }
  .foam-drip {
    animation: drip calc(8s * var(--pace)) ease-in -1.8s infinite;
  }
  @keyframes drip {
    0%,
    62% {
      transform: translate(0, 0);
      opacity: 0;
    }
    66% {
      transform: translate(0, 0);
      opacity: 1;
    }
    94% {
      transform: translate(7px, 62px);
      opacity: 1;
    }
    100% {
      transform: translate(8px, 70px);
      opacity: 0;
    }
  }

  /* 4. A trinca é riscada em vez de surgir pronta. Ao abrir a tela elas
     esperam o copo subir e saem uma depois da outra; a que nasce de um voto
     recebe o atraso do `vote.ts`. */
  .crack {
    animation: draw 0.7s ease-out 1.1s both;
  }
  .crack:nth-child(2) {
    animation-delay: 1.25s;
  }
  .crack:nth-child(3) {
    animation-delay: 1.4s;
  }
  .crack:nth-child(4) {
    animation-delay: 1.55s;
  }
  .crack:nth-child(5) {
    animation-delay: 1.7s;
  }
  .crack:nth-child(6) {
    animation-delay: 1.85s;
  }
  @keyframes draw {
    from {
      stroke-dashoffset: 1.01;
    }
    to {
      stroke-dashoffset: 0;
    }
  }

  /* 5. Um reflexo atravessa o vidro na diagonal a cada 16 s, numa passada de
     1,4 s (o atraso negativo faz o primeiro passar uns 2,4 s depois de a tela
     abrir). */
  .glint {
    animation: sweep calc(16s * var(--pace)) ease-in-out calc(-12.2s * var(--pace)) infinite;
  }
  @keyframes sweep {
    0%,
    91.25% {
      transform: translateX(-70px) skewX(-18deg);
    }
    100% {
      transform: translateX(230px) skewX(-18deg);
    }
  }

  /* 6. Respingo de um voto novo: o `vote.ts` marca o copo com `data-splash`
     e guarda em `--landing` o nível de antes. Uma gota cai até ali, a superfície
     respinga, e só então o nível desliza (é o atraso das transições). */
  .glass[data-splash] :is(.glass-built, .beer, .layers, .bubbles, .beer-head, .rim) {
    transition-delay: 0.45s;
  }
  .glass[data-splash]::before,
  .glass[data-splash]::after {
    content: '';
    position: absolute;
    z-index: 2;
    box-sizing: border-box;
  }
  .glass[data-splash]::before {
    left: 92px;
    top: calc(var(--landing, 150px) - 14px);
    width: 7px;
    height: 10px;
    border: 1.5px solid var(--stroke);
    border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
    background: var(--beer-light);
    animation: fall 0.45s cubic-bezier(0.55, 0, 1, 0.5) both;
  }
  @keyframes fall {
    0% {
      transform: translateY(-80px);
      opacity: 0;
    }
    25%,
    95% {
      opacity: 1;
    }
    100% {
      transform: translateY(0);
      opacity: 0;
    }
  }
  .glass[data-splash]::after {
    left: 83px;
    top: calc(var(--landing, 150px) - 15px);
    width: 25px;
    height: 12px;
    border: 2px solid var(--stroke);
    border-bottom-color: transparent;
    border-radius: 50%;
    transform-origin: 50% 100%;
    animation: splash 0.5s ease-out 0.42s both;
  }
  @keyframes splash {
    from {
      transform: scale(0.25);
      opacity: 0.9;
    }
    to {
      transform: scale(1.35);
      opacity: 0;
    }
  }

  /* Com a aba em segundo plano (classe posta pelo `vote.ts`), o que anima sem
     parar fica pausado. */
  .paused :is(.bubble, .beer-head, .foam, .foam-drip, .foam-bubble, .glint) {
    animation-play-state: paused;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- telas largas: duas áreas lado a lado ---------- */

@media (min-width: 900px) {
  main {
    padding: 72px max(24px, (100% - 1040px) / 2) 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 390px);
    /* O conjunto fica no meio da tela: as linhas de 1fr em cima e embaixo
       dividem a sobra, e o postômetro, que ocupa todas, fica no meio delas. */
    /* A linha 3 é a do Turnstile: escondido, ele some do grid e a linha fica
       com altura zero. Por isso o espaço entre as linhas é a margem de cima de
       cada peça, e não `row-gap`, que deixaria um vão a mais. */
    grid-template-rows: 1fr auto auto auto 1fr;
    /* 36 px até 1000 de largura, 44 px em 1080, crescendo até 64 px em 1280. */
    column-gap: clamp(36px, 10vw - 64px, 64px);
    row-gap: 0;
  }
  /* No computador o postômetro inteiro (copo, rótulos, linhas e total) é
     ampliado. `zoom` redesenha na escala nova, sem borrar, e não mexe na conta
     do copo: por dentro tudo continua nas medidas de src/glass.ts.
     Entre 900 e 1079 px a ampliação é menor: com 1,5 os nomes dos cursos e a
     faixa não caberiam lado a lado. */
  .meter {
    grid-area: 1 / 1 / -1;
    align-self: center;
    zoom: 1.25;
  }
  .masthead {
    grid-area: 2 / 2;
  }
  .turnstile {
    grid-area: 3 / 2;
    margin-top: 24px;
  }
  .vote {
    grid-area: 4 / 2;
    margin-top: 24px;
  }
  /* A faixa é a resposta da página e continua sendo o maior texto da tela:
     cresce junto com o total ampliado (46 px × 1,25 = 57,5 px) e fica acima
     dele. O sublinhado acompanha na mesma proporção (210 px para 56 de letra). */
  .tier-text {
    font-size: 66px;
  }
  .underline {
    width: 248px;
    height: auto;
  }
}
@media (min-width: 1080px) {
  main {
    padding-inline: max(24px, (100% - 1120px) / 2);
    /* A coluna da direita alarga para a faixa mais longa caber numa linha. */
    grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  }
  .meter {
    zoom: 1.5;
  }
  /* Total ampliado: 46 px × 1,5 = 69 px. */
  .tier-text {
    font-size: 80px;
  }
  .underline {
    width: 300px;
  }
}

/* ---------- "Quanto tá" (/cotacao) ---------- */

/* Medidas e textos do protótipo do MVP; as cores e as fontes são as do resto
   da página. Sem JavaScript os controles são links e um formulário GET; com
   `prices.js`, que põe `prices-js` no <html>, a tela troca sem recarregar. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.prices {
  gap: 0;
}
.prices a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.headline {
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.headline-text {
  margin: 0;
  font-family: var(--marker);
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
}

/* A etiqueta "a mais barata": um cartão branco pendurado, com o furo à
   esquerda e a fita no canto. */
.price-tag {
  position: relative;
  margin: 22px 0 0;
  padding: 12px 20px 18px 44px;
  border: 2px solid var(--ink);
  border-radius: 10px 14px 9px 13px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 34, 51, 0.14);
  transform: rotate(-1deg);
}
.price-tag::before {
  content: '';
  position: absolute;
  left: 16px;
  top: calc(50% - 7px);
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}
.price-tag .tape {
  left: auto;
  right: 18px;
  top: -10px;
  width: 64px;
  height: 22px;
  transform: rotate(4deg);
}
.price-tag-title {
  margin: 0;
  font-family: var(--printer);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-text);
}
.price-tag-drink {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
}
.price-tag-price {
  margin: 4px 0 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--marker);
  font-size: 56px;
  line-height: 1;
}
.price-tag-price small {
  font-size: 24px;
}
.price-tag-price small + small {
  font-size: 20px;
}
.price-tag-meta {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--faded);
}
.price-tag-meta b {
  font-weight: 600;
  color: var(--ink);
}
.price-tag-hint {
  margin: 8px 0 0;
  font-family: var(--marker);
  font-size: 19px;
  line-height: 1.15;
  color: var(--red-text);
}

/* A tabela e a rodada. */
.board,
.round {
  margin-top: 32px;
}
.board-title {
  margin: 0 0 8px;
  font-family: var(--marker);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
}
.chips {
  margin: 0 -2px 4px;
  padding: 2px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip {
  flex: none;
  padding: 7px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--marker);
  font-size: 18px;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}
.chip[aria-current='true'] {
  background: var(--ink);
  color: var(--paper);
}
.chip-count {
  margin-left: 4px;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 12px;
  opacity: 0.8;
}
.qty {
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.qty-label {
  font-family: var(--marker);
  font-size: 19px;
  line-height: 1.1;
}
.qty-options {
  flex: none;
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qty-options a {
  min-width: 44px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 2px solid var(--ink);
  font-family: var(--marker);
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
}
.qty-options a:first-child {
  border-left: 0;
}
.qty-options a[aria-current='true'] {
  background: var(--ink);
  color: var(--paper);
}
.prices-notice {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 6px 9px 5px 10px;
  background: var(--highlight);
  font-size: 14px;
  line-height: 1.35;
}
.price-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  table-layout: fixed;
}
.price-table th {
  padding: 0 2px 8px;
  border-bottom: 2px solid var(--ink);
  font-weight: 400;
  text-align: center;
  vertical-align: bottom;
}
.price-table thead th:first-child {
  width: 40%;
  text-align: left;
}
.price-table .sort {
  display: inline-block;
  padding: 4px 10px;
  font-size: 16px;
}
.price-table .place,
.round-list .place {
  display: block;
  font-family: var(--marker);
  font-size: 19px;
  line-height: 1.1;
}
.age {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--faded);
}
.price-table tbody th,
.price-table td {
  padding: 10px 2px;
  border-bottom: 1px dashed var(--faded);
  text-align: center;
  vertical-align: middle;
}
.price-table tbody th {
  text-align: left;
}
.price-table tr.selected > * {
  background: var(--highlight);
}
.drink {
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
}
.drink-name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}
.drink-volume {
  font-size: 12px;
  line-height: 1.35;
  color: var(--faded);
}
.price {
  position: relative;
  display: inline-block;
  padding: 4px 6px;
  font-family: var(--printer);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.price-old {
  font-weight: 400;
  color: var(--faded);
  opacity: 0.6;
}
.circle {
  position: absolute;
  inset: -4px -8px;
  width: calc(100% + 16px);
  height: calc(100% + 8px);
  overflow: visible;
  pointer-events: none;
}
.circle path {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.deal {
  display: block;
  width: max-content;
  margin: 2px auto 0;
  padding: 1px 5px;
  border: 1.5px solid var(--red);
  border-radius: 3px;
  font-family: var(--printer);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--red-text);
  transform: rotate(-2deg);
}
.no-quote {
  font-size: 14px;
  color: var(--faded);
}
.legend {
  margin: 12px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--faded);
}
.legend + .legend {
  margin-top: 4px;
}
.legend .circle {
  position: static;
  flex: none;
  width: 34px;
  height: 20px;
}
.legend .deal {
  flex: none;
  margin: 0;
}
.prices-empty {
  margin: 0;
  padding: 32px 20px;
  font-family: var(--marker);
  font-size: 24px;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  transform: rotate(-1deg);
}
.round-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.round-controls select {
  flex: 1 1 160px;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 6px 9px 5px 10px;
  background: #fff;
  font-weight: 600;
  font-size: 15px;
}
.round-see {
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 8px 10px 7px 11px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}
/* Com `prices.js` a bebida troca na hora, sem o botão. */
.prices-js .round-see {
  display: none;
}
.stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  font-family: var(--marker);
  font-size: 26px;
  line-height: 1;
}
.step {
  width: 44px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
span.step {
  color: var(--faded);
  opacity: 0.5;
}
.stepper output {
  min-width: 34px;
  text-align: center;
}
.round-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.round-list li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed var(--faded);
}
.round-list .place {
  font-size: 21px;
}
.round-list .deal {
  display: inline-block;
  margin: 0 0 0 4px;
  vertical-align: middle;
}
.round-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.round-value .price {
  margin-right: 8px;
}
.round-next {
  margin-right: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--faded);
}
.prices-footer {
  margin: 32px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--faded);
  text-align: center;
  text-wrap: balance;
}
@media (hover: hover) {
  .chip:hover:not([aria-current]),
  .qty-options a:hover:not([aria-current]),
  .step:is(a):hover {
    background: var(--highlight);
  }
  .drink:hover .drink-name {
    text-decoration: underline 2px;
    text-underline-offset: 3px;
  }
}
/* No computador a "Quanto tá" usa a mesma grade de duas áreas da "Quem vai"
   (colunas, margens e espaço entre elas vêm da regra de `main` lá de cima): a
   tabela no lugar do copo, à esquerda; o topo com as abas, a etiqueta e a
   rodada à direita. Trocar de aba deixa o topo no mesmo lugar. As linhas de
   1fr em cima e embaixo põem o conjunto no meio da tela quando ele cabe; o
   rodapé vai embaixo, nas duas colunas. Sem etiqueta e rodada (cotação velha,
   sem preço), as linhas delas somem. */
@media (min-width: 900px) {
  main.prices {
    grid-template-rows: 1fr auto auto auto 1fr auto;
    /* O mesmo espaço entre colunas de `main`, que o `gap: 0` de `.prices` anularia. */
    gap: 0 clamp(36px, 10vw - 64px, 64px);
  }
  .prices .board {
    grid-area: 2 / 1 / 5;
    align-self: start;
    margin-top: 0;
  }
  .prices .price-tag {
    grid-area: 3 / 2;
  }
  .prices .round {
    grid-area: 4 / 2;
  }
  .prices-footer {
    grid-area: 6 / 1 / auto / -1;
  }
  .prices .underline {
    width: 210px;
  }
}
/* Com a coluna da tabela mais larga, ela cresce como o copo da "Quem vai":
   `zoom` redesenha na escala nova sem borrar. A 1080 px a coluna tem uns
   560 px, que divididos por 1,15 ainda dão mais que os 430 do celular. */
@media (min-width: 1080px) {
  .prices .board {
    zoom: 1.15;
  }
}
