/* ✦ ARCANUM · estética mística compartida (morado galáctico + oro) */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --fondo: #06030f;
  --fondo-2: #0d0720;
  --vidrio: rgba(22, 12, 48, .62);
  --vidrio-2: rgba(36, 20, 74, .55);
  --borde: rgba(167, 139, 250, .18);
  --borde-oro: rgba(212, 175, 55, .45);
  --morado: #8b5cf6;
  --morado-2: #a78bfa;
  --morado-3: #6d28d9;
  --magenta: #c026d3;
  --oro: #d4af37;
  --oro-2: #f5d27a;
  --texto: #ece6ff;
  --texto-2: #b8acd9;
  --texto-3: #8677b3;
  --exito: #34d399;
  --peligro: #f43f5e;
  --aviso: #f5b941;
  --radio: 16px;
  --sombra: 0 10px 40px -10px rgba(124, 58, 237, .45), 0 0 0 1px var(--borde);
  --fuente: 'Inter', system-ui, sans-serif;
  --fuente-titulo: 'Cinzel', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--fuente); color: var(--texto); background: var(--fondo);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
#galaxia { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.capa { position: relative; z-index: 1; }

a { color: var(--oro-2); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(212, 175, 55, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--morado-3), var(--morado)); border-radius: 10px; border: 2px solid var(--fondo); }
::-webkit-scrollbar-track { background: transparent; }

/* ── títulos dorados con brillo ── */
.titulo-oro {
  font-family: var(--fuente-titulo); font-weight: 700; letter-spacing: .08em;
  background: linear-gradient(100deg, #b8892a 0%, #ffe9a8 25%, #d4af37 50%, #fff3c4 70%, #b8892a 100%);
  background-size: 250% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: brilloOro 6s linear infinite; filter: drop-shadow(0 0 18px rgba(212, 175, 55, .35));
}
@keyframes brilloOro { to { background-position: 250% center; } }

.vidrio {
  background: var(--vidrio); border: 1px solid var(--borde); border-radius: var(--radio);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--sombra);
}
.borde-magico { position: relative; }
.borde-magico::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(130deg, rgba(212, 175, 55, .7), rgba(139, 92, 246, .2) 40%, rgba(192, 38, 211, .5) 70%, rgba(212, 175, 55, .7));
  background-size: 300% 300%; animation: auroraBorde 8s ease infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
@keyframes auroraBorde { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ── botones ── */
.btn {
  --c1: var(--morado-3); --c2: var(--morado);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08); cursor: pointer; font: 600 14px var(--fuente); color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); transition: transform .15s, box-shadow .25s, filter .2s;
  box-shadow: 0 6px 22px -8px var(--c2); text-decoration: none !important; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -6px var(--c2); filter: brightness(1.12); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.oro { --c1: #9a7420; --c2: #e6c158; color: #1b1030; }
.btn.peligro { --c1: #9f1239; --c2: #f43f5e; }
.btn.exito { --c1: #047857; --c2: #34d399; color: #04130d; }
.btn.fantasma { background: rgba(255, 255, 255, .04); box-shadow: none; border-color: var(--borde); color: var(--texto-2); }
.btn.fantasma:hover { background: rgba(139, 92, 246, .15); color: var(--texto); }
.btn.mini { padding: 6px 10px; font-size: 12px; border-radius: 9px; }

/* ── formularios ── */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.campo > label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-3); }
input, textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--borde); outline: none;
  background: rgba(8, 4, 22, .65); color: var(--texto); font: 14px var(--fuente); transition: border .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--morado-2); box-shadow: 0 0 0 3px rgba(139, 92, 246, .25), 0 0 20px -4px var(--morado); }
input[type=color] { padding: 2px; height: 40px; cursor: pointer; }
input[type=checkbox] { width: auto; accent-color: var(--oro); transform: scale(1.2); }
select option { background: var(--fondo-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(139, 92, 246, .18); border: 1px solid var(--borde); color: var(--morado-2);
}
.chip.oro { background: rgba(212, 175, 55, .14); border-color: var(--borde-oro); color: var(--oro-2); }
.chip.verde { background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .35); color: var(--exito); }
.chip.rojo { background: rgba(244, 63, 94, .14); border-color: rgba(244, 63, 94, .35); color: var(--peligro); }

/* ── toasts ── */
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 380px; padding: 12px 16px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: center;
  background: rgba(20, 10, 44, .92); border: 1px solid var(--borde-oro); box-shadow: 0 10px 40px -10px #000, 0 0 25px -10px var(--oro);
  animation: toastIn .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.toast.error { border-color: rgba(244, 63, 94, .6); }
.toast.saliendo { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ── animaciones ── */
.aparecer { animation: aparecer .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes aparecer { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
.flotar { animation: flotar 6s ease-in-out infinite; }
@keyframes flotar { 50% { transform: translateY(-10px); } }
.girar { animation: girar 20s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.destello { position: relative; overflow: hidden; }
.destello::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 233, 168, .18), transparent); transform: skewX(-20deg);
  animation: destello 5s ease-in-out infinite;
}
@keyframes destello { 0%, 60% { left: -60%; } 100% { left: 140%; } }

.cargando { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(212, 175, 55, .25); border-top-color: var(--oro); animation: girar .8s linear infinite; }
.vacio { text-align: center; padding: 40px 20px; color: var(--texto-3); }
.vacio .icono { font-size: 40px; display: block; margin-bottom: 10px; filter: drop-shadow(0 0 14px var(--morado)); }

/* ── iconos propios ── */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; fill: none; stroke: currentColor; }
.ic.oro { color: var(--oro-2); filter: drop-shadow(0 0 6px rgba(212, 175, 55, .55)); }
.ic.grande { width: 1.6em; height: 1.6em; }

/* ── markdown discord (compartido) ── */
.md-mencion { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 4px; padding: 0 3px; font-weight: 500; }
.md-code { background: rgba(0, 0, 0, .35); border-radius: 4px; padding: 1px 4px; font: 85% 'Consolas', monospace; }
.md-pre { background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .06); border-radius: 6px; padding: 8px 10px; overflow-x: auto; margin: 4px 0; }
.md-pre code { font: 13px 'Consolas', monospace; white-space: pre; }
.md-quote { border-left: 4px solid #4e5058; margin: 2px 0; padding: 0 8px 0 12px; }
.md-h1 { font-size: 1.5em; margin: 8px 0 4px; font-weight: 700; line-height: 1.25; }
.md-h2 { font-size: 1.25em; margin: 8px 0 4px; font-weight: 700; line-height: 1.25; }
.md-h3 { font-size: 1.05em; margin: 8px 0 2px; font-weight: 700; }
.md-sub { font-size: .8em; color: #949ba4; }
.md-li { display: flex; gap: 6px; }
.md-emoji { width: 1.375em; height: 1.375em; vertical-align: bottom; object-fit: contain; }
.md-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; transition: .2s; }
.md-spoiler.visto { background: rgba(255, 255, 255, .1); color: inherit; }
.md-tiempo { background: rgba(255, 255, 255, .06); border-radius: 3px; padding: 0 2px; }
