/* ==========================================================================
   Viciont Studios — estilos base compartidos (web + panel)
   Paleta: morado, rosa, negro y blanco
   ========================================================================== */

:root {
  --bg: #06020c;
  --bg-2: #0d0418;
  --panel: rgba(13, 5, 24, 0.74);
  --panel-strong: rgba(17, 7, 31, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(196, 140, 255, 0.16);
  --line-strong: rgba(214, 160, 255, 0.3);
  --text: #f7f2ff;
  --text-2: #cfc2e8;
  --muted: #9b8cba;
  --purple: #8b5cf6;
  --purple-2: #a855f7;
  --purple-deep: #4c1d95;
  --pink: #ec4899;
  --pink-hot: #ff2bd6;
  --violet-glitch: #7a5cff;
  --danger: #ff5c8a;
  --ok: #c084fc;
  --grad: linear-gradient(100deg, #a855f7 0%, #ec4899 60%, #ff2bd6 100%);
  --grad-soft: linear-gradient(135deg, rgba(168, 85, 247, 0.24), rgba(236, 72, 153, 0.18));
  --glow-purple: 0 0 24px rgba(168, 85, 247, 0.45);
  --glow-pink: 0 0 24px rgba(236, 72, 153, 0.45);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --font-display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --font-ui: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Share Tech Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --header-h: 72px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: #6d28d9 #0a0314;
  scrollbar-width: thin;
}
html.is-locked, html.is-menu-open { overflow: hidden; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }
::selection { background: rgba(236, 72, 153, 0.55); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0314; }
::-webkit-scrollbar-thumb { background: linear-gradient(#7c3aed, #db2777); border-radius: 10px; border: 2px solid #0a0314; }

:focus-visible { outline: 2px solid var(--pink-hot); outline-offset: 3px; }

.i { width: 1.1em; height: 1.1em; flex: none; }
.mono { font-family: var(--font-mono); }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 300;
  padding: 10px 16px; border-radius: 10px;
  background: var(--grad); color: #fff; font-weight: 700; text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Texto enriquecido ---------- */
.rich p + p { margin-top: 0.9em; }
.rich strong { color: #fff; font-weight: 700; background: linear-gradient(transparent 62%, rgba(236, 72, 153, 0.35) 62%); }

/* ---------- Botones ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 44px; padding: 0.7em 1.2em;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: 600 0.88rem/1.1 var(--font-ui);
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  overflow: hidden; isolation: isolate;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s, background 0.25s, color 0.25s;
}
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.6s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: rgba(236, 72, 153, 0.7); box-shadow: var(--glow-pink); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn--primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px rgba(236, 72, 153, 0.7); }
.btn--primary:hover { box-shadow: 0 12px 36px -8px rgba(236, 72, 153, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.15) inset; }
.btn--ghost { background: transparent; }
.btn--danger { border-color: rgba(255, 92, 138, 0.55); color: #ffc2d4; background: rgba(255, 92, 138, 0.08); }
.btn--danger:hover { border-color: var(--danger); box-shadow: 0 0 24px rgba(255, 92, 138, 0.4); }
.btn--sm { min-height: 36px; padding: 0.5em 0.85em; font-size: 0.76rem; border-radius: 10px; }
.btn--icon { padding: 0; width: 44px; min-width: 44px; }
.btn--icon.btn--sm { width: 36px; min-width: 36px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 7px; min-width: 0; }
.field__label { font: 600 0.74rem/1.2 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.field__label em { font-style: normal; color: var(--pink-hot); }
.field__hint { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.field__hint code, .field__hint b { color: var(--text-2); }
.input {
  width: 100%; min-height: 44px;
  padding: 0.7em 0.9em;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(6, 1, 14, 0.72);
  color: var(--text);
  font: 400 0.95rem/1.45 var(--font-ui);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder { color: #7a6c98; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--purple-2); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25); background: rgba(10, 3, 20, 0.9); }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 92, 138, 0.2); }
.textarea { resize: vertical; min-height: 110px; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.4em;
  background-image: linear-gradient(45deg, transparent 50%, #d8b4fe 50%), linear-gradient(135deg, #d8b4fe 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.select option { background: #12061f; color: var(--text); }
.form-error { display: flex; gap: 8px; align-items: flex-start; font-size: 0.88rem; color: #ffc2d4; background: rgba(255, 92, 138, 0.1); border: 1px solid rgba(255, 92, 138, 0.35); padding: 10px 12px; border-radius: 10px; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.92rem; color: var(--text-2); }
.check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-strong); background: rgba(6, 1, 14, 0.7); display: grid; place-items: center; transition: 0.2s; flex: none; }
.check input::after { content: ''; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) scale(0); transition: transform 0.2s var(--ease); margin-top: -2px; }
.check input:checked { background: var(--grad); border-color: transparent; }
.check input:checked::after { transform: rotate(-45deg) scale(1); }

/* ---------- Etiquetas ---------- */
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 400 0.8rem/1.2 var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: #f0abfc; }
.kicker__num { color: #fff; padding: 2px 7px; border-radius: 6px; background: var(--grad); letter-spacing: 0.05em; }

.role {
  display: inline-flex; align-items: center;
  padding: 5px 11px; border-radius: 999px;
  font: 600 0.7rem/1 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase;
  color: #f3e8ff; background: rgba(168, 85, 247, 0.16); border: 1px solid rgba(192, 132, 252, 0.4);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 400 0.74rem/1 var(--font-mono); letter-spacing: 0.05em; padding: 6px 9px; border-radius: 7px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 0.78rem/1 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--grad-soft); color: #fff; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink-hot); box-shadow: 0 0 0 0 rgba(255, 43, 214, 0.7); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 43, 214, 0.65); } 70% { box-shadow: 0 0 0 9px rgba(255, 43, 214, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 43, 214, 0); } }
.caret { display: inline-block; width: 0.55em; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--pink-hot); box-shadow: 0 0 10px var(--pink-hot); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Avatar ---------- */
.avatar { position: relative; display: block; border-radius: 50%; padding: 3px; background: var(--grad); flex: none; }
.avatar > img, .avatar__initials { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #14072a; }
.avatar__initials {
  display: grid; place-items: center;
  font: 400 2.1rem/1 var(--font-display); letter-spacing: 0.04em; color: #fff;
  background: radial-gradient(circle at 30% 25%, #6d28d9, #1b0833 70%);
  text-shadow: -1px 0 rgba(255, 43, 214, 0.8), 1px 0 rgba(122, 92, 255, 0.8);
}

/* ---------- Portada por defecto de las tarjetas ---------- */
.cover {
  position: absolute; inset: 0; overflow: hidden;
  display: grid; place-items: center;
  container-type: size;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(168, 85, 247, 0.6), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(236, 72, 153, 0.5), transparent 60%),
    #0b0316;
}
.cover--1 {
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(255, 43, 214, 0.55), transparent 55%),
    radial-gradient(90% 90% at 0% 100%, rgba(124, 58, 237, 0.6), transparent 60%),
    #0b0316;
}
.cover--2 {
  background:
    radial-gradient(80% 70% at 50% 45%, rgba(139, 92, 246, 0.55), transparent 65%),
    radial-gradient(70% 60% at 85% 10%, rgba(236, 72, 153, 0.45), transparent 60%),
    #0a0213;
}
.cover__grid {
  position: absolute; left: -25%; right: -25%; bottom: -10%; height: 70%; z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 30px 30px;
  transform: perspective(300px) rotateX(52deg);
  transform-origin: bottom;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
}
.cover__orb { position: absolute; width: 55cqi; aspect-ratio: 1; border-radius: 50%; z-index: -1; background: radial-gradient(circle, rgba(255, 43, 214, 0.35), transparent 65%); filter: blur(10px); animation: orb 7s ease-in-out infinite alternate; }
@keyframes orb { from { transform: translate(-18%, -10%) scale(0.9); } to { transform: translate(18%, 8%) scale(1.1); } }
.cover__emblem { position: absolute; right: 5%; bottom: 7%; width: 24cqi; opacity: 0.2; filter: grayscale(1) brightness(1.8); z-index: -1; }
.cover__title {
  padding: 0 9%;
  font: 400 11cqi/0.9 var(--font-display);
  letter-spacing: 0.02em; text-align: center; text-transform: uppercase; color: #fff;
  text-shadow: -2px 0 rgba(255, 43, 214, 0.75), 2px 0 rgba(122, 92, 255, 0.75), 0 0 28px rgba(168, 85, 247, 0.7);
  transition: transform 0.6s var(--ease);
}
.cover__code { position: absolute; left: 5%; bottom: 7%; font: 400 clamp(9px, 3.2cqi, 13px)/1 var(--font-mono); letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.6); }
.cover__corner { position: absolute; width: min(9cqi, 34px); height: min(9cqi, 34px); border: 2px solid rgba(255, 255, 255, 0.35); }
.cover__corner--tl { top: 6%; left: 4%; border-right: 0; border-bottom: 0; }
.cover__corner--tr { right: 4%; top: 6%; border-left: 0; border-bottom: 0; }

/* ---------- Glitch ---------- */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  pointer-events: none; opacity: 0;
  background: none;
  -webkit-text-fill-color: currentColor;
}
.glitch::before { color: var(--pink-hot); }
.glitch::after { color: var(--violet-glitch); }
.glitch.is-bursting { animation: glitch-skew 0.48s steps(2, end) both; }
.glitch.is-bursting::before { opacity: 0.9; animation: glitch-a 0.48s steps(2, end) both; }
.glitch.is-bursting::after { opacity: 0.9; animation: glitch-b 0.48s steps(2, end) both; }
.glitch--grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.glitch--grad::before { -webkit-text-fill-color: var(--pink-hot); }
.glitch--grad::after { -webkit-text-fill-color: var(--violet-glitch); }

@keyframes glitch-a {
  0% { clip-path: inset(10% 0 72% 0); transform: translate(-6px, -1px); }
  20% { clip-path: inset(58% 0 18% 0); transform: translate(5px, 1px); }
  40% { clip-path: inset(32% 0 44% 0); transform: translate(-4px, 2px); }
  60% { clip-path: inset(80% 0 4% 0); transform: translate(6px, -1px); }
  80% { clip-path: inset(4% 0 86% 0); transform: translate(-3px, 1px); }
  100% { clip-path: inset(44% 0 44% 0); transform: translate(0); }
}
@keyframes glitch-b {
  0% { clip-path: inset(66% 0 12% 0); transform: translate(5px, 1px); }
  20% { clip-path: inset(8% 0 78% 0); transform: translate(-6px, -1px); }
  40% { clip-path: inset(46% 0 30% 0); transform: translate(4px, 0); }
  60% { clip-path: inset(22% 0 60% 0); transform: translate(-5px, 1px); }
  80% { clip-path: inset(70% 0 10% 0); transform: translate(3px, -1px); }
  100% { clip-path: inset(40% 0 50% 0); transform: translate(0); }
}
@keyframes glitch-skew {
  0% { transform: none; }
  25% { transform: skewX(-6deg) translateX(2px); }
  50% { transform: skewX(4deg) translateX(-2px); }
  75% { transform: skewX(-2deg); }
  100% { transform: none; }
}

/* Imagen con glitch (emblema) */
.glitch-img { position: relative; }
.glitch-img__main { position: relative; z-index: 1; width: 100%; }
.glitch-img__ghost { position: absolute; inset: 0; width: 100%; opacity: 0; pointer-events: none; mix-blend-mode: screen; }
.glitch-img__ghost--a { filter: brightness(1.4) sepia(1) saturate(7) hue-rotate(255deg); }
.glitch-img__ghost--b { filter: brightness(1.4) sepia(1) saturate(7) hue-rotate(300deg); }
.glitch-img.is-bursting .glitch-img__main { animation: glitch-skew 0.48s steps(2, end) both; }
.glitch-img.is-bursting .glitch-img__ghost { z-index: 2; opacity: 0.85; }
.glitch-img.is-bursting .glitch-img__ghost--a { animation: glitch-a 0.48s steps(2, end) both; }
.glitch-img.is-bursting .glitch-img__ghost--b { animation: glitch-b 0.48s steps(2, end) both; }

/* ---------- Ventana modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 0, 10, 0.74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in 0.25s ease both; }
.modal__dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto; overscroll-behavior: contain;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(24, 9, 43, 0.97), rgba(12, 4, 23, 0.98));
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85), 0 0 60px -12px rgba(168, 85, 247, 0.45);
  animation: modal-in 0.38s var(--ease) both;
  outline: none;
}
.modal__dialog::before { content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px; background: var(--grad); box-shadow: 0 0 16px rgba(236, 72, 153, 0.9); }
.modal__dialog--sm { width: min(420px, 100%); }
.modal__dialog--lg { width: min(760px, 100%); }
.modal__dialog--xl { width: min(980px, 100%); }
.modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(8, 2, 16, 0.75); color: var(--text);
  transition: 0.2s;
}
.modal__close:hover { border-color: var(--pink); color: #fff; box-shadow: var(--glow-pink); transform: rotate(90deg); }
.modal.is-locked .modal__close { display: none; }
.modal.is-closing .modal__dialog { animation: modal-out 0.18s ease both; }
.modal.is-closing .modal__backdrop { animation: fade-out 0.18s ease both; }
.modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.97); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

@media (max-width: 560px) {
  .modal { place-items: end center; padding: 0; }
  .modal__dialog, .modal__dialog--sm, .modal__dialog--lg, .modal__dialog--xl { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; animation-name: sheet-in; }
  .modal__actions { justify-content: stretch; }
  .modal__actions > * { flex: 1 1 auto; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Confirmación */
.confirm { padding: 30px 26px 24px; text-align: center; }
.confirm__icon { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 16px; background: var(--grad-soft); border: 1px solid var(--line-strong); font-size: 1.5rem; color: #f5d0fe; }
.confirm__icon.is-danger { background: rgba(255, 92, 138, 0.12); border-color: rgba(255, 92, 138, 0.45); color: #ffb3c8; }
.confirm__title { font: 400 2rem/1 var(--font-display); letter-spacing: 0.02em; }
.confirm__text { margin-top: 10px; color: var(--text-2); font-size: 0.95rem; }
.confirm .modal__actions { justify-content: center; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 150; display: grid; gap: 10px; transform: translateX(-50%); width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 14px;
  background: rgba(20, 8, 36, 0.96); border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8), 0 0 30px -10px rgba(236, 72, 153, 0.6);
  font-size: 0.92rem; color: var(--text);
  opacity: 0; transform: translateY(14px) scale(0.98);
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.toast.on { opacity: 1; transform: none; }
.toast .i { color: var(--pink-hot); font-size: 1.1rem; }
.toast--success .i { color: #d8b4fe; }
.toast--error { border-color: rgba(255, 92, 138, 0.6); }
.toast--error .i { color: var(--danger); }

/* ---------- Estado vacío ---------- */
.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding: 48px 20px; text-align: center; color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(10, 3, 20, 0.5); }
.empty .i { font-size: 1.8rem; color: var(--pink-hot); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}
