/* ==========================================================================
   TAROT SPREADS · style.css
   ==========================================================================
   ÍNDICE (procure pelo número, ex.: "== 5."):
   1. VARIÁVEIS DO TEMA
   2. BASE
   3. LAYOUT
   4. COMPONENTES
   5. TIRAGENS E MESA
   6. BIBLIOTECA E HISTÓRICO
   7. JANELAS
   8. CARREGAMENTO
   9. EFEITOS
   10. PÁGINA 404

   DICAS
   - A ordem das partes importa: regras mais abaixo podem sobrescrever as de cima.
   - Para mudar cores e arredondados, edite só a parte 1.
   - Cada parte começa com um cabeçalho como este para facilitar a busca.
   ========================================================================== */


/* ==========================================================================
   == 1. VARIÁVEIS DO TEMA
   Cores, raios, espaçamentos e sombras. Mude aqui para alterar o visual do site inteiro.
   ========================================================================== */

:root {
  --bg: #101211;
  --s: #151817;
  --plum: #48252f;
  --gold: #c9b896;
  --ink: #f7ecdc;
  --mu: #e0d6c4; /* clareado para melhor contraste em textos secundários */
  --r1: 10px;
  --rc: 4px;
  --r2: 16px;
  --r3: 24px;
  --p1: 12px;
  --p2: 20px;
  --p3: 32px;
  --bev: inset 0 1px 0 rgba(243, 230, 208, 0.05);
  --pb: inset 0 1px 0 rgba(255, 255, 255, 0.35);

  --sh:
    0 1px 2px rgba(0, 0, 0, 0.42), 0 3px 6px rgba(0, 0, 0, 0.28), 0 8px 18px rgba(0, 0, 0, 0.22);
  --sh2:
    0 2px 3px rgba(0, 0, 0, 0.44), 0 8px 16px rgba(0, 0, 0, 0.3), 0 18px 34px rgba(0, 0, 0, 0.3);
  --sh0: 0 1px 1px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.28);

  --lift1:
    0 2px 3px rgba(0, 0, 0, 0.4), 0 6px 12px rgba(0, 0, 0, 0.3), 0 14px 26px rgba(0, 0, 0, 0.26);
  --lift2:
    0 4px 6px rgba(0, 0, 0, 0.38), 0 14px 26px rgba(0, 0, 0, 0.34), 0 28px 52px rgba(0, 0, 0, 0.3);
  --press: 0 1px 1px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);

  --up: var(--bev), var(--sh);
  --up2: var(--bev), var(--sh2);
  --dn: inset 0 0 0 1px rgba(231, 212, 187, 0.1);

  --hole:
    inset 0 1px 0 rgba(0, 0, 0, 0.6), inset 0 2px 3px rgba(0, 0, 0, 0.5),
    inset 0 7px 16px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(243, 230, 208, 0.05),
    inset 0 0 24px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(243, 230, 208, 0.06);

  --hole-soft:
    inset 0 1px 1px rgba(0, 0, 0, 0.55), inset 0 3px 7px rgba(0, 0, 0, 0.4),
    inset 0 -1px 0 rgba(243, 230, 208, 0.045), inset 0 0 14px rgba(0, 0, 0, 0.18);
}


/* ==========================================================================
   == 2. BASE
   Reset, tipografia, barras de rolagem, proteção de imagens/texto e animações compartilhadas.
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(231, 212, 187, 0.16);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(231, 212, 187, 0.3);
  background-clip: content-box;
}

* {
  box-sizing: border-box;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(231, 212, 187, 0.18) transparent;
}

/* === PÁGINA E TEXTO === */

html {
  background: var(--bg);
  color: var(--ink);
  font:
    400 16px/1.65 "Marcellus",
    "Marcellus Fallback",
    Georgia,
    "Times New Roman",
    serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100vh;
  padding-bottom: 160px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input {
  -webkit-user-select: text;
  user-select: text;
}

::selection {
  background: transparent;
}

input::selection {
  background: rgba(243, 230, 208, 0.25);
}

button,
input {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

html.lock {
  overflow: hidden;
}

/* === ATRIBUTO [hidden] === */

[hidden] {
  display: none !important;
}

/* === ANIMAÇÕES COMPARTILHADAS === */

@keyframes in {
  from {
    opacity: 0;
  }
}

@keyframes out {
  to {
    opacity: 0;
  }
}

@keyframes sh {
  to {
    background-position: -220% 0;
  }
}

/* === FONTE DE RESERVA (evita pulo de layout) === */

@font-face {
  font-family: "Marcellus Fallback";
  src: local("Times New Roman");
  size-adjust: 104%;
  ascent-override: 90%;
  descent-override: 24%;
  line-gap-override: 0%;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* === PROTEÇÃO DE IMAGENS E TEXTO ===
   Barreira contra cópia casual (veja também assets/js/protection.js).
   O texto do corpo não é selecionável; o campo de busca continua normal (regra "input" acima). */

img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* As cartas não recebem clique direto: o clique vai para o botão/cartão ao redor. */
img.im {
  pointer-events: none;
}


/* ==========================================================================
   == 3. LAYOUT
   Cabeçalho, páginas, títulos e menu inferior (dock).
   ========================================================================== */

/* === CABEÇALHO === */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px var(--p1);
  max-width: 960px;
  margin: auto;
  padding: 24px 24px 0;
}

.top h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.top small {
  display: block;
  color: var(--mu);
  font-size: 12px;
}

.top a {
  color: var(--ink);
}

.top a.by {
  text-decoration: none;
  font-weight: 700;
}

.top > div:first-child {
  min-width: 0;
  margin-right: 8px;
}

/* === PÁGINA E TÍTULOS === */

.wrap {
  max-width: 960px;
  margin: auto;
  padding: 40px 24px;
}

.view.fade {
  animation: in 0.15s ease;
}

.view.out {
  animation: out 0.08s ease forwards;
}

.head {
  margin-bottom: 40px;
}

.hr {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

h2 {
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 18px;
  font-weight: 700;
}

.sub {
  color: var(--mu);
  max-width: 56ch;
  margin-top: 14px;
}

@media (max-width: 520px) {
  .wrap {
    padding: 28px 18px;
  }
}

.dock {
  --i: 1;
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  display: flex;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r3);
  background: #171a19;
  box-shadow:
    var(--bev),
    0 2px 3px rgba(0, 0, 0, 0.4),
    0 8px 16px rgba(0, 0, 0, 0.35),
    0 18px 32px rgba(0, 0, 0, 0.35);
  z-index: 20;
  view-transition-name: dock;
}

.tab {
  flex: 1;
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--r2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--mu);
  transition: color 0.1s;
}

.tab .ic {
  transition: transform 0.1s;
}

.tab:active .ic {
  transform: scale(0.94);
}

.tab[aria-current] {
  color: var(--gold);
  font-weight: 800;
}

@media (hover: hover) {
  .tab:hover {
    color: var(--ink);
  }
}

.fine {
  color: var(--gold);
  font-size: 13px;
  text-align: center;
  margin-top: 56px;
}

.top h1 a.home {
  text-decoration: none;
}

/* === AÇÕES DO CABEÇALHO === */

.tact {
  display: flex;
  flex-wrap: wrap; /* em telas estreitas os botões quebram de linha em vez de estourar */
  align-items: center;
  gap: var(--p1);
}


/* ==========================================================================
   == 4. COMPONENTES
   Ícones, botões, dicas (tooltip), aviso rápido (toast), cookies, puxar para atualizar e menu de idiomas.
   ========================================================================== */

/* === ÍCONES (Iconify) === */

.ic {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: none;
}

.ic iconify-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  font-size: 22px;
  transition:
    opacity 0.12s ease,
    transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ic .fi {
  opacity: 0;
  transform: scale(0.78);
}

.tab[aria-current] .ic.p iconify-icon:first-child,
.ok .ic.p iconify-icon:first-child {
  opacity: 0;
  transform: scale(1.12);
}

.tab[aria-current] .ic .fi,
.ok .ic .fi {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  :is(.btn, .tab, .ib, .inf, .lc):hover .ic.p iconify-icon:first-child {
    opacity: 0;
    transform: scale(1.12);
  }

  :is(.btn, .tab, .ib, .inf, .lc):hover .ic .fi {
    opacity: 1;
    transform: none;
  }
}

/* === BOTÃO DE ÍCONE (.ib) E BOTÃO DE IDIOMA/CAFÉ === */

.ib {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r2);
  background: var(--s);
  box-shadow: var(--up);
  color: var(--mu);
  transition: 0.1s;
}

.ib:hover {
  color: var(--ink);
}

.ib:active {
  transform: translateY(1px);
  box-shadow: var(--bev), var(--press);
}

/* === BOTÃO DE INFORMAÇÃO (.inf) === */

.inf {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--r1);
  color: var(--mu);
  transition: 0.1s;
  position: relative;
}

.inf:hover {
  color: var(--ink);
}

.inf .ic {
  width: 22px;
  height: 22px;
}

/* === BOTÕES (.btn) === */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  border-radius: var(--r2);
  background: #181b1a;
  box-shadow: var(--up);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  transition: 0.1s;
  min-height: 48px;
  justify-content: center;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--bev), var(--lift1);
  }

  .pri:hover {
    box-shadow: var(--pb), var(--lift1);
  }
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--bev), var(--press);
}

.pri:active {
  box-shadow: var(--pb), var(--press);
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.pri {
  background: linear-gradient(180deg, #f3e5cf, #dcc6a6);
  color: var(--bg);
  box-shadow: var(--pb), var(--sh);
}

.btn.ok {
  color: var(--ink);
  background: linear-gradient(150deg, #573040, #3b1f27);
}

.dng {
  background: var(--plum);
}

.acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

/* === DICA (tooltip) === */

#tip {
  isolation: isolate;
  position: fixed;
  z-index: 70;
  max-width: 260px;
  padding: 12px 16px;
  border-radius: var(--r2);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.4),
    inset 1px 1px 0 rgba(255, 255, 255, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.06s;
}

#tip.on {
  opacity: 1;
}

#tip::after {
  content: "";
  position: absolute;
  left: var(--ax, 50%);
  bottom: -6px;
  width: 14px;
  height: 14px;
  background: var(--ink);
  border-radius: 3px;
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}

#tip.b::after {
  bottom: auto;
  top: -6px;
}

/* === AVISO RÁPIDO (toast) === */

.toast {
  position: fixed;
  left: 50%;
  top: 20px;
  transform: translate(-50%, -80px);
  padding: 12px 20px;
  border-radius: var(--r2);
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.4),
    inset 1px 1px 0 rgba(255, 255, 255, 0.45);
  transition: 0.14s;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.on {
  transform: translate(-50%, 0);
}

.inf::after {
  content: "";
  position: absolute;
  inset: -8px;
}

@media (max-width: 520px) {
  .acts {
    gap: 10px;
  }

  .acts .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 14px;
  }
}

.btn .ic.r {
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn:active .ic.r {
  transform: rotate(360deg);
}

@media (hover: hover) {
  .btn:hover .ic.r {
    transform: rotate(180deg);
  }
}

/* === AVISO DE COOKIES === */

.cookie {
  position: fixed;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 92px);
  transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--r3);
  background: var(--s);
  box-shadow: var(--up2);
  z-index: 30;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mu);
}

.cookie p {
  flex: 1;
}

.cookie .btn {
  flex: none;
  min-height: 44px;
  padding: 10px 18px;
}

@media (max-width: 520px) {
  .cookie {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie .btn {
    width: 100%;
  }
}

.tring {
  flex: none;
  width: 22px;
  height: 22px;
}

.tring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.tring circle {
  fill: none;
  stroke-width: 2.6;
}

.tk {
  stroke: rgba(16, 18, 17, 0.18);
}

.tp {
  stroke: var(--bg);
  stroke-linecap: round;
  stroke-dasharray: 56.55;
  stroke-dashoffset: 0;
}

.toast.run .tp {
  animation: tcd var(--td, 1.6s) linear forwards;
}

@keyframes tcd {
  to {
    stroke-dashoffset: 56.55;
  }
}

/* === PUXAR PARA ATUALIZAR === */

.ptr {
  --pull: 0px;
  --prog: 0;
  position: fixed;
  z-index: 90;
  top: env(safe-area-inset-top, 0px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  background: var(--s);
  box-shadow: var(--up2);
  color: var(--mu);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(var(--pull) - 64px));
  transition:
    opacity 0.1s,
    transform 0.14s cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.1s;
}

.ptr.pulling {
  opacity: var(--prog);
  transition: color 0.1s;
}

.ptr.armed {
  color: var(--gold);
}

.ptr.busy {
  opacity: 1;
  color: var(--gold);
}

.pring {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.pring svg:first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pring circle {
  fill: none;
  stroke-width: 3;
}

.pk {
  stroke: rgba(231, 212, 187, 0.15);
}

.pg {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 94.25;
  stroke-dashoffset: calc(94.25 * (1 - var(--prog)));
}

.parrow {
  width: 18px;
  height: 18px;
  transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ptr.armed .parrow {
  transform: rotate(180deg);
}

.ptr.busy .parrow {
  opacity: 0;
}

.ptr.busy .pring svg:first-child {
  animation: spin 0.5s linear infinite;
}

.ptr.busy .pg {
  stroke-dashoffset: 70;
}

.ib.cof,
.ib.lang {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  padding: 0 18px 0 14px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.ib.cof:hover,
.ib.lang:hover {
  color: var(--ink);
}

/* === JANELA DE IDIOMAS ===
   Abre ao clicar no botão de idioma. Reaproveita o visual da lista de sugestões (.sug). */

.langbox {
  position: relative;
}

.ib.lang {
  cursor: pointer;
}

.langbox .langmenu {
  left: 0; /* abre para a direita: nunca sai da tela, mesmo quando o botão quebra de linha no celular */
  right: auto;
  min-width: 190px;
}

.langbox .langmenu li[aria-current="true"] {
  color: var(--ink);
}


/* ==========================================================================
   == 5. TIRAGENS E MESA
   Cartões de tiragem, tabuleiro, legenda e baralho.
   ========================================================================== */

/* === PAINEL DA MESA === */

.panel {
  background: var(--s);
  border-radius: var(--r3);
  box-shadow: var(--up);
  padding: 36px 28px;
}

/* === CARTÕES DE TIRAGEM === */

.spreads {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.spread {
  --ty: 0px;
  position: relative;
  display: grid;
  gap: 14px;
  align-content: start;
  text-align: left;
  padding: 28px 24px;
  border-radius: var(--r3);
  background: linear-gradient(150deg, #1c201e, #111413);
  box-shadow:
    var(--bev),
    0 2px 3px rgba(0, 0, 0, 0.4),
    0 8px 16px rgba(0, 0, 0, 0.35),
    0 18px 32px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.1s ease-out,
    box-shadow 0.14s;
  transform: perspective(900px) translateY(var(--ty)) rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
}

.spread::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--gx, 50%) var(--gy, 0%),
    rgba(243, 230, 208, 0.05),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.14s;
  pointer-events: none;
  transform: translateZ(1px);
}

@media (hover: hover) {
  .spread:hover {
    --ty: -4px;
    box-shadow: var(--bev), var(--lift2);
  }

  .spread:hover::before {
    opacity: 1;
  }
}

.spread.on {
  --ty: -2px;
  background: linear-gradient(150deg, #5e3545, #381d26);
  box-shadow:
    inset 0 1px 0 rgba(243, 230, 208, 0.12),
    0 2px 3px rgba(0, 0, 0, 0.4),
    0 8px 16px rgba(0, 0, 0, 0.35),
    0 18px 32px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) {
  .spread.on:hover {
    --ty: -4px;
    box-shadow:
      inset 0 1px 0 rgba(243, 230, 208, 0.12),
      var(--lift2);
  }
}

.spread b {
  font-size: 17px;
}

.spread small {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.spread.on small {
  color: var(--ink);
}

.mini {
  --w: min(
    46px,
    calc(200px / var(--cols) - 5px),
    calc((172px - (var(--rows) - 1) * 5px) / var(--rows) * 2 / 3)
  );
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--w));
  grid-auto-rows: calc(var(--w) * 3 / 2);
  gap: 5px;
  justify-content: center;
  align-content: center;
  width: 100%;
  height: 190px;
  margin-bottom: 14px;
  border-radius: var(--r2);
  transform: translateZ(20px);
}

.mini i {
  grid-column: var(--c);
  grid-row: var(--r);
  border-radius: 2px;
  background: url(../images/cards/back.webp) center/cover var(--plum);
  box-shadow:
    inset 0 0 0 1px rgba(231, 212, 187, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.42);
  transition: translate 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mini i.x {
  transform: rotate(90deg) scale(0.62);
  z-index: 1;
  box-shadow:
    inset 0 0 0 1px rgba(231, 212, 187, 0.45),
    2px 4px 8px rgba(0, 0, 0, 0.7);
}

.spread:hover .mini i {
  translate: 0 -2px;
}

.spread p {
  color: var(--mu);
  font-size: 15px;
  line-height: 1.55;
}

.meta {
  color: var(--mu);
  font-size: 14px;
  margin-top: 10px;
}

/* === TABULEIRO === */

.board {
  --cw: max(
    58px,
    min(
      128px,
      calc((100vw - 96px - (var(--cols) - 1) * 12px) / var(--cols)),
      calc((880px - (var(--cols) - 1) * 12px) / var(--cols))
    )
  );
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cw));
  gap: 14px 12px;
  justify-content: safe center;
  margin: 40px 0 28px;
  overflow-x: auto;
  padding: 12px 6px 16px;
}

.slot {
  grid-column: var(--c);
  grid-row: var(--r);
  aspect-ratio: 2 / 3;
  border-radius: var(--rc);
  background: var(--bg);
  box-shadow: var(--hole);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-weight: 700;
  overflow: hidden;
}

.slot.f {
  box-shadow: var(--up);
  cursor: pointer;
  transition: 0.1s;
  background: var(--plum);
}

.slot.f:hover {
  transform: translateY(-2px);
  box-shadow: var(--up2);
}

.slot,
.mi {
  position: relative;
}

.slot.f::after,
.mi::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.slot.x.f {
  transform: rotate(90deg) scale(0.72);
  z-index: 2;
}

.slot.x.f:hover {
  transform: rotate(90deg) scale(0.76);
}

.flip {
  animation: fl 0.18s ease;
}

@keyframes fl {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}

/* === LEGENDA === */

.leg {
  display: grid;
  gap: 6px;
  margin-top: 32px;
}

.leg button {
  display: flex;
  gap: 16px;
  align-items: baseline;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--r1);
  font-size: 14px;
  color: var(--mu);
  transition: 0.1s;
  min-height: 44px;
}

.leg button.f:hover {
  background: var(--bg);
  color: var(--ink);
}

.leg i {
  font-style: normal;
  font-weight: 800;
  color: var(--gold);
  min-width: 18px;
}

.leg em {
  font-style: normal;
  color: var(--ink);
  font-weight: 700;
  margin-left: auto;
  text-align: right;
}

/* === BARALHO VIRADO === */

.deckh {
  margin: 48px 0 24px;
}

.deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 12px;
}

.back {
  aspect-ratio: 2 / 3;
  border-radius: var(--rc);
  background: url(../images/cards/back.webp) center/cover var(--plum);
  box-shadow: var(--up);
  transition: 0.1s;
}

.back:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--bev), var(--lift1);
}

.back:disabled {
  background: var(--bg);
  box-shadow: var(--hole);
  cursor: default;
}

.back:active:not(:disabled) {
  transform: scale(0.97);
}

@media (max-width: 520px) {
  .mini {
    height: 176px;
  }

  .panel {
    padding: 28px 18px;
  }
}

#hHint {
  margin: 0;
}


/* ==========================================================================
   == 6. BIBLIOTECA E HISTÓRICO
   Busca, filtros, grade de cartas e leituras salvas.
   ========================================================================== */

.lc img,
.th img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* === BUSCA === */

.search {
  position: relative;
}

.search .ic {
  position: absolute;
  left: 16px;
  top: 50%;
  margin-top: -11px;
  color: var(--mu);
}

.search input {
  width: 100%;
  padding: 15px 52px 15px 50px;
  border-radius: var(--r2);
  background: var(--bg);
  box-shadow: var(--hole);
  -webkit-appearance: none;
  appearance: none;
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search input::placeholder {
  color: var(--gold);
}

/* === FILTROS === */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 40px;
}

.chip {
  padding: 8px 16px;
  border-radius: var(--r1);
  background: var(--s);
  box-shadow: var(--up);
  font-size: 13px;
  font-weight: 700;
  color: var(--mu);
  transition: 0.1s;
  min-height: 40px;
}

.chip.on {
  color: var(--gold);
  background: var(--bg);
  box-shadow: var(--hole-soft);
}

/* === GRADE DE CARTAS === */

.lib {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr));
  gap: 32px 20px;
}

.lc {
  display: grid;
  gap: 12px;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--mu);
  overflow-wrap: anywhere;
  transition: color 0.1s;
}

.w {
  display: block;
  aspect-ratio: 2 / 3;
}

.c {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--rc);
  background: var(--plum);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 5px 10px rgba(0, 0, 0, 0.36);
  transition:
    transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.1s;
}

.c::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.lc:active .c,
.th button:active .c {
  transform: scale(0.98);
}

@media (hover: hover) {
  .lc:hover {
    color: var(--ink);
  }

  .lc:hover .c,
  .th button:hover .c {
    transform: translateY(-2px);
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.5),
      0 12px 22px rgba(0, 0, 0, 0.46);
  }
}

@media (max-width: 520px) {
  .lib {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 100px), 1fr));
    gap: 24px 14px;
  }

  .lc {
    font-size: 12px;
    gap: 10px;
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: var(--p2) -18px 28px;
    padding: 4px 18px 10px;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: none;
  }

  .search input {
    padding-block: 13px;
  }
}

.empty {
  color: var(--mu);
  text-align: center;
  padding: 48px 24px;
  grid-column: 1 / -1;
  width: 100%;
}

/* === HISTÓRICO === */

.hi {
  padding: 28px 24px;
  border-radius: var(--r3);
  background: var(--s);
  box-shadow: var(--up);
  margin-bottom: 28px;
}

.hh {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--p1);
  flex-wrap: wrap;
}

.hh span {
  color: var(--mu);
  font-size: 13px;
}

.th {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  margin: 0 -6px;
  padding: 14px 6px 16px;
  scroll-snap-type: x proximity;
}

.th button {
  flex: none;
  width: 72px;
  scroll-snap-align: start;
  border-radius: var(--rc);
}

.hl {
  display: grid;
  gap: 12px;
  font-size: 14px;
  color: var(--mu);
}

.hl b {
  color: var(--ink);
}

/* === LIMPAR BUSCA E SUGESTÕES === */

.sclr {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--mu);
  transition:
    color 0.1s,
    background 0.1s;
}

.sclr:hover {
  color: var(--ink);
  background: rgba(231, 212, 187, 0.08);
}

.sug {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  padding: 8px;
  list-style: none;
  border-radius: var(--r2);
  background: var(--s);
  box-shadow: var(--up2);
}

.sug li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--p1);
  padding: 11px 14px;
  border-radius: var(--r1);
  color: var(--mu);
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
  transition:
    background 0.08s,
    color 0.08s;
}

.sug li b {
  color: var(--gold);
  font-weight: 700;
}

.sug li small {
  flex: none;
  color: var(--gold);
  font-size: 12px;
  opacity: 0.8;
}

.sug li.on,
.sug li:hover {
  color: var(--ink);
  background: var(--bg);
  box-shadow: var(--hole);
}

.sug li.none {
  cursor: default;
}

.sug li.none:hover {
  background: none;
  box-shadow: none;
}

/* === ESQUELETO DA BIBLIOTECA === */

.lc.skl {
  pointer-events: none;
}

.lc.skl .sk {
  width: 100%;
  height: 100%;
}

.lc.skl .sk.pl {
  box-shadow: var(--up);
}

.lc.skl .ln {
  width: 70%;
  height: 12px;
  margin: 0 auto;
}


/* ==========================================================================
   == 7. JANELAS
   Detalhes da carta, barra de rolagem personalizada e caixa de confirmação.
   ========================================================================== */

/* === JANELA DA CARTA === */

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--p2);
  background: rgba(16, 18, 17, 0.82);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: 0.1s;
  z-index: 50;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.mbox {
  scrollbar-width: none;
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 40px 36px;
  border-radius: var(--r3);
  background: var(--s);
  box-shadow: var(--up);
}

.mx {
  position: absolute;
  top: var(--p2);
  right: var(--p2);
}

.mh {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-right: 48px;
}

.mi {
  flex: none;
  width: 112px;
  aspect-ratio: 2 / 3;
  border-radius: var(--rc);
  box-shadow: var(--up);
  overflow: hidden;
}

.mi img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mn {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 4px 0;
}

.ma {
  color: var(--mu);
  font-size: 13px;
}

.mt {
  margin-top: 14px;
  font-weight: 600;
}

.ms {
  color: var(--mu);
  margin-bottom: 28px;
}

.mr {
  padding: 18px 0;
  border-top: 1px solid var(--bg);
}

.mr b {
  display: block;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* === CAIXA DE CONFIRMAÇÃO === */

.cbox {
  width: min(400px, 100%);
  padding: var(--p3) var(--p2);
  border-radius: var(--r3);
  background: var(--s);
  box-shadow: var(--up);
  text-align: center;
}

.cbox .acts {
  justify-content: center;
}

/* === BARRA DE ROLAGEM PERSONALIZADA === */

.mbox::-webkit-scrollbar {
  display: none;
}

.sb {
  position: fixed;
  width: 4px;
  border-radius: 4px;
  background: rgba(231, 212, 187, 0.1);
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: auto;
  cursor: grab;
  padding: 0 6px;
  margin: 0 -6px;
  box-sizing: content-box;
  background-clip: content-box;
  z-index: 2;
  touch-action: none;
}

.sb.on {
  opacity: 1;
}

.sb.drag {
  cursor: grabbing;
}

.sb.drag i {
  background: rgba(231, 212, 187, 0.6);
}

.sb:hover {
  cursor: grab;
}

.sb i {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  border-radius: 4px;
  background: rgba(231, 212, 187, 0.4);
  transition: background 0.1s;
}

.sb:hover i {
  background: rgba(231, 212, 187, 0.5);
}

@media (max-width: 520px) {
  .mbox {
    padding: 28px 22px;
  }

  .mi {
    width: 84px;
  }

  .mh {
    gap: 14px;
    padding-right: 44px;
  }

  .mx {
    top: 12px;
    right: 12px;
  }

  .mn {
    font-size: 21px;
  }

  .mt {
    font-size: 14px;
  }

  .sb {
    width: 6px;
    padding: 0 10px;
    margin: 0 -10px;
  }
  .sb i {
    left: 10px;
    right: 10px;
  }
}

/* === TRANSIÇÃO + JANELA === */

.vt .modal {
  transition: none;
}


/* ==========================================================================
   == 8. CARREGAMENTO
   Tela inicial, esqueletos (shimmer) e fade das imagens.
   ========================================================================== */

/* === FADE DAS IMAGENS === */

img.im {
  opacity: 0;
  transition: opacity 0.18s ease;
}

img.im.ld {
  opacity: 1;
}

.c,
.mi {
  background: linear-gradient(100deg, var(--plum) 30%, #5e3545 50%, var(--plum) 70%) 0 0/220% 100%;
  animation: sh 0.6s linear infinite;
}

.c.rd,
.mi.rd {
  animation: none;
  background: var(--plum);
}

/* === TELA DE CARREGAMENTO === */

#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: var(--bg);
  transition:
    opacity 0.18s,
    visibility 0.18s;
}

#boot.done {
  opacity: 0;
  visibility: hidden;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* === ESQUELETOS (shimmer) === */

.sk {
  display: block;
  border-radius: var(--rc);
  background: linear-gradient(100deg, #171a19 30%, #232827 50%, #171a19 70%) 0 0/220% 100%;
  animation: sh 0.6s linear infinite;
}

.sk.pl {
  background: linear-gradient(100deg, var(--plum) 30%, #5e3545 50%, var(--plum) 70%) 0 0/220% 100%;
}

.bk {
  max-width: 960px;
  margin: auto;
  padding: 24px 24px 0;
}

.bk-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px var(--p1);
}

.bk-ttl {
  display: grid;
  gap: 8px;
  margin-right: 8px;
}

.bk-ttl .t1 {
  width: 132px;
  height: 20px;
}

.bk-ttl .t2 {
  width: 176px;
  height: 11px;
}

.bk-ib {
  width: 44px;
  height: 44px;
  border-radius: var(--r2);
}

.bk-wrap {
  padding: 40px 0;
}

.bk-h {
  width: min(280px, 70%);
  height: 34px;
}

.bk-l {
  width: min(420px, 90%);
  height: 14px;
  margin: 18px 0 40px;
}

.bk-panel {
  display: grid;
  gap: 28px;
  justify-items: center;
  padding: 28px 18px;
  border-radius: var(--r3);
  background: var(--s);
  box-shadow: var(--up);
}

.bk-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 96px));
  gap: 14px;
  justify-content: center;
}

.bk-board .sk,
.bk-deck .sk {
  aspect-ratio: 2 / 3;
}

.bk-acts {
  display: flex;
  gap: 12px;
}

.bk-btn {
  width: 138px;
  height: 48px;
  border-radius: var(--r2);
}

.bk-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.bk-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  text-align: center;
  color: var(--ink);
  font-weight: 700;
  background: rgba(16, 18, 17, 0.72);
}

/* === SEM JAVASCRIPT === */

.nojs {
  padding: 24px;
}

.bk-tact {
  display: flex;
  gap: var(--p1);
}

.bk-ib.lang {
  width: 124px;
}

.bk-ib.wide {
  width: 156px;
}


/* ==========================================================================
   == 9. EFEITOS
   Entrada ao rolar e transições entre telas (View Transitions).
   ========================================================================== */

/* === ENTRADA AO ROLAR === */

.tl:not(.tin) {
  opacity: 0;
}

.tin {
  animation: tiltIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

@keyframes tiltIn {
  from {
    opacity: 0;
    transform: perspective(900px) translateY(14px) rotateX(7deg) scale(0.98);
  }
}

/* === TRANSIÇÕES ENTRE TELAS (View Transitions) === */

::view-transition-group(dock) {
  animation: none;
}

::view-transition-old(dock) {
  display: none;
}

::view-transition-new(dock) {
  animation: none;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.08s;
  animation-timing-function: ease;
}

::view-transition-group(card-hero) {
  animation-duration: 0.14s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: var(--rc);
  overflow: hidden;
}

::view-transition-old(card-hero),
::view-transition-new(card-hero) {
  height: 100%;
  object-fit: cover;
}


/* ==========================================================================
   == 10. PÁGINA 404
   Usada só pelo 404.html.
   ========================================================================== */

.nf {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 960px;
  margin: auto;
  padding: 64px 24px 96px;
  text-align: center;
}

.nf .sub {
  margin: 0;
}

.nf-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  aspect-ratio: 2 / 3;
  margin-bottom: 14px;
  border-radius: var(--rc);
  background: url(../images/cards/back.webp) center/cover var(--plum);
  box-shadow: var(--up2);
  transform: rotate(-6deg);
}

.nf-card span {
  padding: 4px 12px;
  border-radius: var(--r1);
  background: rgba(16, 18, 17, 0.82);
  color: var(--gold);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nf .btn {
  margin-top: 10px;
  text-decoration: none;
}

/* === RODAPÉ (sobre o site, créditos da arte, anúncios e direitos) === */

.foot {
  display: grid;
  gap: 14px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(231, 212, 187, 0.12);
  text-align: center;
  font-size: 13px;
  line-height: 1.65;
  color: var(--mu);
}

.foot p {
  max-width: 64ch;
  margin: 0 auto;
}

.foot .fine {
  margin-top: 0;
}

.foot a {
  color: var(--gold);
  text-underline-offset: 3px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}

.foot-rights {
  font-size: 12px;
  opacity: 0.85;
}
