/* Aetheria Online — estilos del sitio.
   Paleta del launcher: morado, dorado y pergamino. Cambia los colores aqui (tokens). */
:root {
  --bg: #120d1a;
  --bg-2: #1b1426;
  --panel: #241a33;
  --panel-2: #2e2240;
  --line: #3d2f55;
  --ink: #ece4f5;
  --muted: #a99cbd;
  --purple: #8d3fd1;
  --purple-2: #b16ef0;
  --gold: #e6c47a;
  --gold-2: #f6dc8a;
  --parchment: #f3ead6;
  --parchment-ink: #4a2c17;
  --ok: #57c78a;
  --bad: #e2766a;
  --radius: 12px;
  --f-title: "Cinzel", Georgia, serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --max: 1180px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--f-body); }
img { max-width: 100%; display: block; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff3c4; }
h1, h2, h3, h4 { font-family: var(--f-title); line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)); }
.muted { color: var(--muted); }
.gold { color: var(--gold); }

/* --- encabezado --- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(18, 13, 26, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-title); font-size: 1.25rem; color: var(--gold-2); white-space: nowrap; }
.brand img { width: 36px; height: 36px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 2px; margin-left: auto; }
.nav a { color: var(--ink); padding: 7px 8px; border-radius: 8px; font-size: .88rem; white-space: nowrap; }
.nav a:hover, .nav a.active { background: var(--panel-2); color: var(--gold-2); }
.nav .cta { background: var(--purple); color: #fff; }
.nav .cta:hover { background: var(--purple-2); color: #fff; }
.menu-toggle { display: none; margin-left: auto; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: inherit; }
@media (max-width: 1240px) {
  .menu-toggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .site-header .wrap { flex-wrap: wrap; }
}

/* --- aviso de vista previa --- */
.preview-notice { background: var(--panel); border-bottom: 1px solid var(--line); color: var(--ink); font-size: .875rem; line-height: 1.5; }
.preview-notice .wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding-block: 9px; }
.preview-notice strong { color: var(--gold-2); font-weight: 600; }
.preview-notice span { color: var(--muted); }

/* --- estado del servidor --- */
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: .9rem; }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-pill.on .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-pill.off .dot { background: var(--bad); }

/* --- secciones --- */
.section { padding-block: 56px; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--muted); max-width: 70ch; }
.hero { position: relative; padding-block: 0; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; padding-block: 56px; }
.hero h1 { color: var(--gold-2); }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 58ch; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 10px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font: 600 1rem var(--f-body); }
.btn-primary { background: linear-gradient(180deg, var(--purple-2), var(--purple)); color: #fff; box-shadow: 0 6px 18px rgba(141, 63, 209, .35); }
.btn-primary:hover { filter: brightness(1.12); color: #fff; }
.btn-ghost { background: transparent; color: var(--gold-2); border-color: var(--gold); }
.btn-ghost:hover { background: rgba(230, 196, 122, .1); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h3 { color: var(--gold-2); }
.card.parchment { background: var(--parchment); color: var(--parchment-ink); border-color: #d9c79e; }
.card.parchment h3 { color: #5b2f86; }
.feature-list { margin: 0; padding-left: 20px; }
.feature-list li { margin-bottom: 6px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

/* --- espacios para imagenes (reemplaza el div por un <img>) --- */
.img-slot { display: flex; align-items: center; justify-content: center; text-align: center; padding: 18px; border: 2px dashed var(--line); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, rgba(141, 63, 209, .06) 0 12px, transparent 12px 24px); color: var(--muted); font-size: .9rem; aspect-ratio: 16 / 9; }
.img-slot.tall { aspect-ratio: 3 / 4; }
.img-slot.wide { aspect-ratio: 21 / 8; }
.img-slot strong { display: block; color: var(--gold); font-family: var(--f-title); }

/* --- tablas --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--panel-2); font-family: var(--f-title); font-size: .85rem; letter-spacing: .04em; color: var(--gold); position: sticky; top: 0; }
tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
td.num { text-align: right; }

/* --- formularios --- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field small { color: var(--muted); }
input, select, textarea { width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--purple-2); border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: auto; margin-top: 5px; }
.alert { padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line); }
.alert.ok { border-color: var(--ok); background: rgba(87, 199, 138, .1); }
.alert.bad { border-color: var(--bad); background: rgba(226, 118, 106, .1); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- personajes --- */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.char-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; cursor: pointer; transition: transform .15s, border-color .15s; }
.char-card:hover, .char-card:focus-visible { transform: translateY(-3px); border-color: var(--gold); outline: none; }
.char-card .portrait { aspect-ratio: 4 / 5; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(ellipse at 50% 85%, rgba(177, 110, 240, .28), transparent 65%); border-radius: 9px; }
.char-card .portrait img { max-height: 100%; }
.char-card .name { font-family: var(--f-title); color: var(--gold-2); margin-top: 6px; }
.char-card .meta { color: var(--muted); font-size: .85rem; }
.empty { text-align: center; padding: 40px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8, 5, 12, .78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--gold); border-radius: 16px; max-width: 920px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; position: relative; }
.modal-close { position: absolute; top: 10px; right: 12px; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 1.1rem; }
.profile { display: grid; grid-template-columns: 300px 1fr; }
.profile .figure { background: radial-gradient(ellipse at 50% 80%, rgba(177, 110, 240, .35), transparent 70%), var(--bg-2); display: flex; align-items: flex-end; justify-content: center; padding: 16px; border-radius: 16px 0 0 16px; min-height: 380px; }
.profile .info { padding: 26px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 1.2rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8rem; }
@media (max-width: 720px) { .profile { grid-template-columns: 1fr; } .profile .figure { border-radius: 16px 16px 0 0; min-height: 280px; } }

/* --- clases --- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tab { background: var(--panel); border: 1px solid var(--line); color: var(--ink); padding: 9px 16px; border-radius: 999px; cursor: pointer; font: 600 .95rem var(--f-body); }
.tab.active, .tab:hover { border-color: var(--gold); color: var(--gold-2); }
.class-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.class-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; min-width: 0; overflow: hidden; }
.class-item img { width: 36px; height: 36px; flex-shrink: 0; }
.class-item span { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.class-item.active, .class-item:hover { border-color: var(--gold); }
.class-detail { margin-top: 26px; display: grid; grid-template-columns: 340px 1fr; gap: 26px; }
.duo { display: flex; justify-content: center; align-items: flex-end; gap: 0; background: radial-gradient(ellipse at 50% 85%, rgba(177, 110, 240, .3), transparent 68%), var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.duo img { width: 50%; }
.bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--gold)); }
.skill { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.skill img { width: 44px; height: 44px; border-radius: 8px; }
@media (max-width: 860px) { .class-detail { grid-template-columns: 1fr; } }

/* --- pie --- */
.site-footer { border-top: 1px solid var(--line); padding-block: 30px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
