/* ═══ Dial do Raciocínio · estilos ═══
   O jogo roda num iframe 16:10 que vai de 340 × 212 a 1100 × 690, e em tela
   cheia. Tudo é medido em rem, e o rem acompanha o tamanho do iframe, com
   piso de 12 px para o texto continuar legível no menor tamanho. */

:root {
  --fundo: #08080c;
  --fundo-2: #101018;
  --painel: #12121b;
  --painel-2: #171723;
  --tinta: #ededf5;
  --tinta-2: #9a9ab0;
  --borda: #26263a;
  --ambar: #f59e0b;
  --ambar-fraco: rgba(245, 158, 11, 0.14);
  --esmeralda: #10b981;
  --vermelho: #ef4444;
  --violeta: #8b5cf6;
  --sans: system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --raio: 0.6rem;
  --rapido: 160ms;
  --medio: 280ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(12px, min(1.6vw, 2.56vh), 20px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--fundo);
  color: var(--tinta);
  font-family: var(--sans);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

kbd {
  display: inline-block;
  min-width: 1.35em;
  padding: 0 0.3em;
  border: 1px solid var(--borda);
  border-bottom-width: 2px;
  border-radius: 0.3em;
  background: var(--painel-2);
  color: var(--tinta);
  font-family: var(--mono);
  font-size: max(12px, 0.86em);
  line-height: 1.35;
  text-align: center;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--tinta);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.45);
}

.so-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* ═══ Estrutura das telas ═══ */
.jogo {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 50% -10%, rgba(245, 158, 11, 0.07), transparent 60%),
    linear-gradient(180deg, var(--fundo-2), var(--fundo) 65%);
}

.tela {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition:
    opacity var(--medio) ease,
    transform var(--medio) ease,
    visibility 0s linear var(--medio);
}

.jogo[data-tela="inicio"] .tela-inicio,
.jogo[data-tela="jogando"] .tela-jogando,
.jogo[data-tela="fim"] .tela-fim {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.rolagem {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.75rem 0.85rem 1rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--borda) transparent;
}

/* ═══ Botões ═══ */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: max(40px, 2.6rem);
  padding: 0 1.25rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--painel-2);
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition:
    transform var(--rapido) ease,
    background-color var(--rapido) ease,
    box-shadow var(--rapido) ease;
}

.botao.principal {
  border-color: transparent;
  background: var(--ambar);
  color: #1a1204;
  box-shadow:
    0 0.35rem 1.2rem rgba(245, 158, 11, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

@media (hover: hover) {
  .botao.principal:hover {
    background: #fbb02e;
    transform: translateY(-1px);
  }
}

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

.botao-icone {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid var(--borda);
  border-radius: 0.45rem;
  background: var(--painel-2);
  color: var(--tinta-2);
  transition:
    color var(--rapido) ease,
    border-color var(--rapido) ease;
}

/* Área de toque de pelo menos 40 px, mesmo com o botão pequeno no HUD. */
.botao-icone::before {
  content: "";
  position: absolute;
  inset: -0.3rem -0.5rem -1.45rem -1.2rem;
}

.botao-icone:hover {
  color: var(--tinta);
  border-color: var(--ambar);
}

.botao-icone svg {
  width: 62%;
  height: 62%;
  fill: currentColor;
}

/* ═══ Tela de início ═══ */
.abertura {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.emblema {
  width: 3.1rem;
  height: 3.1rem;
  fill: none;
  stroke-linecap: round;
}

.emblema-arco {
  stroke: var(--borda);
  stroke-width: 5;
}

.emblema-marcas path {
  stroke: var(--tinta-2);
  stroke-width: 2;
}

.emblema-ponteiro {
  transform-origin: 32px 32px;
  animation: ponteiro 5.5s cubic-bezier(0.6, 0, 0.3, 1) infinite;
}

.emblema-ponteiro path {
  stroke: var(--ambar);
  stroke-width: 3.2;
}

.emblema-ponteiro circle {
  fill: var(--ambar);
}

@keyframes ponteiro {
  0%,
  8% {
    transform: rotate(-120deg);
  }
  22%,
  30% {
    transform: rotate(-60deg);
  }
  44%,
  52% {
    transform: rotate(0deg);
  }
  66%,
  74% {
    transform: rotate(60deg);
  }
  86%,
  94% {
    transform: rotate(120deg);
  }
  100% {
    transform: rotate(-120deg);
  }
}

.abertura h1 {
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.lema {
  color: var(--tinta-2);
  font-size: 1rem;
  line-height: 1.25;
}

.abertura-acoes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.recorde-inicio {
  color: var(--tinta-2);
  font-size: 1rem;
  white-space: nowrap;
}

.recorde-inicio b {
  color: var(--tinta);
  font-family: var(--mono);
  font-weight: 600;
}

.blocos,
.fim-corpo {
  display: grid;
  gap: 0.6rem;
}

.bloco {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: linear-gradient(180deg, var(--painel-2), var(--painel));
  font-size: 1rem;
}

.bloco h2,
.bloco h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  color: var(--ambar);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bloco h3 + p + h3 {
  margin-top: 0.7rem;
}

.bloco .num {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 1px solid var(--ambar);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: max(12px, 0.86rem);
  letter-spacing: 0;
}

.bloco p + p {
  margin-top: 0.5rem;
}

.bloco li {
  position: relative;
  padding-left: 1rem;
}

.bloco li + li {
  margin-top: 0.3rem;
}

.bloco li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55em;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 1px;
  background: var(--ambar);
  transform: rotate(45deg);
}

/* Dois exemplos desenhados: o que é tarefa fácil e o que é tarefa difícil. */
.exemplos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.exemplos figure {
  margin: 0;
}

.exemplos svg {
  display: block;
  width: 100%;
  border: 1px solid var(--borda);
  border-radius: 0.4rem;
  background: var(--fundo);
}

.exemplos figcaption {
  margin-top: 0.25rem;
  color: var(--tinta-2);
  line-height: 1.25;
}

.exemplos b {
  color: var(--ambar);
}

.ex-trilha {
  fill: none;
  stroke: #38385a;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ex-entrada {
  fill: var(--fundo);
  stroke: var(--ambar);
  stroke-width: 2.5;
}

.ex-saida {
  fill: var(--fundo);
  stroke: var(--tinta);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.nota {
  padding-top: 0.5rem;
  border-top: 1px dashed var(--borda);
  color: var(--tinta-2);
}

/* ═══ Tela de jogo ═══ */
.tela-jogando {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0.2rem;
  padding: 0.3rem 0.3rem 0.35rem;
}

.hud {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 2rem;
  padding: 0 0.15rem 0 0.55rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--painel);
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  white-space: nowrap;
}

.rotulo {
  color: var(--tinta-2);
  font-size: 1rem;
}

.valor {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rotulo-longo {
  display: none;
}

.hud-orcamento {
  flex: 1 1 auto;
}

.icone-token {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: var(--ambar);
  stroke-width: 1.3;
}

.barra {
  position: relative;
  flex: 1 1 2rem;
  min-width: 1.6rem;
  height: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--borda);
  border-radius: 1rem;
  background: var(--fundo);
}

.barra i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ambar);
  transform-origin: left center;
  transition: background-color var(--medio) ease;
}

.hud-orcamento.alerta .barra i {
  background: var(--vermelho);
}

.hud-orcamento.alerta .valor {
  color: var(--vermelho);
}

.hud-orcamento.alerta .valor::after {
  content: " !";
}

.vagas {
  display: flex;
  gap: 0.2rem;
}

.vagas i {
  width: 0.72rem;
  height: 0.72rem;
  border: 1.5px solid var(--borda);
  border-radius: 0.2rem;
  /* A vaga seguinte enche de baixo para cima enquanto a próxima tarefa chega. */
  background: linear-gradient(to top, rgba(245, 158, 11, 0.5) var(--enche, 0%), transparent var(--enche, 0%));
  transition:
    background-color var(--rapido) ease,
    border-color var(--rapido) ease,
    transform var(--rapido) ease;
}

.vagas i.cheia {
  border-color: var(--ambar);
  background: var(--ambar);
}

.vagas i.entrou {
  animation: entrou 320ms ease;
}

@keyframes entrou {
  0% {
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

.hud-fila.alerta .vagas i.cheia {
  border-color: var(--vermelho);
  background: var(--vermelho);
}

.hud-fila.alerta .valor-fila {
  color: var(--vermelho);
}

.hud-fila.alerta .valor-fila::after {
  content: " !";
}

.valor-fila {
  display: none;
}

.hud-pontos .valor {
  color: var(--ambar);
}

.hud-pontos.subiu .valor {
  animation: subiu 380ms ease;
}

@keyframes subiu {
  40% {
    transform: translateY(-2px) scale(1.12);
  }
}

.faixa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  font-size: 1rem;
  line-height: 1.3rem;
  white-space: nowrap;
}

.faixa-tarefa {
  flex: none;
  color: var(--tinta-2);
}

.faixa-tarefa b {
  color: var(--ambar);
  font-weight: 600;
}

.faixa-acao {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.faixa-acao.bom {
  color: var(--esmeralda);
}

.faixa-acao.ruim {
  color: var(--vermelho);
}

.faixa-acao .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.palco {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: #0a0a10;
}

#tela {
  display: block;
  width: 100%;
  height: 100%;
}

.aviso {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 92%;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--vermelho);
  border-radius: var(--raio);
  background: rgba(16, 8, 10, 0.94);
  color: var(--tinta);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  transform: translate(-50%, -50%);
  animation: aviso 260ms ease;
}

.aviso small {
  display: block;
  color: var(--tinta-2);
  font-size: 1rem;
  font-weight: 400;
}

@keyframes aviso {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.96);
  }
}

/* ─── O dial: cinco níveis e o modo adaptativo ─── */
.dial {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.18fr);
  gap: 0.3rem;
}

.dial-ponteiro {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  border-radius: var(--raio);
  background: var(--ambar-fraco);
  box-shadow:
    inset 0 0 0 1.5px var(--ambar),
    0 0 1.1rem rgba(245, 158, 11, 0.28);
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--medio) cubic-bezier(0.3, 1.3, 0.5, 1),
    width var(--medio) ease,
    opacity var(--rapido) ease;
}

.dial-ponteiro.visivel {
  opacity: 1;
}

.nivel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  min-width: 0;
  min-height: max(40px, 3.2rem);
  padding: 0.1rem 0.15rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: linear-gradient(180deg, var(--painel-2), var(--painel));
  transition:
    border-color var(--rapido) ease,
    opacity var(--rapido) ease,
    transform var(--rapido) ease;
}

.nivel-nome {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.nivel-info {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  color: var(--tinta-2);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.barras {
  width: 1.15rem;
  height: 0.78rem;
  fill: var(--borda);
}

.barras .on {
  fill: var(--ambar);
}

.icone-adaptativo {
  width: 1.2rem;
  height: 0.78rem;
  fill: none;
  stroke: var(--violeta);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.nivel kbd {
  position: absolute;
  top: 0.25rem;
  right: 0.3rem;
  display: none;
  color: var(--tinta-2);
  font-size: max(12px, 0.72rem);
}

.so-largo {
  display: none;
}

.nivel-adaptativo {
  border-style: dashed;
  border-color: rgba(139, 92, 246, 0.6);
}

@media (hover: hover) {
  .nivel:not([aria-disabled="true"]):hover {
    border-color: var(--ambar);
    transform: translateY(-1px);
  }
}

.nivel:not([aria-disabled="true"]):active {
  transform: translateY(1px);
}

.nivel[aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

.nivel.escolhido {
  border-color: transparent;
  opacity: 1;
}

.nivel.escolhido .nivel-nome {
  color: var(--ambar);
}

/* Nível que já falhou nesta tarefa: riscado, não só apagado. */
.nivel.falhou .nivel-nome {
  text-decoration: line-through;
  text-decoration-color: var(--vermelho);
  text-decoration-thickness: 2px;
}

/* Depois do resultado, o menor nível que resolvia ganha uma marca. */
.nivel.bastava {
  border-color: var(--esmeralda);
  border-style: solid;
  opacity: 1;
}

.nivel.bastava::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: -0.35rem;
  left: 0.2rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--esmeralda)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.3l2 2 4-4.4' fill='none' stroke='%23062b1f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 80% no-repeat;
  animation: entrou 300ms ease;
}

.nivel.trancado .nivel-nome {
  color: var(--tinta-2);
}

.nivel.trancado .icone-adaptativo {
  display: none;
}

.nivel.novo {
  animation: novo 1.2s ease 3;
}

@keyframes novo {
  50% {
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.35);
  }
}

/* ─── Cartões sobre o jogo ─── */
.sobreposicao {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 0.5rem;
  overflow-y: auto;
  background: rgba(8, 8, 12, 0.8);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: surgir var(--medio) ease;
}

.sobreposicao-pausa {
  background: var(--fundo);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@keyframes surgir {
  from {
    opacity: 0;
  }
}

.cartao {
  width: min(100%, 34rem);
  padding: 0.85rem 1rem 0.9rem;
  border: 1px solid var(--borda);
  border-radius: calc(var(--raio) * 1.4);
  background: linear-gradient(180deg, var(--painel-2), var(--painel));
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.55);
  font-size: 1rem;
  animation: cartao var(--medio) cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes cartao {
  from {
    transform: translateY(0.6rem) scale(0.98);
  }
}

.cartao-sobre {
  color: var(--ambar);
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cartao h2,
.fim-cabeca h2 {
  margin-bottom: 0.35rem;
  font-size: 1.4rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.cartao-resumo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  margin-bottom: 0.5rem;
}

.cartao-resumo li {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--borda);
  border-radius: 1rem;
  background: var(--fundo);
  color: var(--tinta-2);
  white-space: nowrap;
}

.cartao-resumo b {
  color: var(--esmeralda);
  font-family: var(--mono);
  font-weight: 600;
}

.cartao-dados {
  margin-top: 0.4rem;
  color: var(--tinta-2);
}

.cartao .botao {
  width: 100%;
  margin-top: 0.7rem;
}

/* Cartão de fase: em tela baixa o botão fica no topo, ao lado do título,
   para estar sempre à vista sem rolar. Em tela alta ele vai para o rodapé. */
.cartao-fase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "topo botao"
    "resumo resumo"
    "texto texto"
    "dados dados";
  align-items: center;
  column-gap: 0.8rem;
}

.cartao-topo {
  grid-area: topo;
}

.cartao-fase h2 {
  margin-bottom: 0;
}

.cartao-fase .botao {
  grid-area: botao;
  width: auto;
  margin-top: 0;
}

.cartao-fase .cartao-resumo {
  grid-area: resumo;
  margin: 0.45rem 0 0;
}

.cartao-texto {
  grid-area: texto;
  margin-top: 0.45rem;
}

.cartao-fase .cartao-dados {
  grid-area: dados;
}

@media (min-height: 430px) {
  .cartao-fase {
    grid-template-areas:
      "topo topo"
      "resumo resumo"
      "texto texto"
      "dados dados"
      "botao botao";
  }

  .cartao-fase .botao {
    width: 100%;
    margin-top: 0.8rem;
  }
}

.cartao-pausa {
  width: min(100%, 24rem);
  text-align: center;
}

/* ═══ Tela de fim ═══ */
.fim-cabeca {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin-bottom: 0.7rem;
}

.fim-cabeca h2 {
  margin: 0;
}

.fim-placar {
  display: flex;
  gap: 1.2rem;
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--painel);
}

.placar-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5rem;
}

.placar-item .rotulo {
  width: 100%;
}

.placar-valor {
  color: var(--ambar);
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.placar-recorde {
  color: var(--tinta);
}

.selo {
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--esmeralda);
  border-radius: 1rem;
  color: var(--esmeralda);
  font-size: 1rem;
  font-weight: 650;
  white-space: nowrap;
  animation: entrou 420ms ease;
}

.decisoes > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.22rem 0;
}

.decisoes > div + div {
  border-top: 1px solid var(--borda);
}

.decisoes dt {
  position: relative;
  padding-left: 1.3rem;
  color: var(--tinta-2);
}

.decisoes dt .marca {
  position: absolute;
  left: 0;
  color: var(--tinta);
  font-family: var(--mono);
  font-weight: 700;
}

.decisoes dt small {
  display: block;
  font-size: 1rem;
  opacity: 0.85;
}

.decisoes dd {
  flex: none;
  font-family: var(--mono);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bloco-licao p:first-of-type {
  font-size: 1.08rem;
}

/* ═══ Telas maiores ═══ */
@media (min-width: 520px) {
  .rotulo-longo {
    display: inline;
  }

  .rotulo-curto,
  .icone-token {
    display: none;
  }

  .valor-fila {
    display: inline;
  }

  .so-largo {
    display: inline;
  }

  .so-estreito {
    display: none;
  }

  .hud {
    gap: 1.1rem;
    height: 2.3rem;
    padding: 0 0.3rem 0 0.8rem;
  }

  .tela-jogando {
    gap: 0.35rem;
    padding: 0.5rem;
  }

  .dial {
    gap: 0.45rem;
  }

  .nivel {
    min-height: 3.5rem;
  }

  .faixa {
    height: 1.5rem;
  }
}

@media (min-width: 720px) {
  /* Centraliza na vertical quando sobra espaço; se faltar, as margens
     automáticas viram zero e a rolagem começa do topo. */
  .rolagem {
    display: flex;
    flex-direction: column;
    padding: 0.9rem 1.4rem;
  }

  .rolagem > :first-child {
    margin-top: auto;
  }

  .rolagem > :last-child {
    margin-bottom: auto;
  }

  .abertura {
    margin-bottom: 0.8rem;
  }

  .bloco {
    padding: 0.7rem 0.85rem;
    line-height: 1.36;
  }

  /* Na coluna estreita, cada exemplo vira uma linha: desenho e legenda. */
  .exemplos {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .exemplos figure {
    display: grid;
    grid-template-columns: 46% minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
  }

  .exemplos figcaption {
    margin-top: 0;
  }

  .emblema {
    width: 4.2rem;
    height: 4.2rem;
  }

  .abertura h1 {
    font-size: 2.1rem;
  }

  .lema {
    font-size: 1.1rem;
  }

  .abertura-acoes {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .abertura .botao {
    min-height: 3rem;
    padding: 0 2.2rem;
    font-size: 1.15rem;
  }

  .blocos {
    grid-template-columns: 0.85fr 1.25fr 1.1fr;
    align-items: stretch;
    gap: 0.8rem;
  }

  .fim-cabeca {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .fim-placar {
    grid-column: auto;
    grid-row: auto;
  }

  .fim-corpo {
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 0.8rem;
  }

  .fim-cabeca .botao {
    min-height: 3rem;
    padding: 0 1.8rem;
  }
}

@media (hover: hover) and (min-width: 720px) {
  .nivel kbd {
    display: block;
  }
}

/* ═══ Movimento reduzido ═══ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .emblema-ponteiro {
    animation: none;
    transform: rotate(0deg);
  }

  .tela {
    transform: none;
  }
}
