/* =========================================================
   FNF' Ports Mobile — Diseño Glass (rosa / lila)
   Un solo archivo de estilos. Tokens arriba, componentes abajo.
   ========================================================= */

@font-face {
  font-family: 'Funkin';
  src: url('../assets/fonts/funkin.ttf') format('truetype'),
       url('https://raw.githubusercontent.com/LaloCF2/fnf_ports/main/assets/fonts/funkin.ttf') format('truetype');
  font-display: swap;
}

/* ---------- Tokens (tema claro, por defecto) ---------- */
:root {
  --accent: #b14fe0;
  --accent-2: #7b5cf6;
  --accent-grad: linear-gradient(135deg, #e07ad0 0%, var(--accent) 45%, var(--accent-2) 100%);

  --bg-1: #fbd9f1;
  --bg-2: #ecc8f7;
  --bg-3: #f8e3f5;
  --blob-1: rgba(255, 120, 210, 0.55);
  --blob-2: rgba(150, 110, 255, 0.45);
  --blob-3: rgba(120, 200, 255, 0.35);

  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-blur: 16px;

  --text: #2a2140;
  --text-2: #5c4f72;
  --muted: #9284a8;
  --line: rgba(120, 80, 160, 0.14);

  --ok: #19b56b;
  --warn: #f2a516;
  --danger: #ef3e6d;
  --gama-low: #19b56b;
  --gama-mid: #f2a516;
  --gama-high: #ef3e6d;

  --shadow-sm: 0 2px 10px rgba(150, 70, 180, 0.10);
  --shadow: 0 10px 30px rgba(150, 70, 180, 0.16);
  --shadow-lg: 0 24px 60px rgba(120, 50, 160, 0.24);

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.45, .55, 1);

  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg-1: #1b1027;
  --bg-2: #24123a;
  --bg-3: #160d22;
  --blob-1: rgba(225, 80, 190, 0.35);
  --blob-2: rgba(120, 80, 255, 0.32);
  --blob-3: rgba(60, 140, 255, 0.20);

  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(40, 24, 58, 0.86);
  --glass-border: rgba(255, 255, 255, 0.12);

  --text: #f6eefc;
  --text-2: #d3c4e4;
  --muted: #a493b9;
  --line: rgba(255, 255, 255, 0.10);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%) fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .3s var(--ease);
}

/* Burbujas de fondo: fijas, solo transform (GPU) */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  will-change: transform;
  animation: blob-float 18s ease-in-out infinite alternate;
}
.bg-blobs span:nth-child(1) { width: 60vw; height: 60vw; max-width: 520px; max-height: 520px; top: -12%; left: -18%; background: var(--blob-1); }
.bg-blobs span:nth-child(2) { width: 55vw; height: 55vw; max-width: 480px; max-height: 480px; top: 30%; right: -22%; background: var(--blob-2); animation-delay: -6s; }
.bg-blobs span:nth-child(3) { width: 50vw; height: 50vw; max-width: 420px; max-height: 420px; bottom: -14%; left: 10%; background: var(--blob-3); animation-delay: -12s; }

@keyframes blob-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
}

img { max-width: 100%; display: block; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: var(--text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
b, strong { font-weight: 600; }

.icon { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Superficie glass reutilizable ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
}

/* ---------- Loader ---------- */
#global-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center; align-content: center; gap: 18px;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  transition: opacity .45s var(--ease), visibility .45s;
}
#global-loader .spinner {
  width: 54px; height: 54px; border-radius: 50%;
  border: 4px solid rgba(177, 79, 224, 0.18);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
#global-loader p { font-weight: 600; letter-spacing: 3px; font-size: 12px; color: var(--text-2); text-transform: uppercase; }
body.loaded #global-loader { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + 48px + var(--safe-b));
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: env(safe-area-inset-top, 0px);
  margin-bottom: 18px;
}
.greet small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.greet h1 { font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  width: 42px; height: 42px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .2s var(--spring), background .2s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn .lang-label { font-size: 12px; font-weight: 700; }

.avatar-btn { padding: 0; overflow: hidden; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.badge-dot {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg-1);
}

/* ---------- Status chip ---------- */
.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--glass-border);
  font-size: 12px; font-weight: 500; color: var(--text-2);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background .3s; }
.status-dot.online { background: var(--ok); box-shadow: 0 0 0 4px rgba(25, 181, 107, .18); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(25, 181, 107, 0); } }

/* ---------- Secciones (transición suave) ---------- */
.section { display: none; }
.section.active { display: block; animation: section-in .45s var(--ease) both; }
@keyframes section-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.section-head h2 { font-size: 20px; font-weight: 600; }
.section-head .count { font-size: 12px; color: var(--muted); font-weight: 500; }

/* Entrada escalonada de tarjetas */
.stagger > * { animation: card-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 26px 22px;
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  text-align: center;
}
.hero::after {
  content: ''; position: absolute; inset: auto -30% -60% -30%; height: 90%;
  background: radial-gradient(closest-side, rgba(177, 79, 224, .25), transparent);
  pointer-events: none;
}
.fnf-title {
  font-family: 'Funkin', 'Poppins', sans-serif;
  font-size: clamp(30px, 9vw, 48px);
  font-weight: 400;
  line-height: 1.05;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  user-select: none; -webkit-user-select: none;
  margin-bottom: 8px;
  cursor: default;
}
.hero p { color: var(--text-2); font-size: 14px; max-width: 420px; margin: 0 auto 18px; }
.hero .status-chip { margin-bottom: 16px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border: 0; border-radius: 16px;
  background: var(--accent-grad);
  color: #fff; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 20px rgba(160, 70, 220, .30);
  transition: transform .2s var(--spring), box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.96); box-shadow: 0 4px 10px rgba(160, 70, 220, .25); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-block { width: 100%; }
.btn-ghost {
  background: var(--glass); color: var(--text);
  border: 1px solid var(--glass-border); box-shadow: none;
}
.btn-soft {
  background: rgba(177, 79, 224, .12); color: var(--accent);
  box-shadow: none;
}
.btn-danger { background: var(--danger); box-shadow: 0 8px 20px rgba(239, 62, 109, .25); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 12px; }

/* ---------- Tiles de categorías (como "Room") ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 132px; padding: 16px;
  border-radius: var(--r);
  text-align: left; cursor: pointer;
  transition: transform .25s var(--spring), background .25s, box-shadow .25s;
}
.tile:active { transform: scale(.97); }
.tile-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--glass-strong); color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.tile strong { display: block; font-size: 15px; font-weight: 600; }
.tile small { font-size: 12px; color: var(--muted); }
.tile.featured { background: var(--glass-strong); box-shadow: var(--shadow); }
.tile.featured .tile-icon { background: #2c2347; color: #fff; }
:root[data-theme="dark"] .tile.featured .tile-icon { background: var(--accent-grad); }

/* ---------- Tarjeta informativa ---------- */
.card { padding: 20px; border-radius: var(--r); margin-bottom: 14px; }
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card > p { color: var(--text-2); font-size: 14px; margin-bottom: 14px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.feature-list .fi {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(177, 79, 224, .12); color: var(--accent);
}
.feature-list b { color: var(--text); }

.promo { display: flex; gap: 14px; align-items: center; }
.promo .tile-icon { width: 52px; height: 52px; background: var(--accent-grad); color: #fff; }
.promo div { flex: 1; min-width: 0; }

/* ---------- Búsqueda y filtros ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 48px;
  border-radius: 16px; margin-bottom: 12px;
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search .icon { color: var(--muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--glass-border);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all .25s var(--ease);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.active { background: var(--text); color: var(--bg-3); border-color: transparent; }
:root[data-theme="dark"] .chip.active { background: #fff; color: #24123a; }

/* ---------- Grid de contenido ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.item-card {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: var(--r);
  overflow: hidden;
  transition: transform .3s var(--spring), box-shadow .3s;
  content-visibility: auto;
  contain-intrinsic-size: 340px;
}
.item-card:active { transform: scale(.985); }

.item-media {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 10px 10px 0;
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(224, 122, 208, .35), rgba(123, 92, 246, .35));
  cursor: pointer;
}
.item-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s var(--ease), transform .5s var(--ease); }
.item-media img.loaded { opacity: 1; }
.item-card.is-logo .item-media img { object-fit: contain; padding: 14px; }

.media-badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.pill-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
  background: rgba(255, 255, 255, .88); color: #2a2140;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pill-badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.gama-low .dot { background: var(--gama-low); }
.gama-mid .dot { background: var(--gama-mid); }
.gama-high .dot { background: var(--gama-high); }
.badge-new { background: var(--accent-grad); color: #fff; display: none; }
.badge-pin { background: #2c2347; color: #fff; display: none; }
.is-new-mod .badge-new, .pinned-mod .badge-pin { display: inline-flex; }

.item-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.item-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.item-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.led-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: none; }
.led-green { background: var(--ok); box-shadow: 0 0 0 3px rgba(25, 181, 107, .2); }
.led-yellow { background: var(--warn); box-shadow: 0 0 0 3px rgba(242, 165, 22, .2); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 8px;
  font-size: 11px; font-weight: 500;
  background: rgba(177, 79, 224, .10); color: var(--text-2);
}

.item-stats { display: flex; align-items: center; gap: 6px; }
.stat-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 10px;
  border-radius: 11px; border: 0;
  background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s var(--spring);
}
.stat-btn:active { transform: scale(.88); }
.stat-btn.active { color: var(--danger); }
.stat-btn.is-fav { color: var(--accent); }
.stat-btn.active .icon, .stat-btn.is-fav .icon { fill: currentColor; }
.stat-btn.static { cursor: default; }
.item-stats .spacer { flex: 1; }

.item-actions { display: flex; gap: 8px; margin-top: auto; }
.item-actions .btn { flex: 1; padding: 11px 12px; }
.item-actions .btn-ghost { flex: 0 0 auto; width: 46px; padding: 0; }

/* Mod caído */
.is-broken-mod .item-media::after {
  content: 'En mantenimiento';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(30, 15, 40, .62); color: #fff;
  font-weight: 600; font-size: 13px; letter-spacing: .5px;
}

/* Botones de admin dentro de la tarjeta */
.admin-row { display: none; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
body.is-admin .admin-row { display: flex; }
.admin-row button {
  padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--glass-strong); font-size: 11px; font-weight: 600; cursor: pointer;
}

.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 10px; }

/* ---------- FAQ ---------- */
.faq-item { border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.faq-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border: 0; background: transparent;
  font-weight: 600; font-size: 15px; text-align: left; cursor: pointer;
}
.faq-btn .icon { transition: transform .35s var(--ease); }
.faq-btn.active .icon { transform: rotate(180deg); }
.faq-content { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.faq-content.open { grid-template-rows: 1fr; }
.faq-content > div { overflow: hidden; }
.faq-inner { padding: 0 18px 18px; display: grid; gap: 14px; font-size: 14px; color: var(--text-2); }
.faq-inner img { border-radius: 14px; width: 100%; }
.faq-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.faq-row .btn { padding: 10px; font-size: 13px; }
.faq-row .btn img { width: 18px; height: 18px; }
.gallery-thumb { text-align: center; cursor: pointer; font-size: 12px; font-weight: 600; }
.gallery-thumb img { aspect-ratio: 9 / 16; object-fit: cover; margin-bottom: 6px; }

/* ---------- Redes ---------- */
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.social-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--r);
  text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px;
  transition: transform .25s var(--spring);
}
.social-item:active { transform: scale(.96); }
.social-item img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }

.field {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  outline: none;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(177, 79, 224, .15); }
textarea.field { resize: none; min-height: 90px; }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .4px; }
.stack { display: grid; gap: 10px; }

footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px; }

/* =========================================================
   MENÚ PÍLDORA
   ========================================================= */
.pill-nav {
  position: fixed; z-index: 900;
  left: 50%; bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  height: var(--nav-h);
  padding: 7px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  animation: nav-in .6s var(--spring) both .15s;
}
@keyframes nav-in { from { opacity: 0; transform: translate(-50%, 40px); } }

.pill-indicator {
  position: absolute; z-index: 0;
  top: 7px; bottom: 7px; left: 0;
  width: 60px;
  border-radius: 999px;
  background: rgba(177, 79, 224, .14);
  box-shadow: inset 0 0 0 1px rgba(177, 79, 224, .18);
  transition: transform .5s var(--spring), width .5s var(--spring), opacity .3s;
  will-change: transform;
  pointer-events: none;
}
.pill-indicator.dragging { transition: width .2s; background: rgba(177, 79, 224, .22); }
.pill-indicator.off { opacity: 0; }

.nav-item {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: transparent;
  color: var(--muted);
  font-size: 10.5px; font-weight: 600;
  cursor: pointer;
  transition: color .3s var(--ease);
}
.nav-item .icon { transition: transform .4s var(--spring); }
.nav-item.active { color: var(--accent); }
.nav-item.active .icon { transform: translateY(-1px) scale(1.08); }

/* Botón central elevado (como el del micrófono) */
.nav-orb { gap: 0; }
.nav-orb .orb {
  width: 58px; height: 58px; margin-top: -30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 10px 24px rgba(160, 70, 220, .45), 0 0 0 6px var(--glass-strong);
  transition: transform .45s var(--spring), box-shadow .3s;
}
.nav-orb .orb .icon { width: 26px; height: 26px; }
.nav-orb span:last-child { margin-top: 3px; }
.nav-orb.active .orb { transform: translateY(-3px) scale(1.06); box-shadow: 0 14px 30px rgba(160, 70, 220, .55), 0 0 0 6px var(--glass-strong); }
.nav-orb.active .icon { transform: none; }
.nav-orb:active .orb { transform: scale(.92); }

/* =========================================================
   POPUPS / HOJAS
   ========================================================= */
.popup {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  background: rgba(40, 18, 60, .28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}
.popup.show { opacity: 1; visibility: visible; }

.popup-content {
  position: relative;
  width: 100%; max-width: 520px;
  max-height: 88vh; max-height: 88dvh;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 20px calc(24px + var(--safe-b));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  transform: translateY(100%);
  transition: transform .45s var(--ease);
}
.popup.show .popup-content { transform: none; }
.popup-content::before {
  content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 5px; border-radius: 3px; background: var(--line);
}

@media (min-width: 640px) {
  .popup { align-items: center; padding: 20px; }
  .popup-content { border-radius: var(--r-lg); transform: translateY(20px) scale(.96); opacity: 0; transition: transform .4s var(--spring), opacity .3s; padding-bottom: 24px; }
  .popup.show .popup-content { transform: none; opacity: 1; }
  .popup-content::before { display: none; }
}

.popup-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: var(--line); color: var(--text);
  cursor: pointer; transition: transform .2s var(--spring);
}
.popup-close:active { transform: scale(.88); }
.popup-title { font-size: 19px; font-weight: 600; margin: 4px 40px 6px 0; }
.popup-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.popup-center { text-align: center; }
.popup-center .popup-title { margin-right: 0; }

/* Detalle de mod/base/script */
.detail-media { position: relative; border-radius: 18px; overflow: hidden; margin: 6px 0 16px; aspect-ratio: 16 / 9; background: var(--line); }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media.is-logo img { object-fit: contain; padding: 18px; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .85); color: #2a2140; cursor: pointer;
}
.carousel-prev { left: 8px; } .carousel-next { right: 8px; }
.carousel-count { position: absolute; bottom: 8px; right: 10px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.45); color: #fff; }
.detail-desc { color: var(--text-2); font-size: 14px; white-space: pre-line; margin-bottom: 12px; }
.detail-version { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); background: rgba(177, 79, 224, .12); padding: 5px 12px; border-radius: 10px; margin-bottom: 14px; white-space: pre-line; }

.rating { text-align: center; margin-bottom: 16px; }
.rating .stars { display: inline-flex; gap: 6px; }
.rating .stars button { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--line); cursor: pointer; transition: transform .2s var(--spring), color .2s; padding: 0; }
.rating .stars button:active { transform: scale(1.3); }
.rating .stars button.on { color: #f7b500; }
.rating small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

.dl-list { display: grid; gap: 8px; }
.dl-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: transform .2s var(--spring), background .2s;
}
.dl-link:active { transform: scale(.98); }
.dl-link .tile-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-grad); color: #fff; box-shadow: none; }
.dl-link > span:last-child { flex: 1; min-width: 0; }

/* Hoja "Más" */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 6px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--glass);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: transform .2s var(--spring);
}
.more-grid button:active { transform: scale(.94); }
.more-grid .tile-icon { width: 46px; height: 46px; }

/* Ajustes */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.setting-group { padding: 4px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); margin-bottom: 14px; }
.setting-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding-top: 12px; }

.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .3s; }
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform .35s var(--spring);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 44px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; }

/* Comentarios */
.comment-box { display: flex; gap: 12px; padding: 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); margin-bottom: 14px; }
.yt-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  color: #fff; font-weight: 700;
}
.yt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-box textarea { min-height: 60px; }
.comment-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--muted); }
.yt-comment-container { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); animation: card-in .35s var(--ease) both; }
.yt-comment-container.pinned { background: rgba(177, 79, 224, .07); border-radius: 14px; padding: 12px; border: 0; }
.yt-content { flex: 1; min-width: 0; }
.yt-header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.yt-name a { color: var(--text); font-weight: 600; font-size: 13px; text-decoration: none; }
.admin-name a { color: var(--accent); }
.yt-date { font-size: 11px; color: var(--muted); }
.yt-text { font-size: 14px; color: var(--text-2); margin: 3px 0 6px; word-wrap: break-word; }
.yt-actions { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.yt-action-btn { cursor: pointer; }
.yt-action-btn.active { color: var(--accent); font-weight: 600; }
.pinned-badge { font-size: 10px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.danger-link { color: var(--danger); cursor: pointer; }
.gold-link { color: var(--warn); cursor: pointer; }

/* Perfil */
.profile-avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; margin: 6px auto 10px; border: 3px solid var(--accent); box-shadow: 0 0 0 5px rgba(177, 79, 224, .15); }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.profile-stats > div { padding: 12px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); cursor: default; }
.profile-stats > div[onclick] { cursor: pointer; }
.profile-stats strong { display: block; font-size: 18px; color: var(--accent); }
.profile-stats small { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.rank { color: var(--accent); font-weight: 600; font-size: 13px; }

/* Listas en popups (favoritos, pedidos, notificaciones) */
.list { display: grid; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line);
  text-align: left;
  animation: card-in .35s var(--ease) both;
}
.list-item img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item h4 { font-size: 14px; font-weight: 600; }
.list-item p { font-size: 12px; color: var(--muted); }
.list-item[role="button"] { cursor: pointer; }

.status-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .3px; color: #fff; }
.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.progress div { height: 100%; background: var(--accent-grad); border-radius: 6px; transition: width .4s var(--ease); }
.vote-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 50px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass-strong); font-weight: 700; cursor: pointer; transition: transform .2s var(--spring); }
.vote-btn.voted { background: var(--accent-grad); color: #fff; border-color: transparent; }
.vote-btn:active { transform: scale(.9); }
.req-admin { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); width: 100%; }
.req-admin button { flex: 1; padding: 7px 6px; border-radius: 10px; border: 0; font-size: 10.5px; font-weight: 700; cursor: pointer; color: #fff; }

.notif-item { padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.notif-item p { font-size: 14px; color: var(--text); }
.notif-item small { font-size: 11px; color: var(--muted); }
.notif-item .row { display: flex; gap: 8px; margin-top: 8px; }

/* Auth */
.auth-screen {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
}
.auth-card { width: 100%; max-width: 380px; padding: 30px 24px; border-radius: var(--r-lg); text-align: center; animation: card-in .5s var(--ease) both; }
.auth-card .logo { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 16px; object-fit: cover; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.auth-card p { color: var(--text-2); font-size: 14px; margin-bottom: 22px; }
.btn-google { background: #fff; color: #2a2140; box-shadow: var(--shadow); }
.btn-google img { width: 20px; height: 20px; }

/* Toasts */
.toast-container { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 3000; display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 18px;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  font-size: 14px; font-weight: 500;
  animation: toast-in .45s var(--spring) both;
  pointer-events: auto;
}
.toast .tile-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-grad); color: #fff; box-shadow: none; }
.toast.hide { animation: toast-out .35s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-20px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-16px) scale(.96); } }

/* Lightbox galería */
.lightbox { position: fixed; inset: 0; z-index: 2500; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px; background: rgba(20, 10, 30, .9); padding: 20px; }
.lightbox.show { display: flex; animation: section-in .3s var(--ease); }
.lightbox img { max-height: 78vh; border-radius: 16px; }
.lightbox .carousel-btn { position: fixed; }
.lightbox .popup-close { position: fixed; background: rgba(255,255,255,.2); color: #fff; }
.lightbox p { color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 1px; }

/* Partículas FNF */
#particles-container { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; display: none; }
.fnf-particle { position: absolute; bottom: -60px; width: var(--escala-particulas, 40px); opacity: .55; animation: float-up linear forwards; will-change: transform; }
@keyframes float-up { to { transform: translateY(-115vh) rotate(25deg); opacity: 0; } }

/* Imagen con error */
img.img-error { opacity: 0 !important; }

/* Cambio de idioma */
.lang-fade { opacity: 0; transition: opacity .15s; }

/* Brillo al abrir un enlace compartido */
.brillo-epico { box-shadow: 0 0 0 3px var(--accent), var(--shadow-lg) !important; }

/* =========================================================
   FUNCIONES NUEVAS (v7.1)
   ========================================================= */

/* Banner global */
.site-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  border-radius: 16px; font-size: 14px; font-weight: 500;
  animation: card-in .45s var(--ease) both;
}
.site-banner > span { flex: 1; min-width: 0; }
.site-banner button { border: 0; background: none; cursor: pointer; padding: 4px; color: inherit; opacity: .7; }
.site-banner .icon { color: var(--accent); }
.banner-success { box-shadow: inset 4px 0 0 var(--ok), var(--shadow-sm); }
.banner-success .icon { color: var(--ok); }
.banner-warn { box-shadow: inset 4px 0 0 var(--warn), var(--shadow-sm); }
.banner-warn .icon { color: var(--warn); }
.banner-info { box-shadow: inset 4px 0 0 var(--accent), var(--shadow-sm); }

/* Pantalla de mantenimiento */
.maintenance-screen {
  position: fixed; inset: 0; z-index: 2100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
}
.maintenance-screen.hidden { display: none !important; }
.maintenance-screen p { white-space: pre-line; }

/* Top de la semana */
.top-list { border-radius: var(--r); padding: 6px; margin-bottom: 18px; }
.top-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px; border: 0; border-radius: 14px; background: transparent;
  text-align: left; cursor: pointer; transition: background .2s, transform .2s var(--spring);
}
.top-row + .top-row { border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
.top-row:active { transform: scale(.98); }
.top-row img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.top-row .grow { flex: 1; min-width: 0; }
.top-row strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-row small { font-size: 12px; color: var(--muted); }
.top-row .icon { color: var(--muted); }
.top-rank {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: rgba(177, 79, 224, .12); color: var(--accent);
}
.top-row:first-child .top-rank { background: var(--accent-grad); color: #fff; }

/* Barra "¿cuánta RAM tiene tu celular?" + selects */
.device-bar {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; margin-bottom: 12px; border-radius: 16px;
  font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
  transition: transform .2s var(--spring);
}
.device-bar:active { transform: scale(.98); }
.device-bar small { color: var(--accent); font-weight: 600; flex-shrink: 0; }
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.select-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 4px 0 14px; height: 40px; border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  flex: 1 1 150px; min-width: 0;
}
.select-chip select {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text); outline: none; cursor: pointer;
}
.select-chip select option { background: var(--bg-3); color: var(--text); }

/* Compatibilidad */
.tag.compat-ok { background: rgba(25, 181, 107, .14); color: #0f8a50; }
.tag.compat-warn { background: rgba(242, 165, 22, .16); color: #a86d00; }
.tag.compat-bad { background: rgba(239, 62, 109, .14); color: #c42552; }
:root[data-theme="dark"] .tag.compat-ok { color: #5fe0a2; }
:root[data-theme="dark"] .tag.compat-warn { color: #ffc75a; }
:root[data-theme="dark"] .tag.compat-bad { color: #ff87a6; }
.detail-compat { font-size: 13px; font-weight: 500; padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; }
.detail-compat.compat-ok { background: rgba(25, 181, 107, .12); }
.detail-compat.compat-warn { background: rgba(242, 165, 22, .14); }
.detail-compat.compat-bad { background: rgba(239, 62, 109, .12); }
.ram-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.ram-option {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 6px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--glass); font-size: 22px; font-weight: 700; cursor: pointer;
  transition: transform .2s var(--spring), background .2s;
}
.ram-option small { font-size: 11px; font-weight: 600; color: var(--muted); }
.ram-option:active { transform: scale(.94); }
.ram-option.active { background: var(--accent-grad); color: #fff; border-color: transparent; }
.ram-option.active small { color: rgba(255, 255, 255, .8); }

.rate-chip { color: #c98a00; font-weight: 600; }
:root[data-theme="dark"] .rate-chip { color: #ffc75a; }
.upd-tag { color: var(--ok) !important; font-weight: 600; }
.admin-tag { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--accent-grad); color: #fff; vertical-align: middle; letter-spacing: .4px; }

/* Reporte con motivos */
.reason-list { display: grid; gap: 8px; }
.reason {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--glass); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.reason input { margin-top: 3px; accent-color: var(--accent); }
.reason small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.reason:has(input:checked) { border-color: var(--accent); background: rgba(177, 79, 224, .08); }

/* Contador en el botón de Admin */
.tile-icon { position: relative; }
.admin-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
}
.admin-count[hidden] { display: none; }

/* ---------- PANEL DE ADMIN ---------- */
.seg {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 5px; margin-bottom: 14px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--glass-border);
}
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border: 0; border-radius: 13px; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: background .25s var(--ease), color .25s;
}
.seg-btn.active { background: var(--glass-strong); color: var(--accent); box-shadow: var(--shadow-sm); }
.seg-btn .admin-count { position: static; margin-left: 2px; }
.adm-anim > * { animation: card-in .4s var(--ease) both; }
.adm-anim > *:nth-child(2) { animation-delay: 50ms; }
.adm-anim > *:nth-child(3) { animation-delay: 100ms; }
.adm-anim > *:nth-child(4) { animation-delay: 150ms; }
#admin-panel .card > p { font-size: 13px; }
.adm-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.adm-toolbar p, .adm-count { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.adm-item { align-items: center; flex-wrap: wrap; }
.adm-item .grow p { margin-top: 2px; }
.adm-text { color: var(--text) !important; font-size: 13px !important; white-space: pre-line; word-break: break-word; margin: 4px 0; }
.adm-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; justify-content: flex-start; }
@media (min-width: 640px) { .adm-actions { flex-basis: auto; justify-content: flex-end; } }
.adm-row { display: flex; gap: 10px; align-items: center; }
.adm-row select { flex: 1; }

/* Tarjetas de estadística */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-tile { padding: 14px 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -.5px; color: var(--text); }
.stat-tile small { font-size: 11px; color: var(--muted); }

/* Barras horizontales ordenadas: una serie, un color, valor al final de la barra */
.bar-chart { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
.bar-row { position: relative; display: grid; gap: 4px; outline: none; cursor: default; }
.bar-label { font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-line { display: flex; align-items: center; gap: 10px; }
.bar-track { flex: 1; height: 10px; }
.bar-fill {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  transform-origin: left;
  animation: bar-grow .7s var(--ease) both;
}
@keyframes bar-grow { from { transform: scaleX(0); } }
.bar-value { min-width: 44px; font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.bar-row::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 5;
  max-width: 100%; padding: 6px 10px; border-radius: 10px;
  background: var(--text); color: var(--bg-3); font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.bar-row:hover::after, .bar-row:focus::after, .bar-row.tip::after { opacity: 1; transform: none; }
.bar-row:hover .bar-fill, .bar-row:focus .bar-fill, .bar-row.tip .bar-fill { filter: brightness(1.1); }

/* Editor de mods */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editor-preview { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: var(--line); }
#detail-img { cursor: zoom-in; }

/* Numerito de pendientes junto al icono de "Más" en la píldora */
.nav-icon-wrap { position: relative; display: inline-flex; }
.nav-count {
  position: absolute; top: -7px; right: -11px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--glass-strong);
  animation: count-pop .45s var(--spring) both;
}
@keyframes count-pop { from { transform: scale(0); } }

/* Panel de admin dentro del popup de detalle */
.detail-admin {
  margin: 6px 0 14px; padding: 12px; border-radius: 16px;
  background: rgba(177, 79, 224, .08);
  border: 1px dashed rgba(177, 79, 224, .35);
  animation: card-in .35s var(--ease) both;
}
.detail-admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.detail-admin-head span { font-weight: 700; font-size: 13px; color: var(--accent); }
.detail-admin-head small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.detail-admin-alert { font-size: 12px; font-weight: 600; color: var(--danger); margin-bottom: 10px; }
.detail-admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.adm-chip {
  padding: 9px 8px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--glass-strong);
  font-size: 12px; font-weight: 600; text-align: center; cursor: pointer;
  transition: transform .2s var(--spring), background .2s, border-color .2s;
}
.adm-chip:active { transform: scale(.94); }
.adm-chip.on { border-color: var(--accent); background: rgba(177, 79, 224, .16); color: var(--accent); }
.adm-chip.ok { border-color: var(--ok); background: rgba(25, 181, 107, .14); color: var(--ok); }
.adm-chip.danger { color: var(--danger); }

/* Resultado de "Probar Telegram" */
.tg-result { font-size: 13px; font-weight: 500; padding: 10px 12px; border-radius: 12px; line-height: 1.45; }
.tg-result.ok { background: rgba(25, 181, 107, .12); }
.tg-result.bad { background: rgba(239, 62, 109, .12); }

/* =========================================================
   MODO GAMA BAJA y movimiento reducido: sin blur, sin animaciones caras
   ========================================================= */
body.low-end-mode .glass,
body.low-end-mode .icon-btn,
body.low-end-mode .pill-nav,
body.low-end-mode .popup,
body.low-end-mode .popup-content,
body.low-end-mode .toast,
body.low-end-mode .pill-badge {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.low-end-mode { --glass: rgba(255, 255, 255, .78); }
:root[data-theme="dark"] body.low-end-mode { --glass: rgba(45, 28, 64, .95); }
body.low-end-mode .bg-blobs span { animation: none; filter: blur(30px); }
body.low-end-mode .stagger > * { animation: none; }

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