/* --- tema: variables (oscuro por defecto) + claro por usuario --- */
:root {
  --bg:#12141a; --panel:#1b1f2a; --panel-2:#171a24; --btnlike-bg:#1e2740;
  --border:#2a2f3d; --border-soft:#232837;
  --text:#e8eaf0; --text-soft:#aeb6c8; --text-soft2:#9aa2b4; --text-dim:#6d7689;
  --muted:#8b93a5; --heading:#b7c0d0; --link:#7fc4ff;
}
html[data-theme="light"] {
  --bg:#f2f4f8; --panel:#ffffff; --panel-2:#e9edf3; --btnlike-bg:#ffffff;
  --border:#c9d0dc; --border-soft:#dde2ea;
  --text:#1a2030; --text-soft:#3a4356; --text-soft2:#4a5468; --text-dim:#5a6478;
  --muted:#5a6478; --heading:#2a3245; --link:#1660c9;
}
html[data-theme="light"] .flash { background:#e3edfa; color:#173a63; }
html[data-theme="light"] .flash.warn { background:#fdf3d7; color:#6b4b00; }
html[data-theme="light"] .flash.success { background:#e2f5e9; color:#14602f; }
html[data-theme="light"] .addr { background:#e2f5e9; color:#14602f; }

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); }
header { padding: 14px 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
h1 { font-size: 1.25rem; margin: 0 0 6px; }
nav a { color: var(--link); text-decoration: none; margin-right: 12px; font-size: .9rem; }
main { padding: 16px; max-width: 760px; margin: 0 auto; }
h2 { font-size: 1.05rem; }
h3 { margin: 8px 0; font-size: .95rem; color: var(--heading); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 10px 0; }
.auth { max-width: 420px; margin: 24px auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.card img { width: 100%; height: auto; object-fit: contain; border-radius: 6px; margin-bottom: 6px; }
.num { font-size: .8rem; color: var(--muted); }
.name { font-weight: 600; margin: 2px 0 8px; }
input, select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; margin: 2px 4px 2px 0; max-width: 100%; }
button { background: #2d6cdf; color: #fff; border: 0; border-radius: 6px; padding: 6px 12px; margin-top: 6px; }
button.ok { background: #1e9e5a; }
.flashes { margin: 0 0 10px; }
.flash { background: #23405e; border: 1px solid #2d6cdf; border-radius: 8px; padding: 10px 12px; margin: 6px 0; font-size: .9rem; word-break: break-all; }
.flash.warn { background: #43320f; border-color: #b98418; }
.flash.success { background: #14351f; border-color: #1e9e5a; }
.badge { display: inline-block; font-size: .75rem; border-radius: 999px; padding: 2px 8px; margin-top: 6px; }
.badge.dupe { background: #43320f; color: #ffce6b; }
.list { list-style: none; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--border-soft); }
.list li.userrank { flex-direction: column; gap: 2px; }
.rankinfo { color: var(--muted); font-size: .82rem; }
.rankinfo b { color: var(--link); }
.progress { color: var(--link); font-size: .85rem; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
a { color: var(--link); }
.inline form, form.inline { display: inline; }
label.chk { display: block; margin: 4px 0; font-size: .85rem; }
@media (max-width: 600px) { nav a { margin-right: 8px; } }
.how { margin-top: 16px; }
.steps { padding-left: 20px; margin: 8px 0; }
.steps li { margin: 10px 0; line-height: 1.45; }button.mini { padding: 2px 8px; font-size: .75rem; margin: 0 0 0 6px; }
button.danger { background: #a33a3a; }
/* --- v4: tarjetas de colecciones, rejilla de circulos, modal, checklist --- */
.collcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.collcard { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.collname { font-weight: 700; font-size: 1rem; text-decoration: none; display: block; margin-bottom: 8px; color: var(--text); }
.progressline { margin: 6px 0; }
.bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: #2d6cdf; }
.collactions { margin-top: 8px; }
.collactions a { font-size: 1.1rem; text-decoration: none; margin-right: 10px; }
.btnlike { display: inline-block; background: var(--btnlike-bg); border: 1px solid #2d6cdf; color: var(--link); border-radius: 8px; padding: 6px 10px; margin: 4px 6px 4px 0; text-decoration: none; font-size: .85rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 12px; }
.cell { position: relative; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px 4px 18px; text-align: center; }
.circ { width: 40px; height: 40px; border-radius: 50%; border: 0; font-weight: 700; font-size: .95rem; cursor: pointer; color: #fff; }
.circ.green { background: #1e9e5a; }
.circ.red { background: #a33a3a; opacity: .8; }
.cardnum { position: absolute; right: 5px; bottom: 2px; font-size: .7rem; color: var(--muted); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 16px; max-width: 320px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog img.lit { width: 100%; border-radius: 8px; }
dialog img.off { width: 100%; border-radius: 8px; filter: grayscale(1) brightness(.35); }
.card img.off { filter: grayscale(1) brightness(.35); }
.silueta { width: 100%; aspect-ratio: 3/4; background: var(--border-soft); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--muted); }
.checktable { width: 100%; border-collapse: collapse; margin-top: 12px; }
.checktable th, .checktable td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; font-size: .9rem; }
.checktable th { background: var(--panel-2); }
.ck-yes { color: #1e9e5a; font-weight: 700; }
.ck-no { color: #a33a3a; }
@media print {
  body { background: #fff; color: #000; }
  header, .flashes, .printonly-hide { display: none !important; }
  main { max-width: none; padding: 0; }
  .checktable th, .checktable td { border-color: #999; color: #000; }
  .checktable th { background: #eee; }
  .ck-yes { color: #063; }
  .ck-no { color: #900; }
}
.sitefoot { margin-top: 24px; padding: 12px 16px; border-top: 1px solid var(--border); text-align: center; }
/* --- v6: silueta con datos, credito foto, enlace externo --- */
.silueta { flex-direction: column; gap: 6px; padding: 10px 6px; }
.silueta .s-num { font-size: 1.9rem; font-weight: 800; color: var(--text-soft); line-height: 1; }
.silueta .s-name { font-size: .88rem; font-weight: 600; color: var(--text-soft2); text-align: center; }
.silueta .s-rarity { font-size: .72rem; color: var(--text-dim); }
.photocredit { font-size: .72rem; color: var(--text-dim); margin: 6px 0 2px; }

.collcard.notmine { border-style: dashed; opacity: .92; }

/* --- intercambios: chats y chat --- */
#msgs { max-height: 420px; overflow-y: auto; }
.msg { padding: 6px 4px; border-bottom: 1px solid var(--border-soft); word-break: break-word; }
.addr { background: #14351f; border: 1px solid #1e9e5a; border-radius: 8px; padding: 8px 10px; }
.teamchip { grid-column: 1 / -1; font-size: .8rem; font-weight: 600; color: var(--link); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; margin: 6px 0 2px; }

/* --- notificaciones (campana del nav) --- */
.notifbadge { display: inline-block; min-width: 1.3em; padding: 1px 5px; border-radius: 999px;
  background: #e5484d; color: #fff; font-size: .72rem; font-weight: 700; margin-left: 2px; vertical-align: middle; }
.collcard .badge { margin: 4px 6px 0 0; }

/* --- miniaturas de cartas en la ficha de otro usuario (/user/<id>) --- */
.list li img.thumb { height: 4.5rem; width: auto; border-radius: 6px; border: 1px solid var(--border-soft); margin-left: 4px; vertical-align: middle; }
