/* A tela de opções (PRD 33.47, jogo/opcoes.js) e as classes que ela põe no <html>: sem-animacoes, leve e letra-maior */
@keyframes op-surge { from { opacity: 0; } }
@keyframes op-sobe { from { transform: translateY(14px); } }
.op-veu { position: fixed; inset: 0; z-index: 900; display: none; place-items: center; padding: 3vh 3vw; background: rgba(5,6,9,.72); backdrop-filter: blur(5px);
  font-family: Spectral, Literata, Georgia, serif; color: #d9d4c7; }
.op-veu.aberto { display: grid; animation: op-surge .25s ease; }
.op-placa { position: relative; width: min(560px, 94vw); max-height: 92vh; overflow-y: auto; border-radius: 6px; padding: 26px 32px 20px;
  background: radial-gradient(ellipse at 40% 30%, rgba(194,160,102,.10), transparent 60%), linear-gradient(160deg, #241f2c, #15121b 55%, #0f0d14);
  border: 2px solid #c2a066; box-shadow: inset 0 0 0 5px #0e0c12, inset 0 0 0 6px #7d6440, 0 0 0 4px #07080b, 0 24px 60px rgba(0,0,0,.8); animation: op-sobe .3s ease; }
.op-placa h2 { margin: 0 0 6px; text-align: center; font: 700 26px Cinzel, serif; letter-spacing: .08em; color: #f3ead6; }
.op-fechar { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1;
  color: #c2a066; background: rgba(11,13,18,.8); border: 1px solid #7d6440; }
.op-fechar:hover { color: #f3ead6; border-color: #c2a066; }
.op-placa section { padding: 10px 0 6px; border-top: 1px solid rgba(194,160,102,.2); }
.op-placa section:first-of-type { border-top: 0; }
.op-placa h3 { margin: 4px 0 8px; font: 700 12px Cinzel, serif; letter-spacing: .22em; color: #c2a066; }
.op-linha { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 7px 0; font-size: 16px; cursor: pointer; }
.op-linha span small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: #8e8a80; }
.op-linha input[type=range] { width: 190px; accent-color: #c2a066; }
/* O interruptor: a caixa de marcar desenhada como chave */
.op-linha input[type=checkbox] { appearance: none; width: 44px; height: 24px; border-radius: 99px; position: relative; cursor: pointer; margin: 0;
  background: #1c1a22; border: 1px solid #3a4150; transition: background .2s, border-color .2s; }
.op-linha input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #8e8a80; transition: transform .2s, background .2s; }
.op-linha input[type=checkbox]:checked { background: rgba(194,160,102,.3); border-color: #c2a066; }
.op-linha input[type=checkbox]:checked::after { transform: translateX(20px); background: #f0cf86; }
.op-linha input:focus-visible, .op-ritmo button:focus-visible, .op-fechar:focus-visible { outline: 2px solid #f0cf86; outline-offset: 2px; }
.op-ritmo { display: flex; border: 1px solid #3a4150; border-radius: 4px; overflow: hidden; }
.op-ritmo button { font: 700 11px Cinzel, serif; letter-spacing: .1em; padding: 8px 10px; cursor: pointer; color: #b9b3a5; background: transparent; border: 0; border-left: 1px solid #3a4150; }
.op-ritmo button:first-child { border-left: 0; }
.op-ritmo button[aria-checked="true"] { color: #1a140b; background: #c2a066; }
.op-nota { margin: 10px 0 0; text-align: center; font-size: 13px; color: #8e8a80; }
@media (max-width: 700px) and (orientation: portrait) {
  .op-veu { padding: 0; place-items: end center; }
  .op-placa { width: 100vw; max-height: 90dvh; border-radius: 12px 12px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
  .op-linha { font-size: 15px; }
  .op-linha input[type=range] { width: 130px; }
  .op-linha:has(.op-ritmo) { grid-template-columns: 1fr; gap: 6px; }
  .op-ritmo button { flex: 1; }
}

/* ---------- Menos animações: o mesmo que "reduzir movimento" no aparelho, valendo para todas as telas ---------- */
html.sem-animacoes *, html.sem-animacoes *::before, html.sem-animacoes *::after {
  animation-duration: .001s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }

/* ---------- Modo leve: sem névoa, brilhos e movimentos contínuos de enfeite (os que dizem algo do jogo ficam) ---------- */
html.leve .nevoa, html.leve #tela-mesa .cosmos, html.leve .clima, html.leve .quina-viva, html.leve .epoca { display: none !important; }
html.leve #tela-mesa .casa.dono .arte, html.leve #tela-mesa .peao[data-seq]::before, html.leve #tela-mesa .retrato::after,
html.leve #tela-mesa .retrato.corrompido .estrelas { animation: none !important; }
html.leve body, html.leve .op-veu { backdrop-filter: none; }

/* ---------- Letra maior ---------- */
/* As fichas e o título da vez têm tamanho próprio em px (jogo/mesa.css): a letra maior usa esses tamanhos × 1,18 (× 1,12 no
   título), também em px. Em "em", ela contava sobre a letra de fora da ficha e dobrava os números (12 px viravam 19), e as
   fichas da mesa cresciam e quebravam linha (33.85) */
html.letra-maior #tela-mesa .registro p { font-size: 1.18em; }
html.letra-maior #tela-mesa .stats { font-size: 14px; }
html.letra-maior #tela-mesa .j-nome { font-size: 14.5px; }
html.letra-maior #tela-mesa .vez-mesa b { font-size: 27px; }
html.letra-maior #tela-mesa.celular .stats { font-size: 12px; }
html.letra-maior #tela-mesa.celular .stats.controle { font-size: 11px; }
html.letra-maior #tela-mesa.celular .jogadores:has(> .jogador:nth-child(3)) .stats.controle { font-size: 10px; } /* mesa de 6: três fichas por fileira */
html.letra-maior #tela-mesa.celular .jogadores:has(> .jogador:nth-child(3)) .stats:not(.controle) { gap: 4px; } /* "34/34" e ouro de 3 dígitos cabendo ao lado do retrato */
html.letra-maior #tela-mesa.celular .j-nome { font-size: 12.5px; }
html.letra-maior #tela-mesa.celular .barra-celular .vez-mesa b { font-size: 17px; }
html.letra-maior .placa p, html.letra-maior .pagina p, html.letra-maior .bloco, html.letra-maior .cq-linha, html.letra-maior .op-linha { font-size: 1.12em; }
html.letra-maior .opcao .dica, html.letra-maior .anim-faixa small { font-size: 1.1em; }

/* ---------- O Códice das 22 cartas (PRD 33.53, jogo/codice.js) ---------- */
.cx-veu { position: fixed; inset: 0; z-index: 900; display: none; place-items: center; padding: 3vh 3vw; background: rgba(5,6,9,.75); backdrop-filter: blur(5px);
  font-family: Spectral, Literata, Georgia, serif; color: #d9d4c7; }
.cx-veu.aberto { display: grid; animation: op-surge .25s ease; }
.cx-placa { position: relative; width: min(1080px, 96vw); max-height: 94vh; overflow-y: auto; border-radius: 6px; padding: 24px 30px 18px;
  display: grid; grid-template-columns: 1fr; gap: 14px;
  background: radial-gradient(ellipse at 40% 30%, rgba(194,160,102,.10), transparent 60%), linear-gradient(160deg, #241f2c, #15121b 55%, #0f0d14);
  border: 2px solid #c2a066; box-shadow: inset 0 0 0 5px #0e0c12, inset 0 0 0 6px #7d6440, 0 0 0 4px #07080b, 0 24px 60px rgba(0,0,0,.8); animation: op-sobe .3s ease; }
.cx-placa h2 { margin: 0; text-align: center; font: 700 26px Cinzel, serif; letter-spacing: .08em; color: #f3ead6; }
.cx-lista { display: grid; grid-template-columns: repeat(22, minmax(0, 1fr)); gap: 4px; }
.cx-lista button { aspect-ratio: 240 / 416; border-radius: 3px; cursor: pointer; padding: 0; position: relative; border: 1px solid #3a4150;
  background: var(--img) center / cover no-repeat, #1c1a1f; filter: grayscale(.6) brightness(.6); transition: filter .2s, transform .2s; }
.cx-lista button span { position: absolute; left: 0; right: 0; bottom: 0; font: 700 9px Cinzel, serif; color: #f3ead6; background: rgba(0,0,0,.6); }
.cx-lista button:hover { filter: none; }
.cx-lista button[aria-pressed="true"] { filter: none; border-color: #f0cf86; box-shadow: 0 0 0 1.5px #f0cf86, 0 0 12px rgba(240,207,134,.4); transform: translateY(-3px); }
.cx-detalhe { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 26px; align-items: start; }
.cx-carta-grande { display: grid; gap: 8px; }
.cx-arte { aspect-ratio: 500 / 866; border-radius: 8px; background: var(--img) center / cover no-repeat, #1c1a1f; border: 3px solid #c2a066;
  box-shadow: inset 0 0 0 3px #0e0c12, 0 12px 30px rgba(0,0,0,.7); }
[data-cx-ampliar] { cursor: zoom-in; transition: box-shadow .2s; }
[data-cx-ampliar]:hover, [data-cx-ampliar]:focus-visible { outline: none; box-shadow: inset 0 0 0 3px #0e0c12, 0 0 18px rgba(240,207,134,.55), 0 12px 30px rgba(0,0,0,.7); }
/* A arte em tamanho grande, por cima do Códice (PRD 33.102) */
.cx-ampliada { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); background: rgba(5,6,9,.9); backdrop-filter: blur(4px); cursor: zoom-out; animation: op-surge .25s ease; }
.cx-ampliada figure { margin: 0; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 12px; animation: op-sobe .3s ease; }
.cx-ampliada img { display: block; align-self: center; max-width: min(520px, 100%); max-height: 100%; object-fit: contain; border: 2px solid #e6c47e; border-radius: 8px; box-shadow: 0 0 30px rgba(230,196,126,.4), 0 20px 50px rgba(0,0,0,.8); }
.cx-ampliada figcaption { display: grid; justify-items: center; gap: 4px; text-align: center; }
.cx-ampliada figcaption b { font: 700 20px Cinzel, serif; letter-spacing: .08em; color: #f0d698; }
.cx-ampliada figcaption span { display: inline-flex; align-items: center; gap: 6px; font: 600 13px Cinzel, serif; letter-spacing: .1em; color: #cfc8b8; }
.cx-ampliada figcaption svg { width: 16px; height: 16px; color: #e6c47e; }
.cx-faixa { display: flex; align-items: baseline; justify-content: center; gap: 10px; font-family: Cinzel, serif; }
.cx-faixa span { color: #c2a066; font-weight: 700; } .cx-faixa b { color: #f3ead6; font-size: 18px; }
.cx-temas { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.cx-temas button { font: 700 10px Cinzel, serif; letter-spacing: .06em; padding: 5px 8px; border-radius: 3px; cursor: pointer; color: #b9b3a5; background: transparent; border: 1px solid #3a4150; }
.cx-temas button[aria-pressed="true"] { color: #1a140b; background: #c2a066; border-color: #c2a066; }
.cx-texto h3 { margin: 0; font: 700 28px Cinzel, serif; color: #f3ead6; }
.cx-conta { margin: 2px 0 12px; font-size: 14px; color: #a89f8c; }
.cx-bloco { margin-top: 10px; padding: 9px 13px; border-radius: 3px; font-size: 16px; line-height: 1.45; color: #f1e8d2;
  background: rgba(194,160,102,.08); border: 1px solid rgba(194,160,102,.3); }
.cx-bloco.invertido { background: rgba(138,82,208,.12); border-color: rgba(138,82,208,.45); }
.cx-bloco.seq { background: rgba(122,90,190,.08); border-color: rgba(160,130,220,.35); }
.cx-bloco b, .cx-arts > b { display: block; margin-bottom: 3px; font: 700 10.5px Cinzel, serif; letter-spacing: .14em; color: #c2a066; }
.cx-bloco p { margin: 4px 0 0; } .cx-bloco p small { display: inline-block; min-width: 108px; font: 700 10px Cinzel, serif; letter-spacing: .1em; color: #b9a8d8; }
.cx-bloco p.cx-vizinhos small { display: block; min-width: 0; margin-bottom: 1px; } .cx-bloco p.cx-vizinhos strong { color: #e6d3a8; } /* os Caminhos vizinhos (PRD 33.69) */
.cx-arts { margin-top: 12px; } .cx-arts > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cx-art { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; padding: 6px; border-radius: 4px; border: 1px solid #3a4150; }
.cx-art i { aspect-ratio: 1; border-radius: 3px; background: #1c1a22; }
.cx-art.achado i { background: var(--img) center / cover no-repeat; box-shadow: 0 0 0 1px #c2a066; }
.cx-art.achado.invertido i { box-shadow: 0 0 0 1px #8a5cc8; }
.cx-art span { font-size: 14px; color: #f1e8d2; } .cx-art small { display: block; font: 700 9px Cinzel, serif; letter-spacing: .12em; color: #8e8a80; }
.cx-nav { display: flex; justify-content: space-between; }
.cx-nav button { font: 700 11px Cinzel, serif; letter-spacing: .12em; padding: 8px 14px; border-radius: 4px; cursor: pointer; color: #d9d4c7; background: transparent; border: 1px solid #3a4150; }
.cx-nav button:hover { border-color: #7d6440; color: #f3ead6; }
@media (max-width: 700px) and (orientation: portrait) {
  .cx-veu { padding: 0; place-items: end center; }
  .cx-placa { width: 100vw; max-height: 94dvh; border-radius: 12px 12px 0 0; padding: 20px 14px calc(14px + env(safe-area-inset-bottom)); }
  .cx-lista { grid-template-columns: repeat(11, minmax(0, 1fr)); }
  .cx-detalhe { grid-template-columns: 1fr; gap: 14px; }
  .cx-carta-grande { width: min(240px, 70vw); margin: 0 auto; }
  .cx-texto h3 { font-size: 22px; text-align: center; } .cx-conta { text-align: center; }
  .cx-arts > div { grid-template-columns: 1fr; }
  /* 33.63: no celular, o texto de cada Sequência fica embaixo do rótulo, e não ao lado */
  .cx-bloco p small { display: block; min-width: 0; margin-bottom: 1px; }
  .cx-bloco.seq p { margin-top: 8px; }
}

/* ---------- Arrastar o dedo para o lado (PRD 33.62, jogo/gestos.js): a página nova entra pelo lado de onde o dedo veio ---------- */
@keyframes desliza-esq { from { opacity: .2; transform: translateX(46px); } to { opacity: 1; transform: none; } }
@keyframes desliza-dir { from { opacity: .2; transform: translateX(-46px); } to { opacity: 1; transform: none; } }
.desliza-esq { animation: desliza-esq .28s ease-out; }
.desliza-dir { animation: desliza-dir .28s ease-out; }
/* O arrasto de lado é do jogo; a rolagem de cima a baixo continua do navegador */
.cx-detalhe, #pagina, .cq-pagina { touch-action: pan-y; }
