@font-face {
  font-family: Cronica;
  src: url("fontes/cronica.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: Cronica;
  src: url("fontes/cronica-italica.woff") format("woff");
  font-style: italic;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --noite: #15100e;
  --texto: #f2e6d2;
  --suave: #d4bfa3;
  --ouro: #dfbc82;
  --linha: #6c5137;
  --serif: Cronica, Georgia, serif;
  --ui: system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--noite); color: var(--texto); font: 1rem/1.55 var(--serif); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid #ffe39f; outline-offset: 4px; }
.entrada {
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 2.5rem;
  background: radial-gradient(ellipse at 50% 68%, #553820, #130e0d 72%);
}
.entrada-fundo, .entrada-fundo img, .entrada::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.entrada-fundo { z-index: -3; }
.entrada-fundo img { object-fit: cover; object-position: center 56%; }
.entrada::before {
  content: "";
  z-index: -2;
  background: radial-gradient(ellipse at 50% 52%, #120c0980, transparent 50%),
              radial-gradient(ellipse at 50% 55%, transparent 38%, #080605ae);
}
.moldura { position: absolute; inset: clamp(.75rem, 3vw, 2rem); border: 1px solid #c69f6345; pointer-events: none; }
.moldura span { position: absolute; width: 1.3rem; height: 1.3rem; border: 0 solid #d0a974a3; }
.moldura span:nth-child(1) { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.moldura span:nth-child(2) { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.moldura span:nth-child(3) { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.moldura span:nth-child(4) { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.placa {
  position: relative;
  text-decoration: none;
  text-align: center;
  color: #ffebc5;
  line-height: 1.25;
  font-size: clamp(1.12rem, 3.3vw, 1.85rem);
  padding: clamp(1.2rem, 4vw, 1.9rem) clamp(1.25rem, 6vw, 3.5rem);
  background: linear-gradient(112deg, #52351d40, transparent 34%, #774d2435 68%, transparent), linear-gradient(#39281d, #211711 54%, #372419);
  border: 1px solid #c8a56e;
  box-shadow: 0 0 0 4px #1a110c, 0 0 0 5px #a4814b80, 0 16px 45px #000b, inset 0 0 20px #0005;
  text-shadow: 0 2px 4px #000;
  transition: color .22s, box-shadow .22s;
}
.placa::before, .placa::after { content: ""; position: absolute; background: #cca778; width: 6px; height: 6px; top: calc(50% - 3px); transform: rotate(45deg); }
.placa::before { left: .6rem; }
.placa::after { right: .6rem; }
.placa:hover { color: #fff3d7; box-shadow: 0 0 0 4px #1a110c, 0 0 0 5px #c8a56e, 0 12px 45px #ab642e60, inset 0 0 26px #ba773237; }
.quebra-movel { display: none; }
.brasas { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.brasas i { position: absolute; top: 76%; left: 24%; width: 3px; height: 3px; border-radius: 50%; background: #e4ab64; box-shadow: 0 0 10px #f28e43; animation: brasa 9s linear infinite; opacity: 0; }
.brasas i:nth-child(2) { left: 33%; animation-delay: -5s; }
.brasas i:nth-child(3) { left: 69%; animation-delay: -2s; }
.brasas i:nth-child(4) { left: 76%; animation-delay: -6s; }
.brasas i:nth-child(5) { left: 79%; animation-delay: -3s; }
@keyframes brasa { 20%, 66% { opacity: .6; } 100% { transform: translate(25px,-140px); } }
@keyframes revelar { from { opacity: 0; translate: 0 7px; } to { opacity: 1; translate: 0; } }
#catalogo { animation: revelar .47s ease-out both; background: radial-gradient(ellipse at 50% 14rem, #2d2019 0, #17110f 34rem, #15100e 55rem); }
.cabecalho {
  text-align: center;
  padding: clamp(2.75rem, 7vw, 6.25rem) 1rem clamp(2.2rem, 5vw, 3.7rem);
  border-bottom: 1px solid #96724b54;
  position: relative;
  isolation: isolate;
}
.cabecalho::before {
  position: absolute;
  content: "";
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 5%, #72503365, transparent 66%),
              repeating-linear-gradient(126deg, transparent 0 13px, #b6966e08 14px, transparent 15px 26px);
}
.ornamento { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-bottom: 1.15rem; color: #bd955d; }
.ornamento::before, .ornamento::after { content: ""; width: min(16vw, 5rem); height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.ornamento::after { scale: -1 1; }
.ornamento span { width: .52rem; height: .52rem; transform: rotate(45deg); border: 1px solid currentColor; }
h1, h2, h3, p { margin: 0; }
h1 { color: #f6dfb6; font-size: clamp(2rem, 6.2vw, 4.7rem); font-weight: 400; letter-spacing: -.05em; line-height: 1.06; text-wrap: balance; }
.cabecalho p { color: var(--suave); margin: 1.1rem auto 0; font-size: clamp(1rem, 2.1vw, 1.23rem); font-style: italic; text-wrap: balance; }
.acervo { max-width: 80rem; margin: auto; padding: 1.65rem clamp(1rem, 4vw, 3rem) 4rem; }
.controles-catalogo { margin-bottom: 1.1rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .55rem; font-size: .875rem; color: var(--suave); }
#opcoes-filtro { display: flex; flex-wrap: wrap; gap: .38rem; }
#opcoes-filtro button {
  min-height: 44px;
  border: 1px solid #6d5239;
  padding: .34rem .72rem;
  background: #211814;
  color: #e3cfb0;
  font: .875rem/1.25 var(--ui);
}
#opcoes-filtro button[aria-pressed="true"] { color: #21160c; background: #dfbd86; border-color: #dfbd86; }
#opcoes-filtro button:hover:not([aria-pressed="true"]) { border-color: #d7aa73; }
#resultado { min-height: 1.2em; margin-top: .75rem; color: var(--suave); font: .875rem/1.5 var(--ui); }
#resultado button { min-height: 44px; margin-top: .65rem; background: #352519; border: 1px solid var(--linha); padding-inline: .75rem; }
.personagens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.8rem, 2vw, 1.5rem); }
.personagens article { min-width: 0; }
.card {
  --acento: #d7b17a;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-decoration: none;
  background: linear-gradient(160deg, #2c211b, #211815 65%);
  border: 1px solid #745840;
  box-shadow: 0 10px 22px #08050255;
  transition: border-color .2s, transform .2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--acento); }
.selo {
  height: 6.1rem;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-bottom: 1px solid #82624480;
  background: radial-gradient(ellipse, #5e432d 0%, #291c16 62%, #211611 100%);
  background: radial-gradient(ellipse, color-mix(in srgb, var(--acento) 28%, #2d1d15), #291c16 65%, #201611 100%);
}
.selo::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #b38f605f;
  background: repeating-linear-gradient(132deg, transparent 0 5px, #d5ac720b 6px, transparent 7px 12px);
}
.selo::after { content: ""; position: absolute; width: 3.9rem; height: 3.9rem; border: 1px solid #d5ad717d; outline: 1px solid #d5ad7133; outline-offset: 4px; transform: rotate(45deg); }
.selo img { width: 3.4rem; height: 3.4rem; z-index: 1; object-fit: contain; }
.card-corpo { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.15rem 0; }
.card h2 { color: #fff0d5; font-size: clamp(1.22rem, 2vw, 1.52rem); font-weight: normal; line-height: 1.18; overflow-wrap: anywhere; }
.epiteto { margin: .2rem 0 0; color: var(--acento); font-size: .9rem; font-style: italic; }
.identidade { color: #dfc9aa; font: .875rem/1.4 var(--ui); margin-top: .58rem; }
.historia { font-size: 1rem; margin-top: .85rem; }
.personalidade { color: #d4bfa7; font-size: .96rem; font-style: italic; margin-top: .48rem; }
.jogo { margin-top: auto; padding-top: .85rem; }
.funcao { color: var(--acento); font: 600 .875rem/1.4 var(--ui); }
.combate { color: #e4d6c3; font-size: .96rem; margin-top: .28rem; }
.niveis-ficha {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  margin-top: .9rem;
  padding-block: .75rem;
  border-top: 1px solid #a480554f;
}
.abrir-ficha {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: .25rem .15rem;
  border: 1px solid #92704e;
  border-radius: 2px;
  background: linear-gradient(160deg, #4c3625, #302219);
  color: #f1d9ad;
  font: 600 .875rem/1.25 var(--ui);
  text-align: center;
  text-decoration: none;
}
.abrir-ficha:hover { border-color: var(--acento); background: #56402d; color: #fff0d5; }
body.lendo { overflow: hidden; }
dialog {
  width: min(64rem, calc(100% - 2rem));
  max-width: none;
  max-height: none;
  height: min(900px, calc(100dvh - 2rem));
  padding: 0;
  border: 1px solid #99734c;
  color: var(--texto);
  background: #211814;
  box-shadow: 0 0 0 3px #3f2c1e, 0 15px 60px #050302b5;
  overflow: hidden;
}
dialog[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
dialog::backdrop { background: #0f0907d9; }
.ficha-topo { padding: .45rem clamp(.65rem, 3vw, 1.4rem); background: linear-gradient(150deg,#3a2b21,#281c16 75%); }
.ficha-cabecalho, .ficha-links, .ficha-controles, .grupo-controles { display: flex; align-items: center; }
.ficha-cabecalho { justify-content: space-between; gap: .65rem; }
.ficha-topo h2 { color: #fee8be; font-weight: 400; font-size: clamp(1rem, 3vw, 1.65rem); line-height: 1.2; overflow-wrap: anywhere; }
#ficha-classe { margin-top: .25rem; color: #e2c7a2; font: .8125rem/1.3 var(--ui); }
.ficha-links { flex-wrap: wrap; column-gap: 1.1rem; }
.ficha-links a, .botao-voltar { min-height: 44px; display: inline-flex; align-items: center; color: #fbdeb1; font: .875rem/1.25 var(--ui); }
.botao-voltar { flex: 0 0 auto; background: #322216; padding: .3rem .65rem; border: 1px solid #795a3b; }
.ficha-controles { justify-content: center; flex-wrap: wrap; gap: .15rem .7rem; padding: .25rem; border-block: 1px solid #74583d; background: #231914; }
.grupo-controles button, .grupo-controles output { min-width: 44px; min-height: 44px; display: grid; place-items: center; font: .9375rem/1 var(--ui); }
.grupo-controles button { padding: .2rem .45rem; background: #33251b; border: 1px solid #6b4f37; }
.grupo-controles button:disabled { opacity: .5; cursor: default; }
.grupo-controles button:enabled:hover { border-color: var(--ouro); }
.grupo-controles output { padding-inline: .4rem; }
.suporte-pdf { overflow: auto; overscroll-behavior: contain; background: #1a120f; padding: .65rem; }
.suporte-pdf canvas { display: block; margin-inline: auto; background: white; box-shadow: 0 2px 12px #0009; }
#estado-pdf { color: var(--suave); text-align: center; font: .95rem/1.5 var(--ui); margin: 1.2rem auto; }
#estado-pdf:empty { display: none; }
noscript { display: block; padding: .75rem; text-align: center; }
@media (max-width: 920px) { .personagens { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 580px) {
  .personagens { grid-template-columns: minmax(0,1fr); }
  .quebra-movel { display: initial; }
  .entrada { padding: 1.55rem; }
  .placa { max-width: 100%; }
  dialog { width: 100%; height: 100dvh; margin: 0; border-inline: 0; }
  #ajustar { min-width: 48px; }
  .selo { height: 5.45rem; }
  .selo::after { width: 3.2rem; height: 3.2rem; }
  .selo img { width: 3rem; height: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
