/* =====================================================================
   A TOCA DO MAGO — tema do anshiros
   Rocha de caverna · luz de tocha · pergaminho · madeira · latão · brilho arcano
   Veja GUIA-DO-SITE.md antes de criar componentes novos.
   ===================================================================== */

/* ---------- Texturas (SVG embutido, sem arquivos externos) ---------- */
:root {
  --tex-rock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='180'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.09' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 -.12'/%3E%3C/filter%3E%3Crect width='360' height='180' fill='rgba(0,0,0,.55)'/%3E%3Crect x='3' y='3' width='124' height='54' rx='6' fill='rgba(255,240,220,0.09)'/%3E%3Crect x='5' y='3' width='120' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='5' y='54' width='120' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='133' y='3' width='104' height='54' rx='4' fill='rgba(255,240,220,0.09)'/%3E%3Crect x='135' y='3' width='100' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='135' y='54' width='100' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='243' y='3' width='114' height='54' rx='6' fill='rgba(255,240,220,0.055)'/%3E%3Crect x='245' y='3' width='110' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='245' y='54' width='110' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='-57' y='63' width='109' height='54' rx='3' fill='rgba(255,240,220,0.06)'/%3E%3Crect x='-55' y='63' width='105' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='-55' y='114' width='105' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='303' y='63' width='109' height='54' rx='4' fill='rgba(255,240,220,0.055)'/%3E%3Crect x='305' y='63' width='105' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='305' y='114' width='105' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='58' y='63' width='119' height='54' rx='3' fill='rgba(255,240,220,0.055)'/%3E%3Crect x='60' y='63' width='115' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='60' y='114' width='115' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='183' y='63' width='114' height='54' rx='4' fill='rgba(255,240,220,0.045)'/%3E%3Crect x='185' y='63' width='110' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='185' y='114' width='110' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='303' y='63' width='114' height='54' rx='3' fill='rgba(255,240,220,0.075)'/%3E%3Crect x='305' y='63' width='110' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='305' y='114' width='110' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='-57' y='63' width='114' height='54' rx='6' fill='rgba(255,240,220,0.045)'/%3E%3Crect x='-55' y='63' width='110' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='-55' y='114' width='110' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='-27' y='123' width='119' height='54' rx='6' fill='rgba(255,240,220,0.045)'/%3E%3Crect x='-25' y='123' width='115' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='-25' y='174' width='115' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='333' y='123' width='119' height='54' rx='4' fill='rgba(255,240,220,0.09)'/%3E%3Crect x='335' y='123' width='115' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='335' y='174' width='115' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='98' y='123' width='114' height='54' rx='6' fill='rgba(255,240,220,0.055)'/%3E%3Crect x='100' y='123' width='110' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='100' y='174' width='110' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='218' y='123' width='109' height='54' rx='6' fill='rgba(255,240,220,0.06)'/%3E%3Crect x='220' y='123' width='105' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='220' y='174' width='105' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='333' y='123' width='114' height='54' rx='6' fill='rgba(255,240,220,0.045)'/%3E%3Crect x='335' y='123' width='110' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='335' y='174' width='110' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect x='-27' y='123' width='114' height='54' rx='3' fill='rgba(255,240,220,0.045)'/%3E%3Crect x='-25' y='123' width='110' height='2' rx='1' fill='rgba(255,235,200,.07)'/%3E%3Crect x='-25' y='174' width='110' height='3' rx='1.5' fill='rgba(0,0,0,.35)'/%3E%3Crect width='360' height='180' filter='url(%23n)'/%3E%3C/svg%3E");  /* parede de blocos de pedra */
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --tex-parch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .28 0 0 0 0 .1 0 0 0 .5 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20'%3E%3Cg stroke='%23c9a24a' stroke-width='1.4' fill='none'%3E%3Cpath d='M0 10h128M172 10h128'/%3E%3Cpath d='M150 2l9 8-9 8-9-8z'/%3E%3Cpath d='M128 10l6-4M128 10l6 4M172 10l-6-4M172 10l-6 4'/%3E%3C/g%3E%3Ccircle cx='150' cy='10' r='2.6' fill='%2300a8e8'/%3E%3C/svg%3E");
}

/* ---------- Paleta ---------- */
:root, :root[data-theme="dark"] {
  /* caverna */
  --bg: #0a0c0f;
  --stone: #15191e;
  --stone-2: #1d2228;
  --text: #ecdfc2;          /* texto claro e quente sobre a rocha */
  --muted: #a99a7a;
  --border: #2a2f36;
  /* materiais */
  --parch: #ead9b0;
  --parch-2: #d2b985;
  --parch-ink: #2b1c0d;
  --parch-muted: #5a4428;   /* escurecido p/ manter 4.5:1 nas bordas sombreadas */
  --wood: #4a2d17;
  --wood-dark: #24150a;
  --brass: #c9a24a;
  --brass-light: #f0d68a;
  --brass-dark: #7a5a1e;
  /* magia (paleta original do site) */
  --arcane: #00a8e8;
  --arcane-2: #7fd6f7;
  --arcane-mid: #007ea7;
  --arcane-deep: #003459;
  --ember: #ff8a3d;
  --torch: rgba(255, 140, 50, .22);
  /* aliases usados pelos jogos e scripts */
  --bg-elev: var(--stone);
  --accent: var(--arcane);
  --accent-2: var(--ember);
  --accent-soft: rgba(0, 168, 232, .14);
  --on-accent: #00171f;
  --radius: 6px;
  --font-display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --font-head: "Cinzel", Georgia, serif;
  --font: "Crimson Pro", Georgia, "Times New Roman", serif;
  --font-ui: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* fonte do sistema: texto miúdo (rodapé) */
  color-scheme: dark;
}
/* "Velas acesas": a mesma toca, mais clara e quente */
:root[data-theme="light"] {
  --bg: #2a2118;
  --stone: #3a2e22;
  --stone-2: #46382a;
  --text: #f6ead0;
  --muted: #cdb98f;
  --border: #5a4733;
  --torch: rgba(255, 170, 80, .32);
  --accent-soft: rgba(0, 168, 232, .18);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; } /* foco não some atrás do cabeçalho fixo */
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.12rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  position: relative;
  overflow-x: hidden;
}
/* rocha + vinheta: camada fixa e estática (fica numa camada própria da GPU, sem repintar ao rolar) */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .65) 100%),
    radial-gradient(ellipse 60% 45% at 8% 0%, var(--torch), transparent 70%),
    radial-gradient(ellipse 60% 45% at 92% 0%, var(--torch), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(0, 168, 232, .10), transparent 70%),
    var(--tex-rock), var(--tex-grain);
}
/* luz de tocha tremulando — suave e orgânica (só opacidade, sem saltos bruscos) */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 45% 35% at 6% 8%, rgba(255, 150, 60, .14), transparent 70%),
    radial-gradient(ellipse 45% 35% at 94% 8%, rgba(255, 150, 60, .12), transparent 70%);
  animation: flicker 4.8s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { opacity: .85 } 18% { opacity: 1 } 34% { opacity: .72 } 52% { opacity: .95 } 70% { opacity: .78 } 86% { opacity: 1 }
}
.site-header, main, .site-footer { position: relative; z-index: 1; }

a { color: var(--arcane-2); text-decoration: none; transition: color .2s, text-shadow .2s; }
a:hover { color: #fff; text-shadow: 0 0 10px var(--arcane); }
img { max-width: 100%; }
::selection { background: var(--arcane-deep); color: #fff; }
:focus-visible { outline: 2px solid var(--arcane); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; left: 16px; top: 10px; z-index: 100; padding: 10px 18px; border-radius: 4px;
  font-family: var(--font-head); font-weight: 700; color: var(--parch-ink); background: var(--parch);
  box-shadow: 0 0 0 2px var(--brass-dark), 0 6px 18px rgba(0, 0, 0, .7);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; color: var(--parch-ink); text-shadow: none; }
main:focus { outline: none; }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding: 40px 0 80px; }

/* ---------- Tipografia ---------- */
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 3.4rem); margin: 0 0 14px;
  background: linear-gradient(180deg, var(--brass-light) 10%, var(--brass) 55%, var(--brass-dark) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .8)) drop-shadow(0 0 18px rgba(201, 162, 74, .25));
}
h2 {
  font-size: 1.55rem; margin: 56px 0 22px; color: var(--brass-light);
  display: flex; align-items: center; gap: 14px; text-shadow: 0 2px 0 #000;
}
h2::after { content: ""; flex: 1; height: 20px; min-width: 60px; background: var(--ornament) right center / auto 100% no-repeat; opacity: .9; }
h3 { font-size: 1.15rem; }
.lead { font-size: 1.3rem; color: var(--muted); margin: 0 0 28px; max-width: 58ch; font-style: italic; }
.muted { color: var(--muted); }

/* ---------- Cabeçalho: viga de madeira com pregos de latão ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(90deg, rgba(255, 220, 160, .04) 0 1px, transparent 1px 37px),
    linear-gradient(180deg, #5a3820 0%, var(--wood) 45%, var(--wood-dark) 100%);
  border-bottom: 3px solid var(--brass-dark);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 220, 160, .15);
}
.site-header::before, .site-header::after {
  content: ""; position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%; translate: 0 -50%;
  background: radial-gradient(circle at 35% 35%, var(--brass-light), var(--brass) 45%, var(--brass-dark));
  box-shadow: 0 1px 2px #000;
}
.site-header::before { left: 10px; } .site-header::after { right: 10px; }
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 66px; }
.logo {
  display: inline-flex; align-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--brass-light);
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(201, 162, 74, .35);
}
.logo span { color: var(--arcane); }
.logo:hover { text-decoration: none; color: #fff; }
.logo-img {
  width: 38px; height: 38px; border-radius: 9px; margin-right: 10px;
  border: 2px solid var(--brass); box-shadow: 0 0 0 2px var(--wood-dark), 0 0 14px rgba(0, 168, 232, .45);
  transition: transform .35s ease, box-shadow .35s ease;
}
.logo:hover .logo-img { transform: rotate(-8deg) scale(1.08); box-shadow: 0 0 0 2px var(--wood-dark), 0 0 22px var(--arcane); }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-head); font-weight: 500; font-size: .95rem; letter-spacing: .04em;
  color: var(--parch-2); padding: 6px 12px; border-radius: 4px; text-shadow: 0 1px 0 #000;
}
.nav .gi { font-size: 1.05em; color: var(--brass); transition: color .2s, filter .2s; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(0, 0, 0, .25); }
.nav a:hover .gi { color: var(--arcane); filter: drop-shadow(0 0 6px var(--arcane)); }
.nav a.active { color: var(--brass-light); background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px var(--brass-dark); }
.nav a.active .gi { color: var(--arcane); }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1.05rem; flex-shrink: 0;
  border: 2px solid var(--brass-dark); color: var(--text);
  background: radial-gradient(circle at 40% 35%, #3a2a1c, #120b06);
  box-shadow: inset 0 0 8px #000, 0 0 10px rgba(255, 140, 50, .3);
}
.theme-toggle:hover { box-shadow: inset 0 0 8px #000, 0 0 16px rgba(255, 160, 70, .6); }

/* ---------- Rodapé: pedra entalhada ---------- */
.site-footer {
  border-top: 2px solid var(--brass-dark); color: var(--text); padding: 26px 0;
  font-family: var(--font-ui); font-size: .875rem; line-height: 1.6; letter-spacing: .01em;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .85)), var(--tex-grain);
}
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--brass-light); text-decoration: underline; text-decoration-color: var(--brass-dark); text-underline-offset: 2px; }

/* ---------- Tochas nas laterais (inseridas pelo main.js) ---------- */
.torch { position: fixed; top: 120px; z-index: 2; width: 26px; height: 120px; pointer-events: none; }
.torch.left { left: 14px; } .torch.right { right: 14px; }
.torch::before { /* cabo */
  content: ""; position: absolute; left: 9px; top: 34px; width: 8px; height: 80px; border-radius: 2px;
  background: linear-gradient(90deg, #2a170a, #6b4122 50%, #2a170a);
  box-shadow: 0 0 0 1px #000, 0 6px 0 -2px var(--brass-dark);
}
.torch::after { /* chama */
  content: ""; position: absolute; left: -2px; top: 0; width: 30px; height: 44px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 75%, #fff6c8 0%, #ffd36b 22%, #ff8a3d 50%, rgba(220, 60, 10, .6) 70%, transparent 74%);
  filter: blur(.6px) drop-shadow(0 0 14px rgba(255, 140, 50, .9)) drop-shadow(0 0 40px rgba(255, 120, 40, .55));
  transform-origin: 50% 90%; animation: flame 1.8s ease-in-out infinite alternate; will-change: transform;
}
.torch.right::after { animation-delay: -.9s; }
@keyframes flame {
  0% { transform: scale(1, 1) rotate(-2deg); }
  35% { transform: scale(.94, 1.08) rotate(2deg); }
  70% { transform: scale(1.04, .95) rotate(-1deg); }
  100% { transform: scale(.97, 1.05) rotate(3deg); }
}
@media (max-width: 1100px) { .torch { display: none; } }

/* ---------- Partículas (canvas do main.js) ---------- */
.motes { position: fixed; inset: 0; z-index: 3; pointer-events: none; }

/* ---------- Herói da página inicial ---------- */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; padding: 18px 0 8px; }
.hero .kicker {
  font-family: var(--font-head); letter-spacing: .3em; text-transform: uppercase; font-size: .8rem; color: var(--arcane-2);
  text-shadow: 0 0 10px var(--arcane);
}

.portal { position: relative; aspect-ratio: 1; width: min(100%, 340px); margin: 0 auto; }
.portal svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; will-change: transform; }
.portal .ring-outer { animation: spin 60s linear infinite; }
.portal .ring-inner { animation: spin 40s linear infinite reverse; }
.portal .runes { font-family: "Segoe UI Historic", "Noto Sans Runic", var(--font-head); fill: var(--arcane-2); font-size: 15px; letter-spacing: 6px; }
.portal img {
  position: absolute; inset: 27%; width: 46%; height: 46%; border-radius: 22%;
  border: 3px solid var(--brass); box-shadow: 0 0 0 4px var(--wood-dark), 0 0 40px var(--arcane), 0 0 90px rgba(0, 168, 232, .5);
  animation: float 5s ease-in-out infinite;
}
.portal::before {
  content: ""; position: absolute; inset: 12%; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 168, 232, .35), rgba(0, 52, 89, .25) 45%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes pulse { 50% { opacity: .55; transform: scale(1.06); } }

/* ---------- Botões ---------- */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { /* pedra rúnica com brilho arcano */
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 22px; border-radius: 4px; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem; letter-spacing: .06em;
  color: var(--arcane-2); text-shadow: 0 0 8px rgba(0, 168, 232, .8);
  background: linear-gradient(180deg, #24303a, #10161c), var(--tex-grain);
  border: 1px solid var(--arcane-mid);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -3px 0 rgba(0, 0, 0, .5), 0 0 0 1px #000, 0 0 16px rgba(0, 168, 232, .25);
  transition: box-shadow .25s, color .25s, transform .1s;
}
.btn:hover { text-decoration: none; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -3px 0 rgba(0, 0, 0, .5), 0 0 0 1px #000, 0 0 26px rgba(0, 168, 232, .65); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.secondary { /* tábua de madeira com bordas de latão */
  color: var(--brass-light); text-shadow: 0 1px 0 #000;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 9px), linear-gradient(180deg, #6a4325, var(--wood-dark));
  border: 1px solid var(--brass-dark);
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, .2), 0 0 0 1px #000, 0 4px 10px rgba(0, 0, 0, .5);
}
.btn.secondary:hover { color: #fff; box-shadow: inset 0 1px 0 rgba(255, 220, 160, .25), 0 0 0 1px #000, 0 0 18px rgba(255, 140, 50, .45); }
.btn.small { padding: 6px 14px; font-size: .82rem; }
.btn.danger { color: #ff9b8a; border-color: #8a2a1c; text-shadow: 0 0 8px rgba(255, 60, 30, .6); box-shadow: 0 0 0 1px #000, 0 0 14px rgba(255, 60, 30, .2); }
.btn.discord { color: #fff; text-shadow: none; background: linear-gradient(180deg, #6a75f5, #4752c4); border-color: #2c348f; }
.btn.google { color: var(--parch-ink); text-shadow: none; background: linear-gradient(180deg, #f6ecd2, #dcc89a); border-color: var(--brass-dark); }

/* ---------- Pergaminho (cartões, posts, páginas de texto) ---------- */
.card, .prose, .post-list, .login-box, .ranking-list li, .table-wrap, .kpi, .notice {
  --text: var(--parch-ink); --muted: var(--parch-muted);
}
.card, .prose, .post-list, .login-box {
  color: var(--parch-ink);
  background-color: var(--parch);
  background-image: radial-gradient(ellipse at 50% 40%, rgba(255, 250, 230, .55), transparent 70%), var(--tex-parch), var(--tex-grain);
  border-radius: 3px;
  box-shadow:
    inset 0 0 42px rgba(120, 70, 20, .55),
    inset 0 0 8px rgba(70, 35, 8, .7),
    0 0 0 1px rgba(60, 30, 5, .6),
    0 14px 30px rgba(0, 0, 0, .65);
}
.card a, .prose a, .post-list a, .login-box a:not(.btn) { color: var(--arcane-deep); text-shadow: none; }
.card a:hover, .prose a:hover, .login-box a:not(.btn):hover { color: var(--arcane-mid); text-shadow: none; }

/* ---------- Cartões (jogos) ---------- */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { display: block; padding: 24px 22px 22px; transition: transform .25s ease, box-shadow .25s ease; position: relative; }
a.card:hover { text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
a.card:hover {
  transform: translateY(-4px) rotate(-.4deg);
  box-shadow: inset 0 0 42px rgba(120, 70, 20, .5), inset 0 0 8px rgba(70, 35, 8, .7), 0 0 0 1px rgba(60, 30, 5, .6), 0 18px 36px rgba(0, 0, 0, .7), 0 0 28px rgba(0, 168, 232, .35);
}
}
.card h3 { margin: 0 0 6px; font-size: 1.25rem; color: var(--parch-ink); }
.card p { margin: 0; color: var(--parch-muted); font-size: 1.02rem; }
.card .icon { /* medalhão de latão */
  display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 14px; border-radius: 50%;
  font-size: 30px; color: #1b1208;
  background: radial-gradient(circle at 35% 30%, var(--brass-light), var(--brass) 45%, var(--brass-dark) 100%);
  box-shadow: 0 0 0 3px rgba(60, 30, 5, .5), 0 3px 6px rgba(0, 0, 0, .4), inset 0 -3px 6px rgba(0, 0, 0, .35);
}
a.card:hover .icon { color: var(--arcane-deep); }
.card.locked { opacity: .9; filter: saturate(.6); }

/* ---------- Lista de posts: página de grimório ---------- */
.post-list { list-style: none; padding: 10px; margin: 0; display: flex; flex-direction: column; }
.post-list li + li { border-top: 1px dashed rgba(110, 85, 53, .45); }
.post-list a { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 14px 16px; color: var(--parch-ink); border-radius: 3px; }
.post-list a:hover { background: rgba(120, 70, 20, .12); color: var(--parch-ink); }
.post-list .title { font-family: var(--font-head); font-weight: 700; font-size: 1.08rem; }
.post-list .title::before { content: "✦ "; content: "✦ " / ""; color: var(--arcane-mid); }
.post-list .summary { display: block; color: var(--parch-muted); font-size: 1rem; font-style: italic; }
.post-list time { color: var(--parch-muted); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.post-list li.muted { padding: 14px 16px; }

/* ---------- Etiquetas: lacres de cera ---------- */
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 24px; }
.tag {
  min-height: 30px;
  font-family: var(--font-head); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: lowercase;
  padding: 4px 12px; border-radius: 999px; cursor: pointer; color: var(--parch-2);
  background: rgba(0, 0, 0, .35); border: 1px solid var(--brass-dark);
}
.tag:hover { color: #fff; text-decoration: none; border-color: var(--brass); }
.tag.active { color: #fff; background: radial-gradient(circle at 40% 35%, #c2412f, #7a1d12); border-color: #4a0f08; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }

/* ---------- Texto de post / páginas: pergaminho aberto ---------- */
.prose { padding: clamp(24px, 5vw, 56px); font-size: 1.18rem; }
.prose h1 { filter: none; background: none; color: var(--parch-ink); -webkit-text-fill-color: currentColor; font-size: clamp(1.9rem, 5vw, 2.7rem); }
.prose h2 { color: var(--parch-ink); text-shadow: none; margin-top: 1.8em; }
.prose p { margin: 0 0 1.1em; }
.prose p:not(.lead):not(.muted):first-of-type::first-letter { /* capitular */
  float: left; font-family: var(--font-display); font-size: 3.4em; line-height: .9; padding: 6px 8px 0 0; color: var(--arcane-deep);
}
.prose blockquote { margin: 1.4em 0; padding: 4px 18px; border-left: 3px solid var(--brass-dark); color: var(--parch-muted); font-style: italic; }
.prose code { background: rgba(120, 70, 20, .16); padding: 1px 6px; border-radius: 3px; font-size: .85em; }
.prose pre { background: #1a120a; color: var(--parch); border: 1px solid var(--brass-dark); padding: 16px; border-radius: 4px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose .tags .tag { color: var(--parch-ink); background: rgba(120, 70, 20, .12); }
.prose .tags .tag:hover { color: var(--arcane-deep); }
.post-header { margin-bottom: 24px; }
.post-header time { color: var(--parch-muted); font-style: italic; }
.back { display: inline-block; margin-top: 32px; font-family: var(--font-head); }

/* ---------- Jogos ---------- */
.game-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.game-hud { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.stat { /* placa de latão */
  font-family: var(--font-head); font-weight: 700; font-variant-numeric: tabular-nums; color: #1b1208;
  padding: 6px 16px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 50%, var(--brass-dark));
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 10px rgba(0, 0, 0, .5);
}
.stat small { color: #2e2008; font-weight: 500; margin-right: 6px; }
canvas.game {
  max-width: 100%; height: auto; touch-action: none; border-radius: 4px;
  border: 6px solid transparent;
  background: linear-gradient(var(--stone), var(--stone)) padding-box, linear-gradient(180deg, var(--brass-light), var(--brass-dark)) border-box;
  box-shadow: 0 0 0 2px #000, 0 20px 40px rgba(0, 0, 0, .7), 0 0 40px rgba(0, 168, 232, .2);
}
.hint { color: var(--muted); font-size: 1rem; text-align: center; font-style: italic; }

/* ---------- Ícones (game-icons.net, CC BY 3.0) ---------- */
.gi {
  display: inline-block; width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em;
  background-color: currentColor;
  -webkit-mask: var(--gi) center / contain no-repeat; mask: var(--gi) center / contain no-repeat;
}
.gi-logo     { --gi: url(../icons/logo.svg); }
.gi-blog     { --gi: url(../icons/blog.svg); }
.gi-jogos    { --gi: url(../icons/jogos.svg); }
.gi-sobre    { --gi: url(../icons/sobre.svg); }
.gi-memoria  { --gi: url(../icons/memoria.svg); }
.gi-cobrinha { --gi: url(../icons/cobrinha.svg); }
.gi-breve    { --gi: url(../icons/breve.svg); }
.gi-buraco   { --gi: url(../icons/buraco.svg); }
.gi-profundezas { --gi: url(../icons/dungeon-gate.svg); }
.gi-vila     { --gi: url(../icons/vila.svg); }
.gi-cristal  { --gi: url(../icons/floating-crystal.svg); }
h1 .gi { color: var(--arcane); -webkit-text-fill-color: initial; filter: drop-shadow(0 0 10px var(--arcane)); }
.big-icon { font-size: 5rem; color: var(--arcane); filter: drop-shadow(0 0 18px var(--arcane)); }

/* ---------- Conta / login ---------- */
.account { display: flex; align-items: center; }
.account-link { display: inline-flex; align-items: center; gap: 8px; color: var(--parch); font-family: var(--font-head); font-size: .92rem; }
.account-link:hover { text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brass); box-shadow: 0 0 0 1px #000; flex-shrink: 0; }
.avatar.sm { width: 26px; height: 26px; }
.avatar.lg { width: 84px; height: 84px; font-size: 2.2rem; border-width: 3px; box-shadow: 0 0 0 2px #000, 0 0 24px rgba(0, 168, 232, .5); }
.avatar-fallback { display: inline-grid; place-items: center; background: var(--arcane-deep); color: var(--arcane-2); font-family: var(--font-head); font-weight: 700; font-size: .85rem; }
.login-box { max-width: 420px; margin: 0 auto; text-align: center; padding: 34px 28px; }
.login-box h1 { background: none; color: var(--parch-ink); -webkit-text-fill-color: currentColor; filter: none; }
.login-box .btn { width: 100%; justify-content: center; padding: 13px 18px; margin-bottom: 12px; }
.notice { border-radius: 3px; padding: 12px 16px; font-size: 1rem; color: var(--parch-ink); background: var(--parch-2); box-shadow: inset 0 0 12px rgba(80, 40, 10, .45); }
.notice.error { background: #e6b7a6; color: #5a1408; }
.profile { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile h1 { margin: 0; }
code.uid { font-size: .9rem; background: rgba(0, 0, 0, .4); color: var(--arcane-2); padding: 2px 8px; border-radius: 3px; user-select: all; border: 1px solid var(--border); }

/* ---------- Ranking ---------- */
.ranking { width: min(100%, 440px); }
.ranking h2 { font-size: 1.3rem; margin: 10px 0 14px; }
.ranking h2::after { display: none; }
.ranking-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.ranking-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; color: var(--parch-ink); border-radius: 3px;
  background: var(--parch) var(--tex-parch); box-shadow: inset 0 0 18px rgba(120, 70, 20, .5), 0 0 0 1px rgba(60, 30, 5, .6), 0 4px 10px rgba(0, 0, 0, .5);
}
.ranking-list .pos { width: 1.6em; font-family: var(--font-head); font-weight: 700; color: var(--parch-muted); }
.ranking-list li:nth-child(1) .pos { color: #6b4f12; } .ranking-list li:nth-child(1) .pos::after { content: "♛"; content: "♛" / ""; margin-left: 2px; }
.ranking-list li:nth-child(2) .pos { color: #4f5a64; } .ranking-list li:nth-child(3) .pos { color: #7f3d1c; }
.ranking-list .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-list strong { font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.ranking-list small { color: var(--parch-muted); font-weight: 500; }

/* ---------- Tabelas (conta / admin): livro-razão ---------- */
.table-wrap { overflow-x: auto; border-radius: 3px; background: var(--parch) var(--tex-parch); box-shadow: inset 0 0 30px rgba(120, 70, 20, .5), 0 0 0 1px rgba(60, 30, 5, .6), 0 10px 24px rgba(0, 0, 0, .6); }
table { width: 100%; border-collapse: collapse; font-size: 1rem; color: var(--parch-ink); }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px dashed rgba(110, 85, 53, .45); }
th { font-family: var(--font-head); font-size: .85rem; letter-spacing: .05em; color: var(--parch-muted); background: rgba(120, 70, 20, .12); }
td a { color: var(--arcane-deep); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi { padding: 16px 18px; border-radius: 3px; color: var(--parch-ink); background: var(--parch) var(--tex-parch); box-shadow: inset 0 0 26px rgba(120, 70, 20, .5), 0 0 0 1px rgba(60, 30, 5, .6), 0 8px 18px rgba(0, 0, 0, .55); }
.kpi b { display: block; font-size: 2rem; font-family: var(--font-display); color: var(--arcane-deep); font-variant-numeric: tabular-nums; }
.kpi span { color: var(--parch-muted); font-size: .95rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .portal { width: min(70%, 260px); order: -1; }
}
@media (max-width: 560px) {
  html { scroll-padding-top: 126px; }
  body { font-size: 1.05rem; }
  .site-header .container { padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .nav a { padding: 6px 8px; }
  .account { margin-left: auto; }
  .account-name { display: none; }
  .theme-toggle { margin-left: 8px; }
  .post-list a { flex-direction: column; gap: 2px; }
}
/* 5 itens no menu: em telas bem estreitas, letras e espaços menores para caber numa linha */
@media (max-width: 440px) {
  .nav { gap: 0; }
  .nav a { padding: 6px 2px; gap: 3px; font-size: .8rem; letter-spacing: .01em; }
  .nav .gi { font-size: .95em; }
}

/* ---------- Menos movimento para quem pede ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .motes { display: none; }
}
