/* ==========================================================================
   AlexBoost - sistema de diseno propio (modo oscuro, mobile first)
   ======================================================================= */
:root {
  --bg: #080b12;
  --bg-elev: #0d121c;
  --surface: #111827;
  --surface-2: #161f31;
  --surface-3: #1c2739;
  --border: #1e2838;
  --border-strong: #2a3852;
  --text: #e8eef7;
  --text-dim: #9aa8bd;
  --text-faint: #6b7a91;
  --accent: #5b8cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --grad: linear-gradient(135deg, #5b8cff 0%, #22d3ee 100%);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --nav-h: 64px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}

body {
  background-image:
    radial-gradient(900px 500px at 15% -10%, rgba(91, 140, 255, 0.10), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(34, 211, 238, 0.07), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
svg.ic { width: 20px; height: 20px; fill: currentColor; flex: none; }
svg.ic-sm { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* ---------- Pantalla de carga ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--text-dim); }
.boot-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--grad); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .45; transform: scale(.94);} 50% { opacity: 1; transform: scale(1);} }

/* ==========================================================================
   Autenticacion
   ======================================================================= */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px; padding: 32px 26px;
  box-shadow: var(--shadow);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; text-align: center; }
.auth-brand img { width: 64px; height: 64px; }
.auth-brand h1 { margin: 0; font-size: 26px; letter-spacing: -.5px; }
.auth-brand p { margin: 0; color: var(--text-dim); font-size: 14px; }

/* ==========================================================================
   Estructura general
   ======================================================================= */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--sab) + 12px); }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--sat) + 12px) 16px 12px;
  background: rgba(8, 11, 18, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.3px; }
.topbar .brand img { width: 30px; height: 30px; }
.topbar .spacer { flex: 1; }

.iconbtn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); cursor: pointer;
  transition: .15s;
}
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); }
.iconbtn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.main { padding: 16px; max-width: 1180px; margin: 0 auto; }

/* ---------- Navegacion inferior (movil) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(13, 18, 28, 0.94);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--sab);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--nav-h); color: var(--text-faint); font-size: 10.5px; font-weight: 600;
  position: relative; transition: color .15s;
}
.bottomnav a.active { color: var(--accent); }
.bottomnav a.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--grad);
}
.navbadge {
  position: absolute; top: 8px; right: 50%; margin-right: -20px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center;
}

/* ---------- Barra lateral (escritorio) ---------- */
.sidebar { display: none; }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .shell { display: grid; grid-template-columns: 232px 1fr; padding-bottom: 0; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    padding: 22px 14px; border-right: 1px solid var(--border);
    background: var(--bg-elev); position: sticky; top: 0; height: 100vh;
  }
  .sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; font-size: 19px; font-weight: 700; letter-spacing: -.4px; }
  .sidebar .brand img { width: 34px; height: 34px; }
  .sidebar a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px;
    border-radius: var(--radius-sm); color: var(--text-dim); font-weight: 600; font-size: 14px;
    transition: .15s; position: relative;
  }
  .sidebar a:hover { background: var(--surface); color: var(--text); }
  .sidebar a.active { background: var(--accent-soft); color: var(--accent); }
  .sidebar .sb-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 9px; }
  .sidebar .sb-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12px; }
  .topbar { display: none; }
  .main { padding: 26px 30px 40px; }
}

/* ==========================================================================
   Componentes
   ======================================================================= */
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.5px; }
.page-head .sub { color: var(--text-dim); font-size: 13px; margin: 2px 0 0; }
.page-head .spacer { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.card + .card { margin-top: 14px; }
.card h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; }
.card h2 .spacer { flex: 1; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; position: relative; overflow: hidden;
}
.kpi::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--grad); opacity: .8; }
.kpi .k-label { color: var(--text-dim); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 26px; font-weight: 700; letter-spacing: -1px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.kpi.warn::after { background: var(--warn); }
.kpi.danger::after { background: var(--danger); }
.kpi.ok::after { background: var(--ok); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); border-color: transparent; color: #06121f; }
.btn-primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: rgba(239,68,68,.35); background: var(--danger-soft); }
.btn-danger:hover { background: rgba(239,68,68,.22); border-color: var(--danger); }
.btn-ok { color: var(--ok); border-color: rgba(34,197,94,.35); background: var(--ok-soft); }
.btn-ok:hover { background: rgba(34,197,94,.22); border-color: var(--ok); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text);
  outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 70px; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.switch:last-child { border-bottom: 0; }
.switch .s-label { font-size: 14px; font-weight: 600; }
.switch .s-desc { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.toggle { position: relative; width: 46px; height: 27px; flex: none; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.toggle span { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 99px; transition: .2s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--text-faint); transition: .2s; }
.toggle input:checked + span { background: var(--accent-soft); border-color: var(--accent); }
.toggle input:checked + span::after { transform: translateX(19px); background: var(--accent); }

/* ---------- Estados ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
  border: 1px solid transparent; white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.st-online { color: var(--ok); background: var(--ok-soft); border-color: rgba(34,197,94,.3); }
.st-connecting, .st-reconnecting { color: var(--warn); background: var(--warn-soft); border-color: rgba(245,158,11,.3); }
.st-guard { color: var(--accent-2); background: rgba(34,211,238,.14); border-color: rgba(34,211,238,.32); }
.st-error { color: var(--danger); background: var(--danger-soft); border-color: rgba(239,68,68,.3); }
.st-stopped { color: var(--text-faint); background: var(--surface-2); border-color: var(--border-strong); }
.st-online .dot { animation: blink 2s ease-in-out infinite; }
.st-connecting .dot, .st-reconnecting .dot { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Tarjetas de cuenta ---------- */
.acc-grid { display: grid; grid-template-columns: 1fr; gap: 11px; }
@media (min-width: 640px) { .acc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .acc-grid { grid-template-columns: repeat(3, 1fr); } }

.acc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 11px; cursor: pointer;
  transition: .16s; position: relative; overflow: hidden;
}
.acc:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.acc.is-error { border-color: rgba(239,68,68,.4); }
.acc.is-guard { border-color: rgba(34,211,238,.4); }
.acc-top { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: cover;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-weight: 700; color: var(--text-dim); font-size: 16px;
}
.avatar.lg { width: 68px; height: 68px; border-radius: 18px; font-size: 24px; }
.acc-id { min-width: 0; flex: 1; }
.acc-id .name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-id .user { color: var(--text-faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); }
.acc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.acc-msg { font-size: 12px; color: var(--text-faint); line-height: 1.4; }
.acc-actions { display: flex; gap: 7px; }

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.row .r-main { min-width: 0; flex: 1; }
.row .r-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-sub { color: var(--text-faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-actions { display: flex; gap: 6px; flex: none; }

/* ---------- Info grid ---------- */
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .info-grid { grid-template-columns: repeat(4, 1fr); } }
.info {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px;
}
.info .i-label { color: var(--text-faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 5px; }
.info .i-value { font-weight: 600; font-size: 14.5px; margin-top: 4px; word-break: break-word; font-variant-numeric: tabular-nums; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- Logs ---------- */
.logs { font-family: var(--mono); font-size: 12px; display: flex; flex-direction: column; gap: 1px; max-height: 62vh; overflow-y: auto; }
.logline { display: flex; gap: 9px; padding: 6px 8px; border-radius: 7px; align-items: baseline; }
.logline:nth-child(odd) { background: rgba(255,255,255,.017); }
.logline .lt { color: var(--text-faint); flex: none; }
.logline .ls { flex: none; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.logline .lm { flex: 1; word-break: break-word; }
.logline.l-warn .lm { color: var(--warn); }
.logline.l-error .lm { color: var(--danger); }
.logline.l-debug { opacity: .6; }

/* ---------- Barras de reporte ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 108px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--grad); transition: width .4s ease; }
.bar-row .b-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); }
.bar-row .b-val { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; }

/* ---------- Inventario / juegos ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
.tile { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; display: flex; gap: 9px; align-items: center; }
.tile img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.tile .t-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t-sub { font-size: 11px; color: var(--text-faint); }

/* ---------- Varios ---------- */
.empty { text-align: center; padding: 34px 18px; color: var(--text-faint); }
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: 10px; fill: currentColor; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; }
.center { text-align: center; }
.err { color: var(--danger); font-size: 13px; margin-bottom: 12px; }
.notice { background: var(--accent-soft); border: 1px solid rgba(91,140,255,.3); color: var(--text); border-radius: var(--radius-sm); padding: 12px 13px; font-size: 13px; margin-bottom: 14px; }
.notice.warn { background: var(--warn-soft); border-color: rgba(245,158,11,.3); }
.notice.danger { background: var(--danger-soft); border-color: rgba(239,68,68,.3); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; flex: 1; min-width: 130px; padding: 8px 11px; font-size: 13px; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 6, 11, .72);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 18px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 470px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 22px; box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 4px; font-size: 18px; }
.modal .m-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 200; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--sab) + 12px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 900px) { .toasts { left: auto; right: 22px; bottom: 22px; width: 330px; } }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; box-shadow: var(--shadow);
  animation: slidein .22s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ==========================================================================
   Rejilla de juegos con portada
   ======================================================================= */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
@media (min-width: 700px) { .games { grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); } }

.game {
  position: relative; padding: 0; overflow: hidden; text-align: left; color: inherit;
  display: flex; flex-direction: column; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.game:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.game:active { transform: translateY(0) scale(.985); }
.game.on { border-color: var(--ok); }
.game.on .game-body { background: var(--ok-soft); }

.game-cover { position: relative; display: block; aspect-ratio: 460 / 215; background: var(--surface-3); overflow: hidden; }
.game-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: 1; }
.game-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); }
.game-fallback svg { width: 28px; height: 28px; fill: currentColor; opacity: .4; }
.game-flag {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #05170c; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.game-flag svg { width: 14px; height: 14px; fill: currentColor; }
/* Distintivos de funciones activas */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 600;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-dim);
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.chip svg { width: 12px; height: 12px; fill: currentColor; flex: none; }
.chip-accent { background: var(--accent-soft); border-color: rgba(91,140,255,.35); color: var(--accent); }

.card-drops {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--accent); color: #04101f; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.game-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 2px; transition: background .16s; }
.game-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-time { font-size: 11px; color: var(--text-faint); }

/* ==========================================================================
   Ficha de perfil de cuenta
   ======================================================================= */
.profile-head { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.profile-id { min-width: 0; flex: 1; }
.profile-name { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.profile-tags { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.profile-card.live { border-color: rgba(34, 197, 94, .28); }
.profile-card.live .avatar.lg { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(34, 197, 94, .55); }

.btn-steam { background: #1b2838; border-color: #2a475e; color: #c7d5e0; }
.btn-steam:hover { background: #2a475e; border-color: #66c0f4; color: #fff; }

/* ==========================================================================
   Extras de interfaz
   ======================================================================= */
input[type=range] {
  width: 100%; accent-color: var(--accent); background: transparent;
  height: 26px; padding: 0; border: 0;
}
input[type=range]:focus { box-shadow: none; }

.main > * { animation: rise .22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }

.kpi { transition: border-color .16s, transform .16s; }
.kpi:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.acc.is-online .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px rgba(34, 197, 94, .5); }

a.btn { text-decoration: none; }

/* ==========================================================================
   Banner de atencion (fijo arriba en cualquier pagina)
   ======================================================================= */
.attn-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--danger-soft); border: 1px solid rgba(239, 68, 68, .4);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px;
  color: var(--text); font-size: 13.5px;
  animation: attnPulse 2s ease-in-out infinite;
}
.attn-banner svg { fill: var(--danger); flex: none; }
.attn-banner span { flex: 1; min-width: 0; }
.attn-banner .btn { flex: none; }
@keyframes attnPulse { 0%, 100% { border-color: rgba(239, 68, 68, .4); } 50% { border-color: rgba(239, 68, 68, .85); } }

/* ==========================================================================
   Diagnostico de notificaciones
   ======================================================================= */
.chk-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.chk-row { display: flex; align-items: flex-start; gap: 11px; }
.chk {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.chk svg { width: 15px; height: 15px; fill: currentColor; }
.chk.ok { background: var(--ok-soft); color: var(--ok); }
.chk.bad { background: var(--danger-soft); color: var(--danger); }
.chk.pend { background: var(--warn-soft); color: var(--warn); }
.chk-label { font-weight: 600; font-size: 14px; }
.chk-detail { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.steps { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.9; }
.steps li { margin-bottom: 2px; }
.steps code, .notice code {
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 1px 6px; font-family: var(--mono); font-size: 12px; color: var(--accent-2);
  word-break: break-all;
}

.ios-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ios-step {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 13.5px;
}
.ios-num {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--grad); color: #06121f;
}

/* Estado del bot de Telegram */
.tg-status { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 12px 0; }
.tg-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tg-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.tg-dot.off { background: var(--text-faint); }
.tg-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

/* ==========================================================================
   Tema claro (v2.0)
   ======================================================================= */
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --surface-3: #e6ebf3;
  --border: #dde3ec;
  --border-strong: #c4cddb;
  --text: #10151f;
  --text-dim: #4a5568;
  --text-faint: #8592a6;
  --shadow: 0 8px 30px rgba(60, 80, 120, 0.12);
}
:root[data-theme="light"] body {
  background-image:
    radial-gradient(900px 500px at 15% -10%, rgba(91, 140, 255, 0.10), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(34, 211, 238, 0.08), transparent 55%);
}
:root[data-theme="light"] .topbar { background: rgba(244, 246, 251, 0.85); }
:root[data-theme="light"] .bottomnav { background: rgba(255, 255, 255, 0.95); }
:root[data-theme="light"] .btn-primary { color: #fff; }
:root[data-theme="light"] .logline:nth-child(odd) { background: rgba(0,0,0,.02); }

/* ==========================================================================
   Graficas (v2.0)
   ======================================================================= */
.chart { width: 100%; height: auto; display: block; margin: 4px 0 6px; }
.chart-donut { display: block; margin: 0 auto; max-width: 160px; }
.c-grid { stroke: var(--border); stroke-width: 1; }
.c-axis { fill: var(--text-faint); font-size: 10px; font-family: var(--font); }
.c-donut-num { fill: var(--text); font-size: 22px; font-weight: 700; }
.chart-title { font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin: 16px 0 4px; }
.stats-2col { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .stats-2col { grid-template-columns: 160px 1fr; align-items: start; } }

.rank { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.rank-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); }
.rank-track { height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rank-fill { height: 100%; border-radius: 99px; background: var(--grad); }
.rank-val { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; white-space: nowrap; }

/* ==========================================================================
   Centro de notificaciones (v2.0)
   ======================================================================= */
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.notif-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 17px; flex: none; }
.row.unread { position: relative; }
.row.unread::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Selector de acento (v2.0) */
.accent-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.accent-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.accent-dot.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
#accent-picker { width: 34px; height: 30px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: none; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
