@font-face { font-family: "Chakra"; src: url(ChakraPetch-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Chakra"; src: url(ChakraPetch-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JBMono"; src: url(JetBrainsMono.ttf) format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0b0b0c; --panel: #141415; --panel-2: #1a1a1c; --fg: #ecebe6; --dim: #8a8a85; --soft: #bdbcb6;
  --line: rgba(236,235,230,.12); --line-2: rgba(236,235,230,.22);
  --accent: #f5b700; --ink: #0b0b0c;
  --danger: #ff5a4f; --good: #4df0a0; --mana: #3d8bff;
  --f-light: #e8e6dc; --f-dark: #b46cff; --f-magic: #4ea1ff; --f-might: #ff6a4d; --f-wild: #3fdc8a; --f-neutral: #9a9a96;
  --r-common: #9a9a96; --r-rare: #4ea1ff; --r-epic: #b46cff; --r-legendary: #f5b700;
  --r: 14px; --shadow: 0 18px 50px -20px rgba(0,0,0,.8), 0 2px 8px rgba(0,0,0,.35);
  --display: "Chakra", system-ui, sans-serif; --mono: "JBMono", ui-monospace, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--display); font-weight: 500; line-height: 1.55; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.08; letter-spacing: -.01em; }
h2 { font-size: clamp(30px, 4.4vw, 52px); margin: 14px 0 16px; text-wrap: balance; }
.lead { color: var(--dim); font-size: clamp(16px, 1.5vw, 19px); max-width: 62ch; }
section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.kw { font-family: var(--mono); font-size: .88em; color: var(--fg); background: rgba(236,235,230,.07); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 10px; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; border: 1px solid transparent; transition: transform .16s ease, background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--ink); box-shadow: 0 10px 30px -10px rgba(245,183,0,.6); }
.btn-primary:hover { background: #ffc61a; box-shadow: 0 14px 40px -10px rgba(245,183,0,.75); }
.btn-ghost { background: rgba(11,11,12,.45); border-color: var(--line-2); color: var(--fg); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--fg); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 13px; }

/* Navegación */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.scrolled, .nav.solid { background: rgba(11,11,12,.85); backdrop-filter: blur(14px); border-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 19px; letter-spacing: .14em; }
.brand img { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 6px; font-family: var(--mono); font-size: 13px; }
.nav-links a { color: var(--dim); padding: 8px 12px; border-radius: 8px; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--fg); background: rgba(236,235,230,.05); }
.nav-links a[aria-current] { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: none; cursor: pointer; place-items: center; }
.menu-btn svg { width: 20px; height: 20px; }

/* Cabecera de páginas interiores */
.page-head { padding: 150px 0 56px; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.page-head::before { content: ""; position: absolute; inset: 0; background: var(--head-img, none) center/cover; opacity: .28; filter: saturate(.9); }
.page-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,11,12,.6), var(--bg)); }
.page-head .wrap { position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(38px, 6vw, 72px); margin: 14px 0 14px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.toc a { font-family: var(--mono); font-size: 12px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--soft); transition: border-color .2s, color .2s; }
.toc a:hover { border-color: var(--accent); color: var(--fg); }

/* Carta (componente compartido) */
.card { --c: var(--f-light); --rc: var(--r-common); border-radius: 12px; background: #121213; border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s; position: relative; text-align: left; cursor: pointer; }
.card:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.9), 0 0 36px -12px color-mix(in srgb, var(--c) 55%, transparent); }
.card.legendary { border-color: rgba(245,183,0,.55); }
.card.legendary::before { content: ""; position: absolute; inset: -1px; border-radius: 12px; padding: 1px; background: linear-gradient(130deg, transparent 30%, rgba(255,214,90,.9), transparent 70%) 0 0 / 300% 300%; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: shine 4s linear infinite; pointer-events: none; z-index: 2; }
@keyframes shine { from { background-position: 100% 100%; } to { background-position: 0 0; } }
.card .art { aspect-ratio: 4/3; background: #1b1b1d center/cover; position: relative; }
.card .cost { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--mana); color: #fff; font-family: var(--mono); font-weight: 800; display: grid; place-items: center; font-size: 15px; box-shadow: 0 3px 10px rgba(0,0,0,.6); }
.card .rar { position: absolute; top: 10px; right: 10px; font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--rc); background: rgba(0,0,0,.7); padding: 2px 6px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--rc) 50%, transparent); text-transform: uppercase; }
.card .body { padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .fbar { height: 2px; background: var(--c); border-radius: 1px; width: 32px; }
.card h3 { font-size: 15px; line-height: 1.15; }
.card .txt { font-size: 12px; color: var(--soft); line-height: 1.4; flex: 1; }
.card .foot { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-weight: 700; font-size: 14px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; min-height: 30px; }
.card .foot .a { color: var(--accent); } .card .foot .t { font-size: 10px; color: var(--dim); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }

/* Carta grande de la vista ampliada: el mismo diseño que dentro del juego.
   Carbón mate, arte arriba (55 %), línea dorada, estandarte de coste, emblema
   hexagonal de facción y gema de rareza. Todo escala con el ancho. */
.gcard { position: relative; display: block; width: 100%; aspect-ratio: 63/88; container-type: inline-size; text-align: left;
  --c: var(--f-light); --rc: var(--r-common); --cg: #d9b768; --ink: #d8ccae; }
.gcard .face { position: absolute; inset: 0; background: #1d1b18; border-radius: 3cqw; box-shadow: 0 2px 6px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.6), 0 0 40px color-mix(in srgb, var(--c) 18%, transparent); overflow: hidden; }
.gcard .face::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(217,183,104,.55); border-radius: inherit; pointer-events: none; z-index: 4; }
.gcard .art { position: absolute; inset: 0 0 45% 0; background: #0c0b0a center/cover; }
.gcard .art::after { content: ""; position: absolute; inset: auto 0 0 0; height: 34%; background: linear-gradient(transparent, rgba(10,9,8,.88)); }
.gcard .rule { position: absolute; left: 0; right: 0; top: 55%; height: 1px; background: var(--cg); z-index: 1; }
.gcard .banner { position: absolute; left: 8.5%; top: 0; width: 15.6%; height: 19%; z-index: 3; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.gcard .banner svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gcard .banner b { position: absolute; top: 7%; left: 0; right: 0; text-align: center; font: 700 10cqw/1 var(--display); color: var(--cg); }
.gcard .banner small { position: absolute; top: 56%; left: 0; right: 0; text-align: center; font: 700 3.9cqw/1 var(--mono); letter-spacing: .04em; color: var(--cg); }
.gcard .kind { position: absolute; top: 4%; right: 5%; width: 15cqw; height: 15cqw; border-radius: 50%; background: rgba(18,16,15,.88); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); display: grid; place-items: center; z-index: 3; color: var(--c); }
.gcard .kind svg { width: 58%; height: 58%; }
.gcard .gstats { position: absolute; left: 0; right: 0; top: calc(55% - 12cqw); height: 11cqw; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0 9cqw; z-index: 3; font: 700 9cqw/1 var(--display); color: #fff; text-shadow: 0 1px 3px #000; }
.gcard .gstats span { display: flex; align-items: baseline; gap: 2.4cqw; }
.gcard .gstats i { font: 700 4.4cqw var(--mono); font-style: normal; letter-spacing: .06em; }
.gcard .gstats .a i { color: #e07a6e; } .gcard .gstats .h i { color: #86b8e8; }
.gcard .body { position: absolute; left: 7.8cqw; right: 7.8cqw; top: calc(55% + 4.5cqw); bottom: 5.5cqw; display: flex; flex-direction: column; z-index: 2; }
.gcard .name { font: 700 6.4cqw/1.15 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--cg); padding-right: 19cqw; min-height: 14.5cqw; text-wrap: balance; }
.gcard .txt { font: 500 5.2cqw/1.35 var(--display); color: var(--ink); margin: 2.4cqw 0 0; }
.gcard .sp { flex: 1; }
.gcard .foot { border-top: 1px solid rgba(217,183,104,.55); padding-top: 2.4cqw; font: 600 3.9cqw/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(217,183,104,.85); padding-right: 10cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .emblem { position: absolute; right: 6.5cqw; top: calc(55% + 3.6cqw); width: 16cqw; height: 18cqw; z-index: 3; }
.gcard .emblem svg { width: 100%; height: 100%; overflow: visible; }
.gcard .gem { position: absolute; right: 7.6cqw; bottom: 6.6cqw; width: 5.4cqw; height: 5.4cqw; transform: rotate(45deg); z-index: 3; background: linear-gradient(135deg, color-mix(in srgb, var(--rc) 55%, #fff) 0 48%, var(--rc) 48% 100%); box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 0 6px color-mix(in srgb, var(--rc) 60%, transparent); }
.gcard.legendary .face { box-shadow: 0 0 0 1px rgba(245,183,0,.6), 0 0 30px rgba(245,183,0,.3), 0 24px 60px rgba(0,0,0,.6); }
.gcard.legendary .face::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: 5; pointer-events: none; background: linear-gradient(130deg, transparent 30%, rgba(255,214,90,.95), transparent 70%) 0 0 / 300% 300%; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: shine 4s linear infinite; }

/* Carta abierta: vuela desde su sitio al centro, da una vuelta y su ficha aparece al lado */
.chip { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--soft); }
.ov { position: fixed; inset: 0; z-index: 100; overflow-y: auto; background: rgba(5,5,6,0); transition: background .4s, backdrop-filter .4s; }
.ov.open { background: rgba(5,5,6,.86); backdrop-filter: blur(10px); }
.ov .stage { min-height: 100%; display: grid; grid-template-columns: auto minmax(0, 480px); gap: 48px; align-items: center; justify-content: center; padding: 72px 20px 48px; }
.ov .big { width: min(340px, 80vw); perspective: 1600px; position: sticky; top: 72px; align-self: start; }
.ov .big .gcard { transform-style: preserve-3d; }
.ov .info { opacity: 0; transform: translateY(16px); transition: opacity .5s .3s var(--ease), transform .5s .3s var(--ease); display: flex; flex-direction: column; gap: 14px; }
.ov.open .info { opacity: 1; transform: none; }
.ov.closing .info { opacity: 0; transition-delay: 0s; transition-duration: .15s; }
.info h3 { font-size: clamp(28px, 4vw, 40px); text-wrap: balance; }
.info .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.info .istats { display: flex; gap: 18px; font-family: var(--mono); }
.info .istats b { font-size: 26px; display: block; line-height: 1; }
.info .istats span { font-size: 10px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.info .eff { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 16px; }
.info .lore { font-size: 15px; color: var(--soft); font-style: italic; border-left: 2px solid var(--line-2); padding-left: 12px; }
.info .terms { display: grid; gap: 6px; font-size: 13px; color: var(--soft); }
.ovclose { position: fixed; top: 14px; right: 14px; z-index: 101; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(20,20,21,.9); color: var(--fg); cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .3s; }
.ov.open .ovclose { opacity: 1; }
@media (max-width: 860px) { .ov .big { position: static; width: min(300px, 76vw); } .ov .stage { grid-template-columns: 1fr; justify-items: center; gap: 28px; padding-top: 64px; } .ov .info { width: 100%; max-width: 560px; } }

/* CTA y pie */
.cta-band { text-align: center; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; max-width: 200vw; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(245,183,0,.14), transparent 60%); pointer-events: none; }
.cta-band .wrap { position: relative; }
.cta-band h2 { max-width: 18ch; margin-inline: auto; }
.cta-band .lead { margin: 0 auto 32px; }
footer { border-top: 1px solid var(--line); padding: 40px 0 28px; font-size: 14px; color: var(--dim); }
footer .cols { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
footer .links { display: flex; gap: 22px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; }
footer .links a:hover { color: var(--fg); }
footer .legal { margin-top: 28px; font-family: var(--mono); font-size: 12px; }

/* Apariciones */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s var(--ease); }
.rv.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .nav-links { position: fixed; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 16px 16px; background: rgba(11,11,12,.97); border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
  .nav-links a { padding: 14px 4px; font-size: 15px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav.open { background: rgba(11,11,12,.97); }
}
@media (max-width: 480px) { .brand span { display: none; } .nav-right .btn { padding: 0 14px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
