/* Temas alternativos. O padrão (Neon) é o style.css; aqui cada tema troca as
   variáveis de cor e fonte e acrescenta seus ornamentos. Escolha em assets/tema.js. */

/* ============================================================ comum aos temas de fantasia */
html:not([data-tema="neon"]) .scan { display: none; }
html:not([data-tema="neon"]) .g::before, html:not([data-tema="neon"]) .g::after { content: none; }
html:not([data-tema="neon"]) .crumbs::before { content: "❖ "; }
html:not([data-tema="neon"]) .top::after { opacity: .8; }

/* seletor de tema (vale para todos) */
.tema-sel { position: relative; }
.tema-btn { font: inherit; font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tema-btn:hover, .tema-btn[aria-expanded="true"] { color: var(--text); border-color: var(--a); }
.tema-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 260px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.tema-pop[hidden] { display: none; }
.tema-op { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.tema-op:hover { background: var(--panel-2); }
.tema-op.on { border-color: var(--a); }
.tema-op small { display: block; color: var(--muted); font-size: 11.5px; }
.tema-sw { display: inline-flex; flex: none; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.tema-sw i { width: 12px; height: 26px; }
.sw-neon i:nth-child(1) { background: #070b16; } .sw-neon i:nth-child(2) { background: #37d3ff; } .sw-neon i:nth-child(3) { background: #a796ff; } .sw-neon i:nth-child(4) { background: #ffb547; }
.sw-grimorio i:nth-child(1) { background: #17110b; } .sw-grimorio i:nth-child(2) { background: #3a2a1a; } .sw-grimorio i:nth-child(3) { background: #d9a441; } .sw-grimorio i:nth-child(4) { background: #9e3b2c; }
.sw-eterna i:nth-child(1) { background: #0b0718; } .sw-eterna i:nth-child(2) { background: #5b3aa8; } .sw-eterna i:nth-child(3) { background: #7fd8ff; } .sw-eterna i:nth-child(4) { background: #f5c66b; }
.sw-mana i:nth-child(1) { background: #f3e6b8; } .sw-mana i:nth-child(2) { background: #4aa3df; } .sw-mana i:nth-child(3) { background: #a58bd1; } .sw-mana i:nth-child(4) { background: #e2553f; } .sw-mana i:nth-child(5) { background: #3fae6a; }
@media (max-width: 760px) { .tema-sel { order: 3; } .tema-pop { right: auto; left: 0; } }

/* ============================================================ 1. GRIMÓRIO ARCANO
   pergaminho, couro e folha de ouro; brasas subindo ao fundo */
html[data-tema="grimorio"] {
  --bg: #17110b; --panel: #221810; --panel-2: #2c2016; --deep: #120d08; --line: #4a3622;
  --text: #f3e7cc; --soft: #e2d2b0; --muted: #b39b74; --dim: #85704f;
  --a: #e0b45a; --b: #d98b3a; --main: #c9563f; --ok: #9cbc6b; --bad: #d5594a;
  --link: #e8c472; --graph-bg: #120d08; --graph-edge: rgba(200, 160, 100, .14);
  --f-display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --f-body: "Cormorant Garamond", Georgia, serif;
  --f-mono: "Cinzel", Georgia, serif;
  --radius: 6px;
  --shadow: 0 24px 60px -28px rgba(224, 180, 90, .35);
  --gc0: #c9563f; --gc1: #e0b45a; --gc2: #b39b74; --gc3: #9cbc6b;
}
html[data-tema="grimorio"] body {
  font-size: 18.5px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(224, 160, 70, .16), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, .7), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .4 0 0 0 0 .25 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--bg);
}
html[data-tema="grimorio"] h1, html[data-tema="grimorio"] h2 { letter-spacing: .02em; font-weight: 700; }
html[data-tema="grimorio"] h2, html[data-tema="grimorio"] h3 { font-family: "Cinzel", Georgia, serif; }
html[data-tema="grimorio"] .grad { background: linear-gradient(90deg, #a8742a, #f3d48a, #c8902f, #f3d48a, #a8742a); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; }
html[data-tema="grimorio"] .tag { letter-spacing: .14em; text-transform: uppercase; font-size: 11.5px; }
html[data-tema="grimorio"] .tag::before { content: "✦ "; }
html[data-tema="grimorio"] .top { background: linear-gradient(180deg, rgba(34, 24, 16, .96), rgba(23, 17, 11, .9)); }
html[data-tema="grimorio"] .top::after { background: linear-gradient(90deg, transparent, #a8742a, #f3d48a, #a8742a, transparent); }
html[data-tema="grimorio"] .brand { font-family: "Cinzel Decorative", serif; }
html[data-tema="grimorio"] .nav a, html[data-tema="grimorio"] .gres small, html[data-tema="grimorio"] input[type=search] { font-family: "Cinzel", serif; letter-spacing: .03em; }
/* moldura de livro: filete duplo dourado e cantos ornamentais */
html[data-tema="grimorio"] :is(.panel, .pcard, .dscore, .regra) {
  background-color: var(--panel);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' fill='none' stroke='%23d9a441' stroke-width='1.2'%3E%3Cpath d='M2 24V8a6 6 0 0 1 6-6h16'/%3E%3Cpath d='M6 24V12a6 6 0 0 1 6-6h12' opacity='.5'/%3E%3Ccircle cx='8' cy='8' r='1.6' fill='%23d9a441'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 220, 160, .035), transparent 40%);
  background-repeat: no-repeat; background-position: 4px 4px, 0 0;
  box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .22), inset 0 0 0 4px var(--panel), inset 0 0 0 5px rgba(217, 164, 65, .12), 0 16px 40px -24px rgba(0, 0, 0, .8);
}
html[data-tema="grimorio"] .tile { box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .2); }
html[data-tema="grimorio"] .page-head p::first-letter, html[data-tema="grimorio"] .lead::first-letter {
  font-family: "Cinzel Decorative", serif; float: left; font-size: 3.1em; line-height: .85; padding: 4px 8px 0 0; color: var(--a);
  text-shadow: 0 0 18px rgba(224, 180, 90, .45);
}
html[data-tema="grimorio"] .btn { background: linear-gradient(180deg, #f0cf7f, #b9822f); color: #2a1a08; font-family: "Cinzel", serif; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 18px -8px rgba(224, 180, 90, .6); }
html[data-tema="grimorio"] .btn.ghost { background: transparent; color: var(--soft); border: 1px solid var(--line); box-shadow: none; font-family: "Cinzel", serif; }
/* preço como selo de cera */
html[data-tema="grimorio"] .price { font-family: "Cinzel", serif; color: #f0c56a; text-shadow: 0 0 12px rgba(224, 160, 70, .35); }
html[data-tema="grimorio"] .code { background: rgba(201, 86, 63, .18); border-color: rgba(201, 86, 63, .55); color: #f1b9a6; border-radius: 50px; }
html[data-tema="grimorio"] .holo { background: linear-gradient(115deg, transparent 25%, rgba(255, 210, 130, .35) 45%, rgba(255, 240, 200, .3) 52%, rgba(217, 140, 60, .25) 60%, transparent 75%); background-size: 250% 100%; }
html[data-tema="grimorio"] .list th { font-family: "Cinzel", serif; }
html[data-tema="grimorio"] .bar { background: linear-gradient(90deg, #8f4a20, #d9a441, #f3d48a); box-shadow: 0 0 10px rgba(224, 160, 70, .4); }
html[data-tema="grimorio"] .nota-big b, html[data-tema="grimorio"] .podio-pos { background: linear-gradient(90deg, #c8902f, #f3d48a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; }

/* ============================================================ 2. CEGUEIRA ETERNA
   o espaço entre os planos: nebulosa, éter, círculo rúnico e vidro */
html[data-tema="eterna"] {
  --bg: #0a0717; --panel: rgba(22, 15, 46, .72); --panel-2: rgba(36, 25, 72, .72); --deep: rgba(8, 5, 20, .8); --line: #2f2560;
  --text: #ede8ff; --soft: #d0c8f2; --muted: #9b91c9; --dim: #6c629c;
  --a: #7fd8ff; --b: #f5c66b; --main: #b48cff; --ok: #6fe3c1; --bad: #ff7aa8;
  --link: #9fe3ff; --graph-bg: #07051a; --graph-edge: rgba(150, 130, 230, .16);
  --f-display: "Cinzel", Georgia, serif;
  --f-body: "Spectral", Georgia, serif;
  --f-mono: "Cinzel", Georgia, serif;
  --radius: 16px;
  --shadow: 0 24px 70px -28px rgba(180, 140, 255, .5);
  --gc0: #b48cff; --gc1: #f5c66b; --gc2: #7fd8ff; --gc3: #ff7aa8;
}
html[data-tema="eterna"] body {
  background:
    radial-gradient(ellipse 60% 45% at 18% 10%, rgba(120, 60, 220, .32), transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 25%, rgba(30, 150, 190, .22), transparent 70%),
    radial-gradient(ellipse 70% 50% at 60% 95%, rgba(200, 120, 60, .14), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
html[data-tema="eterna"] h1, html[data-tema="eterna"] h2 { letter-spacing: .04em; text-shadow: 0 0 24px rgba(180, 140, 255, .35); }
html[data-tema="eterna"] .tag { letter-spacing: .18em; text-transform: uppercase; font-size: 11px; }
html[data-tema="eterna"] .tag::before { content: "✧ "; color: var(--b); }
html[data-tema="eterna"] .top { background: rgba(10, 7, 23, .65); backdrop-filter: blur(16px) saturate(1.3); }
html[data-tema="eterna"] .grad { background: linear-gradient(90deg, #7fd8ff, #b48cff, #f5c66b, #7fd8ff); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; }
html[data-tema="eterna"] :is(.panel, .pcard, .tile, .dscore, .dcard, .facts div, .regra, .stats a, .filters) {
  backdrop-filter: blur(10px) saturate(1.2);
  border-color: rgba(180, 140, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 50px -30px rgba(120, 80, 255, .5);
}
html[data-tema="eterna"] .tile:hover, html[data-tema="eterna"] .pcard:hover { box-shadow: 0 0 0 1px rgba(127, 216, 255, .4), 0 20px 60px -20px rgba(127, 216, 255, .45); }
/* círculo rúnico girando atrás do título da página inicial */
html[data-tema="eterna"] .home-hero { position: relative; }
html[data-tema="eterna"] .home-hero::before {
  content: ""; position: absolute; z-index: -1; width: 620px; height: 620px; left: -160px; top: -150px; opacity: .35; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%23b48cff'%3E%3Ccircle cx='100' cy='100' r='96' stroke-width='.6'/%3E%3Ccircle cx='100' cy='100' r='88' stroke-width='.4' stroke-dasharray='2 3'/%3E%3Ccircle cx='100' cy='100' r='70' stroke-width='.5'/%3E%3Cpath d='M100 4 L183 148 L17 148 Z M100 196 L17 52 L183 52 Z' stroke-width='.4' stroke='%237fd8ff'/%3E%3Ccircle cx='100' cy='100' r='40' stroke-width='.5' stroke='%23f5c66b'/%3E%3Cg stroke-width='.5'%3E%3Cpath d='M100 12v8M100 180v8M12 100h8M180 100h8M38 38l6 6M156 156l6 6M38 162l6-6M156 44l6-6'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  animation: runa 140s linear infinite;
}
@keyframes runa { to { transform: rotate(360deg); } }
html[data-tema="eterna"] .btn { background: linear-gradient(90deg, #7fd8ff, #b48cff, #f5c66b); background-size: 200% 100%; color: #120a2a; font-family: "Cinzel", serif; }
html[data-tema="eterna"] .btn.ghost { background: rgba(22, 15, 46, .6); color: var(--soft); font-family: "Cinzel", serif; }
html[data-tema="eterna"] .price { font-family: "Cinzel", serif; color: var(--b); }
html[data-tema="eterna"] .holo { background: linear-gradient(115deg, transparent 25%, rgba(180, 140, 255, .4) 42%, rgba(127, 216, 255, .35) 50%, rgba(245, 198, 107, .3) 58%, transparent 75%); background-size: 250% 100%; }
/* a nota do deck num escudo de lealdade */
html[data-tema="eterna"] .nota-big { display: inline-flex; align-items: baseline; padding: 14px 22px 18px; clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%); background: linear-gradient(180deg, rgba(180, 140, 255, .28), rgba(127, 216, 255, .12)); }
html[data-tema="eterna"] .bar { background: linear-gradient(90deg, #7fd8ff, #b48cff, #f5c66b); }

/* ============================================================ 3. ESPECTRO DA MANA
   as cinco cores; nas páginas de precon e de carta, as cores da identidade (JS em app.js) */
html[data-tema="mana"] {
  --bg: #11100e; --panel: #1b1916; --panel-2: #24211d; --deep: #0d0c0a; --line: #38332c;
  --text: #f1ece2; --soft: #dcd4c4; --muted: #a39a89; --dim: #766e60;
  --a: #4aa3df; --b: #e2b84a; --main: #a58bd1; --ok: #3fae6a; --bad: #e2553f;
  --link: #7cc0ec; --graph-bg: #0d0c0a; --graph-edge: rgba(220, 200, 170, .12);
  --f-display: "Marcellus SC", Georgia, serif;
  --f-body: "Alegreya", Georgia, serif;
  --f-mono: "Alegreya Sans SC", system-ui, sans-serif;
  --radius: 12px;
  --shadow: 0 24px 60px -28px color-mix(in srgb, var(--a) 45%, transparent);
  --gc0: #a58bd1; --gc1: #e2b84a; --gc2: #4aa3df; --gc3: #e2553f;
  --w: #f3e6b8; --u: #4aa3df; --k: #a58bd1; --r: #e2553f; --g: #3fae6a;
}
html[data-tema="mana"] body {
  font-size: 17px;
  background:
    radial-gradient(ellipse 50% 35% at 0% 0%, color-mix(in srgb, var(--a) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 35% at 100% 0%, color-mix(in srgb, var(--main) 14%, transparent), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 110%, color-mix(in srgb, var(--b) 10%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
html[data-tema="mana"] .top::after { background: linear-gradient(90deg, var(--w), var(--u), var(--k), var(--r), var(--g)); opacity: .9; height: 2px; }
html[data-tema="mana"] .grad { background: linear-gradient(90deg, var(--w), var(--u), var(--k), var(--r), var(--g), var(--w)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; }
html[data-tema="mana"] .tag { letter-spacing: .08em; font-size: 13px; }
html[data-tema="mana"] .tag::before { content: "◆ "; color: var(--b); }
html[data-tema="mana"] .panel, html[data-tema="mana"] .pcard, html[data-tema="mana"] .dscore { border-top: 2px solid color-mix(in srgb, var(--a) 60%, transparent); }
html[data-tema="mana"] .btn { background: linear-gradient(90deg, var(--a), var(--main)); color: #0f0e0c; font-family: "Marcellus SC", serif; }
html[data-tema="mana"] .btn.ghost { background: transparent; color: var(--soft); font-family: "Alegreya Sans SC", sans-serif; }
html[data-tema="mana"] .pips .ms { box-shadow: 0 0 10px rgba(255, 255, 255, .25); }
/* pódio e nota como cristais de mana */
html[data-tema="mana"] .podio-pos { color: transparent; background: linear-gradient(135deg, var(--w), var(--b)); -webkit-background-clip: text; background-clip: text; }
html[data-tema="mana"] .pv-podio .foil, html[data-tema="mana"] .podio .foil { clip-path: polygon(50% 0, 100% 18%, 100% 82%, 50% 100%, 0 82%, 0 18%); }
html[data-tema="mana"] .bar { background: linear-gradient(90deg, var(--w), var(--u), var(--k), var(--r), var(--g)); box-shadow: none; }
html[data-tema="mana"] .holo { background: linear-gradient(115deg, transparent 20%, rgba(243, 230, 184, .3) 35%, rgba(74, 163, 223, .3) 45%, rgba(165, 139, 209, .3) 55%, rgba(226, 85, 63, .25) 65%, rgba(63, 174, 106, .25) 75%, transparent 85%); background-size: 250% 100%; }

/* fontes de fantasia são mais largas: título da página inicial um pouco menor */
html:not([data-tema="neon"]) .home-hero h1 { font-size: clamp(34px, 5.2vw, 62px); line-height: 1.04; }
html:not([data-tema="neon"]) h1 { font-size: clamp(28px, 4.2vw, 44px); }
html[data-tema="grimorio"] :is(.facts div, .stats a) { box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .18), inset 0 0 0 3px var(--panel), inset 0 0 0 4px rgba(217, 164, 65, .1); }
html[data-tema="grimorio"] .facts div::before { background: linear-gradient(#f3d48a, #a8742a); }
