:root {
  --fundo: #0e141c;
  --fundo-2: #131c27;
  --painel: #172230;
  --painel-2: #1e2b3b;
  --borda: #2a3a4e;
  --texto: #e9eff6;
  --texto-suave: #9fb0c3;
  --destaque: #ff8a3d;
  --destaque-forte: #e8590c;
  --raio: 14px;
  --sombra: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
  font-family: Rubik, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100dvh;
  color: var(--texto);
  background:
    radial-gradient(1200px 600px at 15% -10%, #1d2b3d 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #2b1a10 0%, transparent 55%),
    var(--fundo);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

input {
  width: 100%;
  background: #0d141c;
  color: var(--texto);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--destaque);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.25);
}

kbd {
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  color: var(--texto);
  background: var(--painel-2);
  border: 1px solid var(--borda);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
}

/* Buttons */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--destaque);
  color: #1a0d03;
  font-weight: 800;
  font-size: 16px;
  padding: 12px 18px;
  transition: transform 0.08s, filter 0.15s;
}

.botao:hover {
  filter: brightness(1.08);
}

.botao:active {
  transform: translateY(1px);
}

.botao:disabled {
  opacity: 0.55;
  cursor: progress;
}

.botao:focus-visible,
.botao-icone:focus-visible,
.botao-link:focus-visible {
  outline: 3px solid rgba(255, 138, 61, 0.6);
  outline-offset: 2px;
}

.botao--grande {
  width: 100%;
  margin-top: 16px;
  padding: 15px 20px;
  font-size: 18px;
}

.botao--secundario {
  background: var(--painel-2);
  color: var(--texto);
  border: 1px solid var(--borda);
}

.botao--pequeno {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 10px;
}

.botao-link {
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  background: none;
  border: 0;
  color: var(--texto-suave);
  text-decoration: underline;
}

.botao-icone {
  position: relative;
  width: 38px;
  height: 36px;
  border-radius: 10px;
  background: var(--painel-2);
  border: 1px solid var(--borda);
  color: var(--texto);
  font-size: 16px;
}

.botao-icone:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Music off: the note gets a slash, so the state does not depend on color */
.botao-musica[aria-pressed='false']::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: #ff8787;
  box-shadow: 0 0 0 1px var(--painel-2);
  transform: rotate(-40deg);
}

/* Brand */

.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.marca--pequena {
  font-size: 17px;
}

.marca-icone {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1d2127;
  box-shadow: inset -4px -4px 0 rgba(255, 255, 255, 0.08), 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.marca-icone::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffd43b;
  box-shadow: 0 0 10px 3px rgba(255, 146, 43, 0.8);
  animation: faisca 0.45s infinite alternate;
}

@keyframes faisca {
  from { transform: scale(0.75); opacity: 0.8; }
  to { transform: scale(1.15); opacity: 1; }
}

/* Home */

.inicio {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.inicio-cartao {
  width: min(460px, 100%);
  padding: 28px 24px;
  background: linear-gradient(180deg, var(--painel-2), var(--painel));
  border: 1px solid var(--borda);
  border-radius: 22px;
  box-shadow: var(--sombra);
}

.inicio-lema {
  margin: 10px 0 20px;
  color: var(--texto-suave);
  line-height: 1.45;
}

.jogo-destaque {
  margin-bottom: 20px;
  padding: 16px;
  background: #0f1822;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
}

.jogo-destaque h1 {
  margin: 0 0 6px;
  color: var(--destaque);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.jogo-destaque p {
  margin: 0;
  color: var(--texto-suave);
  line-height: 1.45;
}

.formulario label {
  display: block;
  margin-bottom: 6px;
  color: var(--texto-suave);
  font-size: 14px;
  font-weight: 600;
}

.convite p {
  margin: 14px 0 0;
}

.convite strong {
  color: var(--destaque);
  letter-spacing: 2px;
}

.divisor {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 12px;
  color: var(--texto-suave);
  font-size: 13px;
}

.divisor::before,
.divisor::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--borda);
}

.linha-codigo {
  display: flex;
  gap: 8px;
}

.linha-codigo input {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
}

.mensagem {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ffc9c9;
  font-size: 14px;
  line-height: 1.4;
}

.mensagem--info {
  background: rgba(77, 171, 247, 0.1);
  border-color: rgba(77, 171, 247, 0.35);
  color: #d0ebff;
}

.rodape {
  margin: 20px 0 0;
  color: var(--texto-suave);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* Room: locked to the viewport, no page scroll, bounce, zoom or text selection */

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

html.em-sala,
html.em-sala body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.sala {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.sala-topo {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(14, 20, 28, 0.9);
  border-bottom: 1px solid var(--borda);
}

.sala-codigo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
}

.sala-codigo .rotulo {
  color: var(--texto-suave);
  font-size: 13px;
}

.sala-codigo strong {
  color: var(--destaque);
  font-size: 20px;
  letter-spacing: 3px;
}

.sala-acoes {
  display: flex;
  gap: 8px;
}

.sala-corpo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  min-height: 0;
  padding: 12px 16px;
}

.palco {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.painel {
  align-self: start;
  max-height: 100%;
  overflow: auto;
  padding: 14px;
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
}

.painel h2 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
  color: var(--texto-suave);
  font-size: 15px;
  font-weight: 600;
}

.lista-membros {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lista-membros li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--fundo-2);
  border-radius: 10px;
}

/* Player badge: color plus a shape, so players can be told apart without relying on color */
.marca-jogador {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cor);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
  vertical-align: middle;
}

.marca-jogador svg {
  width: 72%;
  height: 72%;
  fill: #10151c;
}

.membro-nome {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.etiqueta {
  flex: none;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--painel-2);
  color: var(--texto-suave);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.etiqueta--icone {
  padding: 0;
  background: none;
  font-size: 13px;
}

.etiqueta--eu {
  background: rgba(255, 224, 102, 0.15);
  color: #ffe066;
}

.etiqueta--pontos {
  color: #ffd43b;
}

.etiqueta--boa {
  color: #8ce99a;
}

.etiqueta--media {
  color: #ffd43b;
}

.etiqueta--ruim {
  color: #ff8787;
}

.painel-dica {
  margin: 12px 0 0;
  color: var(--texto-suave);
  font-size: 12px;
  line-height: 1.45;
}

.queda {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 8, 12, 0.75);
}

.queda-cartao {
  width: min(420px, 100%);
  padding: 22px;
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: 18px;
  box-shadow: var(--sombra);
  text-align: center;
}

.queda-cartao h2 {
  margin: 0 0 8px;
}

.queda-cartao p {
  margin: 0 0 16px;
  color: var(--texto-suave);
  line-height: 1.45;
}

.queda-acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.avisos {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 60;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.aviso-toast {
  padding: 10px 14px;
  background: var(--painel-2);
  border: 1px solid var(--borda);
  border-radius: 12px;
  box-shadow: var(--sombra);
  font-size: 14px;
  font-weight: 600;
  animation: entrar 0.25s ease-out;
}

@keyframes entrar {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Pavio stage: the arena is sized in JS to fit the space left in .palco */

.pavio {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.pavio-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 22px;
  padding: 0 4px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.pavio-hud-detalhes:not([hidden]) {
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 0 4px;
  color: var(--texto-suave);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pavio-hud-detalhe {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(23, 34, 48, 0.88);
}

/* Powers: one chip each; the timed ones show the time left as a ring */
.pavio-hud-itens {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.pavio-chip {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  background: rgba(23, 34, 48, 0.88);
  border: 1px solid var(--borda);
  font-variant-numeric: tabular-nums;
}

.pavio-chip b {
  font-weight: 800;
}

.pavio-chip--liga,
.pavio-chip--tempo {
  padding: 0 6px;
}

.pavio-chip--tempo {
  border-color: transparent;
  background:
    linear-gradient(rgba(23, 34, 48, 0.95), rgba(23, 34, 48, 0.95)) padding-box,
    conic-gradient(#ffd43b calc(var(--resta, 1) * 360deg), rgba(255, 255, 255, 0.12) 0) border-box;
  border-width: 2px;
}

.pavio-hud-itens--compacto {
  gap: 2px;
}

.pavio-hud-itens--compacto .pavio-chip {
  gap: 1px;
  padding: 0 4px;
}

.pavio-hud-itens--compacto .pavio-chip--contador,
.pavio-hud-itens--compacto .pavio-chip--liga {
  border-color: transparent;
}

.pavio-hud--apertado {
  gap: 4px;
  font-size: 12px;
}

.pavio-hud--apertado .pavio-hud-itens {
  gap: 0;
}

.pavio-hud--apertado .pavio-chip {
  height: 20px;
  gap: 0;
  padding: 0 2px;
}

.pavio-hud--apertado .pavio-chip-icone {
  font-size: 11px;
}

.pavio-hud--apertado .pavio-chip--contador,
.pavio-hud--apertado .pavio-chip--liga {
  border-color: transparent;
  background-color: transparent;
}

.pavio-hud--apertado .pavio-hud-pontos,
.pavio-hud--apertado .pavio-hud-tempo {
  padding: 1px 6px;
}

.pavio-chip--novo {
  animation: chip-novo 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes chip-novo {
  0% { transform: scale(0.6); background-color: rgba(255, 212, 59, 0.5); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.pavio-hud-pontos:not(:empty),
.pavio-hud-tempo:not(:empty) {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(23, 34, 48, 0.85);
  border: 1px solid var(--borda);
}

.pavio-hud-pontos {
  color: #ffd43b;
  font-variant-numeric: tabular-nums;
}

.pavio-hud-pontos--sobe {
  animation: subir-ponto 0.35s ease-out;
}

@keyframes subir-ponto {
  40% { transform: scale(1.25); background: rgba(255, 212, 59, 0.25); }
}

.pavio-hud-tempo {
  color: var(--texto-suave);
  font-variant-numeric: tabular-nums;
}

.pavio-hud-desempenho {
  flex: none;
  color: var(--texto-suave);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.pavio-hud-tempo--subita {
  color: #ff8787;
  border-color: rgba(255, 107, 107, 0.6) !important;
  animation: pulsar-tempo 0.9s ease-in-out infinite;
}

.pavio-hud-tempo--alerta {
  color: #ffd43b;
  animation: pulsar-tempo 1s ease-in-out infinite;
}

@keyframes pulsar-tempo {
  50% { transform: scale(1.08); }
}

.pavio-arena {
  position: relative;
  flex: none;
  aspect-ratio: 21 / 15;
  overflow: hidden;
  background: #161c23;
  border-radius: 12px;
  /* --aura-tema is set by the painter from the map's theme */
  box-shadow: var(--sombra), 0 0 0 1px rgba(var(--aura-tema, 255, 138, 61), 0.18), 0 0 48px rgba(var(--aura-tema, 255, 138, 61), 0.14);
  transition: box-shadow 0.6s;
}

.pavio-arena canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pavio-aviso {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  overflow: auto;
  text-align: center;
}

.pavio-aviso p {
  margin: 0;
  line-height: 1.4;
}

/* Full screens (lobby, results, podium) cover the whole stage, HUD included, and scroll inside if needed */
.pavio-aviso--cartao {
  z-index: 5;
  justify-content: safe center;
  padding: 10px;
  background: rgba(10, 14, 20, 0.62);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  overscroll-behavior: contain;
}

.pavio-cartao {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(640px, 100%);
  padding: 18px 18px 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 43, 59, 0.96), rgba(23, 34, 48, 0.96));
  border: 1px solid var(--borda);
  border-radius: 20px;
  box-shadow: var(--sombra);
  animation: surgir 0.28s ease-out;
}

@keyframes surgir {
  from { transform: translateY(8px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.pavio-aviso--cartao h2 {
  position: relative;
  margin: 0;
  color: var(--destaque);
  font-size: clamp(22px, 4.2vw, 38px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.pavio-cartao > p {
  position: relative;
  max-width: 520px;
}

.pavio-titulo {
  font-size: clamp(34px, 6vw, 52px) !important;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 30px rgba(255, 138, 61, 0.35);
}

.pavio-subtitulo {
  color: var(--texto-suave);
}

.pavio-retrato {
  display: block;
  width: 48px;
  height: 48px;
}

.pavio-retrato--vencedor {
  width: 96px;
  height: 96px;
  margin: -6px 0 -10px;
}

.pavio-aviso .botao {
  width: auto;
  min-width: 220px;
  margin-top: 4px;
}

.pavio-sobretitulo {
  color: var(--texto-suave);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.pavio-dica {
  color: var(--texto-suave);
}

.pavio-motivo {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.15);
  color: #ffc9c9;
  font-weight: 600;
}

.pavio-poder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 14px;
  background: rgba(10, 14, 20, 0.8);
  text-align: left;
}

.pavio-poder-icone {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--fundo);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
  font-size: 19px;
}

.pavio-poder strong {
  color: #ffe066;
}

.pavio-legenda {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  color: var(--texto-suave);
  font-size: 12px;
}

.pavio-prontos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 200px));
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.pavio-prontos li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 12px;
  background: rgba(14, 20, 28, 0.7);
  border: 1px solid var(--borda);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}

.pavio-prontos li.pronto {
  background: rgba(81, 207, 102, 0.1);
  border-color: rgba(81, 207, 102, 0.65);
}

.pavio-prontos-retrato {
  position: relative;
  flex: none;
}

.pavio-prontos-retrato .marca-jogador {
  position: absolute;
  right: -2px;
  bottom: 0;
  width: 17px;
  height: 17px;
  box-shadow: 0 0 0 2px #10151c;
}

.pavio-prontos-texto {
  display: grid;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.pavio-prontos-nome {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pavio-prontos li.eu .pavio-prontos-nome {
  color: #ffe066;
}

.pavio-prontos-voce {
  font-weight: 500;
}

.pavio-prontos-estado {
  color: var(--texto-suave);
  font-size: 12px;
}

.pavio-prontos li.pronto .pavio-prontos-estado {
  color: #8ce99a;
}

.pavio-robos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--texto-suave);
  font-size: 13px;
}

.pavio-aviso .pavio-robos .botao {
  min-width: 0;
  margin-top: 0;
}

.pavio-robo-nivel {
  padding: 4px 10px;
  border: 1px solid var(--borda);
  border-radius: 999px;
  background: var(--painel-2);
  color: var(--texto);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pavio-prontos-texto .pavio-robo-nivel {
  justify-self: start;
  padding: 1px 8px;
  font-size: 11px;
}

.pavio-robo-nivel[aria-pressed='true'] {
  border-color: var(--destaque);
  background: var(--destaque);
  color: #1a0d03;
}

.pavio-robo-nivel:focus-visible,
.pavio-robo-tirar:focus-visible {
  outline: 3px solid rgba(255, 138, 61, 0.6);
  outline-offset: 2px;
}

.pavio-robo-tirar {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--texto-suave);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.pavio-robo-tirar:hover {
  color: var(--texto);
}

.pavio-placar {
  width: min(560px, 100%);
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.pavio-placar th,
.pavio-placar td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(42, 58, 78, 0.8);
  text-align: center;
}

.pavio-placar th {
  color: var(--texto-suave);
  font-weight: 600;
}

.pavio-placar .pavio-placar-nome {
  max-width: 180px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pavio-placar td.pavio-placar-nome .marca-jogador {
  width: 16px;
  height: 16px;
  margin-right: 7px;
}

.pavio-placar-rotulo {
  margin-left: 4px;
  font-size: 12px;
}

.pavio-placar-posicao {
  color: var(--texto-suave);
}

.pavio-placar-eu td {
  background: rgba(255, 224, 102, 0.08);
}

.pavio-placar-pontos {
  color: #ffd43b;
  font-weight: 800;
  white-space: nowrap;
}

.pavio-placar-ganho {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(81, 207, 102, 0.15);
  color: #8ce99a;
  font-size: 11px;
  font-weight: 700;
}

.pavio-proximo {
  color: var(--texto-suave);
}

.pavio-proximo strong {
  color: var(--texto);
}

/* Time left on the results screen */
.pavio-tempo {
  width: min(320px, 80%);
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.pavio-tempo span {
  display: block;
  height: 100%;
  background: var(--destaque);
  transform-origin: left;
  animation: esvaziar var(--duracao, 7s) linear forwards;
}

@keyframes esvaziar {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Podium: 1st in the middle and tallest; the DOM keeps ranking order for screen readers */
.pavio-podio {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 6px 0 2px;
  padding: 0;
  list-style: none;
}

.pavio-podio-lugar {
  display: flex;
  flex: 0 1 150px;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.pavio-podio-lugar--1 {
  order: 2;
}

.pavio-podio-lugar--2 {
  order: 1;
}

.pavio-podio-lugar--3 {
  order: 3;
}

.pavio-retrato--podio {
  width: 64px;
  height: 64px;
}

.pavio-podio-lugar--1 .pavio-retrato--podio {
  width: 84px;
  height: 84px;
}

.pavio-podio-nome {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  font-weight: 700;
}

.pavio-podio-nome > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pavio-podio-pontos {
  color: #ffd43b;
  font-size: 13px;
  font-weight: 700;
}

.pavio-podio-degrau {
  display: grid;
  place-items: center;
  width: 100%;
  height: 38px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #d9773a, #a85420);
  color: #1a0d03;
  font-size: 20px;
  font-weight: 900;
}

.pavio-podio-lugar--1 .pavio-podio-degrau {
  height: 64px;
  background: linear-gradient(180deg, #ffd43b, #e0a800);
  font-size: 26px;
}

.pavio-podio-lugar--2 .pavio-podio-degrau {
  height: 50px;
  background: linear-gradient(180deg, #dee2e6, #a5adb6);
}

/* Confetti over the champion screen (hidden when motion is reduced) */
.pavio-confete {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.pavio-confete span {
  position: absolute;
  top: -14px;
  left: var(--x);
  width: 8px;
  height: 12px;
  border-radius: 2px;
  background: var(--cor);
  opacity: 0;
  animation: confete 2.8s ease-in var(--atraso) 2 forwards;
}

@keyframes confete {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(520px) rotate(var(--giro)); opacity: 0; }
}

.pavio-regra-pontos {
  color: var(--texto-suave);
  font-size: 12px;
}

.pavio-aviso--contagem,
.pavio-aviso--pilula {
  pointer-events: none;
}

.pavio-aviso--contagem {
  background: rgba(10, 14, 20, 0.45);
}

.pavio-aviso--contagem .pavio-sobretitulo {
  color: #dbe4ee;
}

.pavio-mapa {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 4.4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.5px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}

.pavio-aviso--contagem > p:not(.pavio-sobretitulo):not(.pavio-poder):not(.pavio-pilula) {
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(10, 14, 20, 0.55);
}

.pavio-numero {
  color: #fff;
  font-size: clamp(64px, 13vw, 150px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 0 40px rgba(255, 138, 61, 0.6);
}

.pavio-numero[data-n='2'] {
  color: #ffd43b;
}

.pavio-numero[data-n='1'] {
  color: #ff8787;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 0 50px rgba(255, 107, 107, 0.75);
}

.pavio-numero--pop {
  animation: contar 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

@keyframes contar {
  0% { transform: scale(1.9); opacity: 0; }
  25% { transform: scale(0.94); opacity: 1; }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.pavio-pilula,
.pavio-aviso--pilula p {
  padding: 8px 14px;
  background: rgba(10, 14, 20, 0.8);
  border-radius: 999px;
  font-weight: 600;
}

.pavio-aviso--pilula {
  justify-content: flex-start;
}

.pavio-faixa {
  position: absolute;
  left: 0;
  right: 0;
  top: 40%;
  padding: 10px;
  background: linear-gradient(90deg, transparent, rgba(201, 42, 42, 0.88), transparent);
  color: #fff;
  font-size: clamp(18px, 3.4vw, 30px);
  font-weight: 900;
  text-align: center;
  pointer-events: none;
  animation: entrar 0.3s ease-out;
}

/* Touch: a layer over the whole screen while playing (below the header). The stick appears where the
   finger lands on the left half; any tap on the right half drops a bomb. */

.pavio-toque {
  position: fixed;
  inset: 0;
  z-index: 20;
  touch-action: none;
}

.pavio-base,
.pavio-manete,
.pavio-dica-bomba,
.pavio-dica-gelo {
  position: fixed;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
}

/* The stick: a ring with four direction marks; the one being pushed lights up */
.pavio-base {
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  background:
    radial-gradient(circle closest-side, rgba(255, 255, 255, 0.02) 0 64%, rgba(255, 255, 255, 0.09) 66% 100%);
  border: 2px solid rgba(255, 255, 255, 0.16);
  opacity: 0.75;
  transform: translate(calc(env(safe-area-inset-left) + 96px), calc(100dvh - env(safe-area-inset-bottom) - 96px));
  transition: opacity 0.15s, border-color 0.15s;
}

.pavio-base::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background:
    conic-gradient(from -8deg, rgba(255, 255, 255, 0.35) 0 16deg, transparent 0 74deg, rgba(255, 255, 255, 0.35) 0 106deg, transparent 0 164deg, rgba(255, 255, 255, 0.35) 0 196deg, transparent 0 254deg, rgba(255, 255, 255, 0.35) 0 286deg, transparent 0);
  mask: radial-gradient(circle closest-side, transparent 0 74%, #000 77%);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 74%, #000 77%);
}

.pavio-base::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  opacity: 0;
  background: conic-gradient(from -40deg, rgba(255, 212, 59, 0.9) 0 80deg, transparent 0);
  mask: radial-gradient(circle closest-side, transparent 0 86%, #000 89%);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 86%, #000 89%);
  transition: opacity 0.1s;
}

.pavio-base[data-d='1']::after { opacity: 1; transform: rotate(0deg); }
.pavio-base[data-d='4']::after { opacity: 1; transform: rotate(90deg); }
.pavio-base[data-d='2']::after { opacity: 1; transform: rotate(180deg); }
.pavio-base[data-d='3']::after { opacity: 1; transform: rotate(270deg); }

.pavio-manete {
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18) 70%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  opacity: 0.8;
  transform: translate(calc(env(safe-area-inset-left) + 96px), calc(100dvh - env(safe-area-inset-bottom) - 96px));
}

.pavio-toque--ativo .pavio-base {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.32);
}

.pavio-toque--ativo .pavio-manete {
  opacity: 1;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.35) 70%);
}

.pavio-dica-bomba {
  left: auto;
  top: auto;
  right: calc(env(safe-area-inset-right) + 40px);
  bottom: calc(env(safe-area-inset-bottom) + 44px);
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 170, 110, 0.55), rgba(232, 89, 12, 0.35) 70%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.18);
  font-size: 38px;
}

.pavio-dica-bomba--toque {
  animation: apertar 0.2s ease-out;
}

@keyframes apertar {
  0% { transform: scale(0.84); background: rgba(255, 138, 61, 0.85); box-shadow: 0 0 0 0 rgba(255, 170, 110, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 0 18px rgba(255, 170, 110, 0); }
}

/* Ice button: above the bomb button, only while the player has ice */
.pavio-dica-gelo {
  left: auto;
  top: auto;
  right: calc(env(safe-area-inset-right) + 52px);
  bottom: calc(env(safe-area-inset-bottom) + 156px);
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  background: rgba(102, 217, 232, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 28px;
}

.pavio-dica-gelo[hidden] {
  display: none;
}

.pavio-dica-gelo--toque {
  animation: apertar-gelo 0.18s ease-out;
}

@keyframes apertar-gelo {
  from { transform: scale(0.85); background: rgba(102, 217, 232, 0.8); }
  to { transform: scale(1); }
}

/* Portrait phones and tablets: the arena on top, a compact player list below */
@media (orientation: portrait) and (max-width: 900px) {
  .sala-corpo {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }

  .painel {
    max-height: 30dvh;
    padding: 10px;
  }

  .lista-membros {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .painel-dica {
    display: none;
  }
}

/* Short landscape screens (phones): slimmer header and side list */
@media (orientation: landscape) and (max-height: 520px) {
  .sala-topo {
    padding: 4px 12px;
  }

  .sala-topo .marca {
    display: none;
  }

  .sala-corpo {
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 8px;
    padding: 6px 10px;
  }

  .painel {
    padding: 8px;
  }

  .painel-dica {
    display: none;
  }

  .pavio-hud {
    font-size: 13px;
  }

  .pavio-chip {
    height: 22px;
  }
}

/* Short stages (phones in landscape, small windows): tighter full screens */
@media (max-height: 560px) {
  .pavio-cartao {
    gap: 5px;
    padding: 12px;
  }

  .pavio-legenda {
    display: none;
  }

  .pavio-retrato--vencedor {
    width: 64px;
    height: 64px;
  }

  .pavio-retrato--podio,
  .pavio-podio-lugar--1 .pavio-retrato--podio {
    width: 48px;
    height: 48px;
  }

  .pavio-podio-degrau,
  .pavio-podio-lugar--1 .pavio-podio-degrau,
  .pavio-podio-lugar--2 .pavio-podio-degrau {
    height: 26px;
    font-size: 15px;
  }
}

@media (max-width: 560px) {
  .sala-topo .marca {
    display: none;
  }

  .pavio-hud {
    gap: 6px;
    font-size: 13px;
  }

  .pavio-chip {
    height: 22px;
    gap: 2px;
    padding: 0 5px 0 4px;
  }
}

/* Portrait phones: points and clock on top, the powers on a full row of their own below them */
@media (orientation: portrait) and (max-width: 560px) {
  .pavio-hud {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .pavio-hud-itens {
    order: 3;
    flex: 1 0 100%;
  }

  .sala-topo {
    gap: 8px;
    padding: 8px 10px;
  }

  .sala-codigo {
    gap: 6px;
  }

  .sala-codigo .rotulo {
    display: none;
  }

  .sala-acoes {
    gap: 6px;
  }

  .pavio-cartao {
    padding: 14px 10px 12px;
  }

  .pavio-prontos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pavio-prontos li {
    font-size: 13px;
  }

  /* The yellow name already marks you; the text stays for screen readers */
  .pavio-prontos-voce {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .pavio-prontos .pavio-retrato {
    width: 40px;
    height: 40px;
  }

  .pavio-placar-rotulo {
    display: none;
  }

  .pavio-placar th,
  .pavio-placar td {
    padding: 4px 5px;
  }

  .sala-codigo {
    margin: 0;
  }

  .sala-acoes {
    margin-left: auto;
  }

  .avisos {
    left: 16px;
    right: 16px;
  }

  .pavio-placar {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .pavio-confete,
  .pavio-tempo {
    display: none;
  }
}

/* The Molotov control is separate from the bomb and ice on touch devices. */
.pavio-dica-molotov {
  position: fixed;
  left: auto;
  top: auto;
  right: calc(env(safe-area-inset-right) + 140px);
  bottom: calc(env(safe-area-inset-bottom) + 156px);
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(231, 105, 37, 0.45);
  font-size: 28px;
  pointer-events: none;
}
.pavio-dica-molotov--toque { animation: apertar 0.2s ease-out; }

.pavio-dica-portal {
  position: fixed;
  left: auto;
  top: auto;
  right: calc(env(safe-area-inset-right) + 160px);
  bottom: calc(env(safe-area-inset-bottom) + 60px);
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(134, 46, 156, 0.55);
  font-size: 27px;
  pointer-events: none;
}
