/* Colores: dentro de Telegram se usan los del tema del usuario (--tg-theme-*);
   en un navegador normal, los de respaldo (--fb-*) con modo claro/oscuro. */
:root {
  --fb-bg: #ffffff; --fb-bg2: #f1f2f6; --fb-text: #15181d; --fb-hint: #7d848e;
  --fb-link: #2481cc; --fb-btn: #2481cc; --fb-btn-text: #ffffff; --fb-danger: #e5484d;
  --fb-sep: rgba(0, 0, 0, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fb-bg: #1c2129; --fb-bg2: #10141a; --fb-text: #eef1f5; --fb-hint: #8b939f;
    --fb-link: #62a8ea; --fb-btn: #3a8ee6; --fb-btn-text: #ffffff; --fb-danger: #ff6b6f;
    --fb-sep: rgba(255, 255, 255, .09);
  }
}
:root {
  --bg: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, var(--fb-bg)));
  --bg2: var(--tg-theme-secondary-bg-color, var(--fb-bg2));
  --text: var(--tg-theme-text-color, var(--fb-text));
  --hint: var(--tg-theme-hint-color, var(--fb-hint));
  --link: var(--tg-theme-link-color, var(--fb-link));
  --btn: var(--tg-theme-button-color, var(--fb-btn));
  --btn-text: var(--tg-theme-button-text-color, var(--fb-btn-text));
  --danger: var(--tg-theme-destructive-text-color, var(--fb-danger));
  --accent: var(--tg-theme-accent-text-color, var(--link));
  --sep: var(--fb-sep);
  --ok: #22a55b; --warn: #e08a00; --chat: #8b5cf6;
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg2); color: var(--text); }
body { font: 16px/1.45 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; min-height: 100vh;
  -webkit-text-size-adjust: 100%; overflow-x: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.15rem; font-weight: 700; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
b { font-weight: 700; }
.hint { color: var(--hint); font-size: .88rem; }
.small { font-size: .8rem; }
.center { text-align: center; }
.error { color: var(--danger); font-size: .92rem; font-weight: 600; min-height: 1.1em; margin-top: 8px; }
.error:empty { margin: 0; min-height: 0; }
svg { width: 22px; height: 22px; fill: currentColor; flex: none; }

/* ---------- botones e inputs ---------- */
.btn { font: inherit; font-weight: 650; border: 0; border-radius: 14px; padding: 14px 16px; min-height: 50px;
  background: var(--bg2); color: var(--link); cursor: pointer; transition: transform .08s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--btn); color: var(--btn-text); }
.btn.chat { background: var(--chat); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger.subtle { background: none; min-height: 44px; font-size: .92rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: progress; }
.small-btn { min-height: 40px; padding: 9px 14px; font-size: .9rem; margin-top: 10px; }
.link-btn { font: inherit; font-size: .88rem; border: 0; background: none; color: var(--link); padding: 6px 2px; cursor: pointer; }
.icon-btn { border: 0; background: none; color: var(--hint); padding: 6px; cursor: pointer; }
.icon-btn.round { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); color: var(--link);
  font: inherit; font-weight: 800; font-size: 1.05rem; padding: 0; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; padding: 12px 13px; border-radius: 12px;
  border: 1.5px solid var(--sep); background: var(--bg2); color: var(--text); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--btn); }
textarea { min-height: 96px; resize: vertical; }
.big-input { font-size: 1.5rem !important; font-weight: 700; padding: 12px 14px; text-align: center; }
.field { display: block; margin-top: 14px; }
.field > span:first-child { display: block; font-size: .9rem; font-weight: 650; margin: 0 0 6px 2px; }
.field-help { display: block; color: var(--hint); font-size: .8rem; margin: 6px 2px 0; }
.field-help.top { margin: -2px 2px 8px; }
.section-label { margin: 16px 2px 8px; font-size: .8rem; font-weight: 700; color: var(--hint);
  text-transform: uppercase; letter-spacing: .04em; }

/* ---------- login y PIN ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); background: var(--bg); border-radius: 22px; padding: 28px 20px;
  text-align: center; display: grid; gap: 10px; }
.login-card form { display: grid; gap: 10px; margin-top: 8px; }
.logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 4px; display: grid; place-items: center;
  font-size: 2rem; background: color-mix(in srgb, var(--btn) 16%, var(--bg)); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0 4px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--hint); transition: transform .1s; }
.pin-dots i.on { background: var(--btn); border-color: var(--btn); transform: scale(1.1); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px auto 4px; max-width: 290px; width: 100%; }
.keypad button { font: inherit; font-size: 1.55rem; font-weight: 650; height: 62px; border: 0; border-radius: 18px;
  background: var(--bg2); color: var(--text); cursor: pointer; }
.keypad button:active { opacity: .6; transform: scale(.96); }
.keypad button.ghost { background: none; color: var(--hint); font-size: 1.2rem; }

/* ---------- estructura ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 10px; background: var(--bg2); }
.avatar { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem;
  background: color-mix(in srgb, var(--btn) 16%, var(--bg)); flex: none; }
.topbar-text { flex: 1; min-width: 0; }
.topbar-text h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-text .hint { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { padding: 4px 16px calc(92px + var(--safe-bottom)); max-width: 720px; margin: 0 auto; }
.controls { display: grid; gap: 10px; margin: 12px 0 10px; }
.count { margin: 2px 4px 8px; }
.badge { font-size: .75rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.hero-btn { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; min-height: 76px;
  border-radius: 20px; color: #fff; background: linear-gradient(135deg, #7c3aed, #2563eb);
  box-shadow: 0 6px 18px rgba(79, 70, 229, .28); }
.hero-btn b { display: block; font-size: 1.12rem; }
.hero-btn small { display: block; opacity: .85; font-weight: 500; font-size: .85rem; }
.hero-btn-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .2); font-size: 1.7rem; font-weight: 800; }

.first-steps { margin-top: 12px; border: 2px dashed color-mix(in srgb, #7c3aed 40%, transparent); }
.mini-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.mini-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; }
.mini-steps li span { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: #7c3aed; color: #fff; font-weight: 800; font-size: .85rem; }

.segmented { display: flex; background: var(--bg); border-radius: 14px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; font: inherit; font-size: .85rem; font-weight: 650; border: 0; min-height: 40px;
  border-radius: 11px; padding: 8px 4px; background: none; color: var(--hint); cursor: pointer; white-space: nowrap; }
.segmented button.on { background: var(--btn); color: var(--btn-text); }

.alert { margin-top: 12px; padding: 12px 14px; border-radius: 14px; font-weight: 650; font-size: .93rem;
  background: color-mix(in srgb, var(--warn) 18%, var(--bg)); color: var(--text);
  border-left: 5px solid var(--warn); }

/* ---------- tarjetas ---------- */
.list { display: grid; gap: 10px; }
.list-title { margin: 20px 4px 10px; }
.card { background: var(--bg); border-radius: var(--radius); padding: 14px; }
.item { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; border: 0; text-align: left; font: inherit;
  color: inherit; width: 100%; }
.item:active { opacity: .75; }
.item-main { flex: 1; min-width: 0; display: grid; gap: 5px; }
.item-top { display: flex; align-items: flex-start; gap: 8px; }
.item-title { flex: 1; min-width: 0; font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.item-sub { color: var(--hint); font-size: .85rem; overflow-wrap: anywhere; }
.item-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 2px; }
.price { font-weight: 800; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.order.todo { box-shadow: inset 4px 0 0 var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.chip { font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg2); color: var(--hint);
  border: 0; font-family: inherit; }
.chip.ms { color: #7c3aed; background: color-mix(in srgb, #7c3aed 13%, transparent); }
.chip.trait { color: #b45309; background: color-mix(in srgb, #f59e0b 16%, transparent); }
.state { font-size: .74rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--bg2); color: var(--hint); }
.state.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.state.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.state.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.state.info { background: color-mix(in srgb, var(--link) 15%, transparent); color: var(--link); }
.expiry, .deadline { justify-self: start; font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.deadline.urgent, .deadline.late { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.deadline.late { animation: pulse 1.2s ease-in-out infinite; }
.owner-chip { color: var(--accent); font-weight: 650; }

.thumb { width: 60px; height: 60px; border-radius: 14px; overflow: hidden; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc, var(--btn)) 22%, var(--bg2)), var(--bg2)); }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb.big { width: 96px; height: 96px; border-radius: 20px; }
.thumb-fallback { font-size: 1.7rem; }
.thumb.big .thumb-fallback { font-size: 2.6rem; }

.empty { text-align: center; color: var(--hint); padding: 36px 12px; }
.empty-state { text-align: center; padding: 34px 16px; background: var(--bg); border-radius: var(--radius); display: grid; gap: 6px; }
.empty-state.small { padding: 18px 10px; background: none; grid-column: 1 / -1; }
.empty-emoji { font-size: 2.6rem; line-height: 1.1; }
.empty-title { font-weight: 700; }
.skeleton { height: 92px; border-radius: var(--radius); background: var(--bg); opacity: .6;
  animation: pulse 1.2s ease-in-out infinite; }
.loading { padding: 30px 0; text-align: center; color: var(--hint); }
@keyframes pulse { 50% { opacity: .35; } }

/* Colores por rareza (botones, chips, miniaturas). */
[data-rarity="Common"] { --rc: #8b949e; }   [data-rarity="Rare"] { --rc: #3b82f6; }
[data-rarity="Epic"] { --rc: #a855f7; }     [data-rarity="Legendary"] { --rc: #f0a81a; }
[data-rarity="Mythic"], [data-rarity="Mythical"] { --rc: #ef4444; }
[data-rarity="Brainrot God"] { --rc: #14b8a6; }
[data-rarity="Secret"] { --rc: #e0457b; }   [data-rarity="OG"] { --rc: #f97316; }
[data-rarity="Admin"] { --rc: #64748b; }    [data-rarity="Taco"] { --rc: #ca8a04; }
[data-rarity="Festive"] { --rc: #16a34a; }  [data-rarity="Valentines"] { --rc: #ec4899; }
[data-rarity="Summer"] { --rc: #0ea5e9; }   [data-rarity="Skull"] { --rc: #57534e; }
[data-rarity="Spooky"] { --rc: #ea580c; }   [data-rarity="St Patrick's"] { --rc: #15803d; }
[data-rarity="Easter"] { --rc: #d946ef; }   [data-rarity="Honey"] { --rc: #d97706; }
.chip.rare[data-rarity] { color: var(--rc); background: color-mix(in srgb, var(--rc) 15%, transparent); }

/* Colores por mutacion (id de la tienda). */
[data-mutation] { --mc: #8b949e; }
[data-mutation="gold"] { --mc: #d4a106; }       [data-mutation="diamond"] { --mc: #22b8e6; }
[data-mutation="rainbow"] { --mc: #e64980; }    [data-mutation="candy"] { --mc: #f472b6; }
[data-mutation="lava"] { --mc: #ea580c; }       [data-mutation="galaxy"] { --mc: #7c3aed; }
[data-mutation="bloodrot"] { --mc: #b91c1c; }   [data-mutation="cursed"] { --mc: #6b21a8; }
[data-mutation="cyber"] { --mc: #0891b2; }      [data-mutation="divine"] { --mc: #ca8a04; }
[data-mutation="radioactive"] { --mc: #65a30d; } [data-mutation="yin-yang"] { --mc: #475569; }
[data-mutation="phantom"] { --mc: #6366f1; }    [data-mutation="crystal"] { --mc: #06b6d4; }
[data-mutation="eclipse"] { --mc: #c2410c; }    [data-mutation="hacker"] { --mc: #16a34a; }
[data-mutation="none"] { --mc: #8b949e; }
.chip.mut { color: var(--mc); background: color-mix(in srgb, var(--mc) 15%, transparent); }

/* ---------- panel inferior ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); animation: fade .15s ease-out; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; overflow-x: hidden;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px 0;
  max-width: 720px; margin: 0 auto; animation: up .2s ease-out; overscroll-behavior: contain; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--sep); margin: 0 auto 10px; }
.sheet-x { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--bg2); color: var(--hint); font: inherit; font-size: .95rem; cursor: pointer; }
#sheet-title { padding-right: 40px; font-size: 1.2rem; }
.sheet-panel > .hint { margin-top: 2px; }
.sheet-actions { position: sticky; bottom: 0; display: grid; gap: 8px; margin: 14px -16px 0;
  padding: 12px 16px calc(12px + var(--safe-bottom)); background: var(--bg);
  box-shadow: 0 -1px 0 var(--sep); z-index: 2; }
.sheet-actions.row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
#sheet-body .sheet-actions { position: static; margin: 12px 0 0; padding: 0; box-shadow: none; }
.explain-box { margin-top: 12px; padding: 14px; border-radius: 14px; font-size: .95rem;
  background: color-mix(in srgb, var(--link) 10%, var(--bg2)); }
.explain-box.danger { background: color-mix(in srgb, var(--danger) 12%, var(--bg2)); }
.details { margin-top: 12px; background: var(--bg2); border-radius: 14px; padding: 4px 14px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--sep); font-variant-numeric: tabular-nums; text-align: right; }
.row:last-child { border-bottom: 0; }
.row .hint { font-size: .9rem; text-align: left; flex: none; }
.edit-row { width: 100%; font: inherit; color: inherit; background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; }
.edit-hint { opacity: .6; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.tiles-menu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.tile-btn { display: grid; justify-items: center; gap: 4px; padding: 14px 6px; border: 0; border-radius: 16px;
  background: var(--bg2); color: var(--text); font: inherit; font-size: .85rem; font-weight: 650; cursor: pointer; text-align: center; }
.tile-btn:active { transform: scale(.96); }
.tile-btn.danger { color: var(--danger); }
.tile-emoji { font-size: 1.55rem; line-height: 1.2; }

.offer-head, .deliver-box { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.offer-head-info, .deliver-info { flex: 1; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.big-price { font-size: 1.5rem; font-weight: 800; }
.big-price small { font-size: .8rem; color: var(--hint); font-weight: 600; }
.deliver-name { font-size: 1.1rem; }
.rbx-box { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--ok) 12%, var(--bg2)); border: 2px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.rbx-text { flex: 1; min-width: 0; display: grid; }
.rbx-text small { color: var(--hint); font-size: .78rem; font-weight: 700; }
.rbx-name { font-size: 1.15rem; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.rbx-copy { margin-top: 0; flex: none; background: var(--bg); }
.rbx-sub { color: var(--ok); font-weight: 700; }
.todo-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; counter-reset: t; }
.todo-list li { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--ok) 10%, var(--bg2)); font-size: .93rem; font-weight: 600; }
.todo-list li span { font-size: 1.3rem; }

/* ---------- precios de la tienda ---------- */
.market-box { margin-top: 14px; padding: 12px 14px; border-radius: 16px; display: grid; gap: 8px;
  background: color-mix(in srgb, #f59e0b 12%, var(--bg2)); border: 1.5px solid color-mix(in srgb, #f59e0b 35%, transparent); }
.market-title { font-weight: 800; font-size: .95rem; }
.market-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; }
.market-row b { font-size: 1.1rem; }
.market-row small, .market-row .ours { grid-column: 1 / -1; }
.market-label { font-size: .88rem; font-weight: 600; }
.ours { font-size: .78rem; font-weight: 700; color: var(--ok); }
.market-none { font-weight: 650; font-size: .92rem; }
.market-verdict { font-size: .88rem; font-weight: 650; color: var(--warn); }
.market-verdict.good { color: var(--ok); }
.use-price { margin-top: 2px; background: var(--bg); color: var(--text); }
.earn-line { margin-top: 10px; font-size: .95rem; }
.earn-line b { color: var(--ok); }

/* ---------- asistente para publicar ---------- */
.wiz-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 12px 0 4px; }
.wiz-dot { display: grid; justify-items: center; gap: 3px; border: 0; background: none; font: inherit; color: var(--hint);
  padding: 0; cursor: pointer; position: relative; }
.wiz-dot b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem;
  background: var(--bg2); color: var(--hint); border: 2px solid var(--sep); }
.wiz-dot small { font-size: .68rem; font-weight: 650; white-space: nowrap; }
.wiz-dot.on b { background: var(--btn); color: var(--btn-text); border-color: var(--btn); transform: scale(1.1); }
.wiz-dot.on small { color: var(--text); }
.wiz-dot.done b { background: var(--ok); color: #fff; border-color: var(--ok); }
.wiz-dot:disabled { cursor: default; }
.wiz-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; }
.wiz-card { --c: var(--btn); margin-top: 14px; padding: 14px; border-radius: 18px; min-width: 0;
  background: color-mix(in srgb, var(--c) 7%, var(--bg2)); border-left: 5px solid var(--c); display: grid; gap: 8px; }
.wiz-card h3 { color: var(--text); }
.c-ms { --c: #7c3aed; } .c-mut { --c: #ec4899; } .c-trait { --c: #f59e0b; }
.c-price { --c: #22a55b; } .c-qty { --c: #3b82f6; } .c-time { --c: #0ea5e9; }
.c-photo { --c: #f08c1a; } .c-title { --c: #6366f1; } .c-desc { --c: #64748b; }

.picked-box { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 16px;
  background: var(--bg2); border: 2px dashed var(--sep); min-height: 64px; }
.picked-box.on { border: 2px solid var(--rc, var(--ok)); background: color-mix(in srgb, var(--rc, var(--ok)) 10%, var(--bg2)); }
.picked-box .thumb { width: 48px; height: 48px; border-radius: 12px; }
.picked-text { flex: 1; min-width: 0; display: grid; }
.picked-text small { color: var(--hint); font-size: .75rem; }
.picked-empty { color: var(--hint); font-weight: 600; margin: 0 auto; }
.ok-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ok); color: #fff; font-weight: 800; }

.pills { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 6px; margin-top: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pills.wrap { flex-wrap: wrap; overflow: visible; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; font: inherit; font-size: .86rem; font-weight: 650; padding: 9px 13px; border-radius: 999px; min-height: 40px;
  border: 1.5px solid color-mix(in srgb, var(--rc, var(--hint)) 55%, transparent);
  background: color-mix(in srgb, var(--rc, var(--hint)) 10%, var(--bg)); color: var(--text); cursor: pointer; }
.pill.on { background: var(--rc, var(--btn)); border-color: var(--rc, var(--btn)); color: #fff; }
.pill small { opacity: .75; font-weight: 500; }

.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.br { display: grid; justify-items: center; align-content: start; gap: 5px; padding: 8px 4px 9px; border-radius: 16px;
  border: 2px solid transparent; background: var(--bg2); color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.br .thumb { width: 64px; height: 64px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc, var(--btn)) 25%, var(--bg)), var(--bg)); }
.br-name { font-size: .76rem; font-weight: 650; line-height: 1.2; text-align: center; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.br-rarity { font-size: .68rem; color: var(--rc, var(--hint)); font-weight: 700; }
.br.on { border-color: var(--rc, var(--ok)); background: color-mix(in srgb, var(--rc, var(--ok)) 14%, var(--bg2)); }

.ms-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.units { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 14px; }
.unit { font: inherit; font-weight: 750; font-size: .9rem; border: 0; border-radius: 10px; padding: 10px 10px; min-height: 44px;
  background: none; color: var(--hint); cursor: pointer; }
.unit.on { background: #7c3aed; color: #fff; }
.ms-help { font-size: .88rem; color: var(--hint); }
.ms-help b { color: var(--text); }

.mut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 7px; }
.mut-btn { font: inherit; font-size: .86rem; font-weight: 700; padding: 11px 6px; min-height: 46px; border-radius: 14px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--mc) 45%, transparent); color: var(--mc);
  background: color-mix(in srgb, var(--mc) 9%, var(--bg)); }
.mut-btn.on { background: var(--mc); border-color: var(--mc); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--mc) 40%, transparent); }
.mut-btn[data-mutation="rainbow"].on { background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7); }
.mut-btn[data-mutation="galaxy"].on { background: linear-gradient(135deg, #312e81, #7c3aed, #db2777); }

.traits { display: grid; gap: 8px; }
.trait-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 200px; overflow-y: auto; padding: 2px; }
.chip.trait.pick { font-size: .85rem; padding: 8px 12px; cursor: pointer; border: 1.5px solid color-mix(in srgb, #f59e0b 40%, transparent); }
.chip.trait.pick.on { background: #f59e0b; color: #fff; }
.chip.removable { cursor: pointer; font-size: .85rem; padding: 7px 11px; }
.chips.chosen { min-height: 30px; align-items: center; }

.money-input { position: relative; }
.money-input input { padding-left: 34px; padding-right: 58px; }
.money-input::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--hint); font-size: 1.2rem; font-weight: 700; pointer-events: none; }
.money-input::after { content: "USD"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--hint); font-size: .85rem; font-weight: 700; pointer-events: none; }
.stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 8px; align-items: center; }
.step-btn { height: 52px; border: 0; border-radius: 14px; font: inherit; font-size: 1.6rem; font-weight: 700;
  background: var(--bg); color: var(--link); cursor: pointer; }
.step-btn:active { transform: scale(.95); }
.qty-input { text-align: center; font-size: 1.35rem; font-weight: 800; }
.earn-box { padding: 12px 14px; border-radius: 14px; display: grid; gap: 2px; font-size: .9rem;
  background: color-mix(in srgb, var(--ok) 14%, var(--bg)); }
.earn-box b { color: var(--ok); font-size: 1.5rem; }
.earn-box.big { margin-top: 14px; text-align: center; justify-items: center; }
.earn-box.big b { font-size: 1.9rem; }

.photo-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-opt { display: grid; justify-items: center; gap: 3px; padding: 14px 8px; border-radius: 16px; font: inherit; cursor: pointer;
  border: 2px dashed color-mix(in srgb, #f08c1a 55%, transparent); background: var(--bg); color: var(--text); text-align: center; }
.photo-opt small { color: var(--hint); font-size: .74rem; line-height: 1.25; }
.photo-opt.on { border-style: solid; border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--bg)); }
.photo-opt:disabled { opacity: .5; cursor: not-allowed; }
.opt-emoji { font-size: 1.8rem; }
.photo-preview { min-height: 120px; border-radius: 16px; overflow: hidden; display: grid; place-items: center;
  background: var(--bg); border: 2px solid transparent; }
.photo-preview.ready { border-color: var(--ok); }
.photo-preview img { display: block; width: 100%; max-height: 240px; object-fit: contain; }
.photo-empty { color: var(--hint); font-size: .9rem; }
.photo-status { font-weight: 650; }
.preview { background: var(--bg2); pointer-events: none; margin-top: 2px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

/* ---------- bienvenida ---------- */
.tour { text-align: center; display: grid; gap: 12px; padding: 10px 4px 4px; }
.tour-emoji { font-size: 4rem; line-height: 1.1; }
.tour-text { font-size: 1.05rem; }
.tour-dots { display: flex; justify-content: center; gap: 7px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--sep); }
.tour-dots i.on { background: var(--btn); width: 22px; border-radius: 4px; }

/* ---------- ganancias ---------- */
.hero { text-align: center; padding: 22px 14px; margin-top: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 20%, var(--bg)), var(--bg)); }
.hero-amount { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0; color: var(--ok); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tile p:last-child { font-size: 1.2rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.fee-card { margin-top: 10px; display: grid; gap: 10px; }
.fee-chain { display: grid; gap: 10px; }
.fee-step { display: grid; gap: 4px; }
.fee-top { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.fee-track { height: 10px; border-radius: 5px; background: var(--bg2); overflow: hidden; }
.fee-bar { display: block; height: 100%; border-radius: 5px; background: color-mix(in srgb, var(--btn) 55%, transparent); }
.fee-step.final .fee-top { font-weight: 800; font-size: 1rem; }
.fee-step.final .fee-bar { background: var(--ok); }
.sale .item-title { color: var(--ok); }

/* ---------- ayuda ---------- */
.help-hero { text-align: center; margin-top: 12px; display: grid; gap: 4px; }
.help-emoji { font-size: 2.6rem; }
#guide-full { margin-top: 8px; }
.guide { display: grid; gap: 10px; margin-top: 10px; }
.guide-step { --c: var(--btn); background: var(--bg); border-radius: var(--radius); overflow: hidden; border-left: 5px solid var(--c); }
.guide-step summary { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; list-style: none; font-weight: 700; }
.guide-step summary::-webkit-details-marker { display: none; }
.g-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--c); color: #fff; font-weight: 800; }
.g-title { flex: 1; }
.g-emoji { font-size: 1.5rem; }
.guide-step ol { margin: 0; padding: 0 16px 14px 60px; display: grid; gap: 6px; font-size: .93rem; }
.g1 { --c: #7c3aed; } .g2 { --c: #f59e0b; } .g3 { --c: #8b5cf6; }
.g4 { --c: #0ea5e9; } .g5 { --c: #22a55b; } .g6 { --c: #16a34a; }
.server-card, .rules-card { margin-top: 12px; display: grid; gap: 10px; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules li { display: flex; gap: 10px; align-items: center; font-size: .93rem; }
.rules li span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--bg2); }
#tour-again { margin-top: 12px; }

/* ---------- chat ---------- */
.chat-list { display: flex; flex-direction: column; gap: 6px; height: 36vh; min-height: 200px; overflow-y: auto; margin-top: 12px;
  padding: 10px; border-radius: 16px; background: var(--bg2); }
.chat-msg { max-width: 84%; padding: 9px 12px; border-radius: 16px; display: grid; gap: 3px;
  background: var(--bg); align-self: flex-start; border-bottom-left-radius: 5px; }
.chat-msg.me { align-self: flex-end; background: color-mix(in srgb, var(--btn) 22%, var(--bg));
  border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.chat-msg.system { align-self: center; max-width: 92%; background: none; border: 1px dashed var(--sep);
  color: var(--hint); font-size: .85rem; text-align: center; }
.chat-name { font-size: .72rem; font-weight: 800; color: var(--accent); }
.chat-msg.me .chat-name { color: var(--btn); text-align: right; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-time { font-size: .68rem; color: var(--hint); justify-self: end; }
.chat-file { font: inherit; font-size: .88rem; text-align: left; padding: 6px 8px; border-radius: 8px; border: 0;
  background: var(--bg2); color: var(--link); cursor: pointer; }
.quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.quick::-webkit-scrollbar { display: none; }
.quick-btn { flex: none; font: inherit; font-size: .85rem; font-weight: 650; padding: 9px 12px; min-height: 40px; border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--chat) 45%, transparent); background: color-mix(in srgb, var(--chat) 9%, var(--bg));
  color: var(--text); cursor: pointer; }
.chat-meaning { margin-top: 8px; padding: 8px 10px; border-radius: 10px; font-size: .83rem;
  background: color-mix(in srgb, var(--chat) 10%, var(--bg2)); }
.chat-compose { display: flex; gap: 6px; align-items: flex-end; margin-top: 8px; }
.chat-input { min-height: 48px; max-height: 130px; flex: 1; resize: none; }
.chat-send { padding: 11px 14px; min-height: 48px; }
.chat-photo { padding: 10px 12px; font-size: 1.15rem; min-height: 48px; }
.chat-note { margin-top: 8px; text-align: center; }

/* ---------- equipo ---------- */
.link-box { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg2);
  font-family: ui-monospace, Consolas, monospace; font-size: .8rem; overflow-wrap: anywhere; user-select: all; }

/* ---------- barra inferior ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex;
  background: var(--bg); border-top: 1px solid var(--sep); padding: 6px 6px calc(6px + var(--safe-bottom)); }
.tabbar button { position: relative; flex: 1; display: grid; justify-items: center; gap: 1px; border: 0; border-radius: 12px;
  background: none; color: var(--hint); font: inherit; font-size: .72rem; font-weight: 700; padding: 5px 2px; cursor: pointer; min-width: 0; }
.tab-ico { font-size: 1.35rem; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.tabbar button.on { color: var(--btn); background: color-mix(in srgb, var(--btn) 10%, transparent); }
.tabbar button.on .tab-ico { filter: none; opacity: 1; }
.dot { position: absolute; top: 0; left: calc(50% + 8px); min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: #fff; font-size: .72rem; line-height: 19px; }

.kbd-done { position: fixed; right: 12px; z-index: 40; font: inherit; font-weight: 800; font-size: .95rem;
  padding: 10px 18px; border: 0; border-radius: 999px; background: var(--btn); color: var(--btn-text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%);
  z-index: 30; width: max-content; max-width: calc(100vw - 32px); text-align: center; padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-size: .93rem; font-weight: 600; animation: up .2s ease-out;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast.bad { background: var(--danger); color: #fff; }

@media (max-width: 360px) {
  .tiles-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiz-dot small { display: none; }
  .segmented button { font-size: .78rem; }
}
