﻿:root {
  --cor-fundo: #0a0908;
  --cor-fundo-suave: #12100e;
  --cor-texto: #c9c2b6;
  --cor-texto-fraco: #7a746a;
  --cor-titulo: #e8e2d6;
  --cor-borda: #2a2620;
  --cor-metal: #6b6558;
  --cor-metal-claro: #a89b82;
  --cor-metal-escuro: #2a2722;
  --osso: #e8dfcd;
  --osso-suave: #c9c2b6;
  --cinza: #7a746a;
  --latao: #a88b54;
  --brasa: #e0a24a;
  --raio: 4px;
  --sombra-forte: 0 18px 48px rgba(0, 0, 0, 0.55);
  --duracao-fade: 500ms;
  --fonte-display: "Cormorant Garamond", "Times New Roman", serif;
  --fonte-titulo: var(--fonte-display);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--cor-fundo);
  color: var(--cor-texto);
  font-family: var(--fonte-display);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

button:focus-visible {
  outline: 1px solid var(--cor-texto-fraco);
  outline-offset: 4px;
}

.app {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
}

.cena {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--duracao-fade) ease;
  pointer-events: none;
}

.cena.cena--visivel {
  opacity: 1;
  pointer-events: auto;
}

.cena.cena--saindo {
  opacity: 0;
  pointer-events: none;
}

/* Tela inicial — menu cinematográfico */

.tela-inicial {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: #050403;
}

.tela-inicial__fundo {
  position: absolute;
  inset: -6%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.04);
  animation: tela-inicial-kenburns 32s ease-in-out infinite alternate;
  will-change: transform;
}

.tela-inicial__vinheta {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(5, 4, 3, 0.94) 0%,
      rgba(5, 4, 3, 0.78) 22%,
      rgba(5, 4, 3, 0.35) 48%,
      rgba(5, 4, 3, 0.18) 68%,
      rgba(5, 4, 3, 0.28) 100%
    ),
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.42) 0%,
      transparent 26%,
      transparent 70%,
      rgba(0, 0, 0, 0.55) 100%
    );
}

.tela-inicial__painel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2.5rem, 7vh, 4rem);
  width: min(100%, 30rem);
  height: 100%;
  padding: clamp(2rem, 8vh, 5rem) clamp(1.75rem, 5vw, 4.25rem);
  animation: tela-inicial-entrar 1.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tela-inicial__titulo {
  margin: 0;
  font-size: clamp(2.6rem, 6.5vw, 4.35rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: var(--cor-titulo);
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.tela-inicial__acoes {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.tela-inicial__opcao {
  position: relative;
  min-height: 48px;
  padding: 0.75rem 0.75rem 0.75rem 1.15rem;
  font-size: clamp(0.95rem, 2.2vw, 1.12rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(201, 194, 182, 0.78);
  transition:
    color 220ms ease,
    transform 220ms ease,
    opacity 200ms ease;
}

.tela-inicial__opcao::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--osso);
  transform: translateY(-50%);
  transition: height 220ms ease;
  box-shadow: 0 0 12px rgba(232, 223, 205, 0.35);
}

.tela-inicial__opcao:hover,
.tela-inicial__opcao:focus-visible {
  color: var(--cor-titulo);
  transform: translateX(6px);
  outline: none;
}

.tela-inicial__opcao:hover::before,
.tela-inicial__opcao:focus-visible::before {
  height: 58%;
}

.tela-inicial__opcao:active {
  opacity: 0.72;
}

.tela-inicial__opcao--secundaria {
  color: rgba(122, 116, 106, 0.95);
  letter-spacing: 0.24em;
  font-size: clamp(0.88rem, 2vw, 1rem);
}

.tela-inicial__opcao--secundaria:hover,
.tela-inicial__opcao--secundaria:focus-visible {
  color: var(--cor-texto);
}

@keyframes tela-inicial-kenburns {
  from {
    transform: scale(1.04) translate(0, 0);
  }

  to {
    transform: scale(1.12) translate(-1.8%, 1.2%);
  }
}

@keyframes tela-inicial-entrar {
  from {
    opacity: 0;
    transform: translateX(-22px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tela-inicial__fundo {
    animation: none;
  }

  .tela-inicial__painel {
    animation: none;
  }
}

.botao-texto {
  min-height: 44px;
  min-width: 44px;
  padding: 0.65rem 1.4rem;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cor-texto);
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease, opacity 200ms ease;
}

.botao-texto:hover {
  color: var(--cor-titulo);
  border-bottom-color: var(--cor-borda);
}

.botao-texto:active {
  opacity: 0.75;
}

.botao-texto--secundario {
  color: var(--cor-texto-fraco);
  letter-spacing: 0.14em;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
}

.botao-texto--secundario:hover {
  color: var(--cor-texto);
}

.botao-hud {
  background: rgba(10, 9, 8, 0.55);
  border: 1px solid rgba(42, 38, 32, 0.8);
  border-radius: 2px;
  backdrop-filter: blur(2px);
}

/* Introdução */

.introducao {
  gap: 3rem;
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}

.introducao__frase {
  margin: 0;
  min-height: 4.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--cor-titulo);
  opacity: 1;
  transition: opacity 350ms ease;
}

.introducao__frase.introducao__frase--ocultando {
  opacity: 0;
}

.introducao__controles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 2rem;
}

/* Diálogo final sobre o capacete (pós-xadrez) */
.dialogo-final {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  max-width: none;
  margin: 0;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: auto;
}

.dialogo-final.dialogo-final--visivel {
  opacity: 1;
}

.dialogo-final.dialogo-final--saindo {
  opacity: 0;
  pointer-events: none;
}

.dialogo-final.dialogo-final--para-preto {
  background: #000;
  z-index: 70;
  pointer-events: none;
}

.dialogo-final.dialogo-final--para-preto .introducao__frase,
.dialogo-final.dialogo-final--para-preto .introducao__controles {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.cena-foto__imagem {
  transition: opacity 1.1s ease;
}

.cena-foto__imagem.cena-foto__imagem--revelando {
  opacity: 0.25;
}

.cena-foto__imagem.cena-foto__imagem--revelada {
  opacity: 1;
}

/* Cenas fotográficas */

.cena-foto {
  padding: 0;
  background: #000;
}

.palco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  user-select: none;
  touch-action: pan-y;
}

.mundo {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.mundo-parallax {
  position: absolute;
  inset: 0;
  transform: scale(1.025) translate(var(--px, 0%), var(--py, 0%));
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.camada-imagem {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cena-foto__imagem {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  pointer-events: none;
}

.cena-foto__placeholder {
  position: absolute;
  inset: 8% 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 1px dashed #3a3530;
  background:
    linear-gradient(180deg, rgba(18, 16, 14, 0.92), rgba(8, 7, 6, 0.96));
  color: var(--cor-texto-fraco);
  text-align: center;
  padding: 1.5rem;
}

.cena-foto__placeholder[hidden] {
  display: none !important;
}

.cena-foto__placeholder-titulo {
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.cena-foto__placeholder-id {
  margin: 0;
  color: var(--cor-titulo);
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.12em;
}

.cena-foto__placeholder-nota {
  margin: 0;
  max-width: 28rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.camada-props {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.prop-cena {
  position: absolute;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  image-rendering: auto;
}

.prop-cena[hidden] {
  display: none !important;
}

/* Troca leve entre frames da passagem do perseguidor (C01) */
.cena-foto__imagem--troca-frame {
  animation: cena-foto-troca-frame 0.22s ease-out;
}

@keyframes cena-foto-troca-frame {
  0% {
    opacity: 0.82;
  }
  100% {
    opacity: 1;
  }
}

.camada-efeitos {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.5) 100%);
}

.camada-efeitos::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grao 0.9s steps(4) infinite;
}

@keyframes grao {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-1%, -2%); }
  100% { transform: translate(0, 0); }
}

.camada-hotspots {
  position: absolute;
  inset: 0;
}

.hotspot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  min-width: 44px;
  min-height: 44px;
  z-index: 2;
  transition: box-shadow 0.25s, background 0.25s;
}

.hotspot:hover,
.hotspot:focus-visible {
  background: radial-gradient(ellipse at center, rgba(255, 230, 180, 0.07), transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(232, 223, 205, 0.22);
}

.seta-saida {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(232, 223, 205, 0.55);
  border-radius: 50%;
  background: rgba(10, 9, 8, 0.55);
  color: var(--osso);
  font-size: 1.1rem;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s, transform 0.25s;
}

.hotspot:hover .seta-saida,
.hotspot:focus-visible .seta-saida,
.mostrar-areas .seta-saida,
.hotspot-saida-fixa .seta-saida {
  opacity: 1;
  transform: none;
}

/* Saída sempre visível (ex.: close-up do arquivo de gavetas).
   Ícone igual aos outros; só a hitbox do hotspot fica mais larga. */
.hotspot-saida-fixa .seta-saida {
  border-color: rgba(232, 223, 205, 0.78);
  background: rgba(10, 9, 8, 0.82);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

.hotspot-saida-fixa:hover .seta-saida,
.hotspot-saida-fixa:focus-visible .seta-saida {
  border-color: rgba(232, 223, 205, 0.95);
  background: rgba(14, 12, 10, 0.9);
}

.mostrar-areas .hotspot,
.camada-base.faltando ~ .camada-hotspots .hotspot {
  box-shadow: inset 0 0 0 1px rgba(224, 162, 74, 0.6);
  background: rgba(224, 162, 74, 0.06);
}

.rotulo-hotspot {
  position: absolute;
  z-index: 3;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  background: rgba(8, 7, 6, 0.82);
  color: var(--osso);
  font-family: var(--fonte-titulo);
  font-size: 1.02rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(16px, 14px);
  transition: opacity 0.15s;
}

.rotulo-hotspot.visivel {
  opacity: 1;
}

.botao-voltar {
  position: absolute;
  left: 1rem;
  bottom: 1.1rem;
  z-index: 4;
  padding: 0.55rem 1.2rem;
  border: 1px solid rgba(232, 223, 205, 0.28);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(14, 12, 10, 0.72), rgba(6, 5, 4, 0.82));
  color: rgba(232, 223, 205, 0.9);
  font-family: var(--fonte-titulo);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0.72;
  transition: opacity 0.2s, border-color 0.2s;
}

.botao-voltar:hover,
.botao-voltar:focus-visible {
  opacity: 1;
  border-color: rgba(232, 223, 205, 0.6);
}

.mensagem-flutuante {
  position: absolute;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  z-index: 5;
  margin: 0;
  max-width: min(90vw, 28rem);
  padding: 0.75rem 1.1rem;
  text-align: center;
  color: var(--cor-titulo);
  background: rgba(10, 9, 8, 0.88);
  border: 1px solid var(--cor-borda);
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  line-height: 1.35;
  opacity: 1;
  pointer-events: none;
  transition: opacity 280ms ease;
}

.mensagem-flutuante--saindo {
  opacity: 0;
}

/* Modo Dev — edição de hotspots */

.modo-dev .camada-hotspots {
  pointer-events: none;
}

.modo-dev-camada {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: auto;
  touch-action: none;
}

.modo-dev-retangulo {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(224, 162, 74, 0.95);
  background: rgba(224, 162, 74, 0.18);
  cursor: move;
  min-width: 12px;
  min-height: 12px;
}

.modo-dev-rotulo {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-100%);
  padding: 0.15rem 0.35rem;
  background: rgba(8, 7, 6, 0.88);
  color: #f0e6d2;
  font-family: var(--fonte-titulo);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

.modo-dev-alca {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #e0a24a;
  border: 1px solid #1a1612;
  border-radius: 1px;
  z-index: 2;
}

.modo-dev-alca--nw { left: -5px; top: -5px; cursor: nwse-resize; }
.modo-dev-alca--ne { right: -5px; top: -5px; cursor: nesw-resize; }
.modo-dev-alca--sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.modo-dev-alca--se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.modo-dev-alca--n { left: 50%; top: -5px; margin-left: -5px; cursor: ns-resize; }
.modo-dev-alca--s { left: 50%; bottom: -5px; margin-left: -5px; cursor: ns-resize; }
.modo-dev-alca--w { left: -5px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.modo-dev-alca--e { right: -5px; top: 50%; margin-top: -5px; cursor: ew-resize; }

.modo-dev-painel {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 40;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid rgba(224, 162, 74, 0.45);
  border-radius: 4px;
  background: rgba(10, 9, 8, 0.92);
  color: var(--osso);
  pointer-events: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.modo-dev-painel[hidden] {
  display: none !important;
}

.modo-dev-painel__titulo {
  margin: 0 0 0.35rem;
  font-family: var(--fonte-titulo);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brasa);
}

.modo-dev-painel__info {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--cor-texto-fraco);
  line-height: 1.35;
}

.modo-dev-painel__acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.modo-dev-botao {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(232, 223, 205, 0.35);
  border-radius: 3px;
  background: rgba(30, 24, 18, 0.85);
  color: var(--osso);
  font-family: var(--fonte-titulo);
  font-size: 0.92rem;
  cursor: pointer;
}

.modo-dev-botao:hover {
  border-color: var(--brasa);
}

.modo-dev-botao--secundario {
  color: var(--cor-texto-fraco);
}

/* HUD */

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem 1.6rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent);
  pointer-events: none;
  transition: opacity 0.6s;
}

.sem-hud .hud,
.sem-hud .legenda {
  opacity: 0;
  pointer-events: none;
}

.hud-lugar {
  margin: 0;
  font-family: var(--fonte-titulo);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 223, 205, 0.82);
  text-shadow: 0 2px 8px #000;
}

.hud-acoes {
  display: flex;
  gap: 0.4rem;
  pointer-events: auto;
}

.hud-botao {
  min-height: 40px;
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(232, 223, 205, 0.25);
  border-radius: var(--raio);
  background: rgba(12, 10, 9, 0.6);
  backdrop-filter: blur(4px);
  font-family: var(--fonte-titulo);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: border-color 0.2s, background 0.2s;
}

.hud-botao:hover {
  border-color: rgba(224, 162, 74, 0.7);
  background: rgba(30, 24, 18, 0.8);
}

.hud-botao[aria-pressed="true"] {
  border-color: var(--brasa);
}

.hud-icone {
  min-width: 40px;
  padding: 0.3rem 0.5rem;
}

.hud-botao.pulso {
  animation: pulso-botao 1.4s ease-in-out 4;
}

@keyframes pulso-botao {
  0%, 100% { box-shadow: 0 0 0 rgba(224, 162, 74, 0); }
  50% { box-shadow: 0 0 18px rgba(224, 162, 74, 0.6); border-color: var(--brasa); }
}

.legenda {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  z-index: 15;
  max-width: min(46rem, 92vw);
  margin: 0;
  padding: 0.7rem 1.3rem;
  border-radius: 3px;
  background: rgba(6, 5, 4, 0.78);
  color: var(--osso);
  font-family: var(--fonte-titulo);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-style: italic;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
}

.legenda.visivel {
  opacity: 1;
  transform: translate(-50%, 0);
}

.veu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition-property: opacity;
  transition-timing-function: ease;
}

.veu.ativo {
  opacity: 1;
  pointer-events: auto;
}

.toasts {
  position: fixed;
  top: 4.2rem;
  left: 50%;
  z-index: 70;
  display: grid;
  gap: 0.5rem;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  min-width: 16rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid rgba(168, 139, 84, 0.55);
  border-radius: 3px;
  background: rgba(14, 12, 10, 0.92);
  text-align: center;
  box-shadow: var(--sombra-forte);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s, transform 0.5s;
}

.toast.visivel {
  opacity: 1;
  transform: none;
}

.toast-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--latao);
}

.toast-titulo {
  margin: 0.15rem 0 0;
  font-family: var(--fonte-titulo);
  font-size: 1.3rem;
  font-weight: 600;
}

/* Painel Inventário */

.painel-reliquias {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(390px, 100vw);
  border-left: 1px solid rgba(232, 223, 205, 0.12);
  background: linear-gradient(180deg, rgba(20, 17, 14, 0.97), rgba(10, 9, 8, 0.98));
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.6);
  transform: translateX(105%);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.painel-reliquias.aberto {
  transform: none;
}

.painel-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.6rem;
}

.painel-titulo {
  margin: 0;
  font-family: var(--fonte-titulo);
  font-size: 1.6rem;
  font-weight: 600;
}

.painel-fechar {
  border: 0;
  background: none;
  color: var(--cinza);
  font-size: 0.95rem;
}

.painel-corpo {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem 2rem;
}

.painel-vazio {
  margin: 1rem 0 0;
  color: var(--cor-texto-fraco);
  text-align: center;
}

.grade-reliquias {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}

.reliquia {
  display: grid;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid rgba(232, 223, 205, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.reliquia:hover {
  border-color: rgba(224, 162, 74, 0.5);
}

.reliquia-nome {
  font-family: var(--fonte-titulo);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
}

.item-miniatura {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 3px;
  background: radial-gradient(ellipse at 45% 40%, #3a332a, #120f0c);
}

.item-figura {
  width: 86%;
  height: 86%;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
  pointer-events: none;
  user-select: none;
}

.item-inicial {
  font-family: var(--fonte-titulo);
  font-size: 2.4rem;
  color: var(--latao);
}

@media (prefers-reduced-motion: reduce) {
  .mundo-parallax {
    transform: none;
    transition: none;
  }

  .camada-efeitos::before {
    animation: none;
  }

  .medalhao {
    transform: none;
    transition: none;
  }
}

@media (max-width: 720px) {
  .botao-voltar {
    left: 0.6rem;
    bottom: 0.7rem;
    font-size: 0.9rem;
    padding: 0.5rem 0.9rem;
  }

  .legenda {
    bottom: 4rem;
  }
}

/* Examinador */

/* Confirmação central (escada / decisões) */
.confirmacao {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
}

.confirmacao__painel {
  width: min(92vw, 26rem);
  padding: 1.4rem 1.5rem 1.35rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #161310, #0d0b09);
  border: 1px solid var(--cor-borda);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.confirmacao__pergunta {
  margin: 0 0 1.15rem;
  font-family: var(--fonte-titulo, Georgia, serif);
  font-size: 1.15rem;
  line-height: 1.35;
  color: #e8e0d4;
}

.confirmacao__acoes {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.confirmacao__botao {
  min-width: 7.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--cor-borda);
  background: #1a1612;
  color: #e8e0d4;
  font: inherit;
  cursor: pointer;
}

.confirmacao__botao:hover,
.confirmacao__botao:focus-visible {
  border-color: #8a7a62;
  outline: none;
}

.confirmacao__botao--primario {
  background: #2a2218;
  border-color: #6a5a42;
}

/* Minigame de aparadas (luta C01B) */
.minigame-aparadas {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.minigame-aparadas__escurecido {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  transition: background 0.35s ease;
}

.minigame-aparadas__escurecido--batalha {
  background: rgba(0, 0, 0, 0.28);
}

.minigame-aparadas__area {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.minigame-aparadas__painel {
  position: relative;
  z-index: 2;
  width: min(94vw, 42rem);
  padding: 2.4rem 2.5rem 2rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #161310, #0d0b09);
  border: 1px solid var(--cor-borda);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.minigame-aparadas__titulo {
  margin: 0 0 1.1rem;
  font-family: var(--fonte-titulo);
  font-size: clamp(1.85rem, 3.2vw, 2.45rem);
  font-weight: 600;
  color: var(--cor-titulo);
  line-height: 1.2;
}

.minigame-aparadas__texto {
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.45;
  color: var(--cor-texto);
}

.minigame-aparadas__dicas {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.85rem;
}

.minigame-aparadas__dica {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 8.5rem;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.25;
  color: var(--cor-texto-fraco);
}

.minigame-aparadas__dica-icone {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 1px solid #5a5040;
  background: #12100e;
  position: relative;
  display: grid;
  place-items: center;
  overflow: visible;
}

.minigame-aparadas__dica-zona {
  position: absolute;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(232, 210, 150, 0.5);
  border: 1px solid rgba(240, 220, 170, 0.55);
  pointer-events: none;
  z-index: 0;
}

.minigame-aparadas__dica-zona--pronta {
  background: rgba(255, 230, 160, 0.55);
  border-color: rgba(255, 230, 160, 0.7);
}

.minigame-aparadas__dica-nucleo {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #e8dcc8, #8a7350 55%, #3a3228 100%);
  border: 2px solid #d4c4a0;
  box-shadow: 0 0 8px rgba(200, 170, 120, 0.35);
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.minigame-aparadas__dica-nucleo--pronto {
  border-color: #ffe6a8;
  box-shadow: 0 0 12px rgba(255, 210, 120, 0.75);
}

.minigame-aparadas__dica-espada {
  width: 0.55rem;
  height: 0.85rem;
  background: linear-gradient(180deg, #f2e8d4 0%, #a89878 55%, #5a5040 100%);
  clip-path: polygon(50% 0%, 68% 18%, 62% 18%, 62% 72%, 78% 72%, 78% 82%, 22% 82%, 22% 72%, 38% 72%, 38% 18%, 32% 18%);
}

.minigame-aparadas__dica-anel {
  position: absolute;
  width: 4.15rem;
  height: 4.15rem;
  border-radius: 50%;
  border: 2px solid rgba(232, 220, 190, 0.95);
  box-shadow: 0 0 8px rgba(200, 180, 140, 0.3);
  pointer-events: none;
  z-index: 2;
}

.minigame-aparadas__dica-anel--encaixe {
  width: 2.75rem;
  height: 2.75rem;
  border-color: #ffe6a8;
  box-shadow: 0 0 10px rgba(255, 210, 120, 0.55);
}

.minigame-aparadas__continuar {
  min-width: 12rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid #6a5a42;
  background: #2a2218;
  color: #e8e0d4;
  font: inherit;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  cursor: pointer;
}

.minigame-aparadas__continuar:hover,
.minigame-aparadas__continuar:focus-visible {
  border-color: #a89b82;
  outline: none;
}

.minigame-aparadas__vidas {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  z-index: 3;
  display: flex;
  gap: 0.45rem;
  pointer-events: none;
}

.minigame-aparadas__vida {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c45a5a, #6a1818 70%);
  border: 1px solid #3a1010;
  box-shadow: 0 0 8px rgba(120, 20, 20, 0.45);
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.minigame-aparadas__vida--perdida {
  opacity: 0.25;
  filter: grayscale(1);
}

.minigame-aparadas__alvo {
  position: absolute;
  width: 5.25rem;
  height: 5.25rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: crosshair;
  z-index: 2;
  overflow: visible;
}

/* Clique vale em todo o halo (não só no círculo do meio) */
.minigame-aparadas__hit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: scale(var(--escala-zona, 1.65));
  z-index: 5;
  cursor: crosshair;
}

/* Halo = área válida de aparar (~50% opacidade) */
.minigame-aparadas__zona {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(232, 210, 150, 0.5);
  border: 2px solid rgba(240, 220, 170, 0.55);
  box-shadow: 0 0 18px rgba(220, 190, 130, 0.25);
  transform: scale(var(--escala-zona, 1.65));
  pointer-events: none;
  z-index: 0;
}

/* Núcleo maior no centro, com ícone de espada */
.minigame-aparadas__nucleo {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f0e6d2, #9a8060 52%, #2e2820 100%);
  border: 2px solid #e8d7b0;
  box-shadow:
    0 0 0 2px rgba(20, 16, 12, 0.65),
    0 0 14px rgba(200, 170, 120, 0.4);
  pointer-events: none;
  z-index: 1;
  display: grid;
  place-items: center;
}

.minigame-aparadas__icone-espada {
  width: 1rem;
  height: 1.55rem;
  background: linear-gradient(180deg, #f5eedc 0%, #c4b49a 40%, #8a7a62 70%, #4a4030 100%);
  clip-path: polygon(
    50% 2%,
    62% 16%,
    58% 16%,
    58% 62%,
    78% 62%,
    78% 72%,
    58% 72%,
    58% 88%,
    68% 88%,
    68% 96%,
    32% 96%,
    32% 88%,
    42% 88%,
    42% 72%,
    22% 72%,
    22% 62%,
    42% 62%,
    42% 16%,
    38% 16%
  );
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.45));
}

/* Anel nasce bem longe e fecha; toca o halo no mesmo instante de antes */
.minigame-aparadas__anel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(245, 230, 190, 0.95);
  box-shadow: 0 0 14px rgba(220, 190, 130, 0.35);
  pointer-events: none;
  transform: scale(var(--escala-inicio, 3.55));
  opacity: 0.95;
  z-index: 2;
}

.minigame-aparadas__anel--fecha {
  animation: minigame-anel-fecha var(--janela-ms, 1100ms) linear forwards;
}

@keyframes minigame-anel-fecha {
  0% {
    transform: scale(var(--escala-inicio, 3.55));
    opacity: 0.92;
  }
  /* Mesmo tempo até encostar no halo; trecho inicial mais longo = encolhe mais rápido */
  72% {
    transform: scale(var(--escala-zona, 1.65));
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Anel entrou na zona: halo e núcleo destacam */
.minigame-aparadas__alvo--pronto .minigame-aparadas__zona {
  background: rgba(255, 230, 160, 0.55);
  border-color: rgba(255, 232, 170, 0.75);
  box-shadow: 0 0 22px rgba(255, 210, 120, 0.45);
}

.minigame-aparadas__alvo--pronto .minigame-aparadas__nucleo {
  border-color: #ffe9b0;
  box-shadow:
    0 0 0 2px rgba(20, 16, 12, 0.55),
    0 0 22px rgba(255, 210, 120, 0.85);
}

.minigame-aparadas__alvo--pronto .minigame-aparadas__anel {
  border-color: #ffe9b0;
}

.minigame-aparadas__alvo--acerto .minigame-aparadas__nucleo {
  background: radial-gradient(circle at 40% 35%, #fff4d8, #c9a86a 60%, #5a4830 100%);
  box-shadow: 0 0 22px rgba(255, 210, 140, 0.85);
}

.minigame-aparadas__alvo--erro .minigame-aparadas__nucleo {
  background: radial-gradient(circle at 40% 35%, #ffb0b0, #8a2020 60%, #3a1010 100%);
  box-shadow: 0 0 16px rgba(180, 40, 40, 0.65);
}

.minigame-aparadas--hit::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: rgba(120, 0, 0, 0.28);
  animation: minigame-flash-hit 0.28s ease-out forwards;
}

@keyframes minigame-flash-hit {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Flash de morte / espadada */
.morte-flash {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: #000;
  opacity: 0;
}

.morte-flash--impacto {
  animation: morte-impacto 0.55s ease-out forwards;
}

.morte-flash--preto {
  opacity: 1;
}

@keyframes morte-impacto {
  0% {
    opacity: 0;
    background: #fff;
  }
  18% {
    opacity: 1;
    background: #fff;
  }
  35% {
    opacity: 1;
    background: #3a0000;
  }
  100% {
    opacity: 1;
    background: #000;
  }
}

/* Pálpebras abrindo (Return by Death → G00A) */
.olhos-abrindo {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  overflow: hidden;
}

.olhos-abrindo__tampa {
  position: absolute;
  left: 0;
  right: 0;
  height: 52%;
  background: #000;
  transition: transform 2.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.olhos-abrindo__tampa--cima {
  top: 0;
  transform-origin: top center;
}

.olhos-abrindo__tampa--baixo {
  bottom: 0;
  transform-origin: bottom center;
}

.olhos-abrindo--aberto .olhos-abrindo__tampa--cima {
  transform: translateY(-105%);
}

.olhos-abrindo--aberto .olhos-abrindo__tampa--baixo {
  transform: translateY(105%);
}

.examinador {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
}

.examinador__painel {
  width: min(92vw, 42rem);
  max-height: min(92dvh, 48rem);
  overflow: auto;
  padding: 1.25rem 1.35rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #161310, #0d0b09);
  border: 1px solid var(--cor-borda);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.examinador__titulo {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cor-titulo);
  font-weight: 600;
  text-align: center;
}

.examinador__corpo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.examinador__rodape {
  margin: 1.1rem 0 0;
  color: var(--cor-texto-fraco);
  font-size: 0.98rem;
  line-height: 1.4;
  text-align: center;
}

.examinador__fechar {
  display: block;
  margin: 1.25rem auto 0;
  color: var(--cor-titulo);
  opacity: 0.92;
}

.examinador__fechar:hover,
.examinador__fechar:focus-visible {
  color: var(--cor-titulo);
  opacity: 1;
  border-bottom-color: var(--cor-borda);
}

.examinador__nota-simples {
  margin: 0.5rem 0 0;
  max-width: 22rem;
  color: var(--cor-texto);
  font-family: var(--fonte-display);
  font-size: 1.25rem;
  line-height: 1.45;
  text-align: center;
}

.espada-palco {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78vw, 22rem);
  min-height: min(58vw, 26rem);
  padding: 1.25rem 1rem 1.75rem;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 42%, #2a241c 0%, #0c0a08 62%, #050403 100%);
  box-shadow:
    inset 0 0 0 1px #5a4d3888,
    0 18px 40px #000a;
}

.espada-palco::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: radial-gradient(ellipse, #000c 0%, transparent 70%);
  pointer-events: none;
}

.espada-reliquia {
  position: relative;
  z-index: 1;
  display: block;
  width: min(42vw, 11.5rem);
  height: auto;
  max-height: min(52vw, 22rem);
  object-fit: contain;
  filter: drop-shadow(0 14px 22px #000c);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.examinador--nas-maos .espada-palco {
  width: min(82vw, 24rem);
  background: transparent;
  box-shadow: none;
  padding: 0.5rem 0 1rem;
}

.item-miniatura--espada .item-figura {
  object-fit: contain;
  border-radius: 0;
  width: 70%;
  height: 90%;
}

/* Mesa das Cartas (E01) — estilos mc-* da referência funcional */
.c02m .camada-base {
  opacity: 0;
  pointer-events: none;
}

.c02m .camada-efeitos {
  opacity: 0.35;
}

.mc-root {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  overflow: auto;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% -20%, #2f2923, #0d0c0b 69%);
}

.mc-scene {
  width: min(100%, 1850px);
  flex: 1;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1vw, 16px);
  pointer-events: none;
  box-sizing: border-box;
}

.mc-table {
  position: relative;
  width: 100%;
  max-width: 1760px;
  min-height: min(790px, calc(100% - 8px));
  border-radius: 13px;
  overflow: hidden;
  pointer-events: auto;
  box-shadow:
    0 28px 85px #000e,
    inset 0 0 0 3px #725037,
    inset 0 0 0 13px #29180e,
    inset 0 0 0 17px #6c4930,
    inset 0 0 0 19px #22130b;
  background:
    radial-gradient(ellipse at 35% 20%, #6d4830aa, transparent 66%),
    repeating-linear-gradient(91deg, #3d2518 0px, #513421 16px, #442a1b 32px, #563822 60px, #3f291b 89px),
    #3b2519;
}

.mc-table:before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 5px;
  pointer-events: none;
  box-shadow: inset 0 0 80px #140905a8, inset 0 0 0 1px #b68b553c;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 15px, #0f070409 16px, transparent 18px);
  opacity: 0.75;
}

.mc-table:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(130deg, #e6b17013 0%, transparent 32%, #07040550 91%);
}

.mc-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(440px, 1.15fr);
  column-gap: clamp(20px, 2.4vw, 42px);
  padding: clamp(24px, 2vw, 34px) clamp(28px, 3.5vw, 58px);
  align-items: center;
  min-height: inherit;
  box-sizing: border-box;
}

.mc-workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.mc-slot-grid {
  display: flex;
  justify-content: center;
  gap: clamp(9px, 1vw, 17px);
  width: fit-content;
  max-width: 100%;
  margin: 22px auto 0;
  padding: 0.35rem;
  border-radius: 0.45rem;
  transition: box-shadow 0.18s ease, background-color 0.18s ease;
}

@keyframes mc-tremer {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

.mc-slot-grid.is-tremendo .mc-slot {
  animation: mc-tremer 0.42s ease-in-out;
}

.mc-slot-grid--acertadas {
  background: rgba(40, 90, 55, 0.12);
  box-shadow:
    0 0 0 2px rgba(90, 190, 110, 0.7),
    0 0 18px rgba(70, 170, 95, 0.45);
}

.mc-slot {
  --s: 132px;
  flex: 0 0 var(--s);
  height: calc(var(--s) * 1.4);
  position: relative;
  background: linear-gradient(140deg, #140d0a, #2f2119 50%, #1a100d);
  border: 2px solid #76543c;
  border-radius: 6px;
  padding: 5px;
  box-shadow:
    inset 3px 5px 10px #080503d6,
    inset -2px -2px 3px #78583b4a,
    0 1px 0 #97715133;
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.mc-slot:before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #b18c5a25;
  border-radius: 3px;
  pointer-events: none;
}

.mc-slot:focus-visible,
.mc-slot:hover,
.mc-slot.is-drop-target {
  border-color: #b9a076;
  box-shadow: inset 3px 5px 10px #080503d6, 0 0 0 2px #c3a7795e;
}

.mc-slot-empty {
  height: 100%;
  display: grid;
  place-content: center;
  color: #907354;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.mc-slot .mc-card {
  width: 100%;
  height: 100%;
  box-shadow: 0 3px 7px #0007;
}

.mc-hand-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 122px));
  gap: 9px 15px;
  justify-content: center;
  align-content: start;
  width: 100%;
  margin-top: 28px;
  min-height: calc(2 * 166px + 9px);
  padding: 0.35rem;
  border-radius: 0.45rem;
  box-sizing: border-box;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}

.mc-hand-grid.is-drop-target {
  background: rgba(185, 160, 110, 0.1);
  box-shadow: 0 0 0 2px #c3a7795e;
}

.mc-card {
  width: 122px;
  height: 166px;
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  outline: none;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 13px;
  background: linear-gradient(115deg, #d8c49c, #f0e4c9 45%, #dbc89e);
  color: #211914;
  border: 1px solid #bda77d;
  border-radius: 5px;
  box-shadow: 1px 2px 1px #24180e, 3px 6px 10px #100b09a6, inset 0 0 0 3px #fff7e528;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  font-family: var(--fonte-display);
  box-sizing: border-box;
}

.mc-card:before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid #8b72522e;
  border-radius: 2px;
  pointer-events: none;
}

.mc-card:focus-visible {
  outline: 3px solid #d3ba7e;
  outline-offset: 3px;
}

.mc-card:hover {
  transform: translateY(-4px);
  box-shadow: 2px 9px 16px #080504bf;
}

.mc-card.is-selected {
  transform: translateY(-7px);
  box-shadow: 0 0 0 3px #d9bf8c, 0 12px 20px #080504cf;
}

.mc-card.is-dragging {
  visibility: hidden;
}

.mc-card-corner {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
  font-size: 19px;
  font-weight: bold;
  z-index: 1;
}

.mc-card-corner .mc-suit-small {
  font-size: 15px;
}

.mc-card-suit {
  font-size: 39px;
  line-height: 1;
  filter: drop-shadow(0 1px 0 #fff4);
  margin-top: -2px;
}

.mc-card-word {
  font-size: 13px;
  letter-spacing: 0.06em;
  font-weight: bold;
  white-space: nowrap;
  line-height: 1.2;
  max-width: 100%;
}

.mc-card-word.is-long {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.mc-card.is-red {
  color: #812d34;
}

.mc-card.is-black {
  color: #292522;
}

.mc-divider {
  height: 1px;
  width: min(93%, 730px);
  background: linear-gradient(to right, transparent, #d0a66b51, transparent);
  margin-top: 14px;
}

.mc-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.mc-button {
  border: 1px solid #94754e;
  border-radius: 3px;
  min-width: 150px;
  height: 44px;
  padding: 0 18px;
  background: linear-gradient(#392a1f, #23180f);
  color: #e6d5ba;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 #bc955a55, 0 3px 9px #0009;
  transition: filter 0.15s, transform 0.15s;
}

.mc-button:hover:not(:disabled) {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.mc-button:disabled {
  opacity: 0.43;
  cursor: not-allowed;
}

.mc-button-primary {
  background: linear-gradient(#715431, #493117);
  border-color: #b79258;
  color: #fff1ca;
}

.mc-gaveta-aviso {
  margin: 10px 0 0;
  max-width: 28rem;
  padding: 0.45rem 0.7rem;
  background: rgba(8, 6, 5, 0.78);
  border: 1px solid rgba(200, 180, 140, 0.4);
  color: #e8d7b0;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
}

.mc-paper-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  align-self: stretch;
}

.mc-paper {
  width: 100%;
  max-width: 620px;
  height: auto;
  min-height: min(720px, 88%);
  padding: 48px 42px 40px;
  color: #30251a;
  background: radial-gradient(circle at 45% 38%, #f1e4c7 0%, #e9d8b3 56%, #d6bd8c 100%);
  border: 1px solid #ad8c58;
  border-radius: 2px;
  box-shadow:
    1px 2px 1px #fef1ca60 inset,
    -2px -4px 17px #886e458a inset,
    4px 11px 17px #100905a9;
  transform: rotate(0.22deg);
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mc-paper:before {
  content: "";
  inset: 7px;
  position: absolute;
  border: 1px solid #ad976a30;
  pointer-events: none;
}

.mc-paper h2 {
  font-size: 36px;
  text-align: center;
  letter-spacing: 0.055em;
  font-weight: 400;
  line-height: 1.1;
  margin: 4px 0 36px;
  font-family: var(--fonte-display);
}

.mc-paper ol {
  margin: 0;
  padding-left: 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mc-paper li {
  font-size: 23px;
  line-height: 1.4;
  padding-left: 4px;
}

.mc-paper li::marker {
  font-variant-numeric: oldstyle-nums;
}

.mc-paper-foot {
  margin-top: 25px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
}

.mc-paper-foot:before,
.mc-paper-foot:after {
  content: "";
  height: 1px;
  background: #654c30;
  width: 60px;
}

.mc-paper-foot span {
  font-size: 18px;
}

.mc-paper-fecho {
  margin: 18px 0 0;
  text-align: center;
  font-size: 20px;
  line-height: 1.35;
  font-style: italic;
  color: #2a2016;
}

.mc-drag-ghost {
  position: fixed !important;
  pointer-events: none !important;
  z-index: 9999 !important;
  transform: rotate(-3deg) scale(1.05) !important;
  opacity: 0.95;
  box-shadow: 0 19px 35px #000b !important;
}

.cadeado--quatro .cadeado-janela {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1400px) {
  .mc-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(380px, 1.05fr);
    padding: 36px 32px;
    gap: 22px;
  }

  .mc-slot {
    --s: 116px;
  }

  .mc-hand-grid {
    grid-template-columns: repeat(5, minmax(0, 110px));
    gap: 10px 11px;
    min-height: calc(2 * 151px + 10px);
  }

  .mc-hand-grid .mc-card {
    width: 110px;
    height: 151px;
  }

  .mc-card {
    padding: 9px 6px 10px;
  }

  .mc-card-corner {
    font-size: 17px;
  }

  .mc-card-suit {
    font-size: 33px;
  }

  .mc-card-word {
    font-size: 11px;
  }

  .mc-card-word.is-long {
    font-size: 10px;
  }

  .mc-paper {
    max-width: 560px;
    min-height: min(640px, 86%);
    padding: 40px 34px 34px;
  }

  .mc-paper h2 {
    font-size: 30px;
  }

  .mc-paper li {
    font-size: 20px;
  }

  .mc-paper-fecho {
    font-size: 18px;
  }

  .mc-paper ol {
    gap: 14px;
  }
}

@media (max-width: 1060px) {
  .mc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 46px 27px;
  }

  .mc-table {
    min-height: 0;
  }

  .mc-paper {
    max-width: 820px;
    min-height: 0;
    transform: none;
    padding: 42px 36px 36px;
  }

  .mc-paper-wrap {
    order: 2;
  }

  .mc-workspace {
    order: 1;
  }

  .mc-paper ol {
    gap: 14px;
  }

  .mc-paper h2 {
    margin-bottom: 28px;
    font-size: 32px;
  }

  .mc-hand-grid {
    grid-template-columns: repeat(5, 110px);
    justify-content: center;
  }

  .mc-paper li {
    font-size: 20px;
  }

  .mc-paper-fecho {
    font-size: 18px;
  }
}

@media (max-width: 650px) {
  .mc-scene {
    padding: 7px;
  }

  .mc-table {
    border-radius: 6px;
  }

  .mc-layout {
    padding: 40px 12px 20px;
    gap: 22px;
  }

  .mc-slot-grid {
    gap: 6px;
  }

  .mc-slot {
    --s: clamp(65px, 19.5vw, 100px);
    padding: 3px;
    border-width: 1px;
  }

  .mc-slot-empty {
    font-size: 9px;
  }

  .mc-hand-grid {
    grid-template-columns: repeat(3, minmax(0, 95px));
    gap: 9px;
    min-height: 0;
  }

  .mc-hand-grid .mc-card {
    width: 95px;
    height: 137px;
  }

  .mc-paper {
    padding: 28px 22px;
    transform: none;
  }

  .mc-paper h2 {
    font-size: 24px;
  }

  .mc-paper li {
    font-size: 17px;
  }

  .mc-paper-fecho {
    font-size: 15px;
  }

  .mc-button {
    min-width: 122px;
    height: 42px;
    font-size: 11px;
  }

  .mc-card-word {
    font-size: 10px;
  }

  .mc-card-word.is-long {
    font-size: 9px;
  }

  .mc-card-suit {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mc-slot,
  .mc-card,
  .mc-button,
  .mc-slot-grid {
    transition: none !important;
  }

  .mc-slot-grid.is-tremendo .mc-slot {
    animation: none;
  }
}

/* Exame a partir do inventário: objeto “na mão”, sem caixa marrom */
.examinador--nas-maos {
  padding: 1.5rem 1rem 2rem;
  background: rgba(0, 0, 0, 0.78);
}

.examinador--nas-maos .examinador__painel {
  width: min(92vw, 32rem);
  max-height: min(96dvh, 56rem);
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.examinador--nas-maos .examinador__titulo {
  margin-bottom: 0;
  text-align: center;
  font-size: clamp(1.1rem, 3.2vw, 1.45rem);
}

.examinador--nas-maos .examinador__corpo {
  gap: 0;
  position: relative;
  z-index: 0;
}

.examinador--nas-maos .examinador__fechar {
  position: relative;
  z-index: 2;
  margin-top: 0.25rem;
}

.examinador--nas-maos .medalhao {
  width: min(78vw, 440px);
}

/* Relógio falso 3D */

.relogio-falso {
  width: min(72vw, 17.5rem);
  aspect-ratio: 1;
  perspective: 800px;
}

.relogio-falso__aro {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 4.5%;
  background:
    radial-gradient(circle at 32% 28%, #6a6258 0%, #3a3530 42%, #151210 100%);
  box-shadow:
    inset 0 1px 0 rgba(210, 198, 170, 0.28),
    inset 0 -10px 18px rgba(0, 0, 0, 0.45),
    0 16px 32px rgba(0, 0, 0, 0.5);
  transform: rotateX(7deg);
}

.relogio-falso__face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, #e8dcc0 0%, #c9b896 48%, #8f8168 100%);
  box-shadow:
    inset 0 0 0 2px #2a241c,
    inset 0 0 26px rgba(40, 28, 12, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.4);
}

.relogio-falso__marca {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.8rem;
  margin-left: -0.9rem;
  color: #1a1612;
  font-family: var(--fonte-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1;
  transform: rotate(var(--angulo)) translateY(-6.15rem) rotate(calc(var(--angulo) * -1));
  user-select: none;
}

.relogio-falso__ponteiro {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  background: linear-gradient(180deg, #2a241c, #0d0b09);
  border-radius: 2px;
  box-shadow: 0 0 0 0.5px rgba(180, 160, 120, 0.35);
}

.relogio-falso__ponteiro--hora {
  width: 5px;
  height: 28%;
  margin-left: -2.5px;
}

.relogio-falso__ponteiro--minuto {
  width: 3px;
  height: 40%;
  margin-left: -1.5px;
}

.relogio-falso__eixo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a7d63, #2a241c 70%);
  box-shadow: 0 0 0 2px #1a1612;
}

/* Papel da rotina do arquivo (gaveta das cartas) */

.papel-arquivo {
  width: min(94vw, 40rem);
  padding: 1.4rem 1.85rem 1.35rem;
  background: radial-gradient(circle at 45% 30%, #f0e3c6 0%, #e4d2ad 55%, #d2ba8a 100%);
  color: #2d2318;
  border: 1px solid #ad8c58;
  border-radius: 2px;
  box-shadow:
    inset 1px 2px 0 #fef1ca55,
    0 12px 28px #0009;
}

.papel-arquivo__titulo {
  margin: 0 0 0.9rem;
  font-family: var(--fonte-display);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}

.papel-arquivo__nota {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.85;
}

.papel-arquivo__rotina {
  margin: 0;
  padding: 0.7rem 0.75rem;
  border-radius: 3px;
  background: rgba(59, 42, 25, 0.1);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Inscrição */

.inscricao-falsa {
  width: min(88vw, 23rem);
  padding: 0.85rem;
  background:
    linear-gradient(160deg, #3d3830, #1f1b16 55%, #100e0c);
  border: 1px solid #5a5246;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.45),
    0 12px 28px rgba(0, 0, 0, 0.4);
}

.inscricao-falsa__moldura {
  padding: 1.5rem 1rem;
  border: 1px solid rgba(120, 108, 88, 0.45);
  background:
    linear-gradient(165deg, #4a4338 0%, #2c2720 48%, #171411 100%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.4);
}

.inscricao-falsa__letras {
  margin: 0;
  text-align: center;
  letter-spacing: 0.42em;
  font-size: clamp(2rem, 8vw, 3rem);
  color: #d8d0c0;
  text-indent: 0.42em;
  text-shadow:
    0 1px 0 rgba(255, 245, 220, 0.12),
    0 2px 0 rgba(0, 0, 0, 0.55);
}

/* Medalhão (falso 3D) */

.medalhao-palco {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.4rem 0;
  perspective: 1000px;
}

.medalhao {
  position: relative;
  width: min(72vw, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.medalhao-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 32%, #8f7a52 0%, #5a4828 45%, #2a2013 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.medalhao-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: none;
  cursor: grab;
  /* Só os anéis capturam clique — cantos do SVG e centro não cobrem o Fechar */
  pointer-events: none;
}

.medalhao.girando .medalhao-svg {
  cursor: grabbing;
}

.medalhao-aro {
  fill: none;
  stroke: rgba(90, 70, 40, 0.45);
  stroke-width: 2;
  pointer-events: none;
}

.anel {
  transform-origin: 200px 200px;
  transform-box: view-box;
  pointer-events: auto;
  cursor: grab;
}

.medalhao.girando .anel {
  cursor: grabbing;
}

.anel-externo .anel-faixa {
  fill: none;
  stroke: url(#medalhao-grad-latao);
  opacity: 0.94;
}

.anel-interno .anel-faixa {
  fill: none;
  stroke: url(#medalhao-grad-ferro);
  opacity: 0.95;
}

.medalhao.com-textura .anel-externo .anel-faixa {
  opacity: 0.38;
  mix-blend-mode: multiply;
}

.medalhao.com-textura .anel-interno .anel-faixa {
  opacity: 0.55;
  mix-blend-mode: multiply;
}

.anel-borda {
  fill: none;
  stroke: rgba(20, 14, 8, 0.85);
  stroke-width: 1.4;
}

.anel-divisao {
  stroke: rgba(20, 14, 8, 0.55);
  stroke-width: 1;
}

.anel-letra {
  font-family: var(--fonte-display);
  fill: #f6e4a8;
  paint-order: stroke fill;
  stroke: rgba(40, 24, 8, 0.55);
  stroke-width: 1.2;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
  pointer-events: none;
  user-select: none;
}

.anel-interno .anel-letra {
  fill: #f8e9b4;
}

.anel-letra.alinhada {
  fill: #fff1c4;
}

.medalhao-centro {
  fill: rgba(20, 15, 9, 0.18);
  stroke: rgba(20, 14, 8, 0.7);
  stroke-width: 2;
}

.medalhao-eixo {
  fill: url(#medalhao-grad-latao);
  stroke: rgba(20, 14, 8, 0.8);
  stroke-width: 1.5;
}

.medalhao-ponteiro {
  fill: var(--brasa);
  stroke: #2a1a0a;
  stroke-width: 1;
  pointer-events: none;
}

.medalhao-brilho {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--bx, 35%) var(--by, 30%),
    rgba(255, 240, 205, 0.28),
    transparent 45%
  );
  mix-blend-mode: soft-light;
}

.medalhao-leitura,
.medalhao-deslocamento {
  margin: 0.75rem auto 0;
  max-width: 28rem;
  text-align: center;
  color: var(--cor-texto-fraco);
  font-size: 0.92rem;
  line-height: 1.45;
}

.medalhao-grupos {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.8rem;
}

.medalhao-grupo {
  text-align: center;
}

.medalhao-grupo p {
  margin: 0 0 0.35rem;
  color: var(--cor-texto-fraco);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.pinos {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.pino {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 35% 30%, #d9d0c2, #6d655c 42%, #2a2724 75%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 0 #111;
}

.chevron {
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto;
  border-top: 2px solid #1a1612;
  border-right: 2px solid #1a1612;
}

.chevron-esquerda {
  transform: rotate(-135deg);
}

.chevron-direita {
  transform: rotate(45deg);
}

/* Cadeado */

.cadeado {
  width: min(640px, 100%);
  margin: 0 auto;
}

/* Digitação sob o cadeado (risquinhos; teclado global no examinador) */
.cadeado-digitacao {
  --cadeado-digitos: 5;
  width: min(640px, 100%);
  margin: 1.15rem auto 0;
  text-align: center;
}

.cadeado-digitacao__slots {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
}

.cadeado-digitacao__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 1.9rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: text;
  color: inherit;
}

.cadeado-digitacao__slot:disabled {
  cursor: default;
}

.cadeado-digitacao__slot:focus-visible {
  outline: none;
}

.cadeado-digitacao__letra {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 1.7rem;
  font-family: var(--fonte-display);
  font-size: 1.55rem;
  line-height: 1;
  color: #e8dfd0;
}

.cadeado-digitacao__risco {
  width: 100%;
  height: 2px;
  margin-top: 0.28rem;
  border-radius: 1px;
  background: #6e675e;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.cadeado-digitacao__slot.ativo .cadeado-digitacao__risco {
  background: #d9cbb5;
  box-shadow: 0 0 0 1px rgba(217, 203, 181, 0.25);
}

.cadeado-digitacao__slot:disabled .cadeado-digitacao__letra {
  color: #7a736a;
}

.cadeado-digitacao__slot:disabled .cadeado-digitacao__risco {
  background: #4a453f;
}

.cadeado-argola {
  width: 42%;
  height: 78px;
  margin: 0 auto -18px;
  border: 16px solid #5a5146;
  border-bottom: 0;
  border-radius: 80px 80px 0 0;
  background:
    linear-gradient(
      90deg,
      transparent 0 18px,
      rgba(0, 0, 0, 0.4) 18px 22px,
      transparent 22px
    );
  box-shadow:
    inset 0 0 0 1px #1f1b16,
    inset 0 8px 10px rgba(120, 90, 50, 0.12),
    0 -8px 16px rgba(0, 0, 0, 0.3);
}

.cadeado-corpo {
  position: relative;
  padding: 2.2rem 1rem 3.4rem;
  border-radius: 14px 14px 22px 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(180, 150, 110, 0.14), transparent 32%),
    linear-gradient(165deg, #5c5348, #2a2520 38%, #12100e 74%, #3a342c);
  box-shadow:
    inset 0 1px 0 rgba(210, 190, 150, 0.18),
    inset 0 -14px 18px rgba(0, 0, 0, 0.42),
    0 18px 30px rgba(0, 0, 0, 0.5);
}

.cadeado-rebites {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.cadeado-rebites span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d5cdc0, #5c564e 50%, #2a2724);
  box-shadow: 0 1px 0 #111;
}

.cadeado-janela {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.45rem;
  border-radius: 8px;
  background: #0c0b0a;
  box-shadow:
    inset 0 8px 14px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(255, 255, 255, 0.12);
}

.roda {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 118px;
  padding: 0.2rem 0;
  border: 0;
  cursor: ns-resize;
  touch-action: none;
  color: #1b140e;
  font-family: var(--fonte-display);
  background:
    linear-gradient(
      180deg,
      #141210 0%,
      #3a342c 16%,
      #cfc3ae 46%,
      #f4ecdf 50%,
      #b7a890 55%,
      #3a342c 84%,
      #141210 100%
    );
  box-shadow:
    inset 0 8px 10px rgba(0, 0, 0, 0.35),
    inset 0 -8px 10px rgba(0, 0, 0, 0.35);
}

.roda-atual {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 600;
}

.roda-anterior,
.roda-seguinte {
  font-size: 0.85rem;
  color: #4e463d;
}

.rola-sobe {
  animation: rola-sobe 140ms ease;
}

.rola-desce {
  animation: rola-desce 140ms ease;
}

@keyframes rola-sobe {
  from {
    transform: translateY(45%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes rola-desce {
  from {
    transform: translateY(-45%);
  }
  to {
    transform: translateY(0);
  }
}

.lingueta {
  position: absolute;
  right: 12px;
  bottom: 10px;
  top: auto;
  width: 92px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.lingueta-haste {
  display: block;
  height: 12px;
  margin-top: 8px;
  border-radius: 6px;
  background: linear-gradient(#c2b8aa, #4d473f 55%, #2a261f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform-origin: 10px 50%;
  transition: transform 160ms ease;
}

.lingueta.puxada .lingueta-haste,
.lingueta-haste.puxada {
  transform: rotate(26deg);
}

.lingueta-haste.presa {
  transform: rotate(34deg);
}

.lingueta-haste.recua {
  transition-duration: 90ms;
  transform: rotate(0deg);
}

@media (max-width: 480px) {
  .cena {
    padding: 1.25rem 1rem;
  }

  .tela-inicial__painel {
    width: 100%;
    gap: 2.25rem;
    padding: 2rem 1.35rem 1.75rem;
  }

  .tela-inicial__titulo {
    font-size: clamp(2.2rem, 11vw, 3rem);
  }

  .tela-inicial__vinheta {
    background:
      linear-gradient(
        90deg,
        rgba(5, 4, 3, 0.9) 0%,
        rgba(5, 4, 3, 0.62) 42%,
        rgba(5, 4, 3, 0.4) 100%
      ),
      linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.45) 0%,
        transparent 30%,
        transparent 65%,
        rgba(0, 0, 0, 0.6) 100%
      );
  }

  .introducao {
    gap: 2.5rem;
  }

  .introducao__controles {
    width: 100%;
    flex-direction: column;
  }

  .botao-texto {
    width: auto;
  }

  .lingueta {
    position: relative;
    right: auto;
    top: auto;
    width: 100%;
    height: 52px;
    margin-top: 0.9rem;
  }

  .cadeado-corpo {
    padding-bottom: 1rem;
  }

  .medalhao-grupos {
    gap: 0.8rem;
  }
}

/* ---------- E02: Estante de gavetas ---------- */

.eg-root {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  overflow: auto;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% -10%, #2a2420cc, #0b0a09f0 72%);
}

.eg-scene {
  width: min(100%, 1480px);
  flex: 1;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 0.8vw, 12px) clamp(6px, 0.8vw, 12px) 72px;
  pointer-events: none;
  box-sizing: border-box;
}

.eg-painel {
  position: relative;
  width: 100%;
  max-width: 1180px;
  max-height: calc(100% - 4px);
  border-radius: 10px;
  overflow: auto;
  pointer-events: auto;
  box-shadow:
    0 24px 70px #000d,
    inset 0 0 0 2px #6a4c33,
    inset 0 0 0 10px #24160e;
  background:
    linear-gradient(180deg, #2a1d14ee, #160f0bee),
    repeating-linear-gradient(92deg, #3a2718 0 7px, #312113 7px 12px);
  padding: clamp(12px, 1.4vw, 20px);
  padding-bottom: clamp(18px, 2vw, 28px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.eg-painel--so-gavetas {
  max-width: 980px;
}

.eg-rodape {
  position: relative;
  z-index: 12;
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 0.5rem;
  flex-shrink: 0;
}

.eg-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: clamp(12px, 1.5vw, 20px);
  padding: clamp(12px, 1.4vw, 20px);
  align-items: start;
  box-sizing: border-box;
}

.eg-movel {
  min-width: 0;
  padding: 0.55rem;
  padding-bottom: 0.85rem;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.42)),
    repeating-linear-gradient(92deg, #3b2817 0 6px, #34230f 6px 9px, #402c19 9px 15px);
  box-shadow:
    inset 0 0 0 5px #1f150b,
    inset 0 0 36px rgba(0, 0, 0, 0.7),
    0 10px 28px #0009;
  perspective: 900px;
  perspective-origin: 50% -90%;
}

.eg-movel--ok {
  box-shadow:
    inset 0 0 0 5px #1f150b,
    inset 0 0 36px rgba(0, 0, 0, 0.7),
    0 0 0 1px #c4a06a55,
    0 10px 28px #0009;
}

.eg-estante {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  transform-style: preserve-3d;
  width: 100%;
}

.eg-gaveta,
.eg-gaveta-vazia {
  position: relative;
  aspect-ratio: 1.2;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: #120c06;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9);
  transform-style: preserve-3d;
  cursor: pointer;
}

.eg-gaveta:focus-visible {
  outline: 2px solid #d3ba7e;
  outline-offset: 2px;
}

.eg-gaveta-corpo {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.3, 1);
}

.eg-gaveta.aberta {
  z-index: 2;
}

.eg-gaveta.aberta .eg-gaveta-corpo {
  transform: translateZ(32px);
}

.eg-gaveta-frente {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8%;
  border-radius: 2px;
  background-image:
    linear-gradient(180deg, rgba(255, 220, 170, 0.08), rgba(0, 0, 0, 0.35)),
    repeating-linear-gradient(88deg, #5a3d22 0 5px, #4d331b 5px 8px, #634428 8px 13px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 230, 190, 0.12);
}

.eg-gaveta:nth-child(3n) .eg-gaveta-frente {
  background-position: center, 30% 70%;
}

.eg-gaveta:nth-child(3n + 1) .eg-gaveta-frente {
  background-position: center, 80% 20%;
}

.eg-gaveta:nth-child(3n + 2) .eg-gaveta-frente {
  background-position: center, 55% 45%;
}

.eg-gaveta-placa {
  min-width: 46%;
  padding: 0 0.25rem;
  border-radius: 2px;
  background: linear-gradient(180deg, #b39661, #7a6236);
  box-shadow: inset 0 0 0 1px rgba(40, 28, 10, 0.7), 0 1px 2px rgba(0, 0, 0, 0.6);
  color: #241809;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(0.58rem, 0.95vw, 0.8rem);
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.eg-gaveta-puxador {
  width: 22%;
  height: 12%;
  border-radius: 0 0 50% 50%;
  border: 2px solid #1d1309;
  border-top: 0;
  background: transparent;
}

.eg-gaveta-revelacao {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: linear-gradient(180deg, #e9dcbc, #c7b48a);
  color: #24170a;
  box-shadow: inset 0 0 0 2px #4a3219;
}

.eg-gaveta.aberta .eg-gaveta-revelacao {
  display: flex;
}

.eg-gaveta.aberta .eg-gaveta-placa,
.eg-gaveta.aberta .eg-gaveta-puxador {
  visibility: hidden;
}

.eg-gaveta.no-caminho .eg-gaveta-revelacao {
  box-shadow: inset 0 0 0 2px #8a2a2a;
}

.eg-gaveta-topo {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transform: translateZ(-32px) rotateX(90deg);
  transform-origin: top center;
  background: linear-gradient(180deg, #e9dcbc, #c7b48a);
  box-shadow: inset 0 0 0 3px #4a3219;
  color: #24170a;
  opacity: 0;
  transition: opacity 0.2s;
}

.eg-gaveta.aberta .eg-gaveta-topo {
  opacity: 1;
  transition-delay: 0.1s;
}

.eg-gaveta-numero {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(0.72rem, 1.1vw, 1rem);
  font-weight: 600;
}

.eg-gaveta-etiqueta {
  font-family: var(--fonte-display);
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  color: #8a2a2a;
  font-weight: 600;
}

.eg-gaveta-lado {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  background: #2a1c0e;
  opacity: 0;
}

.eg-gaveta.aberta .eg-gaveta-lado {
  opacity: 1;
}

.eg-gaveta-lado-esq {
  left: 0;
  transform: rotateY(90deg);
  transform-origin: left center;
}

.eg-gaveta-lado-dir {
  right: 0;
  transform: rotateY(-90deg);
  transform-origin: right center;
}

.eg-gaveta.no-caminho .eg-gaveta-topo {
  box-shadow: inset 0 0 0 3px #8a2a2a;
}

.eg-gaveta.no-caminho .eg-gaveta-frente {
  box-shadow: inset 0 0 0 2px rgba(224, 162, 74, 0.85);
}

.eg-gaveta:hover:not(.aberta) .eg-gaveta-frente {
  filter: brightness(1.16);
}

.eg-gaveta-vazia {
  background: repeating-linear-gradient(88deg, #3a2714 0 5px, #33220f 5px 8px);
  cursor: default;
  pointer-events: none;
}

.eg-lateral {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: 3px;
  background: radial-gradient(circle at 45% 30%, #f0e3c6 0%, #e4d2ad 55%, #d2ba8a 100%);
  color: #2d2318;
  box-shadow:
    inset 0 0 0 1px #ad8c58,
    inset 1px 2px 0 #fef1ca55,
    0 10px 22px #0008;
}

.eg-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.62;
}

.eg-titulo {
  margin: 0;
  font-family: var(--fonte-display);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.eg-rotina {
  margin: 0;
  padding: 0.55rem 0.6rem;
  border-radius: 3px;
  background: rgba(59, 42, 25, 0.1);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(0.62rem, 0.9vw, 0.76rem);
  line-height: 1.45;
  white-space: pre-wrap;
}

.eg-bloco {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.35rem;
  border-top: 1px solid #ad8c5840;
}

.eg-registro {
  margin: 0;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}

.eg-placas {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}

.eg-placa-letra {
  width: 2rem;
  height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: linear-gradient(180deg, #4a3a28, #2a1f14);
  color: #e8d5b0;
  font-family: var(--fonte-display);
  font-size: 1.25rem;
  box-shadow: inset 0 0 0 1px #0008, 0 2px 4px #0005;
}

.eg-placas.reveladas .eg-placa-letra {
  color: #fff1ca;
  box-shadow: inset 0 0 0 1px #c4a06a88, 0 2px 6px #0006;
}

.eg-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.eg-botao {
  border: 1px solid #94754e;
  border-radius: 3px;
  min-height: 40px;
  padding: 0 14px;
  background: linear-gradient(#392a1f, #23180f);
  color: #e6d5ba;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 #bc955a55, 0 3px 8px #0008;
  cursor: pointer;
}

.eg-botao:hover:not(:disabled) {
  filter: brightness(1.15);
}

.eg-botao:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.eg-botao-primario {
  background: linear-gradient(#715431, #493117);
  border-color: #b79258;
  color: #fff1ca;
}

.eg-rodas {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.eg-roda {
  width: 2.55rem;
  height: 4.4rem;
  padding: 0;
  border: 1px solid #6a5335;
  border-radius: 3px;
  background: linear-gradient(#2a2118, #15100c);
  color: #e8d7b0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #0006;
}

.eg-roda:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.eg-roda-letra {
  font-family: var(--fonte-display);
  font-size: 0.95rem;
  line-height: 1;
}

.eg-roda-anterior,
.eg-roda-seguinte {
  opacity: 0.35;
  font-size: 0.75rem;
}

.eg-roda-atual {
  font-size: 1.35rem;
  font-weight: 600;
}

.eg-feedback {
  margin: 0;
  min-height: 2.4em;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #3a2c1d;
}

@media (max-width: 1180px) {
  .eg-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    gap: 10px;
    padding: 10px;
  }
}

@media (max-width: 980px) {
  .eg-layout {
    grid-template-columns: 1fr;
  }

  .eg-lateral {
    order: 2;
  }

  .eg-movel {
    order: 1;
  }
}

@media (max-width: 720px) {
  .eg-estante {
    grid-template-columns: repeat(4, 1fr);
  }

  .eg-gaveta.aberta .eg-gaveta-corpo {
    transform: translateZ(28px);
  }

  .eg-gaveta-topo {
    height: 28px;
    transform: translateZ(-28px) rotateX(90deg);
  }

  .eg-gaveta-lado {
    width: 28px;
  }
}



/* ===== E03 — Oito adagas (close-up sem folha) ===== */
.prop-carta-adagas {
  mix-blend-mode: lighten;
  filter: drop-shadow(0 8px 16px #000c);
  object-fit: contain;
}

.carta-adagas-palco {
  width: min(90vw, 34rem);
  min-height: auto;
}

.examinador--nas-maos .carta-adagas-palco {
  width: min(92vw, 36rem);
  background: transparent;
  box-shadow: none;
  padding: 0.5rem 0 1rem;
}

.carta-pergaminho {
  position: relative;
  width: min(86vw, 32rem);
  padding: 2.4rem 2.2rem 2.1rem;
  color: #2a1f14;
  background:
    radial-gradient(ellipse at 30% 18%, #f4e6c8 0%, transparent 55%),
    radial-gradient(ellipse at 78% 88%, #c4a574 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent 0 3px,
      rgba(90, 60, 30, 0.03) 3px 4px
    ),
    linear-gradient(155deg, #f0e0bf 0%, #e2c894 42%, #d2b07a 100%);
  border: 1px solid #a88958;
  border-radius: 3px 8px 4px 10px / 6px 3px 9px 4px;
  box-shadow:
    inset 0 0 0 1px #f7ebcf88,
    inset 0 -18px 30px #8a664033,
    0 14px 28px #000b;
  clip-path: polygon(
    1% 0.8%,
    98.5% 0%,
    100% 2%,
    99.2% 97.5%,
    97% 100%,
    2% 99.2%,
    0% 97%,
    0.6% 2%
  );
  filter: drop-shadow(0 14px 22px #000c);
}

.carta-pergaminho--reliquia {
  width: min(86vw, 32rem);
}

.carta-pergaminho::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.55rem;
  width: 0.85rem;
  height: 0.85rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c9a46a, #5a3f22 70%);
  box-shadow: 0 2px 4px #0008;
  pointer-events: none;
}

.carta-pergaminho__rotina {
  margin: 0.85rem 0 0;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--fonte-display);
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  line-height: 1.75;
  white-space: pre-wrap;
  color: #2c2116;
  text-align: left;
}

.ad-root {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  overflow: auto;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% -20%, #2f2923, #0d0c0b 69%);
}

.ad-scene {
  width: min(100%, 1200px);
  flex: 1;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1vw, 16px) clamp(8px, 1vw, 16px) 20px;
  pointer-events: none;
  box-sizing: border-box;
}

.ad-painel {
  width: 100%;
  pointer-events: auto;
  border-radius: 12px;
  padding: clamp(18px, 2vw, 32px);
  box-sizing: border-box;
  color: #e8dcc4;
  background:
    linear-gradient(180deg, #2a1d14ee, #140e0aee),
    repeating-linear-gradient(92deg, #3a2718 0 7px, #312113 7px 12px);
  box-shadow:
    0 28px 85px #000e,
    inset 0 0 0 3px #725037,
    inset 0 0 0 12px #29180e;
}

.ad-workspace {
  width: 100%;
}

.ad-grade {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: clamp(10px, 1.4vw, 20px);
  width: 100%;
}

.ad-adaga {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  min-height: clamp(180px, 24vh, 240px);
  padding: 0.55rem 0.2rem 0.55rem;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  color: #efe3c8;
  background: transparent;
  box-shadow: none;
}

.ad-adaga:focus-visible {
  outline: 2px solid #d3ba7e;
  outline-offset: 3px;
}

.ad-adaga:disabled {
  cursor: default;
  opacity: 0.92;
}

.ad-adaga__rotulo {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--fonte-display);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-shadow: 0 1px 4px #000c;
}

.ad-adaga__figura {
  display: block;
  width: 100%;
  max-width: 140px;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 10px 16px #000a);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.ad-adaga.ligada .ad-adaga__figura {
  filter:
    drop-shadow(0 0 12px #d4a84a44)
    drop-shadow(0 10px 16px #000a);
}

.ad-adaga:hover:not(:disabled) .ad-adaga__figura {
  transform: translateY(-2px);
}

.ad-voltar {
  pointer-events: auto;
}

@media (max-width: 560px) {
  .ad-grade {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, auto);
  }
}
/* ---------- Xadrez (Última Partida / C01D) ---------- */

.xz-root {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  overflow: auto;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% -20%, #2f2923, #0d0c0b 69%);
  opacity: 1;
  transition: opacity 1.4s ease;
}

.xz-root.xz-root--saindo {
  opacity: 0;
  pointer-events: none;
}

.xz-scene {
  width: min(100%, 1200px);
  flex: 1;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1vw, 16px) clamp(8px, 1vw, 16px) 20px;
  pointer-events: none;
  box-sizing: border-box;
}

.xz-painel {
  width: min(100%, 640px);
  pointer-events: auto;
  border-radius: 12px;
  padding: clamp(14px, 2vw, 28px);
  box-sizing: border-box;
  color: #e8dcc4;
  background:
    linear-gradient(180deg, #2a1d14ee, #140e0aee),
    repeating-linear-gradient(92deg, #3a2718 0 7px, #312113 7px 12px);
  box-shadow:
    0 28px 85px #000e,
    inset 0 0 0 3px #725037,
    inset 0 0 0 12px #29180e;
}

.xz-voltar {
  pointer-events: auto;
}

.xadrez-frases {
  text-align: center;
}

.frase-caca {
  margin: 0;
  font-family: var(--fonte-titulo);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-style: italic;
  line-height: 1.2;
  color: var(--osso);
}

.letras-caca {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.9rem 0 0.4rem;
}

.letra-caca {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.5rem;
  border-bottom: 2px solid rgba(232, 223, 205, 0.25);
  font-family: var(--fonte-display);
  font-size: 1.6rem;
  color: var(--brasa);
}

.letra-caca.preenchida {
  border-bottom-color: var(--brasa);
}

.tabuleiro-cena {
  display: flex;
  justify-content: center;
  padding: 0.6rem 0 1.2rem;
  perspective: 1200px;
}

.tabuleiro-moldura {
  padding: clamp(10px, 2.2vw, 22px);
  border-radius: 6px;
  background-image:
    linear-gradient(160deg, rgba(255, 220, 170, 0.08), rgba(0, 0, 0, 0.35)),
    repeating-linear-gradient(90deg, #4a2f18 0 7px, #3e2612 7px 11px, #54361d 11px 17px);
  background-size: cover;
  background-position: center;
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.7), inset 0 0 0 2px #1f130a;
  transform: rotateX(22deg);
  transform-origin: 50% 70%;
  transform-style: preserve-3d;
}

.tabuleiro-moldura.alerta {
  animation: xz-tremer 0.35s ease;
}

@keyframes xz-tremer {
  0%, 100% { transform: rotateX(22deg) translateX(0); }
  25% { transform: rotateX(22deg) translateX(-6px); }
  75% { transform: rotateX(22deg) translateX(6px); }
}

.palco-xadrez {
  position: relative;
  width: min(520px, 80vw);
  aspect-ratio: 1;
  transform-style: preserve-3d;
}

.grade-xadrez {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  box-shadow: 0 0 0 2px #1a0f06;
}

.casa-xadrez {
  position: relative;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.casa-xadrez.clara {
  background: linear-gradient(135deg, #c9ab7c, #b8996a);
}

.casa-xadrez.escura {
  background: linear-gradient(135deg, #5c3b20, #4a2e17);
}

.casa-xadrez:hover:not(:disabled) {
  box-shadow: inset 0 0 0 3px rgba(224, 162, 74, 0.7);
}

.casa-xadrez:disabled {
  cursor: default;
}

.casa-xadrez.rastro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(122, 32, 25, 0.35);
}

.letra-rastro {
  position: absolute;
  right: 6%;
  top: 4%;
  z-index: 1;
  font-family: var(--fonte-display);
  font-size: clamp(0.8rem, 1.6vw, 1.15rem);
  color: #f6e7c4;
  text-shadow: 0 1px 2px #000;
}

.coord {
  position: absolute;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.6rem;
  color: rgba(20, 12, 5, 0.7);
  pointer-events: none;
}

.casa-xadrez.escura .coord {
  color: rgba(240, 220, 190, 0.6);
}

.coord-fileira {
  left: 3px;
  top: 2px;
}

.coord-arquivo {
  right: 3px;
  bottom: 1px;
}

.pecas-xadrez {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-style: preserve-3d;
}

.peca {
  position: absolute;
  left: 0;
  top: 0;
  width: 12.5%;
  height: 12.5%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.42s cubic-bezier(0.3, 0.7, 0.3, 1), opacity 0.4s;
  transform-style: preserve-3d;
}

.peca-figura {
  display: block;
  font-size: clamp(1.6rem, 4.6vw, 2.7rem);
  line-height: 1;
  transform: rotateX(-22deg) translateY(-6%);
  transform-origin: 50% 100%;
}

.peca-inimiga .peca-figura {
  color: #1b1916;
  text-shadow: 0 1px 0 #6b655b, 0 -1px 0 #000, 0 6px 6px rgba(0, 0, 0, 0.55);
}

.peca-heroi .peca-figura {
  color: #efe6d2;
  text-shadow: 0 1px 0 #fff, 0 -1px 0 #7d715d, 0 6px 8px rgba(0, 0, 0, 0.6);
}

.peca.ameacando .peca-figura {
  color: #5c1410;
  text-shadow: 0 0 10px rgba(200, 40, 20, 0.8);
}

.peca.em-perigo .peca-figura {
  animation: xz-perigo-peca 0.7s ease-in-out infinite;
}

@keyframes xz-perigo-peca {
  0%, 100% { filter: none; }
  50% { filter: drop-shadow(0 0 8px rgba(220, 60, 30, 0.9)); }
}

.peca.caida .peca-figura {
  transform: rotateX(-22deg) rotate(80deg) translateY(10%);
  opacity: 0.4;
  transition: transform 0.5s, opacity 0.5s;
}

.peca.capturada,
.peca.tomado {
  opacity: 0;
}

.peca.em-mate .peca-figura {
  color: #6a1610;
}

.mensagem-xadrez {
  min-height: 1.6em;
  margin: 0;
  text-align: center;
  font-family: var(--fonte-titulo);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--osso);
}

.mensagem-xadrez[data-tipo="erro"] {
  color: var(--cinza);
}

.mensagem-xadrez[data-tipo="perigo"] {
  color: #d9593d;
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
}

.mensagem-xadrez[data-tipo="mate"] {
  color: var(--brasa);
  letter-spacing: 0.3em;
}

.acoes-xadrez {
  display: flex;
  justify-content: center;
  margin-top: 0.6rem;
}

/* ---------- Revelação final (créditos sobre a vila) ---------- */

.revelacao {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  background: #000;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.revelacao.visivel {
  opacity: 1;
}

.revelacao-fundo {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  pointer-events: none;
}

.revelacao-fundo.oculto {
  opacity: 0;
}

.revelacao-veu {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  opacity: 1;
  pointer-events: none;
}

.revelacao-veu.oculto {
  opacity: 0;
}

/* Capa preta: cobre a vila até o fade-in já escurecido */
.revelacao-capa {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #000;
  opacity: 1;
  transition: opacity 1.35s ease;
  pointer-events: none;
}

.revelacao-capa.saindo {
  opacity: 0;
}

.revelacao--chave {
  background: #000;
}

.revelacao-palco {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.creditos {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.7s ease;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.creditos.saindo {
  opacity: 0;
}

.rolo-creditos {
  position: absolute;
  left: 50%;
  top: 100%;
  width: min(44rem, 92vw);
  transform: translateX(-50%);
  text-align: center;
  animation: xz-subir-creditos var(--duracao, 80s) linear forwards;
}

@keyframes xz-subir-creditos {
  from { transform: translate(-50%, 0); }
  to { transform: translate(-50%, calc(-100% - 100vh)); }
}

.linha-credito {
  margin: 0 0 0.85rem;
  font-family: var(--fonte-titulo);
  font-size: clamp(1.45rem, 2.8vw, 2.05rem);
  font-style: italic;
  line-height: 1.35;
  color: #f7f1e4;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(0, 0, 0, 0.75);
}

.pausa-credito {
  display: block;
  height: 2.8rem;
}

.creditos-controles {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.creditos-velocidade {
  --progresso: 0%;
  display: grid;
  grid-template-columns: auto minmax(5.2rem, 7.5rem) 2rem;
  align-items: center;
  gap: 0.45rem;
  min-height: 32px;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(247, 241, 228, 0.55);
  border-radius: 2px;
  background: rgba(247, 241, 228, 0.12);
}

.creditos-velocidade-rotulo,
.creditos-velocidade-valor {
  font-family: var(--fonte-titulo);
  font-size: clamp(0.68rem, 1.3vw, 0.78rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f7f1e4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}

.creditos-velocidade-valor {
  justify-self: end;
  color: #ffe2a8;
  min-width: 1.9rem;
  text-align: right;
}

.creditos-velocidade-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.22rem;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(224, 162, 74, 0.95) 0%,
    rgba(224, 162, 74, 0.95) var(--progresso),
    rgba(247, 241, 228, 0.28) var(--progresso),
    rgba(247, 241, 228, 0.28) 100%
  );
  cursor: pointer;
  outline: none;
}

.creditos-velocidade-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 226, 168, 0.95);
  background: #e0a24a;
  box-shadow: 0 0 8px rgba(224, 162, 74, 0.4);
  cursor: grab;
}

.creditos-velocidade-slider::-moz-range-thumb {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 226, 168, 0.95);
  background: #e0a24a;
  box-shadow: 0 0 8px rgba(224, 162, 74, 0.4);
  cursor: grab;
}

.creditos-velocidade-slider::-moz-range-track {
  height: 0.22rem;
  border: none;
  background: transparent;
}

.creditos-velocidade-slider:focus-visible {
  outline: 1px solid rgba(247, 241, 228, 0.9);
  outline-offset: 3px;
}

.creditos-botao {
  min-height: 32px;
  min-width: 2.8rem;
  padding: 0.32rem 0.75rem;
  border: 1px solid rgba(247, 241, 228, 0.55);
  border-radius: 2px;
  background: rgba(247, 241, 228, 0.12);
  color: #f7f1e4;
  font-family: var(--fonte-titulo);
  font-size: clamp(0.72rem, 1.5vw, 0.85rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.creditos-botao:hover,
.creditos-botao:focus-visible {
  color: #fff8ec;
  border-color: rgba(247, 241, 228, 0.9);
  background: rgba(247, 241, 228, 0.22);
  outline: none;
}

.chave-final {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 2.2s ease, transform 2.2s ease;
}

.chave-final.surgindo {
  opacity: 1;
  transform: none;
}

.palavra-cavaleiro {
  margin: 0;
  font-family: var(--fonte-display);
  font-size: clamp(3.2rem, 12vw, 9rem);
  font-weight: 400;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: #efe4cc;
  text-shadow:
    0 0 12px rgba(224, 162, 74, 0.15),
    0 0 48px rgba(224, 162, 74, 0.35),
    0 0 90px rgba(224, 162, 74, 0.2),
    0 4px 24px #000;
  opacity: 0;
  transform: scale(0.82);
  filter: blur(6px);
}

.palavra-cavaleiro.revelando {
  animation: xz-revelar-cavaleiro 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes xz-revelar-cavaleiro {
  0% {
    opacity: 0;
    letter-spacing: 0.55em;
    transform: scale(0.82);
    filter: blur(6px);
  }
  45% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    transform: scale(1);
    filter: blur(0);
    text-shadow:
      0 0 18px rgba(224, 162, 74, 0.45),
      0 0 60px rgba(224, 162, 74, 0.35),
      0 0 110px rgba(224, 162, 74, 0.18),
      0 4px 24px #000;
  }
}

.sua-chave {
  margin: 0.4rem 0 0;
  font-size: clamp(1.15rem, 2.8vw, 1.65rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--latao);
  opacity: 0;
  animation: xz-aparecer-rodape 1.4s ease 2.4s forwards;
}

.chave-final.surgindo .sua-chave {
  animation-play-state: running;
}

@keyframes xz-aparecer-rodape {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.chave-final .botao-texto {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 5vh, 3rem);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  animation: xz-aparecer-menu 2.8s ease 5s forwards;
}

@keyframes xz-aparecer-menu {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
    pointer-events: none;
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabuleiro-moldura {
    transform: none;
  }

  .peca-figura {
    transform: none;
  }

  .rolo-creditos {
    animation: none;
    top: 12%;
    transform: translateX(-50%);
  }

  .palavra-cavaleiro {
    opacity: 1;
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    transform: none;
    filter: none;
    animation: none;
  }

  .sua-chave,
  .chave-final .botao-texto {
    opacity: 1;
    animation: none;
  }
}
