:root {
  --teal: #0e3330;
  --teal-deep: #082421;
  --teal-mid: #145049;
  --gold: #e2c36a;
  --gold-deep: #8a6412;
  --ink: #1b140c;
  --cream: #f7f1e3;
  --parchment: #f4e7c8;
  --parchment-deep: #efe0bc;
  --erro: #6e241c;
  --erro-fundo: #f8e6e0;
  --certo: #0e3d22;
  --certo-fundo: #e5f3e6;
  --linha: #c6a15a;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background-color: var(--teal);
  background-image:
    radial-gradient(ellipse at top, rgba(226, 195, 106, 0.18), transparent 52%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 12px);
  font-family: Georgia, "Iowan Old Style", Palatino, "Palatino Linotype", "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.5;
}

main {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1rem 2.75rem;
}

.cabeca,
.palco,
.elenco,
.aviso {
  width: min(960px, 100%);
  margin-left: auto;
  margin-right: auto;
}

h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(1.6rem, 4.6vw, 2.4rem);
  line-height: 1.2;
  font-weight: 700;
  border-bottom: 3px solid var(--gold);
  padding-bottom: 0.45rem;
}

h2,
h3 {
  margin: 0.15rem 0 0.55rem;
  color: var(--ink);
  line-height: 1.25;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0.4rem 0;
}

.palco {
  margin-top: 0.85rem;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 3px solid var(--gold);
  border-radius: 14px;
}

.palco video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 10px;
}

.palco:focus-within {
  outline: 3px solid #ffe08a;
  outline-offset: 4px;
}

.elenco {
  margin-top: 0.85rem;
  color: var(--cream);
}

.aviso {
  margin-top: 0.85rem;
  padding: 0.95rem 1.05rem;
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--linha);
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 700;
}

.cartas {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.cartas > li {
  display: flex;
}

.carta,
.painel {
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--linha);
  border-radius: 16px;
  box-shadow: inset 0 0 0 4px #f8f1df;
}

.carta {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 1rem 1rem 1.1rem;
}

.painel {
  width: min(960px, 100%);
  margin: 1rem auto 0;
  padding: 1rem 1rem 1.15rem;
}

.retrato,
.ilustra {
  display: block;
  width: 100%;
}

.retrato {
  height: 92px;
}

.ilustra {
  height: 92px;
  border-radius: 12px;
}

.voz {
  margin: 0.35rem 0 0;
  color: #4a3208;
  font-weight: 700;
}

.carta p,
.painel p,
.painel li {
  color: var(--ink);
}

.carta button,
.painel button,
.acoes button {
  margin-top: auto;
}

button {
  min-height: 48px;
  min-width: 44px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--gold);
  background: var(--teal-mid);
  color: var(--cream);
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.carta button {
  width: 100%;
  margin-top: 0.8rem;
}

button:hover {
  background: #1b675c;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  background: #efe4cc;
  color: #3a332c;
  border-color: #b7a88a;
  cursor: not-allowed;
  transform: none;
}

button.secundario {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

button.secundario:hover {
  background: rgba(27, 20, 12, 0.06);
}

:focus-visible {
  outline: 3px solid #ffe08a;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--teal-deep);
}

.instrucao {
  font-size: 1.15rem;
}

.progresso {
  font-weight: 700;
}

.pares,
.etapas,
.linha-tempo,
.lista-opcoes,
.acoes,
.ordem,
.pares > div {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.ordem,
.linha-tempo,
.lista-opcoes,
.resultado-lista {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.opcao,
.etapa {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  background: #fffaf0;
  color: var(--ink);
  border: 2px solid #8d7340;
}

.opcao:hover,
.etapa:hover {
  background: #fff;
}

.opcao-rotulo,
.opcao-nota,
.posicao {
  font-size: 0.95rem;
  font-weight: 700;
  color: #4a3208;
}

.opcao-nome,
.etapa-nome {
  font-size: 1.15rem;
}

.opcao[aria-pressed="true"],
.etapa[aria-pressed="true"] {
  background: #fff3c4;
  border-color: var(--gold-deep);
  box-shadow: inset 4px 0 0 var(--gold-deep);
}

button.certo,
button.certo:disabled {
  background: var(--certo-fundo);
  color: var(--certo);
  border-color: #1f6b3a;
  opacity: 1;
}

button.marca-erro,
button.marca-erro:disabled {
  background: var(--erro-fundo);
  color: var(--erro);
  border-color: #a34a3e;
  opacity: 1;
}

.feedback,
.explicacao {
  margin-top: 0.8rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 2px solid var(--linha);
  background: #fffaf0;
  color: var(--ink);
  font-weight: 700;
}

.feedback:focus {
  outline: 3px solid var(--teal-deep);
  outline-offset: 3px;
}

.feedback.erro,
.marca-erro {
  background: var(--erro-fundo);
  color: var(--erro);
  border-color: #a34a3e;
}

.feedback.certo,
.marca-certo {
  background: var(--certo-fundo);
  color: var(--certo);
  border-color: #1f6b3a;
}

.feedback.info {
  background: #fff6d8;
  color: var(--ink);
  border-color: var(--gold-deep);
}

.explicacao {
  font-weight: 400;
}

.pergunta,
.pergunta-central {
  margin-top: 0.7rem;
  font-size: 1.25rem;
  font-weight: 700;
  max-width: 65ch;
}

.vazio {
  color: #4a3208;
  font-weight: 700;
}

.idade {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--cream);
  font-weight: 700;
}

.linha-tempo li,
.resultado-lista li,
.ordem li {
  background: #fffaf0;
  border: 2px solid #8d7340;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

.acoes {
  margin-top: 1rem;
}

.tema {
  margin: 0.35rem 0 0;
  color: #4a3208;
  font-weight: 700;
}

@media (min-width: 900px) {
  .cartas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .pares,
  .etapas,
  .linha-tempo {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pares {
    grid-template-columns: 1fr 1fr;
  }

  .acoes {
    grid-template-columns: 1fr 1fr;
  }
}
