/* Tinta Brava: telas fora da partida (menu, sala, resultado, opções).
   A partida em si é desenhada no canvas.

   Direção: cartaz de rua pintado à mão. Traço escuro grosso, cor chapada,
   sombra dura deslocada (nunca borrada), papel creme colado num muro amarelo
   com as cores dos dois times, fita crepe e etiquetas levemente tortas. Nada
   de vidro, brilho nem degradê de enfeite.

   Celular primeiro: cabe em 390 px de largura em pé e em 390 px de altura
   deitado (iPhone, 844x390). Ninguém confere isto num navegador, então o CSS
   é conservador de propósito: flex, grid e clamp; nada de `inset`.

   Três combinados que valem para o arquivo todo:
   - peça que se inclina guarda o ângulo em --r e usa rotate(var(--r)): a
     entrada (.pop) e o aperto do botão não desfazem a inclinação;
   - altura de tela vem de --vh (1dvh onde existe): no Safari deitado a barra
     de endereço come uns 50 px e o vh puro não fica sabendo;
   - mancha, pincelada e escorrido são máscaras (SVG embutido) pintadas com
     uma cor do CSS: só enfeite, nunca conteúdo. */

@font-face {
  font-family: "Baloo 2";
  src: url("assets/fonts/baloo2.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1a1d2b;
  --bg: #161a2b;
  --wall: #ffd23f;
  --paper: #fff4dc;
  --paper2: #f3e3bd;
  --tape: #ecdcae;
  --muted: #5e5a66;
  --yellow: #ffd23f;
  --pink: #ff4fa3;
  --blue: #4f6bff;
  --orange: #ff7a1a;
  --mint: #19e0b0;
  --red: #ff3b5c;
  /* faixas do muro: as cores dos dois times (o ui.js troca pelas do mapa) */
  --wa: #ff7a1a;
  --wb: #4353ff;
  /* cor de quem venceu, para a tinta que escorre no resultado */
  --tw: #ff4fa3;
  /* cor do corpo do personagem em destaque */
  --hero: #ff7a1a;
  --font: "Baloo 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --vh: 1vh;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  /* contorno de letra pequena (a grande usa .stk) */
  --outline: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink),
    1.5px 1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px -1.5px 0 var(--ink);
  --outline-s: 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 1.5px 0 var(--ink), 0 -1.5px 0 var(--ink),
    1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink);
  /* retícula de cartaz */
  --dots: radial-gradient(circle at center, rgba(26, 29, 43, 0.13) 0, rgba(26, 29, 43, 0.13) 28%, transparent 31%);
  /* pontas serrilhadas da fita crepe */
  --cut: polygon(0 0, 100% 0, calc(100% - 4px) 17%, 100% 34%, calc(100% - 4px) 50%, 100% 67%, calc(100% - 4px) 84%, 100% 100%, 0 100%, 4px 84%, 0 67%, 4px 50%, 0 34%, 4px 17%);
  --m-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.4l2.6 2.6 5-5.6' fill='none' stroke='%231a1d2b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  /* máscaras de tinta: mancha, pincelada, escorrido e selo de pontas */
  --m-splat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M73.6 62.7C71 63.7 74.4 67.1 74.1 69C73.8 71 73 73.1 71.7 74.4C70.5 75.6 68.4 76.6 66.4 76.5C64.4 76.5 61.3 73.3 59.6 74.2C58 75.1 58.1 80.1 56.6 82C55.2 83.8 53 85.4 51.1 85.5C49.2 85.5 46.8 84.1 45.3 82.2C43.8 80.4 44.1 74.3 41.9 74.6C39.7 74.8 34.9 82.2 31.9 83.6C28.9 85.1 25.6 84.6 23.7 83.4C21.8 82.1 19.8 79.5 20.6 76.2C21.5 72.8 29.1 65.4 28.5 63.3C28 61.1 20 64 17.2 63.1C14.3 62.2 11.8 60 11.4 58C11 56 13 53 15 51.1C17.1 49.1 22.5 47.9 23.6 46.2C24.7 44.4 21.8 42.4 21.6 40.6C21.4 38.8 21.7 36.7 22.5 35.2C23.3 33.7 24.9 32.3 26.5 31.5C28.1 30.6 31.8 32.5 32.3 30.1C32.8 27.7 29.3 20.3 29.6 17C29.9 13.7 32.1 11.2 34.2 10.3C36.3 9.5 39.6 9.4 42.1 11.9C44.6 14.3 47.2 23.5 49.2 25C51.3 26.4 52.6 21.1 54.3 20.3C56.1 19.6 58 20.2 59.7 20.7C61.3 21.3 63.1 22.2 64.2 23.6C65.3 25.1 64.8 28.3 66.4 29.3C67.9 30.2 71.5 28.5 73.4 29.1C75.3 29.7 76.7 31.4 77.7 32.9C78.7 34.4 80 36.3 79.5 38.3C79 40.3 72.7 43.1 74.6 44.9C76.6 46.6 87.7 46.8 91.2 48.8C94.6 50.7 95.5 54.2 95.3 56.6C95 59 93.3 62.1 89.7 63.1C86.1 64.1 76.2 61.7 73.6 62.7ZM47.8 92.5a3.7 3.7 0 1 1 7.4 0a3.7 3.7 0 1 1 -7.4 0ZM35.8 8.3a3.9 3.9 0 1 1 7.7 0a3.9 3.9 0 1 1 -7.7 0ZM73.3 83.4a2.4 2.4 0 1 1 4.9 0a2.4 2.4 0 1 1 -4.9 0Z'/%3E%3C/svg%3E");
  --m-splat2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M27.6 62.7C26.6 60.8 20.5 61.8 18.6 60.4C16.8 58.9 16.7 56.3 16.5 54.2C16.4 52 16.2 49.4 17.8 47.6C19.4 45.8 25.1 45.2 25.9 43.3C26.6 41.4 22.7 38.3 22.5 36.2C22.3 34 23.5 31.9 24.9 30.4C26.2 28.9 28.3 27.7 30.4 27.3C32.5 26.9 36 29.4 37.6 28.1C39.1 26.7 38.4 20.9 39.8 19.3C41.2 17.6 44 18.3 46.1 18.2C48.1 18.2 50.5 17.6 52.3 18.8C54.1 19.9 54.6 25.1 56.9 25.2C59.1 25.2 62.9 19.7 65.7 18.8C68.4 18 71.4 18.8 73.3 20.1C75.2 21.4 77.2 23.7 77.2 26.5C77.1 29.3 72.3 34.8 73 37C73.6 39.2 79 38.3 81.1 39.7C83.3 41.1 85.2 43.4 85.8 45.6C86.3 47.7 86.3 50.6 84.4 52.5C82.5 54.4 75.4 54.8 74.5 56.8C73.5 58.7 78.3 62.1 78.5 64.3C78.8 66.6 77.3 68.7 76 70.2C74.6 71.8 72.7 73.4 70.5 73.7C68.3 74.1 64.5 71.3 62.8 72.5C61.1 73.7 61.7 79.3 60.3 81.1C58.8 82.9 56.2 83.3 54.1 83.3C52 83.4 49.6 82.8 47.7 81.5C45.8 80.2 45 76 42.9 75.6C40.8 75.3 37.5 79.4 35.1 79.6C32.7 79.9 30.5 78.5 28.7 77.3C26.9 76.1 24.5 74.6 24.3 72.2C24.1 69.7 28.5 64.7 27.6 62.7ZM5.5 54.1a2.9 2.9 0 1 1 5.7 0a2.9 2.9 0 1 1 -5.7 0ZM85.1 28.9a3.5 3.5 0 1 1 7 0a3.5 3.5 0 1 1 -7 0Z'/%3E%3C/svg%3E");
  --m-stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M14 7.9L31 8.5L48 9L65 9.8L82 7.2L99 8.5L116 10.1L133 9.2L150 7.1L167 10.4L184 9.7L191.5 9L179.5 12.5L196.9 16L177.4 19.5L198.8 23L181.2 26.5L190.2 30L180.1 33.5L192.9 37L177.3 40.5L187.4 44L176.4 47.5L190.1 51L184 52.5L167 50.2L150 50.7L133 51.5L116 51.9L99 50L82 49.3L65 52.3L48 51.7L31 49.1L14 51.4L9.7 51L11.4 46L10.2 40.5L12.6 35.5L6.3 30L12.9 25L10 19.5L10.5 14.5L8.6 9Z'/%3E%3C/svg%3E");
  --m-drips: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 0H200V12Q195.3 9 190.6 13.5V13.1a3.2 3.2 0 0 1 -6.4 0V13.5Q181 9 177.8 12Q174.6 9 171.5 17.8V24a4.7 4.7 0 0 1 -9.3 0V17.8Q158.9 9 155.6 12Q153.1 9 150.7 14.8V15.9a4.1 4.1 0 0 1 -8.2 0V14.8Q138 9 133.3 12Q130 9 126.7 14.2V14a4.2 4.2 0 0 1 -8.4 0V14.2Q114.7 9 111.1 12Q107.1 9 103.1 21.4V36.2a2.5 2.5 0 0 1 -5.1 0V21.4Q93.5 9 88.9 12Q86.2 9 83.5 14.9V15a5.2 5.2 0 0 1 -10.4 0V14.9Q69.9 9 66.7 12Q63.8 9 61 17.7V25.1a3.2 3.2 0 0 1 -6.5 0V17.7Q49.5 9 44.4 12Q40.8 9 37.2 19.3V30a2.7 2.7 0 0 1 -5.4 0V19.3Q27 9 22.2 12Q18.5 9 14.7 15V17.1a3.4 3.4 0 0 1 -6.8 0V15Q3.9 9 0 12V0Z'/%3E%3C/svg%3E");
  --m-burst: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M50 1L59.2 9.9L71.3 5.9L75.7 17.8L88.3 19.4L87.1 32.1L97.8 39.1L91.2 50L97.8 60.9L87.1 67.9L88.3 80.6L75.7 82.2L71.3 94.1L59.2 90.1L50 99L40.8 90.1L28.7 94.1L24.3 82.2L11.7 80.6L12.9 67.9L2.2 60.9L8.8 50L2.2 39.1L12.9 32.1L11.7 19.4L24.3 17.8L28.7 5.9L40.8 9.9Z'/%3E%3C/svg%3E");
}
@supports (height: 1dvh) {
  :root { --vh: 1dvh; }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.25;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  touch-action: manipulation;
}

h1, h2, h3, p { margin: 0; }
button, input { font-family: inherit; }

/* ---------- O muro ----------
   Amarelo, com uma faixa de cada time cortando os cantos na diagonal, traço
   escuro na emenda e uns pingos soltos. Só gradiente de parada seca. */
body::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 29% 13%, var(--wa) 0, var(--wa) 11px, var(--ink) 12px, var(--ink) 14px, transparent 15px),
    radial-gradient(circle at 26% 27%, var(--wa) 0, var(--wa) 4px, var(--ink) 5px, var(--ink) 7px, transparent 8px),
    radial-gradient(circle at 14% 93%, var(--wa) 0, var(--wa) 7px, var(--ink) 8px, var(--ink) 10px, transparent 11px),
    radial-gradient(circle at 71% 88%, var(--wb) 0, var(--wb) 12px, var(--ink) 13px, var(--ink) 15px, transparent 16px),
    radial-gradient(circle at 76% 71%, var(--wb) 0, var(--wb) 5px, var(--ink) 6px, var(--ink) 8px, transparent 9px),
    radial-gradient(circle at 90% 9%, var(--wb) 0, var(--wb) 8px, var(--ink) 9px, var(--ink) 11px, transparent 12px),
    linear-gradient(112deg, var(--wa) 0, var(--wa) 21%, var(--ink) calc(21% + 1px), var(--ink) calc(21% + 4px), transparent calc(21% + 5px)),
    linear-gradient(112deg, transparent 0, transparent 81%, var(--ink) calc(81% + 1px), var(--ink) calc(81% + 4px), var(--wb) calc(81% + 5px)),
    var(--wall);
}
/* retícula que some para o meio do muro */
body::after {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--dots);
  background-size: 13px 13px;
  -webkit-mask-image: linear-gradient(112deg, transparent 20%, #000 23%, transparent 48%, transparent 58%, #000 80%, transparent 82%);
  mask-image: linear-gradient(112deg, transparent 20%, #000 23%, transparent 48%, transparent 58%, #000 80%, transparent 82%);
}

#safe {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  visibility: hidden;
  padding: var(--sat) var(--sar) var(--sab) var(--sal);
}

#game {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  touch-action: none;
  background: var(--bg);
}
#game[hidden] { display: none; }
/* Partida em 3D: o WebGL fica embaixo e este canvas vira só a camada do HUD. */
#game.overlay { background: transparent; }
#game3d {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  background: var(--bg);
}
#game3d[hidden] { display: none; }

#ui {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2;
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding:
    max(10px, var(--sat)) max(14px, var(--sar))
    max(12px, var(--sab)) max(14px, var(--sal));
}
#ui[hidden] { display: none; }
/* Resultado por cima da partida: escurece o mapa e a tinta de quem venceu escorre do alto. */
#ui.over-game { background: rgba(26, 29, 43, 0.62); }
#ui.over-game::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 34px;
  z-index: 0;
  pointer-events: none;
  background: var(--tw);
  -webkit-mask-image: var(--m-drips);
  -webkit-mask-size: 420px 100%;
  -webkit-mask-repeat: repeat-x;
  -webkit-mask-position: 0 0;
  mask-image: var(--m-drips);
  mask-size: 420px 100%;
  mask-repeat: repeat-x;
  mask-position: 0 0;
}

/* Pincelada que atravessa a tela na troca de tela (classe .go, posta pelo ui.js). */
#wipe {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}
#wipe::before, #wipe::after {
  content: "";
  position: absolute;
  top: -10%; bottom: -10%; left: 0;
  width: 46%;
  background: var(--ink);
  transform: translateX(-260%) skewX(-18deg);
}
#wipe::after { width: 30%; background: var(--pink); }
/* `backwards`: terminou, a faixa volta para fora da tela (com `both` a ponta de
   baixo da rosa sobrava no canto em tela alta, por cima de tudo). */
#wipe.go::before { animation: wipe 0.5s cubic-bezier(0.55, 0, 0.3, 1) backwards; }
#wipe.go::after { animation: wipe 0.5s cubic-bezier(0.55, 0, 0.3, 1) 0.06s backwards; }
@keyframes wipe {
  from { transform: translateX(-140%) skewX(-18deg); }
  to { transform: translateX(520%) skewX(-18deg); }
}

.screen {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 940px;
}

/* Entrada com mola, uma peça depois da outra (--i é a vez de cada uma). */
.pop {
  animation: pop-in 0.42s cubic-bezier(0.3, 1.45, 0.5, 1) backwards;
  animation-delay: calc(var(--i, 0) * 55ms + 70ms);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(18px) scale(0.88) rotate(var(--r, 0deg)); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(var(--r, 0deg)); }
}
/* a mesma tela redesenhada (alguém entrou, troquei de aba): sem entrada de novo */
#ui.again .pop { animation: none; }

/* ---------- Botões: adesivo com traço e sombra dura; afunda quando aperta ---------- */
.btn {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font: 800 17px/1.05 var(--font);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.06s, box-shadow 0.06s;
}
.btn:active { transform: translateY(4px) rotate(var(--r, 0deg)); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--yellow); }
.btn.pink { background: var(--pink); }
.btn.blue { background: var(--blue); color: #ffffff; text-shadow: var(--outline-s); }
.btn.mint { background: var(--mint); }
.btn.ghost { background: var(--paper2); }
.btn.danger { background: var(--red); color: #ffffff; text-shadow: var(--outline-s); }
.btn.big { min-height: 62px; border-width: 4px; border-radius: 18px; font-size: 24px; box-shadow: 0 6px 0 var(--ink); }
.btn.big:active { transform: translateY(5px) rotate(var(--r, 0deg)); box-shadow: 0 1px 0 var(--ink); }
.btn.small { min-height: 40px; padding: 5px 12px; border-radius: 11px; font-size: 13.5px; box-shadow: 0 4px 0 var(--ink); }
.btn.small:active { transform: translateY(3px) rotate(var(--r, 0deg)); box-shadow: 0 1px 0 var(--ink); }
/* a opção escolhida: afundada e pintada de escuro */
.btn.on { background: var(--ink); color: var(--yellow); text-shadow: none; transform: translateY(2px) rotate(var(--r, 0deg)); box-shadow: 0 2px 0 var(--ink); }
.btn.full { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.on[disabled] { opacity: 0.9; }
.btn .sub { display: block; font-weight: 800; font-size: 11.5px; letter-spacing: 0.05em; }
/* "Voltar" e "Sair": setinha desenhada */
.btn.back::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 9px 6px 0;
  border-color: transparent var(--ink) transparent transparent;
}

.row { display: flex; gap: 10px; }
.row > * { flex: 1 1 0; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.spacer { flex: 0 0 auto; width: 84px; }
.nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm small {
  display: block; overflow: hidden; text-overflow: ellipsis;
  font-weight: 700; font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--muted);
}
.hint { font: 700 12px/1.3 var(--font); color: rgba(26, 29, 43, 0.74); text-align: center; overflow-wrap: anywhere; }
.hint b { color: var(--ink); -webkit-user-select: text; user-select: text; }
.status { font: 800 12.5px/1.25 var(--font); text-align: center; }
.status b { color: #c2156a; }

/* ---------- Cartaz: papel creme colado no muro com fita crepe ---------- */
.poster {
  position: relative;
  padding: 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 6px 7px 0 var(--ink);
}
.poster::before, .sheet::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  z-index: 3;
  width: 92px;
  height: 23px;
  margin-left: -46px;
  background: var(--tape);
  -webkit-clip-path: var(--cut);
  clip-path: var(--cut);
  transform: rotate(-2.5deg);
  pointer-events: none;
}
/* lista comprida dentro de um cartaz: quem rola é o miolo, para a fita não ser cortada */
.scroll-y { min-height: 0; }

/* etiqueta de fita crepe */
.tape-tag {
  display: inline-block;
  max-width: 100%;
  justify-self: start;
  padding: 3px 14px 2px;
  overflow: hidden;
  background: var(--tape);
  color: var(--ink);
  font: 800 12px/1.3 var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-clip-path: var(--cut);
  clip-path: var(--cut);
  --r: -2deg;
  transform: rotate(var(--r));
}
.tape-tag.hot { background: var(--pink); }

/* título de tela: letra amarela em cima de uma pincelada escura */
.title {
  position: relative;
  z-index: 0;
  padding: 5px 30px 6px 24px;
  color: var(--yellow);
  font: 800 24px/1.05 var(--font);
  letter-spacing: 0.04em;
  text-shadow: var(--outline);
  text-transform: uppercase;
  white-space: nowrap;
  --r: -2deg;
  transform: rotate(var(--r));
}
.title::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  background: var(--ink);
}
.title::before, .sheet h2::after {
  -webkit-mask-image: var(--m-stroke);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: var(--m-stroke);
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}

/* letra grande com contorno grosso e sombra dura: duas cópias do texto por
   trás (data-text), uma delas deslocada para baixo */
.stk { position: relative; z-index: 0; display: inline-block; text-shadow: var(--outline); white-space: nowrap; }
.stk::before, .stk::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  color: var(--ink);
  -webkit-text-stroke: 0.24em var(--ink);
  stroke-linejoin: round;
  pointer-events: none;
}
.stk::before, .stk::after { text-shadow: none; }
.stk::after { top: 0.1em; z-index: -2; }

/* selo de pontas (liga, VS) */
.seal {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1;
  text-align: center;
  --r: 8deg;
  transform: rotate(var(--r));
}
.seal::before, .seal::after, .vs::before, .vs::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  background: var(--mint);
}
.seal::after, .vs::after {
  top: -5px; right: -5px; bottom: -8px; left: -5px;
  z-index: -2;
  background: var(--ink);
}
.seal::before, .seal::after, .vs::before, .vs::after, .btn.play::before, .btn.play::after {
  -webkit-mask-image: var(--m-burst);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: var(--m-burst);
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}
.seal small { font: 800 10px/1 var(--font); letter-spacing: 0.1em; text-transform: uppercase; }
.seal b { max-width: 78px; overflow: hidden; font: 800 15px/1.15 var(--font); text-transform: uppercase; }
.seal i { font: 800 11px/1 var(--font); }
button.seal { cursor: pointer; }
button.seal:active { transform: scale(0.93) rotate(var(--r)); }

/* retrato do personagem em pé numa mancha de tinta da cor dele */
.hero-wrap {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 0;
  flex: 0 0 auto;
  display: block;
  width: var(--hs);
  height: var(--hs);
  padding: 0;
  border: 0;
  background: none;
}
.hero-wrap::before, .hero-wrap::after {
  content: "";
  position: absolute;
  left: 1%; right: 1%; bottom: 3%;
  height: 27%;
  z-index: -1;
  background: var(--hero);
}
.hero-wrap::after {
  left: -1.5%; right: -1.5%; bottom: 0.5%;
  height: 31%;
  z-index: -2;
  background: var(--ink);
}
/* sem 3D o boneco é visto de cima: a mancha vai para o meio */
.hero-wrap.flat::before { left: 9%; right: 13%; bottom: 17%; height: 64%; }
.hero-wrap.flat::after { left: 6.5%; right: 10.5%; bottom: 14.5%; height: 68%; }
.hero-wrap::before, .hero-wrap::after {
  -webkit-mask-image: var(--m-splat);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: var(--m-splat);
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}
.wd-art::before, .wd-art::after {
  -webkit-mask-image: var(--m-splat2);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: var(--m-splat2);
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}
.hero { display: block; width: 100%; height: 100%; }
button.hero-wrap { cursor: pointer; }
button.hero-wrap:active { transform: scale(0.97); }

/* ---------- Tela inicial ---------- */
.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 470px;
}
/* palco: letreiro, selo da liga, personagem e etiquetas, montados como colagem */
.stage {
  position: relative;
  --ls: clamp(40px, calc(var(--vh) * 8.4), 66px);
  --hs: min(70vw, calc(var(--vh) * 38), 300px);
  height: min(92vw, calc(var(--vh) * 46));
  min-height: 250px;
}
.logo {
  position: absolute;
  left: 4px;
  top: 14px;
  z-index: 3;
  font: 800 var(--ls)/0.8 var(--font);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  --r: -5deg;
  transform: rotate(var(--r));
  transform-origin: 0 60%;
  pointer-events: none;
}
.logo .stk { display: block; width: -webkit-max-content; width: max-content; }
.logo-a { color: #ffffff; }
.logo-b { margin-left: 0.3em; color: var(--yellow); }
.stage .seal { position: absolute; left: 6px; top: calc(var(--ls) * 1.68 + 26px); z-index: 3; }
.stage .hero-wrap { position: absolute; right: -4px; bottom: 46px; z-index: 2; }
.stage-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
/* nome escrito numa tira de fita crepe */
.nametag {
  flex: 1 1 170px;
  min-width: 0;
  max-width: 240px;
  display: grid;
  padding: 4px 16px 6px;
  background: var(--tape);
  -webkit-clip-path: var(--cut);
  clip-path: var(--cut);
  --r: -2deg;
  transform: rotate(var(--r));
}
.nametag span { font: 800 10px/1.2 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nametag input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-bottom: 2px dashed rgba(26, 29, 43, 0.5);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 800 20px/1.1 var(--font);
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.nametag input:focus { border-bottom: 2px solid var(--pink); }
.nametag input::placeholder { color: rgba(26, 29, 43, 0.4); }
/* arma escolhida: etiqueta que leva para a troca */
.geartag {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 6px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 800 14px/1.05 var(--font);
  text-align: left;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  --r: 2deg;
  transform: rotate(var(--r));
}
.geartag:active { transform: translateY(3px) rotate(var(--r)); box-shadow: 0 1px 0 var(--ink); }
.geartag canvas { flex: 0 0 auto; display: block; width: 34px; height: 34px; }

/* cartaz das ações */
.menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 20px 14px 12px;
  --r: 0.6deg;
  transform: rotate(var(--r));
}
/* aqui quem segura o cartaz é a etiqueta do modo de jogo */
.menu::before { display: none; }
.menu > .tape-tag { position: absolute; top: -13px; left: 12px; z-index: 3; --r: -3deg; }
/* o botão que não dá para errar */
.btn.play {
  flex-direction: column;
  gap: 3px;
  min-height: 80px;
  padding: 8px 14px 9px;
  border-width: 4px;
  border-radius: 18px;
  background: var(--pink);
  color: #ffffff;
  box-shadow: 0 7px 0 var(--ink);
}
.btn.play:active { transform: translateY(6px) rotate(var(--r, 0deg)); box-shadow: 0 1px 0 var(--ink); }
.play-t { display: block; font: 800 30px/1 var(--font); letter-spacing: 0.02em; text-shadow: var(--outline), 0 4px 0 var(--ink); }
.btn.play .sub { color: var(--ink); }
/* selo "JÁ!" balançando no canto */
.btn.play::before, .btn.play::after {
  content: "";
  position: absolute;
  top: -28px;
  right: -20px;
  width: 58px;
  height: 58px;
  background: var(--ink);
  pointer-events: none;
  animation: wob 2.6s ease-in-out infinite;
}
.btn.play::after {
  content: "JÁ!";
  top: -24px;
  right: -16px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  color: var(--ink);
  font: 800 15px/1 var(--font);
  letter-spacing: 0;
  text-shadow: none;
}
@keyframes wob {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.07); }
}
.menu .row > * { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; font-size: 15px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-grid .btn { padding-left: 3px; padding-right: 3px; font-size: 12.5px; }

/* ---------- Telas de dentro: barra com Voltar e título, depois o conteúdo ---------- */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.bar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.bar .title { margin: 0 auto; }
/* quem cede na barra é o título, nunca o botão (em pé o "Voltar" era esmagado) */
.bar > .btn { flex: 0 0 auto; }
@media (max-width: 460px) {
  .spacer { display: none; }
}

/* Personagem */
.custom { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.custom > * { min-width: 0; }
.custom-preview { display: grid; justify-items: center; align-content: start; gap: 10px; --hs: min(62vw, 250px); }
.swatches { display: flex; gap: 7px; }
/* tampinha de lata de tinta */
.swatch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--c, #ffffff);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s;
}
.swatch.on { transform: translateY(-4px) scale(1.14); box-shadow: 0 6px 0 var(--ink); }
.swatch.on::after {
  content: "";
  position: absolute;
  top: 3px; right: 3px; bottom: 3px; left: 3px;
  border: 3px solid #ffffff;
  border-radius: 50%;
}
.custom-pick { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 14px 10px 10px; }
.tabs, .rack {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar, .rack::-webkit-scrollbar, .steps::-webkit-scrollbar, .awards::-webkit-scrollbar { display: none; }
.tabs { flex: 0 0 auto; gap: 4px; padding: 2px 2px 6px; }
.tabs .btn { flex: 1 0 auto; padding-left: 6px; padding-right: 6px; font-size: 12px; }
/* opções em fichas de amostra de cor (leque de tintas) */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  align-content: start;
  gap: 12px 8px;
  padding: 6px 4px 10px;
}
.tile {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background-color: var(--paper2);
  background-image: var(--dots);
  background-size: 9px 9px;
  color: var(--ink);
  font: 800 11.5px/1.05 var(--font);
  text-align: center;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.08s;
}
.tile canvas { display: block; width: 58px; height: 58px; margin: 5px auto 3px; }
.tile-name { display: block; margin-top: auto; padding: 4px 2px 3px; border-top: 3px solid var(--ink); background: #ffffff; }
.tile.on { --r: -3deg; transform: translateY(-3px) rotate(var(--r)); box-shadow: 0 7px 0 var(--ink); }
.tile.on .tile-name { background: var(--yellow); }
.tile.on::after, .member.ready::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--mint) var(--m-check) center / 11px 11px no-repeat;
}
/* cor de detalhe: um pingo da própria cor (só borda arredondada: é conteúdo,
   não pode depender de máscara) */
.dot {
  display: block;
  width: 44px;
  height: 44px;
  margin: 12px auto 10px;
  border: 3px solid var(--ink);
  border-radius: 58% 42% 55% 45% / 48% 58% 42% 52%;
  background: var(--c, #ffffff);
  box-shadow: 0 3px 0 var(--ink);
}

/* Arma: prateleira de escolha e ficha da escolhida */
.weapons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.weapons > * { min-width: 0; }
.rack { gap: 8px; padding: 2px 4px 8px 2px; }
.wcard {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  padding: 4px 14px 4px 6px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 800 16px/1.05 var(--font);
  text-align: left;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.08s;
}
.wcard canvas { flex: 0 0 auto; display: block; width: 40px; height: 40px; }
.wcard.on { --r: -1.5deg; background: var(--yellow); transform: translateY(-2px) rotate(var(--r)); box-shadow: 0 6px 0 var(--ink); }
.wcard.on .nm small { color: var(--ink); }
.wdetail { padding: 0; }
.wd-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px 14px 12px; }
.wd-art { position: relative; z-index: 0; width: 150px; height: 150px; margin: 0 auto; }
.wd-art::before, .wd-art::after {
  content: "";
  position: absolute;
  top: 8%; right: 0; bottom: 4%; left: 0;
  z-index: -1;
  background: var(--yellow);
}
.wd-art::after { top: 5.5%; right: -2.5%; bottom: 1%; left: -2.5%; z-index: -2; background: var(--ink); }
.wd-art canvas { display: block; width: 100%; height: 100%; }
.wd-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; min-width: 0; }
.wd-text h3 { font: 800 26px/1 var(--font); letter-spacing: 0.02em; text-transform: uppercase; }
.blurb { font: 600 14px/1.3 var(--font); }
.bars { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; font: 800 11px/1 var(--font); letter-spacing: 0.05em; text-transform: uppercase; }
/* cinco pinceladas por atributo */
.pips { display: flex; gap: 4px; }
.pips i { flex: 0 0 22px; height: 11px; border: 2px solid var(--ink); border-radius: 3px; background: rgba(26, 29, 43, 0.1); transform: skewX(-14deg); }
.pips i.on { background: var(--pink); }
.special-line {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  border: 2px dashed rgba(26, 29, 43, 0.5);
  border-radius: 8px;
  font: 600 12.5px/1.25 var(--font);
}
.special-line canvas { flex: 0 0 auto; display: block; width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 50%; background: var(--mint); }
.special-line b { font-weight: 800; }

/* ---------- Sala: um time de cada lado ---------- */
.lobby .bar { align-items: center; }
.code-box { flex: 1 1 auto; min-width: 0; text-align: center; line-height: 1; }
.code-box small { display: block; margin-bottom: 1px; font: 800 11px/1.2 var(--font); letter-spacing: 0.08em; text-transform: uppercase; }
.code-box b {
  display: inline-block;
  max-width: 100%;
  padding: 2px 10px 0 calc(10px + 0.16em);
  background: var(--tape);
  font: 800 26px/1.05 var(--font);
  letter-spacing: 0.16em;
  -webkit-clip-path: var(--cut);
  clip-path: var(--cut);
  transform: rotate(-2deg);
  -webkit-user-select: text;
  user-select: text;
}
.code-box b.mode { padding: 3px 14px 1px; font-size: 20px; letter-spacing: 0.03em; text-transform: uppercase; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lobby-grid > * { min-width: 0; }
.lobby-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }
.teams { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.team {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
  padding: 5px 5px 6px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--tc);
  box-shadow: 0 5px 0 var(--ink);
  transform: rotate(var(--r, 0deg));
}
.team-a { --tc: var(--ta, var(--wa)); --r: -0.8deg; }
.team-b { --tc: var(--tb, var(--wb)); --r: 0.8deg; }
.team h3 {
  padding: 0 2px 1px;
  overflow: hidden;
  color: #ffffff;
  font: 800 15px/1.2 var(--font);
  letter-spacing: 0.04em;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: var(--outline-s);
  text-transform: uppercase;
  white-space: nowrap;
}
.vs {
  position: absolute;
  left: 50%;
  top: -9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  font: 800 14px/1 var(--font);
  transform: rotate(8deg);
}
.vs::before { background: var(--yellow); }
.vs::after { top: -4px; right: -4px; bottom: -6px; left: -4px; }
.member {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 1px 6px 1px 3px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  font: 800 13.5px/1.1 var(--font);
}
.member canvas.avatar { display: block; width: 32px; height: 32px; }
.member canvas.wicon { display: block; width: 24px; height: 24px; }
.member .nm small { font-size: 10.5px; }
.member.me { border-width: 3px; background: var(--yellow); }
.member.me .nm small { color: var(--ink); }
.member.off { opacity: 0.55; }
.member.ready .nm small { color: #08745b; }
.member.ready::after { top: -7px; right: -7px; }
.member.slot {
  grid-template-columns: minmax(0, 1fr);
  border-style: dashed;
  background: rgba(255, 255, 255, 0.28);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}
.lobby-actions { display: flex; gap: 8px; }
.lobby-actions .btn { flex: 1 1 0; padding-left: 6px; padding-right: 6px; font-size: 12.5px; }
.lobby-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.cfg { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.cfg-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; padding: 14px 10px 8px; }
/* os mapas são cartões (.mapcard, no bloco "mapas e copa", no fim); aqui fica só o nome, que nunca quebra */
.mn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-blurb { font: 600 12px/1.25 var(--font); }
.map-blurb b { font-weight: 800; }
.cfg-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 6px; }
.cfg-row > span { font: 800 11px/1.1 var(--font); letter-spacing: 0.05em; text-transform: uppercase; }
.seg { display: flex; flex-wrap: wrap; gap: 5px; }
.seg .btn { flex: 1 1 auto; min-height: 30px; padding: 3px 8px; border-radius: 9px; font-size: 12px; box-shadow: 0 3px 0 var(--ink); }
.seg .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.seg .btn.on { transform: translateY(1px); box-shadow: 0 2px 0 var(--ink); }
/* partida rápida: cartaz do modo de jogo, com a contagem */
.mode-card { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: center; padding: 22px 14px 14px; text-align: center; }
.mode-card h3 { font: 800 26px/1 var(--font); letter-spacing: 0.03em; text-transform: uppercase; }
.mode-card p { font: 600 14px/1.3 var(--font); }
.mode-card .status { font-weight: 800; }
.mode-card .status b { display: inline-block; min-width: 1.1em; color: var(--pink); font-size: 30px; line-height: 1; text-shadow: var(--outline); vertical-align: -4px; }

/* ---------- Resultado ---------- */
.result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 640px; --rh: clamp(84px, 24vw, 112px); }
.result > * { min-width: 0; }
.result-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; padding: 12px 14px; }
.result-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.result-hero { flex: 0 0 auto; width: var(--rh); height: var(--rh); }
.verdict { font: 800 clamp(36px, 12vw, 58px)/0.95 var(--font); letter-spacing: 0.02em; --r: -4deg; transform: rotate(var(--r)); }
.result.win .verdict { color: var(--yellow); }
.result.lose .verdict { color: #c9cfee; }
.result.draw .verdict { color: #ffffff; }
/* quem só assistiu à partida: "ACABOU!" sem veredito, na tinta do empate */
.result.watch .verdict { color: #ffffff; }
/* e sem boneco ao lado: o letreiro fica sozinho, no meio, com a mesma altura de linha
   (colado no alto do cartaz ele entraria embaixo da fita crepe) */
.result-top.solo { justify-content: center; min-height: var(--rh); }
/* placar: os dois números grandes e o cabo de guerra de tinta */
.score { display: grid; gap: 4px; }
.score-nums { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.side { display: flex; flex-direction: column; min-width: 0; line-height: 1; }
.side.r { align-items: flex-end; text-align: right; }
.side b { font: 800 30px/1 var(--font); font-variant-numeric: tabular-nums; text-shadow: var(--outline); }
.side small { margin-top: 2px; font: 800 11px/1.2 var(--font); letter-spacing: 0.06em; text-transform: uppercase; }
.mapname { flex: 1 1 auto; min-width: 0; padding-bottom: 1px; color: var(--muted); font: 700 11px/1.2 var(--font); text-align: center; }
.scorebar {
  position: relative;
  display: flex;
  justify-content: space-between;
  height: 30px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background-color: #dccfb0;
  background-image: var(--dots);
  background-size: 8px 8px;
  box-shadow: 0 4px 0 var(--ink);
}
.scorebar div { width: 0; height: 100%; transition: width 1.6s cubic-bezier(0.2, 0.9, 0.2, 1); }
.scorebar .a { border-right: 3px solid var(--ink); }
.scorebar .b { border-left: 3px solid var(--ink); }
.scorebar::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  margin-left: -1px;
  border-left: 2px dashed var(--ink);
  opacity: 0.55;
}
/* prêmios: adesivos */
.awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.awards:empty { display: none; }
.sticker {
  display: inline-flex;
  flex-direction: column;
  max-width: 100%;
  padding: 3px 10px;
  border: 3px solid var(--ink);
  border-radius: 9px;
  background: var(--c, var(--yellow));
  box-shadow: 0 3px 0 var(--ink);
  line-height: 1.05;
  transform: rotate(var(--r, 0deg));
}
.sticker small { font: 800 9.5px/1.25 var(--font); letter-spacing: 0.06em; text-transform: uppercase; }
.sticker b { overflow: hidden; font: 800 13.5px/1.1 var(--font); text-overflow: ellipsis; white-space: nowrap; }
.gain { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gain b { color: var(--mint); font: 800 32px/1 var(--font); text-shadow: var(--outline); }
.gain.neg b { color: var(--red); }
.gain span { min-width: 0; font: 800 12px/1.15 var(--font); letter-spacing: 0.04em; text-transform: uppercase; }
.gain small { display: block; color: var(--muted); font: 700 11px/1.2 var(--font); letter-spacing: 0; text-transform: none; }
.result-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }
.board { display: grid; gap: 3px; padding: 12px 10px 10px; }
.board-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 44px 30px 28px 28px;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 1px 8px 1px 4px;
  border-left: 8px solid var(--c, transparent);
  border-radius: 4px;
  background: rgba(26, 29, 43, 0.07);
  font: 800 13.5px/1.1 var(--font);
}
.board-row.head { min-height: 16px; background: none; color: var(--muted); font-size: 9.5px; letter-spacing: 0.03em; text-transform: uppercase; }
.board-row canvas { display: block; width: 26px; height: 26px; }
.board-row .n { text-align: right; font-variant-numeric: tabular-nums; }
.board-row .nm small { display: inline; font-size: 10px; }
.board-row.me { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--ink); }
.result-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.result-foot .status { color: #ffffff; font-size: 13px; letter-spacing: 0.05em; text-shadow: var(--outline-s); text-transform: uppercase; }
.result-foot .status b { color: var(--yellow); font-size: 18px; }

/* ---------- Janelas: um cartaz por cima de tudo ---------- */
#modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 5;
  display: flex; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding: max(16px, var(--sat)) max(16px, var(--sar)) max(16px, var(--sab)) max(16px, var(--sal));
  background: rgba(26, 29, 43, 0.72);
}
#modal { cursor: pointer; }
#modal[hidden] { display: none; }
.sheet {
  cursor: auto;
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 18px 14px 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 7px 8px 0 var(--ink);
  animation: sheet-in 0.32s cubic-bezier(0.3, 1.45, 0.5, 1) backwards;
}
.sheet > * { min-width: 0; }
.sheet.wide { max-width: 720px; }
#modal.again .sheet { animation: none; }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(26px) scale(0.92) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
/* título com marca-texto de pincel por baixo */
.sheet h2 {
  position: relative;
  z-index: 0;
  padding: 0 4px 5px;
  font: 800 24px/1.05 var(--font);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.sheet h2::after {
  content: "";
  position: absolute;
  left: -6px; right: -12px; bottom: 0;
  height: 12px;
  z-index: -1;
  background: var(--pink);
}
.sheet p { font: 600 14.5px/1.35 var(--font); }
.sheet p b { font-weight: 800; }
.code-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 66px;
  padding: 6px 8px 4px calc(8px + 0.34em);
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font: 800 40px/1 var(--font);
  letter-spacing: 0.34em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  box-shadow: inset 0 5px 0 rgba(26, 29, 43, 0.12);
  -webkit-user-select: text;
  user-select: text;
}
.code-input:focus { border-color: var(--pink); }
.code-input::placeholder { color: rgba(26, 29, 43, 0.28); }
.sheet .share-url {
  padding: 8px 10px;
  border: 2px dashed var(--ink);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  word-break: break-all;
  -webkit-user-select: text;
  user-select: text;
}
.share-code {
  display: inline-block;
  padding: 1px 8px 0 calc(8px + 0.14em);
  background: var(--tape);
  font-size: 24px;
  letter-spacing: 0.14em;
  vertical-align: middle;
  -webkit-clip-path: var(--cut);
  clip-path: var(--cut);
  transform: rotate(-2deg);
  -webkit-user-select: text;
  user-select: text;
}
/* opções: linhas de formulário em papel */
.opts { display: grid; gap: 0 18px; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 0;
  padding: 7px 2px;
  border-bottom: 2px dashed rgba(26, 29, 43, 0.22);
  font: 800 15px/1.15 var(--font);
}
.opt > span { min-width: 0; }
.opt small { display: block; margin-top: 1px; color: var(--muted); font: 600 11.5px/1.25 var(--font); }
.opt.col { flex-direction: column; align-items: stretch; gap: 6px; }
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 32px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--paper2);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.12s;
}
.switch.on { background: var(--mint); }
.switch.on::after { transform: translateX(26px); }

/* como jogar: quadrinhos numerados */
.steps { display: grid; gap: 14px; padding: 6px 0 2px 6px; counter-reset: step; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper2);
  box-shadow: 0 4px 0 var(--ink);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  top: -10px;
  left: -10px;
  z-index: 1;
  width: 26px;
  height: 26px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
  font: 800 14px/20px var(--font);
  text-align: center;
}
.step canvas { display: block; width: 96px; height: 73px; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); }
.step h3 { font: 800 15.5px/1.1 var(--font); text-transform: uppercase; }
.sheet .step p { margin-top: 3px; font-size: 13px; line-height: 1.3; }

/* liga */
.league-card { display: flex; align-items: center; gap: 16px; padding: 4px 2px 2px 6px; }
.league-card > div:last-child { flex: 1 1 auto; min-width: 0; display: grid; gap: 6px; }
.meter { height: 16px; overflow: hidden; border: 3px solid var(--ink); border-radius: 8px; background: var(--paper2); }
.meter i { display: block; height: 100%; border-right: 3px solid var(--ink); background: var(--mint); }
.rank { display: grid; }
.rank-row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
  padding: 6px 2px;
  border-bottom: 2px dashed rgba(26, 29, 43, 0.22);
  font: 800 14px/1.1 var(--font);
}
.rank-row > span:first-child {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  font-size: 12px;
  line-height: 24px;
  text-align: center;
}
.rank-row .lg {
  padding: 2px 9px 1px;
  background: var(--tape);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  -webkit-clip-path: var(--cut);
  clip-path: var(--cut);
}

/* ---------- Avisos ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--sab)); z-index: 9;
  transform: translate(-50%, 30px) rotate(-1.5deg); opacity: 0; pointer-events: none;
  width: -webkit-max-content; width: max-content;
  max-width: min(92vw, 460px);
  padding: 9px 16px; border: 3px solid var(--ink); border-radius: 12px;
  background: #ffffff; color: var(--ink); font-weight: 800; font-size: 15.5px; text-align: center;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.2s cubic-bezier(0.3, 1.45, 0.5, 1), opacity 0.16s;
}
#toast.show { transform: translate(-50%, 0) rotate(-1.5deg); opacity: 1; }

#net {
  position: fixed; left: 50%; top: calc(64px + var(--sat)); z-index: 8; transform: translateX(-50%) rotate(-1.5deg);
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; border: 3px solid var(--ink); border-radius: 12px;
  background: var(--ink); color: var(--yellow); font-weight: 800; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(26, 29, 43, 0.45);
}
#net[hidden] { display: none; }
.spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 4px solid var(--yellow); border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#rotate {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 6; display: flex;
  background: rgba(26, 29, 43, 0.82); padding: 24px;
}
#rotate[hidden] { display: none; }
.rotate-card {
  margin: auto; max-width: 300px; display: grid; gap: 14px; justify-items: center;
  padding: 22px 18px 18px; border: 3px solid var(--ink); border-radius: 8px;
  background: var(--paper); color: var(--ink); font-weight: 800; font-size: 19px; line-height: 1.2; text-align: center;
  box-shadow: 7px 8px 0 var(--ink); transform: rotate(-1.5deg);
}
.phone {
  width: 50px; height: 86px; border: 5px solid var(--ink); border-radius: 12px; background: var(--yellow);
  animation: tilt 1.6s ease-in-out infinite;
}
@keyframes tilt { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* ---------- Deitado (o jeito de jogar): duas colunas que ocupam a altura da tela ---------- */
@media (orientation: landscape) and (min-width: 620px) {
  .home {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    grid-template-rows: minmax(0, 1fr);
    max-width: 900px;
    height: 100%;
    max-height: 520px;
  }
  .stage {
    --ls: clamp(34px, calc(var(--vh) * 15.4), 62px);
    --hs: clamp(150px, calc(var(--vh) * 62), 290px);
    height: 100%;
    min-height: 230px;
  }
  /* em tela estreita (iPhone pequeno deitado) a letra dos botões miúdos encolhe */
  .mini-grid .btn { font-size: clamp(10.5px, 1.5vw, 12.5px); }

  /* Telas de dentro ocupam a altura toda; quem rola é a lista de dentro. */
  .fill {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 900px;
    height: 100%;
    max-height: 560px;
  }
  .fill > .bar { flex: 0 0 auto; }
  .scroll-y, .tiles {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  .custom {
    --cw: clamp(170px, 30vw, 240px);
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: var(--cw) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .custom-preview { --hs: min(var(--cw), calc(var(--vh) * 44)); align-content: center; }
  .tiles { flex: 1 1 auto; min-height: 0; }

  .weapons {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .rack { flex-direction: column; gap: 7px; overflow: visible; padding: 0 4px 6px 0; }
  .rack .wcard { flex: 1 1 0; min-height: 36px; max-height: 58px; }
  .wdetail { display: flex; flex-direction: column; min-height: 0; }
  .wd-in { flex: 1 1 auto; grid-template-columns: 150px minmax(0, 1fr); align-items: start; }
  .wd-art { margin: 0; }

  .lobby-grid {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .cfg { flex: 1 1 auto; }
  .cfg-in { flex: 1 1 auto; }

  .result {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
    max-width: 900px;
    --rh: clamp(72px, calc(var(--vh) * 25), 100px);
  }
  .verdict { font-size: clamp(30px, min(calc(var(--vh) * 13), 6.4vw), 54px); }

  .sheet.wide .opts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* como jogar vira uma tira de quadrinhos que rola de lado */
  .sheet.wide .steps {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 12px 6px 8px 12px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
  }
  .sheet.wide .step { flex: 0 0 300px; }
}

/* ---------- Deitado e baixo (celular): tudo encolhe com a altura ---------- */
@media (orientation: landscape) and (max-height: 430px) {
  .btn { min-height: clamp(40px, calc(var(--vh) * 12.6), 50px); }
  .btn.small { min-height: clamp(32px, calc(var(--vh) * 10.2), 40px); }
  .btn.big { min-height: clamp(48px, calc(var(--vh) * 14.4), 62px); font-size: clamp(19px, calc(var(--vh) * 6), 24px); }
  .btn.play { min-height: clamp(58px, calc(var(--vh) * 20.5), 80px); }
  .play-t { font-size: clamp(22px, min(calc(var(--vh) * 7.6), 3.9vw), 30px); }
  .seg .btn { min-height: 28px; }
  .menu { gap: clamp(6px, calc(var(--vh) * 2.4), 10px); }
  .member { grid-template-columns: 26px minmax(0, 1fr) 22px; min-height: clamp(32px, calc(var(--vh) * 10.4), 42px); }
  .member canvas.avatar { width: 26px; height: 26px; }
  .member canvas.wicon { width: 22px; height: 22px; }
  .board-row { min-height: clamp(21px, calc(var(--vh) * 7), 28px); }
  .board-row canvas { width: 20px; height: 20px; }
  .wcard { padding-top: 2px; padding-bottom: 2px; }
  .wcard canvas { width: clamp(28px, calc(var(--vh) * 9.4), 40px); height: clamp(28px, calc(var(--vh) * 9.4), 40px); }
}
/* Safari deitado com a barra de endereço (uns 340 px de altura): some o que é
   só explicação e os prêmios viram uma fila que rola de lado. */
@media (orientation: landscape) and (max-height: 379px) {
  /* (a frase do mapa e a folga do cartaz de opções já saem antes, em todo celular deitado: ver "opções da sala", no fim) */
  .lobby-main .status { display: none; }
  .wd-in { padding-top: 10px; padding-bottom: 8px; }
  .awards { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; scrollbar-width: none; }
  .sticker { flex: 0 0 auto; }
}
@media (orientation: landscape) and (max-height: 320px) {
  .menu .hint, .custom-preview .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pop, .sheet, #wipe.go::before, #wipe.go::after, .btn.play::before, .btn.play::after { animation: none; }
  .scorebar div { transition: none; }
  .phone, .spin { animation-duration: 3s; }
}

/* controles e visão */
/* ---------- Opções: a visão em três cartões e a linha que ocupa a folha inteira ---------- */
.opt.full { grid-column: 1 / -1; }
.views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.viewcard {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  gap: 3px;
  justify-items: center;
  align-content: start;
  min-width: 0;
  padding: 6px 5px 7px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--paper2);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  font: 800 13px/1.1 var(--font);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.06s, box-shadow 0.06s;
}
/* o desenho tem 416x264 pixels (o dobro do maior tamanho na tela) e escala pela largura */
.viewcard canvas { display: block; width: 100%; max-width: 208px; height: auto; aspect-ratio: 416 / 264; border-radius: 6px; }
.viewcard b { text-transform: uppercase; letter-spacing: 0.02em; }
.viewcard small { color: var(--muted); font: 600 11px/1.2 var(--font); }
.viewcard:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
/* a visão escolhida: afundada e amarela, como a opção marcada dos outros menus */
.viewcard.on { background: var(--yellow); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.viewcard.on small { color: var(--ink); }
.sheet .howto-note { color: var(--muted); font-size: 12.5px; }
/* escolhas que se tocam com o dedo no meio da partida (visão na pausa, controles): altura de dedo */
.seg.tall .btn { min-height: 44px; font-size: 13px; }
/* celular em pé: cabe o desenho e o nome */
@media (max-width: 460px) {
  .viewcard small { display: none; }
}
/* celular deitado: o desenho encolhe para a folha não virar uma rolagem só */
@media (orientation: landscape) and (max-height: 430px) {
  .viewcard canvas { width: auto; max-width: 100%; height: clamp(54px, calc(var(--vh) * 19), 84px); }
}

/* ---------- Pausa ----------
   Continuar, trocar a visão ali mesmo, opções e sair. É aberta no meio da
   partida, com a mão no aparelho: tudo o que se toca tem altura de dedo. */
.sheet[data-sheet="pause"] > .btn.small { min-height: 44px; }
/* Deitado no celular a folha tem de caber em 340 px de altura (Safari com a barra
   de endereço) sem empurrar "Sair da partida" para baixo da dobra: a visão vira
   uma linha só, com o nome ao lado dos botões, e os espaços encolhem. Vale até
   480 px, que cobre o maior celular deitado. */
@media (orientation: landscape) and (max-height: 480px) {
  .sheet[data-sheet="pause"] { gap: 8px; padding-top: 14px; padding-bottom: 12px; }
  .sheet[data-sheet="pause"] .sheet-head { min-height: 0; }
  .sheet[data-sheet="pause"] .row .btn { min-height: clamp(44px, calc(var(--vh) * 12.6), 50px); }
  .opt.pause-view { flex-direction: row; align-items: center; gap: 10px; padding: 0 2px; border-bottom: 0; }
  .opt.pause-view small { display: none; }
  .opt.pause-view .seg { flex: 1 1 auto; }
}
/* com a barra de endereço à vista, some a frase que é só explicação */
@media (orientation: landscape) and (max-height: 379px) {
  .pause-note { display: none; }
}

/* ---------- Computador: mouse por cima e teclado ----------
   Quem tem mouse vê o que dá para apertar ganhar um segundo traço; quem anda
   pelo teclado (Tab) ou pelo controle de videogame vê o anel rosa no botão da vez. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not([disabled]), .viewcard:hover, .switch:hover, .tile:hover, .wcard:hover, .mapcard:hover:not([disabled]),
  .swatch:hover, .geartag:hover, button.seal:hover, button.hero-wrap:hover {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
  }
}
/* Como jogar no computador: a rodinha do mouse não rola de lado e a tira de
   quadrinhos esconde a barra de rolagem, então quem joga no teclado só via os
   dois primeiros passos. Com mouse os passos ficam todos à vista, em duas colunas
   (se a janela for baixa, a folha rola para baixo, e isso a rodinha faz). */
@media (orientation: landscape) and (min-width: 620px) and (hover: hover) and (pointer: fine) {
  .sheet.wide .steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px 14px;
    overflow: visible;
    padding: 10px 0 2px 10px;
  }
}
button:focus-visible, [data-act]:focus-visible,
.padnav button:focus, .padnav [data-act]:focus {
  outline: 4px solid var(--pink);
  outline-offset: 3px;
}
button:focus:not(:focus-visible) { outline: none; }
.padnav button:focus:not(:focus-visible) { outline: 4px solid var(--pink); }

/* mapas e copa */
/* ---------- Desenhos pequenos de traço: aparelho e visão de cada um, e o troféu ---------- */
.ico {
  display: block;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* na lista da sala: os dois desenhos antes do texto miúdo de cada pessoa */
.tags { display: inline-flex; gap: 3px; margin-right: 4px; vertical-align: -2px; }
/* Celular em pé: com dois times lado a lado sobram uns 60 px para a linha miúda, e
   os dois desenhos comiam metade dela ("pron…", "Zar…"). Aqui eles descem para
   baixo da arma, à direita, e a linha fica inteira para o texto. */
@media (max-width: 460px) {
  .member canvas.wicon { align-self: start; width: 20px; height: 20px; margin: 1px auto 0; }
  .member .tags { position: absolute; right: 6px; bottom: 2px; gap: 2px; margin: 0; }
  .member .tags .ico { width: 11px; height: 11px; }
}
.trophy { display: block; flex: 0 0 auto; width: 36px; height: 36px; overflow: visible; }
.t-c { fill: var(--yellow); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.t-h { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.t-b { fill: var(--pink); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.t-s { fill: none; stroke: #ffffff; stroke-width: 2.4; stroke-linecap: round; }

/* ---------- Tela inicial: a Copa ao lado da partida rápida ---------- */
.play-row { display: flex; align-items: stretch; gap: 12px; }
.play-row > .btn.play { flex: 1 1 0; }
/* com a Copa ao lado o botão fica mais estreito: o nome quebra em duas linhas
   e o selo "JÁ!" recua para não invadir o vizinho */
.play-row .play-t { font-size: clamp(22px, 7.4vw, 28px); }
.play-row .btn.play::before { right: -12px; }
.play-row .btn.play::after { right: -8px; }
.cup-btn {
  flex: 0 0 auto;
  flex-direction: column;
  gap: 1px;
  width: 96px;
  min-height: 80px;
  padding: 6px 4px 7px;
  border-width: 4px;
  border-radius: 18px;
  background: var(--orange);
  color: #ffffff;
  box-shadow: 0 7px 0 var(--ink);
  --r: 2deg;
}
.cup-btn:active { transform: translateY(6px) rotate(var(--r)); box-shadow: 0 1px 0 var(--ink); }
.cup-btn .trophy { width: 34px; height: 34px; }
.cup-t { display: block; font: 800 21px/1 var(--font); letter-spacing: 0.03em; text-shadow: var(--outline); }
.cup-btn .sub { color: var(--ink); font-size: 10.5px; letter-spacing: 0.03em; }

/* ---------- Sala: mapas em cartões (planta, nome e o que o mapa tem de especial) ----------
   São quatro mapas: dois por fileira no celular em pé e os quatro numa fileira só
   onde há largura (tablet em pé, computador, celular deitado). Nunca três e um
   sozinho embaixo: por isso a conta de colunas é fixa, e não "quantos couberem". */
.mapgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mapcard {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 4px 4px 5px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font: 800 12.5px/1.15 var(--font);
  text-align: left;
  text-transform: uppercase;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.06s, box-shadow 0.06s;
}
/* A planta tem 456x276 pixels e aparece do tamanho do cartão. A proporção vai
   escrita e o mínimo é zero, para o cartão (que é uma coluna flex) nunca tentar
   dar à planta a altura do desenho em pixels. */
.mapcard canvas { flex: 0 0 auto; display: block; width: 100%; height: auto; min-height: 0; aspect-ratio: 456 / 276; border-radius: 5px; }
.mapcard .mn { padding: 0 2px; }
/* a frase do mapa: no máximo duas linhas, para os cartões ficarem do mesmo tamanho */
.mtip {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 0 2px;
  color: var(--muted);
  font: 600 11px/1.2 var(--font);
  text-transform: none;
}
.mapcard:active { transform: translateY(3px) rotate(var(--r, 0deg)); box-shadow: 0 1px 0 var(--ink); }
/* o mapa escolhido (ou o meu voto): amarelo e um pouco torto, como adesivo recém-colado */
.mapcard.on { --r: -1.5deg; background: var(--yellow); box-shadow: 0 5px 0 var(--ink); }
.mapcard.on .mtip { color: var(--ink); }
.mapcard[disabled] { opacity: 0.62; pointer-events: none; }
.mapcard.on[disabled] { opacity: 1; }
/* quantos votos o mapa tem: selo no canto do cartão */
.mvotes {
  position: absolute;
  top: -9px;
  right: -5px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  background: var(--pink);
  color: #ffffff;
  font: 800 14px/1 var(--font);
  text-shadow: var(--outline-s);
  transform: rotate(8deg);
}
/* partida rápida: o cartaz da votação */
.vote-card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 0; }
.vote-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; padding: 16px 10px 10px; }
.vote-in h3 { font: 800 20px/1 var(--font); letter-spacing: 0.03em; text-align: center; text-transform: uppercase; }
.vote-in .status b { display: inline-block; min-width: 1.1em; color: var(--pink); font-size: 22px; line-height: 1; text-shadow: var(--outline-s); vertical-align: -2px; }
/* linha de opção com o nome em cima (cabem três botões lado a lado no celular) */
.cfg-row.stack { grid-template-columns: minmax(0, 1fr); gap: 3px; }

/* ---------- Sala em formato Copa ---------- */
/* uma lista só, a dos inscritos: os times são sorteados a cada rodada */
.teams.solo { grid-template-columns: minmax(0, 1fr); }
.cup-roster { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); --tc: var(--orange); --r: -0.5deg; }
.cup-roster h3 { grid-column: 1 / -1; }
.cup-card .trophy { justify-self: center; width: 54px; height: 54px; transform: rotate(-6deg); }
.cup-blurb { display: flex; align-items: center; gap: 8px; font: 600 12px/1.25 var(--font); }
.cup-blurb b { font-weight: 800; }
.cup-blurb .trophy { width: 34px; height: 34px; }

/* ---------- Copa: o que a rodada deu e a tabela ---------- */
.gains { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.gains:empty { display: none; }
.cup-gain b { color: var(--yellow); }
/* a etiqueta da rodada é quem segura o cartaz da tabela, como a do modo de jogo na tela inicial */
.cup-table { padding-top: 18px; }
.cup-table::before { display: none; }
.cup-tag { background: var(--yellow); }
.cup-table > .cup-tag { position: absolute; top: -13px; left: 12px; z-index: 3; max-width: calc(100% - 24px); --r: -3deg; }
.cup-row {
  display: grid;
  grid-template-columns: 20px 12px minmax(0, 1fr) 46px 40px;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 1px 8px 1px 4px;
  border-radius: 4px;
  background: rgba(26, 29, 43, 0.07);
  font: 800 13.5px/1.1 var(--font);
}
.cup-row.head { min-height: 16px; background: none; color: var(--muted); font-size: 9.5px; letter-spacing: 0.03em; text-transform: uppercase; }
.cup-row.head > span:first-child { text-align: center; }
.cup-row .n { text-align: right; font-variant-numeric: tabular-nums; }
.cup-row .nm small { display: inline; font-size: 10px; }
.pos { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--yellow); font-size: 11.5px; line-height: 20px; text-align: center; }
.plus { color: #08745b; }
.tot { font-size: 15px; }
.cup-row.me { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--ink); }
.cup-row.off { opacity: 0.55; }
/* subiu, desceu ou ficou no mesmo lugar */
.mv { justify-self: center; width: 0; height: 0; border-style: solid; border-width: 0; }
.mv.up { border-width: 0 5px 8px 5px; border-color: transparent transparent #0a8f6f transparent; }
.mv.down { border-width: 8px 5px 0 5px; border-color: var(--red) transparent transparent transparent; }
.mv.same { width: 8px; height: 3px; border-radius: 2px; background: rgba(26, 29, 43, 0.3); }
.cup-next { margin-top: 3px; font: 700 12px/1.25 var(--font); text-align: center; }
.cup-next b { font-weight: 800; }
/* rodapé do resultado na Copa: a contagem e dois botões na mesma linha */
.cup-foot { flex-wrap: wrap; row-gap: 6px; }
.cup-foot .status { flex: 1 1 auto; text-align: left; }
.cup-foot .btn { flex: 0 0 auto; }

/* ---------- Copa: o pódio ---------- */
.podium-screen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 640px; }
.podium-screen > * { min-width: 0; }
.podium-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: center; align-content: start; padding: 16px 12px 12px; text-align: center; }
.podium-main .verdict { color: var(--yellow); font-size: clamp(28px, 9.6vw, 50px); }
/* três degraus: segundo, primeiro e terceiro, em cima do traço do chão */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 420px;
  margin-top: 8px;
  padding: 0 4px;
  border-bottom: 4px solid var(--ink);
  --pa: clamp(58px, 25vw, 112px);
}
.pod { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pod.p1 { flex-grow: 1.25; }
/* cada um numa foto colada com um pouco de inclinação */
.pod-art {
  display: block;
  width: 100%;
  max-width: var(--pa);
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background-color: #ffffff;
  background-image: var(--dots);
  background-size: 8px 8px;
  box-shadow: 0 4px 0 var(--ink);
  transform: rotate(var(--r, 0deg));
}
.p1 .pod-art { max-width: calc(var(--pa) * 1.2); --r: -2deg; }
.p2 .pod-art { --r: 2.5deg; }
.p3 .pod-art { --r: -1.5deg; }
.pod-pic { display: block; width: 100%; height: auto; }
.pod .trophy { position: absolute; top: -14px; right: -6px; z-index: 2; width: 38px; height: 38px; transform: rotate(14deg); }
.pod-name { max-width: 100%; margin-top: 3px; padding: 0 5px; overflow: hidden; border-radius: 4px; font: 800 13px/1.2 var(--font); text-overflow: ellipsis; white-space: nowrap; }
.pod-name small { color: var(--muted); font-size: 10px; font-weight: 700; }
.pod.me .pod-name { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--ink); }
.pod-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 46px;
  border: 3px solid var(--ink);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #c9cfee;
  line-height: 1;
}
.pod-step i { font: 800 22px/1 var(--font); }
.pod-step small { font: 800 10.5px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase; }
.p1 .pod-step { height: 62px; background: var(--yellow); }
.p1 .pod-step i { font-size: 30px; }
.p3 .pod-step { height: 34px; background: #ffb27a; }
.p3 .pod-step i { font-size: 16px; }
.trophy-line { max-width: 360px; font: 700 13.5px/1.3 var(--font); }
.trophy-line b { font-weight: 800; }
.podium-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }
/* O pódio fica em cima do muro amarelo, não por cima da partida: a contagem vai
   em tinta escura. (A do resultado é branca com o número amarelo, que aqui sumia.) */
.podium-side .status { color: var(--ink); text-shadow: none; }
.podium-side .status b { color: #c2156a; }

/* ---------- Copa: a janela de entrada e os troféus na liga ---------- */
.cup-intro { display: flex; align-items: center; gap: 12px; }
.cup-intro .trophy { width: 62px; height: 62px; transform: rotate(-8deg); }
.cup-rules { display: grid; gap: 6px; margin: 0; padding: 0 0 0 22px; font: 600 14.5px/1.3 var(--font); }
.cup-rules b { font-weight: 800; }
.rank-row { grid-template-columns: 26px minmax(0, 1fr) auto auto auto; }
.cups { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; }
.cups:empty { display: none; }
.cups .trophy { width: 18px; height: 18px; }

/* Sala numa coluna só (celular em pé e tela estreita): o botão principal sobe para
   antes do cartaz. Embaixo dele, "Estou pronto" e "Começar" ficavam fora da tela
   no celular com a barra do navegador (uns 640 px de altura à vista). */
@media (max-width: 619px), (orientation: portrait) and (max-width: 699px) {
  .lobby-side > .btn.big { order: -1; }
}
/* celular em pé: a votação cabe numa fileira (planta e nome), e a contagem fica à vista */
@media (max-width: 599px) {
  .vote-in { padding-left: 8px; padding-right: 8px; }
  .vote-in .mapgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .vote-in .mapcard { padding: 2px 2px 3px; border-radius: 8px; font-size: 9.5px; letter-spacing: -0.01em; box-shadow: 0 3px 0 var(--ink); }
  .vote-in .mapcard .mn { padding: 0 1px; }
  .vote-in .mtip { display: none; }
  .vote-in .mvotes { top: -8px; min-width: 22px; height: 22px; font-size: 12px; }
  /* o cartaz da Copa aberta encolhe um pouco, para a contagem não ir para baixo da dobra */
  .cup-card { gap: 6px; padding: 18px 12px 12px; }
  .cup-card .trophy { width: 44px; height: 44px; }
}
/* em pé e largo (tablet): os quatro mapas numa fileira */
@media (orientation: portrait) and (min-width: 600px) {
  .mapgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* deitado: duas colunas, como o resultado */
@media (orientation: landscape) and (min-width: 620px) {
  .vote-in { flex: 1 1 auto; }
  .podium-screen { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; max-width: 900px; }
  .podium-main .verdict { font-size: clamp(26px, min(calc(var(--vh) * 11), 5.4vw), 48px); }
  .podium { --pa: clamp(54px, calc(var(--vh) * 24), 120px); }
}
/* Computador e tablet deitado: a sala ganha largura e a coluna da direita fica com
   a maior parte, para os quatro mapas caberem numa fileira sem o cartaz rolar por
   dentro. Vale a partir de 560 px de altura: é o que sobra de um notebook de 768
   depois das barras do navegador. */
@media (orientation: landscape) and (min-width: 1000px) and (min-height: 560px) {
  .lobby.fill { max-width: 1040px; max-height: 700px; }
  .lobby-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
  .mapgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* a votação é curta para um cartaz deste tamanho: fica no meio dele, como o cartaz da Copa aberta */
  .vote-in { align-content: center; }
}
/* Deitado e sem altura para os cartões inteiros (celular, janela baixa): os quatro
   mapas numa fileira, só a planta e o nome. Vai até onde começa o bloco de cima;
   o maior celular deitado tem 440 px de altura. */
@media (orientation: landscape) and (max-height: 559px) {
  .mapgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .mapcard { padding: 2px 2px 3px; border-radius: 8px; font-size: 9.5px; letter-spacing: -0.01em; box-shadow: 0 3px 0 var(--ink); }
  .mtip { display: none; }
  .mvotes { top: -8px; min-width: 22px; height: 22px; font-size: 12px; }
}
/* Celular deitado, opções da sala: "Formato" e "Mapa" têm o nome ao lado dos botões,
   como as outras linhas (em pé ele fica em cima; e sem nome nenhum eram duas
   fileiras iguais, uma colada na outra). Os botões encolhem em vez de quebrar a
   fileira, e a frase do mapa, que é só explicação, some para sobrar altura para
   as opções de baixo. */
@media (orientation: landscape) and (max-height: 480px) {
  .cfg-row.stack { grid-template-columns: 58px minmax(0, 1fr); gap: 6px; }
  .cfg .seg { flex-wrap: nowrap; }
  .cfg .seg .btn { padding-left: 5px; padding-right: 5px; }
  .cfg-in { gap: 4px; padding-top: 12px; padding-bottom: 6px; }
  .map-blurb { display: none; }
  .lobby-side { gap: 6px; }
}
/* idem, em celular pequeno deitado (duas colunas em menos de 750 px de largura):
   a letra dos botões encolhe junto, para cada palavra caber no seu */
@media (orientation: landscape) and (min-width: 620px) and (max-height: 480px) {
  .cfg .seg .btn { font-size: clamp(10px, 1.6vw, 12px); }
}
/* celular deitado: tudo encolhe com a altura */
@media (orientation: landscape) and (max-height: 430px) {
  .play-row .play-t { font-size: clamp(19px, min(calc(var(--vh) * 6.2), 3vw), 28px); }
  .cup-btn { width: 88px; min-height: clamp(58px, calc(var(--vh) * 20.5), 80px); }
  .cup-btn .trophy { width: clamp(24px, calc(var(--vh) * 8.5), 34px); height: clamp(24px, calc(var(--vh) * 8.5), 34px); }
  .cup-t { font-size: clamp(16px, calc(var(--vh) * 5.4), 21px); }
  .vote-in { padding-top: 12px; padding-bottom: 6px; }
  .vote-in h3 { font-size: 17px; }
  /* o botão principal da sala fica na altura mínima: os pixels vão para o cartaz ao lado */
  .lobby-side > .btn.big { min-height: 48px; }
  .cup-card .trophy { width: 40px; height: 40px; }
  .cup-row { min-height: clamp(20px, calc(var(--vh) * 6.1), 26px); }
  .pos { width: 18px; height: 18px; font-size: 10.5px; line-height: 18px; }
  .podium-main { gap: 6px; padding-top: 12px; padding-bottom: 8px; }
  .podium { margin-top: 4px; }
  .pod-step { height: 34px; }
  .p1 .pod-step { height: 44px; }
  .p3 .pod-step { height: 26px; }
  .trophy-line { font-size: 12.5px; }
}
/* Safari deitado com a barra de endereço: some o que é só explicação */
@media (orientation: landscape) and (max-height: 379px) {
  .cup-next, .podium-main .status, .cup-card p:not(.status) { display: none; }
}
