:root {
  --bg: #0b0a17;
  --bg-card: #16142a;
  --bg-card-2: #201c3c;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(135deg, #8b5cf6, #6d28d9);
  --text: #f1f0fa;
  --muted: #9b97b8;
  --good: #34d399;
  --bad: #f87171;
  --border: #2a264a;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: "Outfit", system-ui, sans-serif;
  background:
    radial-gradient(900px 500px at 80% -10%, #221a52 0%, transparent 60%),
    radial-gradient(700px 500px at 0% 0%, #15233f 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }
.accent { color: var(--accent-2); }
/* Invitado (sin login): se ocultan saldo, packs, regalo, admin… (se ve el catálogo + feed) */
body.guest .logged-only { display: none !important; }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px); background: rgba(11, 10, 23, 0.8);
}
.brand { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 7px; }
.logo { font-size: 22px; }
.user-area { display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }
.user-name { font-weight: 600; font-size: 14px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Layout ───────────────────────────────────────────── */
.container { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 16px; }
.section-title { margin: 26px 0 14px; font-size: 18px; font-weight: 700; letter-spacing: .2px; }

/* ── Stream status ────────────────────────────────────── */
.stream-status {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 12px; font-weight: 600; font-size: 14px; margin-bottom: 8px;
}
.stream-status.online { background: rgba(52, 211, 153, 0.12); color: var(--good); }
.stream-status.offline { background: rgba(155, 151, 184, 0.1); color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.online { background: var(--good); box-shadow: 0 0 10px var(--good); animation: pulse 1.6s infinite; }
.dot.offline { background: var(--muted); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Hero (invitados) ─────────────────────────────────── */
.hero { text-align: center; padding: 48px 16px; }
.hero h1 { font-size: clamp(28px, 8vw, 42px); font-weight: 800; line-height: 1.1; margin-bottom: 14px; }
.hero p { color: var(--muted); font-size: 16px; margin-bottom: 28px; max-width: 440px; margin-inline: auto; }

/* ── Botones ──────────────────────────────────────────── */
.btn {
  border: none; border-radius: 12px; padding: 13px 20px; font-size: 15px;
  font-weight: 700; cursor: pointer; font-family: inherit;
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
  min-height: 44px;
}
.btn:active { transform: scale(0.96); }
.btn-google { background: #fff; color: #1a1a1a; display: inline-flex; gap: 10px; align-items: center; box-shadow: var(--shadow); }
.btn-google::before { content: "G"; font-weight: 800; color: #4285f4; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-logout { background: var(--bg-card-2); color: var(--text); padding: 8px 12px; font-size: 13px; min-height: 36px; }
.btn-edit { padding: 6px 9px; font-size: 14px; min-height: 36px; }

/* ── Balance ──────────────────────────────────────────── */
.balance-card {
  background: var(--accent-grad); border-radius: 18px; padding: 20px;
  text-align: center; box-shadow: 0 12px 36px rgba(139, 92, 246, 0.35);
  position: relative; overflow: hidden;
}
.balance-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(300px 120px at 80% 0%, rgba(255,255,255,.18), transparent 70%);
}
.balance-label { opacity: .9; font-size: 13px; font-weight: 600; }
.balance-amount { font-size: clamp(34px, 11vw, 46px); font-weight: 800; margin-top: 2px; letter-spacing: .5px; }
.coin { font-size: 0.7em; }

/* ── Cabecera del catálogo + toggle combo ─────────────── */
.catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.catalog-head .section-title { margin: 26px 0 14px; }
.combo-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.combo-toggle input { display: none; }
.combo-track { width: 42px; height: 24px; border-radius: 999px; background: var(--bg-card-2); border: 1px solid var(--border); position: relative; transition: background .2s; flex-shrink: 0; }
.combo-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.combo-toggle input:checked + .combo-track { background: var(--accent); border-color: var(--accent); }
.combo-toggle input:checked + .combo-track .combo-thumb { transform: translateX(18px); background: #fff; }
.combo-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.combo-toggle input:checked ~ .combo-label { color: var(--accent-2); }

/* ── Catálogo de efectos ──────────────────────────────── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 9px;
  transition: border-color .2s, transform .1s; position: relative; overflow: hidden;
}
.card:hover { border-color: var(--accent); }
.card-imgwrap { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--bg-card-2); }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-noimg { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.card-badge {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(10, 8, 22, 0.82); backdrop-filter: blur(6px);
  color: var(--accent-2); font-weight: 800; font-size: 13.5px; letter-spacing: .2px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, .45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .42), 0 0 12px rgba(34, 211, 238, .2);
}
.card-title {
  font-weight: 800; font-size: 13px; text-align: center; line-height: 1.25;
  text-transform: uppercase; letter-spacing: .7px;
  color: #eceaf7; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 34px;
}
.card.selected .card-title { color: var(--accent-2); }
.btn-send { margin-top: auto; background: var(--accent-grad); color: #fff; padding: 11px; font-size: 14px; box-shadow: 0 4px 14px rgba(139,92,246,.3); }
.btn-send:active { transform: scale(0.93); }
.btn-send:disabled { opacity: .5; filter: grayscale(.4); cursor: not-allowed; box-shadow: none; }

/* Animación de envío (spam) */
.card.sent { animation: cardSent .35s ease; }
@keyframes cardSent {
  0% { box-shadow: 0 0 0 0 rgba(34,211,238,.55); }
  100% { box-shadow: 0 0 0 14px rgba(34,211,238,0); }
}
.cost-pop {
  position: absolute; top: 40%; left: 50%; transform: translateX(-50%);
  font-weight: 800; font-size: 18px; color: var(--accent-2);
  text-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none; z-index: 3;
  animation: costFloat .75s ease-out forwards;
}
@keyframes costFloat {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); }
  25% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -38px) scale(1); }
}

/* ── Packs de monedas ─────────────────────────────────── */
.packs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pack {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 14px; text-align: center; cursor: pointer; transition: border-color .15s, transform .1s;
}
.pack:active { transform: scale(0.97); }
.pack.selected { border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-2) inset; }
.pack-tokens { font-size: 26px; font-weight: 800; color: var(--accent-2); }
.pack-usd { color: var(--muted); margin-top: 2px; }

.pack { position: relative; }
.pack-bonus { position: absolute; top: 8px; right: 8px; background: var(--good); color: #052e1b; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 999px; }

/* ── Monto personalizado ──────────────────────────────── */
.custom-buy { margin-top: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.custom-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.custom-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.custom-cur { font-size: 20px; font-weight: 800; }
.custom-input { width: 90px; padding: 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 16px; text-align: center; }
.custom-coins { color: var(--accent-2); font-weight: 800; font-size: 16px; flex: 1; min-width: 110px; }
.custom-buy .btn-save { margin-top: 0; }

/* ── Editor config de monedas (admin) ─────────────────── */
.cfg-minmax { margin: 10px 0; }
.cfg-mini { width: 64px; padding: 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); text-align: center; margin: 0 4px; }
.cfg-mini2 { width: 90px; padding: 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); text-align: center; }
.cfg-subtitle { font-size: 15px; margin: 14px 0 8px; }
.cfg-packs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cfg-pack { display: flex; align-items: center; gap: 6px; background: var(--bg-card-2); padding: 8px 10px; border-radius: 10px; font-size: 14px; }
.cfg-pack .cfg-usd { width: 70px; }
.cfg-del { margin-left: auto; background: transparent; border: none; color: var(--bad); font-size: 16px; cursor: pointer; padding: 4px 8px; }
#coinAdminSave { display: block; width: 100%; }
#cfgAddPack { margin-right: 8px; }

/* ── Regalo + PayPal ──────────────────────────────────── */
.gift-row { margin: 16px 0; display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 14px; }
.gift-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.gift-input { padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); width: 100%; max-width: 360px; font-size: 15px; }
.paypal-area { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 10px; }
.paypal-info { margin-bottom: 14px; color: var(--muted); }

.empty { color: var(--muted); padding: 28px 16px; text-align: center; grid-column: 1/-1; font-size: 15px; }

/* ── Panel admin ──────────────────────────────────────── */
.btn-admin { background: var(--bg-card-2); color: var(--accent-2); border: 1px solid var(--accent-2); margin-top: 16px; width: 100%; }
.btn-save { background: var(--good); color: #052e1b; margin-top: 14px; }
.admin-panel { background: var(--bg-card); border: 1px solid var(--accent-2); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.admin-head .section-title { margin: 0; font-size: 16px; }
.admin-hint { color: var(--muted); font-size: 13px; margin: 8px 0 14px; }
.admin-rules { display: flex; flex-direction: column; gap: 9px; }
.admin-rule { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--bg-card-2); border-radius: 10px; flex-wrap: wrap; }
.admin-rule .ar-img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.admin-rule .ar-noimg { color: var(--muted); }
.admin-rule .ar-info { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 2px; }
.admin-rule .ar-label { font-weight: 600; font-size: 14px; }
.admin-rule .ar-meta { color: var(--muted); font-size: 12px; }
.admin-rule .ar-price { width: 78px; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); text-align: center; font-size: 14px; }
.admin-rule .ar-sell { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }

/* ── Switch reusable (privacidad) ─────────────────────── */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text b { font-size: 14px; }
.switch-text small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.sw { position: relative; display: inline-flex; flex-shrink: 0; }
.sw input { display: none; }
.sw-track { width: 46px; height: 26px; border-radius: 999px; background: var(--bg-card-2); border: 1px solid var(--border); position: relative; transition: background .2s; }
.sw-thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.sw input:checked + .sw-track { background: var(--good); border-color: var(--good); }
.sw input:checked + .sw-track .sw-thumb { transform: translateX(20px); background: #fff; }

/* ── Usuarios recientes (regalar) ─────────────────────── */
.recent-users { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; -webkit-overflow-scrolling: touch; }
.ruser {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: transparent; border: none; cursor: pointer; width: 68px; font-family: inherit;
}
.ruser-avatar-wrap { position: relative; display: inline-block; }
.ruser-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); transition: transform .1s, border-color .2s, box-shadow .2s; }
.ruser:active .ruser-avatar { transform: scale(0.92); }
.ruser:hover .ruser-avatar { border-color: var(--accent-2); }
.ruser-name { font-size: 12px; color: var(--text); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Subs en la sección de regalar: foto con marco dorado + coronita */
.ruser.sub .ruser-avatar { border: 2.5px solid #fbbf24; box-shadow: 0 0 12px rgba(251,191,36,.5); }
.ruser.sub:hover .ruser-avatar { border-color: #fcd34d; }
.ruser-crown { display: none; }
.ruser.sub .ruser-crown {
  display: flex; align-items: center; justify-content: center;
  position: absolute; bottom: -2px; right: -2px; width: 20px; height: 20px;
  font-size: 11px; background: #1a160a; border: 1.5px solid #fbbf24; border-radius: 50%;
}

/* ── Feed de actividad ────────────────────────────────── */
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; animation: feedIn .25s ease; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.feed-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.feed-text { flex: 1; font-size: 14px; line-height: 1.3; }
.feed-text b { color: var(--accent-2); }
.feed-rule { color: var(--text); font-weight: 600; }
.feed-time { color: var(--muted); font-size: 12px; flex-shrink: 0; }

/* ── Cofre activo (widget FLOTANTE, siempre visible) ──── */
.chest-active {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 560px; z-index: 150;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #2a2410, #1f1b3a);
  border: 1.5px solid #fbbf24; border-radius: 16px; padding: 12px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 30px rgba(251,191,36,.25);
  animation: chestIn .35s cubic-bezier(.2,1.3,.4,1);
}
/* Empujar el contenido para que el cofre flotante no tape el inicio */
body.has-chest .container { padding-top: 80px; }
@keyframes chestIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.chest-emoji { font-size: 34px; animation: chestWiggle 1.4s ease-in-out infinite; }
@keyframes chestWiggle { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.chest-info { flex: 1; min-width: 0; }
.chest-title { font-weight: 800; font-size: 16px; }
.chest-title b { color: #fbbf24; }
.chest-sub { color: var(--muted); font-size: 13px; }
.chest-sub #chestTimer { color: var(--accent-2); font-weight: 700; }
.chest-active .btn-save { margin-top: 0; background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #3b2a06; flex-shrink: 0; }
.chest-active .btn-save:disabled { opacity: .6; }

/* ── Crear cofre (desplegable compacto) ───────────────── */
.chest-create { margin-top: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chest-create > summary { padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
.chest-create > summary::-webkit-details-marker { display: none; }
.chest-create > summary::after { content: "▾"; float: right; color: var(--muted); }
.chest-create[open] > summary::after { content: "▴"; }
.chest-create-body { padding: 0 14px 14px; }
.chest-hint { color: var(--muted); font-size: 12px; line-height: 1.4; margin-bottom: 10px; }

/* ── Hint del monto personalizado ─────────────────────── */
.custom-hint { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* ── Regalar monedas (admin) ──────────────────────────── */
.grant-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.grant-label { font-weight: 600; font-size: 14px; }
.grant-input { padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.grant-input { flex: 1; min-width: 90px; }
.grant-num { flex: 0 0 110px; min-width: 90px; }
.grant-row .btn-save { margin-top: 0; }

/* ── Logo ─────────────────────────────────────────────── */
.logo-mark { display: block; flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(139,92,246,.4)); }
.brand-name { font-weight: 800; }

/* ── Estado EN VIVO (animación al pasar a vivo) ───────── */
.stream-status.preview { background: rgba(139, 92, 246, 0.14); color: #c4b5fd; }
.stream-status.online { font-weight: 800; }
.stream-status.just-live { animation: liveFlash 1s ease; }
@keyframes liveFlash {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(52,211,153,.6); }
  30% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(52,211,153,0); }
  100% { transform: scale(1); }
}

/* ── Banner vista previa admin ────────────────────────── */
.preview-banner {
  grid-column: 1/-1; background: rgba(139,92,246,.12); border: 1px dashed var(--accent);
  border-radius: 12px; padding: 10px 14px; font-size: 13px; color: #c4b5fd;
}
.preview-banner b { color: var(--text); }

/* ── Banner de REGALO (claro) ─────────────────────────── */
.gift-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(34,211,238,.16), rgba(139,92,246,.16));
  border: 1px solid var(--accent-2); border-radius: 12px; padding: 12px 14px; margin: 10px 0;
  font-size: 15px; animation: feedIn .25s ease;
}
.gift-banner b { color: var(--accent-2); }
.gift-banner-x { background: var(--bg-card-2); color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }

/* ── Cabecera del feed + limpiar ──────────────────────── */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feed-head .section-title { margin: 26px 0 14px; }
#clearActivityBtn { padding: 7px 12px; font-size: 13px; min-height: 34px; }

/* ── Confirmación de compra ───────────────────────────── */
.purchase-done {
  position: fixed; inset: 0; background: rgba(6,5,14,.82); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 400; padding: 20px;
  animation: feedIn .2s ease;
}
.pd-card {
  background: var(--bg-card); border: 1px solid var(--good); border-radius: 22px;
  padding: 32px 28px; text-align: center; max-width: 380px; width: 100%;
  box-shadow: 0 24px 70px rgba(0,0,0,.55); animation: pdPop .4s cubic-bezier(.2,1.3,.4,1);
}
@keyframes pdPop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pd-emoji { font-size: 54px; }
.pd-title { font-size: 22px; font-weight: 800; margin-top: 6px; }
.pd-coins { font-size: 40px; font-weight: 800; color: var(--good); margin: 10px 0 4px; }
.pd-sub { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.pd-sub b { color: var(--text); }
.pd-card .pd-ok { width: 100%; margin-top: 0; }

/* ── Resultados del cofre (ganadores) ─────────────────── */
.cr-card { max-width: 420px; }
.cr-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; max-height: 46vh; overflow-y: auto; }
.cr-row { display: flex; align-items: center; gap: 10px; background: var(--bg-card-2); border-radius: 10px; padding: 8px 11px; animation: feedIn .3s ease; }
.cr-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #fbbf24; flex-shrink: 0; }
.cr-name { flex: 1; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-won { color: var(--good); font-weight: 800; flex-shrink: 0; }

/* ── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  padding: 13px 20px; border-radius: 12px; font-weight: 700; z-index: 200;
  box-shadow: var(--shadow); max-width: 90vw; text-align: center; font-size: 14px;
}
.toast.ok { background: var(--good); color: #052e1b; }
.toast.err { background: var(--bad); color: #3b0a0a; }

/* ── Footer ───────────────────────────────────────────── */
.footer { text-align: center; padding: 22px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

/* ── Modal de perfil ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6, 5, 14, 0.82); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 300; padding: 16px;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--accent); border-radius: 20px;
  padding: 24px; width: 100%; max-width: 400px; box-shadow: 0 24px 70px rgba(0,0,0,.55);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h2 { font-size: 21px; margin-bottom: 5px; }
.modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 16px; }
.avatar-big { width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--accent); object-fit: cover; background: var(--bg-card-2); }
.avatar-btn { cursor: pointer; padding: 9px 16px; font-size: 14px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.modal-input { width: 100%; padding: 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 16px; font-family: inherit; }
.username-hint { font-size: 13px; color: var(--muted); margin-top: 6px; min-height: 18px; }
.username-hint.ok { color: var(--good); }
.username-hint.err { color: var(--bad); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn-save { margin-top: 0; flex: 1; }

/* ── Tarjeta seleccionable: 1er toque ARMA (marco); con la carta armada, el
      botón envía (combo). Anti-envío accidental. Sin check, solo el marco. ── */
.card.selectable { cursor: pointer; }
.card.selectable:active { transform: scale(0.97); }
.card-img { transition: transform .25s ease; }
.card.selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px var(--accent-2) inset, 0 12px 30px rgba(34,211,238,.3);
  transform: translateY(-2px);
}
.card.selected .card-img { transform: scale(1.04); }
/* Sin armar: botón "fantasma" (tocar = armar). Armada: botón lleno + glow,
   listo para enviar (mashear el combo las veces que quieras). */
.card .card-send {
  margin-top: 4px; background: transparent; color: var(--accent-2);
  border: 1px solid var(--border); box-shadow: none;
}
.card.selected .card-send {
  background: var(--accent-grad); color: #fff; border: none;
  box-shadow: 0 6px 22px rgba(139,92,246,.6); animation: sendReveal .2s ease;
}
@keyframes sendReveal { from { transform: scale(.96); } to { transform: scale(1); } }

/* ── Panel de usuarios (admin) + subs (foto con marco dorado) ── */
.users-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; max-height: 60vh; overflow-y: auto; }
.user-row { transition: border-color .2s, background .2s; }
.user-row.is-sub { border: 1px solid #fbbf24; background: rgba(251,191,36,.08); border-radius: 10px; }
.usr-avatar-wrap { position: relative; flex-shrink: 0; width: 44px; height: 44px; }
.usr-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); background: var(--bg-card-2);
  transition: border-color .2s, box-shadow .2s;
}
.user-row.is-sub .usr-avatar {
  border: 2.5px solid #fbbf24;
  box-shadow: 0 0 0 2px rgba(251,191,36,.22), 0 0 14px rgba(251,191,36,.45);
}
.usr-crown { display: none; }
.user-row.is-sub .usr-crown {
  display: flex; align-items: center; justify-content: center;
  position: absolute; bottom: -3px; right: -3px; width: 20px; height: 20px;
  font-size: 11px; background: #1a160a; border: 1.5px solid #fbbf24; border-radius: 50%;
}
.sub-toggle { cursor: pointer; white-space: nowrap; }
#usersSearch { margin-bottom: 4px; }

/* ── Subs en el feed: marco dorado + estrella ─────────── */
.feed-row.sub { border-color: rgba(251,191,36,.5); }
.feed-row.sub .feed-avatar { border: 2px solid #fbbf24; box-shadow: 0 0 10px rgba(251,191,36,.4); }
.feed-sub { display: inline-flex; vertical-align: -0.12em; color: #fbbf24; }
.feed-sub .ic-star { font-size: 14px; }

/* ── Íconos SVG profesionales (reemplazan emojis) ─────── */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
.ic-coin { vertical-align: -0.16em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.section-title { display: inline-flex; align-items: center; gap: 9px; }
.section-title .ic { color: var(--accent-2); }
.grant-label, .combo-label { display: inline-flex; align-items: center; gap: 7px; }
.card-badge { gap: 4px; }
.card-badge .ic-coin { font-size: 13px; }
.pack-tokens { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.pack-tokens .ic-coin { font-size: 22px; }
.custom-cur.ic-coin { font-size: 20px; vertical-align: middle; }
.pd-coins { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.pd-coins .ic-coin { font-size: .82em; }
.cr-won { display: inline-flex; align-items: center; gap: 4px; }
.chest-title { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chest-emoji .ic { color: #fbbf24; }
.cr-card .pd-emoji .ic { color: #fbbf24; }
.pd-ok-ic .ic { color: var(--good); }
.usr-crown .ic-star, .ruser-crown .ic-star { width: 13px; height: 13px; }

/* ── Pantallas grandes ────────────────────────────────── */
@media (min-width: 600px) {
  .container { padding: 24px; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .user-name { max-width: 160px; font-size: 15px; }
  .section-title { font-size: 20px; }
}
