/* Biblioteca de exercícios: identidade do app de treino do Diego. */
:root {
  --fundo: #12161D;
  --superficie: #1C222B;
  --borda: #2D3644;
  --texto: #F2EEE6;
  --secundario: #8C95A3;
  --destaque: #FFB21A;
  --erro: #FF8B7B;

  --f-display: "Avenir Next Condensed", "AvenirNextCondensed-HeavyItalic", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --f-texto: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--destaque); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ===== Topo fixo ===== */
.topo {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--fundo);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--borda);
}
.topo-dentro {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px var(--gutter) 10px;
}
.marca { display: flex; align-items: center; gap: 12px; }
.marca img { width: 29px; height: 48px; flex: none; }
.topo h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-style: italic;
  font-size: 24px;
  line-height: 1.05;
}
.frase { font-size: 15px; color: var(--secundario); line-height: 1.3; }
.painel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 8px;
}
.progresso { font-size: 15px; font-variant-numeric: tabular-nums; }
.progresso strong { font-weight: 700; }
.filtro {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  background: var(--superficie);
  font-size: 15px;
  font-weight: 600;
}
.filtro[aria-pressed="true"] { background: var(--destaque); border-color: var(--destaque); color: var(--fundo); }
.falha-carga { margin-top: 6px; font-size: 15px; color: var(--erro); }
.barra { height: 3px; background: var(--superficie); }
.barra span { display: block; height: 100%; width: 0; background: var(--destaque); }

/* ===== Lista ===== */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px var(--gutter) calc(48px + env(safe-area-inset-bottom));
}
.turma h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-style: italic;
  font-size: 30px;
  line-height: 1.1;
  margin: 28px 0 14px;
}
.turma-vazia { color: var(--secundario); font-size: 15px; }

.cartao {
  background: var(--superficie);
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 12px;
  scroll-margin-top: 150px;
}
.linha {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 14px;
  align-items: start;
}

/* Vídeo em pé, capa até carregar */
.midia {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: var(--fundo);
}
.midia video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--fundo); }
.marcador {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--destaque);
  color: var(--fundo);
  display: none;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}
.cartao[data-modo="feito"] .marcador { display: grid; }
.cartao.recem .marcador { animation: carimbo .42s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes carimbo { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cartao.recem .marcador { animation: none; }
}

/* Texto à direita */
.info { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.numero { font-size: 15px; color: var(--secundario); }
.nome {
  font-family: var(--f-display);
  font-weight: 800;
  font-style: italic;
  font-size: 30px;
  line-height: 1.02;
  overflow-wrap: break-word;   /* quebra só entre palavras (sem hífen) */
  hyphens: manual;
}
.nome.longo { font-size: 24px; }
.nome .sugerido, .nome .corrigido { display: block; }
.nome .pergunta-nome { display: block; color: var(--destaque); }
.cartao[data-corrigido] .nome .sugerido {
  font-size: 18px;
  line-height: 1.15;
  color: var(--secundario);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  margin-bottom: 4px;
}
.nome .corrigido { color: var(--destaque); }
.obs { font-size: 15px; color: var(--secundario); line-height: 1.3; }

.pergunta { font-size: 15px; margin-top: 4px; }
.botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.botoes button, .alterar {
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  background: #262E3A;
  font-size: 18px;
  font-weight: 700;
}
.botoes button[aria-pressed="true"] { border-color: var(--destaque); box-shadow: inset 0 0 0 1px var(--destaque); }
.feito { font-size: 16px; font-weight: 700; color: var(--destaque); margin-top: 4px; }
.alterar { min-height: 48px; font-size: 16px; padding: 0 18px; align-self: flex-start; }

/* Campo do nome correto: largura toda, embaixo */
.corrigir { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.corrigir label { font-size: 15px; color: var(--secundario); }
.corrigir input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  background: var(--fundo);
  font-size: 18px;
}
.corrigir input:focus-visible { outline-offset: 0; border-color: var(--destaque); }
.salvar {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--destaque);
  color: var(--fundo);
  font-size: 18px;
  font-weight: 800;
}
.aviso { font-size: 15px; margin-top: 10px; }
.aviso:empty { display: none; }
.aviso.erro { color: var(--erro); }

.fim {
  font-family: var(--f-display);
  font-weight: 800;
  font-style: italic;
  font-size: 30px;
  line-height: 1.1;
  color: var(--destaque);
  margin: 36px 0 12px;
}

@media (min-width: 560px) {
  .nome { font-size: 34px; }
  .nome.longo { font-size: 28px; }
}
