/* Robin Dark — diseño 3D dorado: negro profundo y oro, sin verde. */
:root {
  --bg: #0a0805;
  --panel: #171208;
  --panel2: #211a0c;
  --gold: #f2c14e;
  --gold-deep: #b8860b;
  --gold-bright: #ffe9a8;
  --gold-grad: linear-gradient(135deg, #fbe08a 0%, #f2c14e 35%, #c9962e 70%, #8a6410 100%);
  --text: #f7f1e3;
  --muted: #b8a97e;
  --line: #6b5518;
}
* { box-sizing: border-box; }
/* Las palabras largas sin espacios (alias, títulos, descripciones,
   enlaces, mensajes) se parten dentro de su caja en vez de
   ensancharla y salirse de la pantalla: era el desbordamiento
   horizontal real en móvil y escritorio. */
.card, .bubble, .conv, .chat-peer, .modal-card, .profile-listing,
.admin-table td, .who, .stat, .seller-link, h1, h2, h3 {
  overflow-wrap: break-word;
}
.grid > *, .chat-layout > *, .auth-grid > *, .profile-stats > * { min-width: 0; }
.search-box input, .chat-form input { min-width: 0; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(242, 193, 78, .16), transparent 60%),
    radial-gradient(800px 400px at 90% 110%, rgba(184, 134, 11, .12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.topbar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 14px 20px;
  background: linear-gradient(180deg, #241c0c 0%, #120d05 100%);
  border-bottom: 3px solid transparent;
  border-image: var(--gold-grad) 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .65), 0 2px 0 rgba(242, 193, 78, .35);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 1.5rem; font-weight: 900; letter-spacing: .5px; text-shadow: 0 2px 0 #000, 0 0 22px rgba(242, 193, 78, .35); }
.brand .logo { color: var(--gold); }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  background: linear-gradient(180deg, #2a2110, #171208);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 3px 0 #000, inset 0 1px 0 rgba(255, 233, 168, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.nav-btn.active, .nav-btn:hover {
  background: var(--gold-grad); color: #1a1200; font-weight: 700;
  box-shadow: 0 4px 0 #6b4d05, 0 8px 18px rgba(242, 193, 78, .35);
  transform: translateY(-1px);
}
.auth-area { margin-left: auto; display: flex; gap: 10px; align-items: center; }
button { cursor: pointer; }
.cta, form button[type="submit"], .buy-btn {
  background: var(--gold-grad); color: #1a1200; border: none; font-weight: 800;
  padding: 10px 18px; border-radius: 10px;
  box-shadow: 0 5px 0 #6b4d05, 0 10px 22px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.cta:hover, form button[type="submit"]:hover, .buy-btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.cta:active, form button[type="submit"]:active, .buy-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #6b4d05, 0 4px 10px rgba(0, 0, 0, .55); }
.ghost {
  background: linear-gradient(180deg, #2a2110, #171208); color: var(--text);
  border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px;
  box-shadow: 0 3px 0 #000, inset 0 1px 0 rgba(255, 233, 168, .2);
}
main { max-width: 1100px; margin: 0 auto; padding: 20px; perspective: 1200px; }
.hero { text-align: center; padding: 28px 12px 10px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0; line-height: 1.15; text-shadow: 0 4px 0 #000, 0 10px 30px rgba(0, 0, 0, .8); }
.hero h1 span {
  display: block;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* Sin text-shadow heredada: la sombra negra tapaba el dorado y las
     líneas se veían oscuras y pegadas en el teléfono. */
  text-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .9)) drop-shadow(0 0 18px rgba(242, 193, 78, .3));
}
.welcome { max-width: 760px; margin: 16px auto; color: #e8dcbd; font-size: 1.1rem; line-height: 1.6; }
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px;
  max-width: 760px; margin: 18px auto 4px; perspective: 1000px;
}
.stat {
  background: linear-gradient(160deg, #241c0c 0%, var(--panel) 45%, #0f0a04 100%);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .6), 0 2px 0 rgba(242, 193, 78, .18), inset 0 1px 0 rgba(255, 233, 168, .18);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.stat:hover {
  transform: translateY(-4px) rotateX(2deg) translateZ(6px);
  border-color: var(--gold);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .75), 0 0 20px rgba(242, 193, 78, .25), inset 0 1px 0 rgba(255, 233, 168, .3);
}
.stat strong {
  display: block; font-size: 1.9rem; font-weight: 900; color: var(--gold);
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .9));
}
.stat span { color: var(--muted); font-size: .9rem; font-weight: 700; }
.search-box { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.search-box input {
  flex: 1; padding: 14px; border-radius: 12px;
  border: 2px solid var(--gold); background: linear-gradient(180deg, #241c0c, #120d05);
  color: var(--text); font-size: 1rem;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .7), 0 0 0 3px rgba(242, 193, 78, .12);
}
.search-box input:focus { outline: none; box-shadow: inset 0 3px 8px rgba(0, 0, 0, .7), 0 0 18px rgba(242, 193, 78, .45); }
.pub-filters { justify-content: center; margin: 12px 0 4px; }
.hint { color: var(--muted); }
.ticker {
  overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 10px 0; margin: 22px 0; color: var(--gold); font-weight: 700;
  background: linear-gradient(180deg, rgba(242, 193, 78, .08), transparent);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
}
.ticker span { display: inline-block; padding-right: 20px; animation: slide 22s linear infinite; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker span { animation: none; } .card:hover, .conv:hover { transform: none; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; perspective: 1000px; }
.card {
  background: linear-gradient(160deg, #241c0c 0%, var(--panel) 45%, #0f0a04 100%);
  border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .6), 0 2px 0 rgba(242, 193, 78, .18), inset 0 1px 0 rgba(255, 233, 168, .18);
  transform-style: preserve-3d;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-6px) rotateX(2deg) rotateY(-2deg) translateZ(8px);
  border-color: var(--gold);
  box-shadow: 0 22px 40px rgba(0, 0, 0, .75), 0 0 24px rgba(242, 193, 78, .28), inset 0 1px 0 rgba(255, 233, 168, .3);
}
.price { color: var(--gold); font-size: 1.3rem; font-weight: 900; margin: 8px 0; text-shadow: 0 2px 0 #000; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.form { display: grid; gap: 12px; max-width: 560px; }
.form label { display: grid; gap: 6px; font-weight: 700; }
.form input, .form textarea {
  padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #241c0c, #120d05); color: var(--text); font-size: 1rem;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .65);
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .65), 0 0 14px rgba(242, 193, 78, .35); }
.msg { min-height: 1.2em; }
.msg.ok { color: var(--gold); }
.msg.error { color: #ff7a7a; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.who { font-weight: 800; }
.badge { background: var(--gold-grad); color: #1a1200; border-radius: 999px; padding: 1px 7px; font-size: .8rem; font-weight: 800; box-shadow: 0 2px 0 #6b4d05; }
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
.conv-list { display: grid; gap: 8px; align-content: start; }
.conv {
  text-align: left;
  background: linear-gradient(160deg, #241c0c, var(--panel));
  color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 233, 168, .15);
  transition: transform .15s ease, border-color .15s ease;
}
.conv:hover { transform: translateY(-2px); }
.conv.active { border-color: var(--gold); box-shadow: 0 6px 14px rgba(0, 0, 0, .5), 0 0 16px rgba(242, 193, 78, .3); }
.chat-messages {
  display: grid; gap: 10px; align-content: start; min-height: 220px; max-height: 60vh; overflow-y: auto;
  background: linear-gradient(160deg, #1d1608, #0f0a04);
  border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  box-shadow: inset 0 4px 16px rgba(0, 0, 0, .65), 0 8px 20px rgba(0, 0, 0, .5);
}
.bubble {
  background: linear-gradient(180deg, #2a2110, var(--panel2));
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; max-width: 80%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 233, 168, .15);
}
.bubble.mine {
  margin-left: auto;
  background: linear-gradient(180deg, #5c430f, #332507);
  border-color: var(--gold);
}
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input {
  flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #241c0c, #120d05); color: var(--text);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .65);
}
/* Insignias y perfil público: dorado 3D, sin verde. */
.seller-link {
  background: none; border: none; padding: 0; font: inherit; font-weight: 800;
  color: var(--gold); text-decoration: underline; text-underline-offset: 2px;
}
.seller-link:hover { color: var(--gold-bright); }
/* Insignia de verificado estilo Facebook: círculo azul con check
   blanco. La clase .badge-verificado es solo el envoltorio del SVG
   (sin fondo dorado); el brillo azul va en .verified-badge. */
.badge-verificado { background: none; box-shadow: none; padding: 0; }
.verified-badge {
  display: inline-flex; vertical-align: middle; line-height: 0;
  filter: drop-shadow(0 0 6px rgba(24, 119, 242, .8)) drop-shadow(0 2px 3px rgba(0, 0, 0, .65));
}
.verified-badge svg { display: block; }
.verified-lg svg { width: 26px; height: 26px; }
.verified-sm svg { width: 18px; height: 18px; }
.badge-top { background: linear-gradient(135deg, #ffe9a8, #f2c14e); color: #1a1200; box-shadow: 0 2px 0 #6b4d05, 0 0 12px rgba(242, 193, 78, .4); }
.badge-confiable { background: linear-gradient(180deg, #3a2d10, #241c0c); color: var(--gold); border: 1px solid var(--gold); }
.badge-nuevo { background: linear-gradient(180deg, #2a2110, #171208); color: var(--muted); border: 1px solid var(--line); }
/* Letras de rango llamativas: grandes (~26px), cada una con un
   degradado vivo de su color, borde luminoso y resplandor propio.
   Van junto a la insignia de reputación en tienda, chat y perfil. */
.rank-letters { display: inline-flex; gap: 5px; vertical-align: middle; margin-left: 4px; }
.rank { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; font-size: 1rem; font-weight: 900; line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .65); }
.rank-letters.rank-sm { gap: 3px; margin-left: 2px; }
.rank-letters.rank-sm .rank { min-width: 20px; height: 20px; padding: 0 4px; border-radius: 6px; font-size: .8rem; }
.rank-a { background: var(--gold-grad); color: #1a1200; border: 1px solid #ffe9a8; box-shadow: 0 2px 0 #6b4d05, 0 0 16px rgba(242, 193, 78, .8), 0 0 5px rgba(255, 233, 168, .9); }
.rank-m { background: linear-gradient(180deg, #60a5fa, #1d4ed8 55%, #1e3a8a); color: #eff6ff; border: 1px solid #93c5fd; box-shadow: 0 2px 0 #172554, 0 0 16px rgba(59, 130, 246, .75); }
.rank-v { background: linear-gradient(180deg, #4ade80, #15803d 55%, #14532d); color: #f0fdf4; border: 1px solid #86efac; box-shadow: 0 2px 0 #052e16, 0 0 16px rgba(34, 197, 94, .7); }
.rank-n { background: linear-gradient(180deg, #a1a1aa, #3f3f46 60%, #27272a); color: #fafafa; border: 1px solid #d4d4d8; box-shadow: 0 2px 0 #18181b, 0 0 12px rgba(161, 161, 170, .5); }
.admin-rank-select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font: inherit; }
/* El rango activo en el panel Admin brilla con el color de su rango. */
.admin-rank-select[data-rank="moderator"] { border-color: #60a5fa; color: #dbeafe; box-shadow: 0 0 0 2px rgba(59, 130, 246, .35), 0 0 16px rgba(59, 130, 246, .6); }
.admin-rank-select[data-rank="veteran"] { border-color: #4ade80; color: #dcfce7; box-shadow: 0 0 0 2px rgba(34, 197, 94, .35), 0 0 16px rgba(34, 197, 94, .6); }
.admin-rank-select[data-rank="new"] { border-color: #a1a1aa; color: #e4e4e7; box-shadow: 0 0 0 2px rgba(161, 161, 170, .3), 0 0 12px rgba(161, 161, 170, .45); }
.chat-peer {
  font-weight: 800; padding: 10px 12px; margin-bottom: 10px;
  background: linear-gradient(160deg, #241c0c, var(--panel));
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 233, 168, .15);
}
.profile-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px;
  margin: 14px 0; perspective: 1000px;
}
.profile-stats .stat strong { font-size: 1.4rem; }
.profile-listing {
  display: block; width: 100%; text-align: left;
  background: linear-gradient(160deg, #241c0c, var(--panel));
  color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-top: 8px; font-size: 1rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 233, 168, .15);
  transition: transform .15s ease, border-color .15s ease;
}
.profile-listing:hover { transform: translateY(-2px); border-color: var(--gold); }
.listing.flash {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, .5), 0 22px 40px rgba(0, 0, 0, .75), 0 0 24px rgba(242, 193, 78, .4);
}

footer { text-align: center; color: var(--muted); border-top: 1px solid var(--line); padding: 28px 16px; margin-top: 30px; }

/* Panel de administrador: tablas doradas con relieve 3D. */
.table-wrap { overflow-x: auto; border-radius: 16px; box-shadow: 0 10px 24px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 233, 168, .18); }
.admin-table { width: 100%; border-collapse: collapse; background: linear-gradient(160deg, #241c0c 0%, var(--panel) 45%, #0f0a04 100%); font-size: .92rem; }
.admin-table th {
  text-align: left; padding: 12px 14px; color: var(--gold); font-weight: 800;
  border-bottom: 2px solid var(--gold-deep); background: linear-gradient(180deg, #2a2110, #171208);
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tr:hover td { background: rgba(242, 193, 78, .06); }
footer strong { color: var(--gold); }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card {
  background: linear-gradient(160deg, #241c0c, #120d05);
  border: 1px solid var(--gold); border-radius: 16px; padding: 24px; max-width: 520px; width: calc(100% - 32px); max-height: 90vh; overflow-y: auto; position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .8), 0 0 30px rgba(242, 193, 78, .25), inset 0 1px 0 rgba(255, 233, 168, .25);
  transform: perspective(900px) rotateX(1deg);
}
.modal-close { position: absolute; top: 10px; right: 10px; }
/* Móvil: la barra se apila sin salirse, los botones llegan a 44px
   de alto para el tacto y nada se pega a los bordes. */
@media (max-width: 700px) {
  .chat-layout { grid-template-columns: 1fr; }
  .auth-area { margin-left: 0; }
  main { padding: 16px 14px; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .brand { font-size: 1.25rem; }
  .hero { padding: 18px 4px 8px; }
  .welcome { font-size: 1rem; }
  .nav-btn, .ghost, .cta, form button[type="submit"], .buy-btn { min-height: 44px; }
  .nav-btn { padding: 10px 14px; }
  .modal-card { padding: 20px 16px; }
  .admin-table { font-size: .85rem; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
  .stat strong { font-size: 1.6rem; }
  .chat-messages { max-height: 55vh; }
}
/* Teléfonos muy angostos: título y letras de rango un poco más
   pequeños para que no se apelotonen junto al alias. */
@media (max-width: 380px) {
  .hero h1 { font-size: 1.8rem; }
  .rank { min-width: 24px; height: 24px; font-size: .9rem; }
}

