@font-face {
  font-family: Fraunces;
  src: url("fontes/fraunces.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url("fontes/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("fontes/barlow.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: #1c2418;
  font-family: Fraunces, Palatino, "Palatino Linotype", serif;
  font-weight: 500;
  background-color: #2c1e15;
  background-image:
    radial-gradient(ellipse 70% 42% at 50% 12%, rgba(255, 214, 160, 0.18), transparent 62%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px 6px);
}

button,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid #e4c27a;
  outline-offset: 3px;
}

::selection {
  background: #1c6436;
  color: #f4efe4;
}

.so-leitores {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mesa {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 22px;
  padding: 32px 16px 28px;
}

.livro {
  position: relative;
  width: min(1040px, calc(100vw - 32px));
  background-color: #143028;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.035) 0 1px,
    transparent 1px 3px
  );
  padding: 14px 14px 14px 22px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 22px 40px rgba(0, 0, 0, 0.35);
}

.livro::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, #0c2218, #1e4a34 55%, #0c2218);
  pointer-events: none;
}

.folha.capa {
  min-height: 560px;
  padding: 18px 18px 18px 6px;
  color: #f4efe4;
}

.capa-miolo {
  min-height: 524px;
  border: 1px solid rgba(244, 239, 228, 0.42);
  padding: 36px 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.capa h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(4.4rem, 8vw, 6.6rem);
  line-height: 0.86;
  letter-spacing: -0.03em;
}

.capa .sub {
  margin: 16px auto 0;
  max-width: 16em;
  font-size: 1.35rem;
  line-height: 1.35;
}

.pilha {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 148px;
  margin-top: auto;
  margin-bottom: 26px;
}

.costas {
  width: 86px;
  height: 122px;
  margin: 0 -6px;
  background-color: #1c6436;
  background-image:
    radial-gradient(circle at 50% 42%, transparent 16px, rgba(244, 239, 228, 0.9) 17px 18.5px, transparent 19.5px),
    linear-gradient(#f4efe4, #f4efe4) center / 68% 2px no-repeat;
  border: 7px solid #f4efe4;
  border-radius: 2px;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.28);
}

.costas:nth-child(1) { transform: rotate(-8deg); }
.costas:nth-child(2) { transform: translateY(-10px); position: relative; z-index: 1; }
.costas:nth-child(3) { transform: rotate(7deg); }

.capa-accao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.abrir {
  font: inherit;
  font-weight: 600;
  font-size: 1.2rem;
  background: #f4efe4;
  color: #143028;
  border: 0;
  padding: 0.7rem 1.05rem;
  border-radius: 2px;
  cursor: pointer;
}

.abrir:hover { background: #fff; }

.estado-capa { font-size: 1.05rem; }

.recomecar {
  font: inherit;
  font-size: 0.98rem;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.folha.interior {
  background: #f3ecdc;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.faixa {
  padding: 16px 18px 13px;
  margin-bottom: 16px;
}

.faixa h2 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.1;
}

.faixa-noite { background: #1a3c56; color: #f4efe4; }
.faixa-relva { background: #1c6436; color: #f4efe4; }
.faixa-jogo { background: #8e2f28; color: #f4efe4; }
.faixa-fim { background: #6a501c; color: #f6f0e2; }

.grelha {
  display: grid;
  gap: 14px 12px;
  padding: 0 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.grelha[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.grelha[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.grelha[data-n="2"],
.grelha[data-n="1"] {
  grid-template-columns: repeat(2, minmax(0, 280px));
  justify-content: center;
  padding-top: 8px;
}

.grelha[data-n="1"] { grid-template-columns: minmax(0, 280px); }

.legenda {
  display: block;
  min-height: 2.5em;
  font-size: 0.92rem;
  line-height: 1.25;
  color: #1c2418;
}

.foto,
.lugar-foto {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  background: #d9d0be;
  overflow: hidden;
}

.foto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jogador .foto {
  background: #f4f0e6;
}

.jogador .foto img {
  object-fit: contain;
  object-position: center bottom;
}

.numero {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  background: #f7f4ee;
  color: #1c2418;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1;
  padding: 4px 6px 2px;
}

button.cromo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.cromo-borda {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 7px 8px;
  background: #f7f4ee;
  border: 2px solid #efe8da;
  border-radius: 2px;
  box-shadow: 0 8px 14px rgba(40, 30, 10, 0.12);
}

.brilhante .cromo-borda {
  border-color: transparent;
  background:
    linear-gradient(#f7f4ee, #f7f4ee) padding-box,
    linear-gradient(120deg, #6e5018, #f6e7b4 42%, #fffef8 50%, #e0c06a 58%, #6e5018) border-box;
}

.lugar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 7px 7px 8px;
  border: 2px dashed rgba(28, 36, 24, 0.38);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  color: inherit;
  font: inherit;
  text-align: left;
}

button.lugar { cursor: pointer; }

.lugar.pronto {
  border-style: solid;
  border-color: #1c6436;
  background: rgba(255, 255, 255, 0.62);
}

.lugar-foto {
  display: grid;
  place-items: center;
  background: rgba(28, 36, 24, 0.045);
}

.lugar-num {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1;
  color: rgba(28, 36, 24, 0.42);
}

.lugar.pronto .lugar-num { color: #1c6436; }

.colar-ja {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  color: #1c6436;
  font-size: 0.95rem;
}

.lugar.a-receber {
  outline: 2px solid #1c6436;
  outline-offset: 3px;
}

.lugar.recusa {
  animation: recusa 360ms linear;
  outline: 2px solid #8e2f28;
  outline-offset: 3px;
}

@keyframes recusa {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.paginacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 18px 16px 14px;
}

.paginacao button {
  font: inherit;
  font-size: 1rem;
  color: #1c2418;
  background: transparent;
  border: 1px solid rgba(28, 36, 24, 0.4);
  border-radius: 2px;
  padding: 8px 14px;
  cursor: pointer;
}

.paginacao button:hover:not(:disabled) {
  background: #1c2418;
  color: #f4efe4;
}

.paginacao button:disabled {
  opacity: 0.35;
  cursor: default;
}

.paginacao span {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 600;
  font-size: 1.4rem;
}

.tabuleiro {
  width: min(1040px, calc(100vw - 32px));
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 18px;
  color: #f4efe4;
}

.pista {
  flex: 1;
  min-width: 12rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

.progresso {
  margin-left: auto;
  font-size: 1.05rem;
  white-space: nowrap;
}

.contagem {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.contagem .progresso {
  margin-left: 0;
}

.progresso.sozinho {
  margin-left: 0;
  width: 100%;
  text-align: center;
}

.saqueta {
  width: 108px;
  height: 150px;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 12px 10px;
  border: 0;
  border-radius: 3px 3px 7px 7px;
  color: #f8efe4;
  background:
    linear-gradient(155deg, transparent 42%, rgba(255, 255, 255, 0.2) 42% 48%, transparent 48%),
    linear-gradient(180deg, #d6453a, #9d2a24 72%);
  box-shadow: 0 8px 0 #6e1c18, 0 14px 18px rgba(0, 0, 0, 0.25);
  transform: rotate(-6deg);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.saqueta:hover { transform: rotate(-2deg) translateY(-4px); }

.saqueta:active {
  transform: rotate(-6deg) translateY(2px);
  box-shadow: 0 4px 0 #6e1c18, 0 8px 12px rgba(0, 0, 0, 0.25);
}

.saqueta-marca {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1;
}

.saqueta-tipo { font-size: 1.05rem; }
.saqueta-qtd { font-size: 0.95rem; }

.saqueta-fim {
  width: 9rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

.fila-soltos {
  flex-basis: 100%;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 8px;
}

.solto {
  width: 92px;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1c2418;
  font: inherit;
  text-align: left;
  cursor: grab;
}

.solto:active { cursor: grabbing; }

.solto:hover { transform: translateY(-4px); }

.solto .cromo-borda {
  gap: 4px;
  padding: 4px 4px 5px;
}

.solto .numero {
  top: 3px;
  left: 3px;
  font-size: 1rem;
  padding: 2px 4px 1px;
}

.solto .legenda {
  min-height: 0;
  font-size: 0.68rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.solto.acabado-de-sair { animation: sair 480ms cubic-bezier(.2, .8, .2, 1); }

@keyframes sair {
  from { transform: translateY(14px) scale(0.92); opacity: 0; }
}

.folha.entra-seguinte { animation: entra-seguinte 420ms cubic-bezier(.2, .7, .2, 1); }
.folha.entra-anterior { animation: entra-anterior 420ms cubic-bezier(.2, .7, .2, 1); }

@keyframes entra-seguinte {
  from { transform: translateX(22px); opacity: 0.2; }
}

@keyframes entra-anterior {
  from { transform: translateX(-22px); opacity: 0.2; }
}

.a-voar {
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

#ampliado {
  border: 0;
  padding: 16px;
  background: #f3ecdc;
  width: min(460px, 94vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

#ampliado::backdrop { background: rgba(24, 16, 10, 0.74); }

.cromo-grande .legenda {
  min-height: 0;
  margin-top: 2px;
  font-size: 1.2rem;
}

.accoes-dialogo {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.accoes-dialogo button {
  font: inherit;
  font-size: 1rem;
  color: #1c2418;
  background: transparent;
  border: 1px solid rgba(28, 36, 24, 0.4);
  border-radius: 2px;
  padding: 8px 12px;
  cursor: pointer;
}

.accoes-dialogo button:last-child {
  background: #1c2418;
  color: #f4efe4;
  border-color: #1c2418;
}

@media (max-width: 860px) {
  .grelha[data-n] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .grelha[data-n="1"] {
    grid-template-columns: minmax(0, 240px);
    justify-content: center;
  }

  .folha.capa,
  .folha.interior,
  .capa-miolo {
    min-height: 0;
  }

  .capa-miolo { padding: 28px 16px 18px; }
  .capa h1 { font-size: min(4.2rem, 13.5vw); }
}

@media (max-width: 560px) {
  .progresso { white-space: normal; }
  .saqueta { transform: none; }
  .saqueta:hover { transform: translateY(-3px); }
}

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