/* Panel de moderacion - monocromo (negro / blanco / grises), animado, sin librerias ni fuentes externas */

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg: #050505;
  --bg-2: #0d0d0d;
  --panel: rgba(16, 16, 16, 0.72);
  --panel-solid: #111111;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.42);
  --fg: #ffffff;
  --muted: #9b9b9b;
  --soft: rgba(255, 255, 255, 0.06);
  --soft-2: rgba(255, 255, 255, 0.11);
  --accent: #ffffff;
  --accent-fg: #000000;
  --dot: 255, 255, 255;
  --glow: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f4f4;
  --bg-2: #ececec;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --border: rgba(0, 0, 0, 0.14);
  --border-strong: rgba(0, 0, 0, 0.5);
  --fg: #000000;
  --muted: #666666;
  --soft: rgba(0, 0, 0, 0.045);
  --soft-2: rgba(0, 0, 0, 0.09);
  --accent: #000000;
  --accent-fg: #ffffff;
  --dot: 0, 0, 0;
  --glow: rgba(0, 0, 0, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-fg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------ fondo */
#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  filter: blur(40px);
  opacity: 0.8;
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { top: -18vmax; left: -12vmax; }
.aurora i:nth-child(2) { bottom: -22vmax; right: -14vmax; animation-duration: 28s; animation-delay: -8s; }
.aurora i:nth-child(3) { top: 30%; left: 45%; width: 30vmax; height: 30vmax; opacity: 0.45; animation-duration: 34s; animation-delay: -14s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.15); }
  100% { transform: translate3d(-4vmax, 8vmax, 0) scale(0.95); }
}
body::after { /* grano muy sutil para dar profundidad */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(var(--dot), 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.35;
}
#app, .toasts, .modal-root { position: relative; z-index: 2; }

/* ------------------------------------------------------------ animaciones base */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinAngle { to { --angle: 360deg; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--dot), 0.6); } 70% { box-shadow: 0 0 0 9px rgba(var(--dot), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--dot), 0); } }
.rise { opacity: 0; animation: rise 0.7s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 70ms); }

/* sin repetir la animacion de entrada cuando solo se refrescan datos de la misma pestaña */
.still .rise, .still tbody tr, .still .feed li, .still .chip, .still .table-wrap { animation: none; opacity: 1; }

/* ------------------------------------------------------------ utilidades */
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.grow > input { flex: 1; min-width: 220px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.card:hover { border-color: var(--border-strong); }
.card h2 { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); font-weight: 700; }

/* ------------------------------------------------------------ controles */
input[type="text"], select {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  min-height: 44px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s var(--ease), background 0.2s;
}
input[type="text"]::placeholder { color: var(--muted); }
input[type="text"]:hover, select:hover { border-color: var(--border-strong); }
input[type="text"]:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--soft-2); background: var(--soft-2); }
select option { background: var(--panel-solid); color: var(--fg); }

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 0 20px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), background 0.2s, color 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(var(--dot), 0.22); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn.alt { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn.alt:hover { background: var(--accent); color: var(--accent-fg); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 11px; border-radius: 10px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn::after { /* brillo que cruza el boton */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.btn:not(.alt):hover::after { transform: translateX(120%); }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--soft-2); border-color: var(--border-strong); transform: rotate(12deg) scale(1.06); }

/* ------------------------------------------------------------ barra superior */
.shell { min-height: 100vh; }
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(14px, 3vw, 28px);
  min-height: 66px;
  flex-wrap: wrap;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  animation: fade 0.6s var(--ease);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.2em; font-size: 13px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; }
.logo .icon { width: 17px; height: 17px; stroke-width: 2.4; }
.tabs { position: relative; display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}
.tab:hover { color: var(--fg); background: var(--soft); }
.tab.on { color: var(--fg); }
.ind { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; background: var(--accent); border-radius: 2px; box-shadow: 0 0 14px var(--accent); transition: transform 0.45s var(--ease), width 0.45s var(--ease); }
.ind.no-anim { transition: none; }
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.langs { display: flex; padding: 3px; gap: 2px; background: var(--soft); border: 1px solid var(--border); border-radius: 12px; }
.lang { background: transparent; border: 0; border-radius: 9px; padding: 6px 10px; cursor: pointer; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--muted); transition: background 0.25s var(--ease), color 0.2s; }
.lang:hover { color: var(--fg); }
.lang.on { background: var(--accent); color: var(--accent-fg); }
.me { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; background: var(--soft); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600; }
.me img { width: 30px; height: 30px; border-radius: 50%; background: var(--soft-2); object-fit: cover; }
.role { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); }

/* ------------------------------------------------------------ contenido */
main { max-width: 1040px; margin: 0 auto; padding: 32px clamp(14px, 3vw, 28px) 90px; }
.view-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 24px; }
.view-title h1 { font-size: clamp(24px, 4vw, 34px); margin: 0; letter-spacing: -0.02em; }
.view-title span { color: var(--muted); }

/* estadisticas */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { position: relative; overflow: hidden; margin: 0; padding: 20px; }
.stat::before { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 70%); }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }
.stat .num { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 10px; font-variant-numeric: tabular-nums; }

/* lista de actividad */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.feed li:first-child { border-top: 0; }
.feed .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--soft-2); }
.feed .txt { flex: 1; min-width: 0; }
.feed .txt b { font-weight: 700; }
.feed .when { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ficha del jugador */
.player { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.avatar-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.avatar-wrap::before { content: ""; position: absolute; inset: -5px; border-radius: 26px; background: conic-gradient(from var(--angle), transparent 0 55%, var(--accent) 100%); animation: spinAngle 4s linear infinite; opacity: 0.9; }
.avatar-wrap.safe::before { animation: none; background: var(--border-strong); opacity: 0.6; }
.avatar-wrap .photo { position: relative; width: 100%; height: 100%; border-radius: 22px; background: var(--panel-solid); object-fit: cover; display: block; border: 3px solid var(--bg); }
.player .info { flex: 1; min-width: 250px; }
.player .name { font-size: clamp(24px, 4vw, 32px); font-weight: 800; letter-spacing: -0.02em; margin: 0; word-break: break-all; text-transform: none; color: var(--fg); }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-weight: 800; letter-spacing: 0.12em; font-size: 11px; text-transform: uppercase; margin: 10px 0; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg); }
.badge.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.badge.on .dot { background: var(--accent-fg); animation: pulse 1.6s infinite; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 12px 0 0; }
dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; padding-top: 3px; }
dd { margin: 0; word-break: break-word; }
.link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--muted); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.link:hover { color: var(--fg); }

/* barra del puntaje del anticheat */
.meter { position: relative; height: 12px; border-radius: 999px; background: var(--soft-2); overflow: hidden; margin: 14px 0 6px; }
.meter .fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--accent); transition: width 1.1s var(--ease); }
.meter .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.meter-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-family: var(--mono); font-size: 12px; padding: 6px 10px; border-radius: 10px; background: var(--soft); border: 1px solid var(--border); animation: pop 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.chip b { color: var(--fg); }

.actions-box { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 20px; }
.actions-box .row { margin-bottom: 12px; }
.actions-box input[type="text"] { flex: 1; min-width: 220px; }

/* tablas */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow); animation: rise 0.6s var(--ease) both; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 14px 14px; font-weight: 700; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; font-size: 14px; word-break: break-word; }
tbody tr { animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); transition: background 0.2s; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: var(--soft); }
td img { width: 40px; height: 40px; border-radius: 12px; background: var(--soft-2); display: block; object-fit: cover; }
.empty { padding: 46px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 16px; animation: fade 0.5s var(--ease); }

/* esqueleto de carga */
.skel { position: relative; overflow: hidden; background: var(--soft-2); border-radius: 10px; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(var(--dot), 0.14), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
.skel.line { height: 14px; margin: 8px 0; }
.skel.block { height: 130px; border-radius: 16px; }

/* ------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; }
.login-top { position: absolute; top: 18px; right: 18px; display: flex; gap: 10px; align-items: center; }
.login-card { position: relative; width: min(440px, 100%); padding: 1px; border-radius: 26px; background: conic-gradient(from var(--angle), var(--border) 0 30%, var(--accent) 50%, var(--border) 70% 100%); animation: spinAngle 6s linear infinite, pop 0.9s var(--ease) both; box-shadow: var(--shadow), 0 0 80px var(--glow); }
.login-inner { border-radius: 25px; background: var(--panel-solid); padding: 44px 36px 34px; text-align: center; }
.login-inner .logo { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 20px; animation: float 4s ease-in-out infinite; }
.login-inner .logo .icon { width: 32px; height: 32px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.login-inner h1 { font-size: 26px; letter-spacing: 0.22em; margin: 0 0 10px; font-weight: 800; }
.login-inner p { margin: 0 0 26px; color: var(--muted); }
.login-inner .btn { width: 100%; min-height: 52px; font-size: 13px; }
.login-inner .err { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--border-strong); border-radius: 12px; padding: 11px 14px; margin: 0 0 20px; font-weight: 600; font-size: 14px; animation: pop 0.4s var(--ease); }
.features { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: 12px; }
.features span { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------ avisos */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 60; width: min(380px, calc(100vw - 36px)); }
.toast { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--accent); color: var(--accent-fg); border-radius: 14px; font-weight: 600; box-shadow: var(--shadow); animation: slideIn 0.5s var(--ease) both; }
.toast.err { background: var(--panel-solid); color: var(--fg); border: 1px solid var(--border-strong); }
.toast.out { animation: slideOut 0.35s var(--ease) forwards; }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: 0.45; transform-origin: left; animation: shrink 4.5s linear forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(40px) scale(0.96); } }
@keyframes shrink { to { transform: scaleX(0); } }

/* ------------------------------------------------------------ dialogo de confirmacion */
.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.25s var(--ease); }
.modal { width: min(440px, 100%); background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 20px; padding: 26px; box-shadow: var(--shadow), 0 0 70px var(--glow); animation: pop 0.4s var(--ease); }
.modal h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.modal p { margin: 0 0 22px; color: var(--muted); word-break: break-word; }
.modal .row { justify-content: flex-end; }
.modal.leaving { animation: none; opacity: 0; transform: scale(0.95); transition: all 0.2s var(--ease); }

/* ------------------------------------------------------------ responsive y accesibilidad */
@media (max-width: 720px) {
  .top { padding-top: 10px; padding-bottom: 6px; gap: 10px; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tab { padding: 10px 11px; white-space: nowrap; }
  .player { gap: 18px; }
  .avatar-wrap { width: 104px; height: 104px; }
  .stat .num { font-size: 36px; }
  .me .nm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .rise { opacity: 1; }
}
