/* Gathering Market — estética de fantasía medieval.
   Oscuro = "taberna de noche" (cuero, oro viejo, lacre). Claro = "pergamino". */
:root {
  --bg: #140e09;
  --bg-2: #1b130c;
  --surface: #22180f;
  --surface-2: #2e2116;
  --line: #4d3a24;
  --line-soft: #35271a;
  --text: #f1e5c9;
  --muted: #b29c78;
  --gold: #d6a84e;
  --gold-2: #f2d68f;
  --gold-ink: #231505;
  --up: #86c98a;
  --down: #e4705c;
  --blue: #86b6dc;
  --seal: #8e2b20;
  --crest-fill: #3a1f14;
  --icon-filter: invert(78%) sepia(35%) saturate(520%) hue-rotate(2deg) brightness(96%);
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --radius: 10px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ecdfc0; --bg-2: #e4d4ae; --surface: #f7eed6; --surface-2: #eadcb7; --line: #c3a674; --line-soft: #d8c296;
    --text: #2a1b0c; --muted: #6c5434; --gold: #94641a; --gold-2: #c48d2c; --gold-ink: #fff7e2;
    --up: #2e7a39; --down: #b03a2a; --blue: #2d5c86; --crest-fill: #f4e6c1;
    --icon-filter: sepia(1) saturate(1.4) brightness(.38);
    --shadow: 0 2px 8px rgba(80, 50, 10, .14);
    color-scheme: light;
  }
}:root[data-theme="light"] {
    --bg: #ecdfc0; --bg-2: #e4d4ae; --surface: #f7eed6; --surface-2: #eadcb7; --line: #c3a674; --line-soft: #d8c296;
    --text: #2a1b0c; --muted: #6c5434; --gold: #94641a; --gold-2: #c48d2c; --gold-ink: #fff7e2;
    --up: #2e7a39; --down: #b03a2a; --blue: #2d5c86; --crest-fill: #f4e6c1;
    --icon-filter: sepia(1) saturate(1.4) brightness(.38);
    --shadow: 0 2px 8px rgba(80, 50, 10, .14);
    color-scheme: light;
  }
:root[data-theme="light"] .sheet h3 { color: var(--gold); }

:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--text);
  font: 17px/1.4 var(--body);
  font-variant-numeric: lining-nums;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg);
  /* textura de pergamino/cuero + viñeta */
  background-image:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 60%),
    radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, .28)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }
.num, .price, .big, .stat b, .pct, .share, .qty, .badge { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Cabecera ---------- */
.top {
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 16px;
  max-width: 720px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.crest { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.brand span {
  font: 800 19px/1 var(--display); letter-spacing: .06em;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lang-btn { margin-left: auto; border: 1px solid var(--line); background: var(--surface); color: var(--gold); border-radius: 999px;
  padding: 4px 11px; font: 700 12px var(--display); letter-spacing: .08em; cursor: pointer; }
.treasury {
  margin-top: 14px; padding: 14px 16px 12px; border-radius: 12px; position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 12%, var(--surface)), var(--surface) 55%);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px color-mix(in srgb, var(--gold) 35%, transparent), var(--shadow);
}
.eyebrow {
  border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted);
  font: 600 12px var(--display); letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow.multi::after { content: " ▾"; color: var(--gold); }  /* solo si quedan carpetas antiguas */
.big { font: 700 36px/1.1 var(--display); letter-spacing: .01em; margin-top: 2px; }
.sub { color: var(--muted); font-size: 14.5px; }

main { max-width: 720px; margin: 0 auto; padding: 0 16px; }
h2 {
  display: flex; align-items: center; gap: 10px;
  font: 700 13px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  margin: 24px 0 10px;
}
h2::before { content: "◆"; font-size: 8px; }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.hint { color: var(--muted); font-size: 15px; margin: 6px 0 14px; font-style: italic; }

/* ---------- Controles ---------- */
.search {
  width: 100%; padding: 11px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); outline: none; box-shadow: inset 0 1px 3px rgba(0,0,0,.25);
}
.search::placeholder { color: var(--muted); font-style: italic; }
.search:focus { border-color: var(--gold); }
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.seg button {
  flex: none; border: 1px solid var(--line); background: var(--surface); padding: 6px 13px;
  border-radius: 999px; font: 600 12.5px var(--display); letter-spacing: .03em; cursor: pointer; color: var(--muted);
}
.seg button.on {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: var(--gold);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; cursor: pointer;
  font: 700 13px var(--display); letter-spacing: .05em; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}
.btn.primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink);
  border-color: color-mix(in srgb, var(--gold) 70%, #000);
  text-shadow: 0 1px 0 rgba(255, 240, 200, .35);
}
.btn.block { width: 100%; }
.btn.danger { color: #e05a4f; border-color: rgba(224, 90, 79, .45); }
.btn:disabled { opacity: .5; }
.row-btns { display: flex; gap: 8px; margin-top: 12px; }
.row-btns .btn { flex: 1; }

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.item {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); width: 100%; text-align: left;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--bg)));
  border: 1px solid var(--line-soft); cursor: pointer; box-shadow: var(--shadow);
}
.item:hover { border-color: var(--line); }
.item.on { border-color: var(--gold); }
.thumb { width: 46px; aspect-ratio: 488/680; border-radius: 4px; object-fit: cover; background: var(--surface-2); flex: none; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.item-side { text-align: right; flex: none; }
.price { font-weight: 700; }
.up { color: var(--up); } .down { color: var(--down); }
.chip { font-size: 12.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.gold { border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.chip.foil { background: linear-gradient(90deg, #ff9a9e44, #a1c4fd44, #c2e9fb44); color: var(--text); }
.chip.ban { border-color: var(--down); color: var(--down); }
.r { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.r-common { background: #9aa0a6; } .r-uncommon { background: #b8c7d6; }
.r-rare { background: #d9b65d; } .r-mythic { background: #e8673a; } .r-special, .r-bonus { background: #a66be0; }

.empty {
  text-align: center; padding: 30px 20px; color: var(--muted); border: 1px dashed var(--line);
  border-radius: var(--radius); margin-top: 14px; font-style: italic;
}
.empty strong { display: block; color: var(--text); font: 700 15px var(--display); letter-spacing: .04em; margin-bottom: 6px; font-style: normal; }

/* ---------- Mazos ---------- */
.deck { display: block; padding: 14px; }
.deck-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.deck-name { font: 700 16px var(--display); letter-spacing: .03em; }
.share { font: 700 16px var(--display); color: var(--gold); }
.bar { height: 7px; border-radius: 99px; background: var(--bg); overflow: hidden; margin: 10px 0 6px; box-shadow: inset 0 1px 2px rgba(0,0,0,.5); border: 1px solid var(--line-soft); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 99px; }
.deck-foot { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.deck-line { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.deck-line:last-child { border-bottom: 0; }
.qty { width: 42px; font-weight: 700; flex: none; }
.qty.full { color: var(--up); } .qty.part { color: var(--gold); } .qty.none { color: var(--muted); }
.deck-line .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--surface-2); border-radius: 8px; padding: 9px 10px; border: 1px solid var(--line-soft); }
.stat b { display: block; font: 700 18px var(--display); }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- Mercado ---------- */
.mover { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: 8px; }
.mover .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mover .pct { font-weight: 700; width: 64px; text-align: right; }
.mover .from { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ---------- Avisos ---------- */
.event { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--gold); border-radius: 8px; }
.event .t { font-weight: 600; }
.event .b { color: var(--muted); font-size: 15px; margin-top: 2px; }
.event .d { color: var(--muted); font-size: 13px; margin-top: 4px; font-style: italic; }

/* ---------- Colecciones (ediciones) ---------- */
.set-icon { width: 34px; height: 34px; flex: none; object-fit: contain; filter: var(--icon-filter); }
.set-row .item-title { white-space: normal; line-height: 1.2; }
.pin { font-size: 13px; color: var(--gold); }
.set-head { display: flex; gap: 12px; align-items: center; margin: 4px 40px 6px 0; }
.set-head .set-icon { width: 44px; height: 44px; }
.set-head h3 { margin: 0 !important; }
.rarity-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 10px; }
.rarity-row div { text-align: center; font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 5px 2px; border: 1px solid var(--line-soft); }
.rarity-row b { display: block; color: var(--text); font: 700 14px var(--display); }
button.gcard { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.gcard .check { display: none; position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%;
  place-items: center; font-weight: 800; background: var(--gold); color: var(--gold-ink); box-shadow: 0 0 0 2px var(--bg); }
.gcard.picked .check { display: grid; }
.gcard.picked img, .gcard.missing.picked img { outline: 3px solid var(--gold); outline-offset: -1px; filter: none; }
.sel-bar { position: sticky; bottom: calc(-24px - var(--safe-b)); margin: 12px -16px calc(-24px - var(--safe-b));
  padding: 10px 16px calc(12px + var(--safe-b)); display: flex; gap: 8px; align-items: center;
  background: var(--surface); border-top: 1px solid var(--gold); box-shadow: 0 -6px 16px rgba(0,0,0,.35); z-index: 2; }
.sel-bar[hidden] { display: none; }
.sel-bar #sel-add { flex: 1; }
.sel-bar #sel-all { padding: 11px 10px; font-size: 11.5px; }
.gcard .num-tag { position: absolute; bottom: 26px; right: 5px; font-size: 11px; padding: 0 5px; border-radius: 5px; background: rgba(0,0,0,.72); color: #e9dcc0; }

/* ---------- Navegación inferior ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b); display: flex; z-index: 10;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--bg) 96%, transparent));
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  box-shadow: 0 -1px 0 color-mix(in srgb, var(--gold) 25%, transparent), 0 -6px 18px rgba(0,0,0,.3);
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font: 600 10.5px var(--display); letter-spacing: .02em; position: relative; min-width: 0; padding: 0 2px; }
.tabs a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .tabs a { font-size: 9px; letter-spacing: 0; } .tabs svg { width: 22px; height: 22px; } }
.tabs svg { width: 24px; height: 24px; }
.tabs a.on { color: var(--gold); }
.tabs a.on::before { content: "◆"; position: absolute; top: 3px; font-size: 7px; color: var(--gold-2); }
.tabs .dot { position: absolute; top: 9px; right: calc(50% - 17px); width: 8px; height: 8px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 2px var(--bg); }

/* Botón de escanear: un sello de lacre */
.fab {
  position: fixed; right: max(16px, calc(50% - 344px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  width: 62px; height: 62px; border-radius: 50%; cursor: pointer; z-index: 11; display: grid; place-items: center;
  color: #f6dc9c; border: 2px solid color-mix(in srgb, #f2d68f 45%, transparent);
  background: radial-gradient(circle at 35% 30%, #c4493d, var(--seal) 58%, #561710);
  box-shadow: 0 6px 18px rgba(0,0,0,.45), inset 0 -3px 6px rgba(0,0,0,.35), inset 0 0 0 5px rgba(0,0,0,.12);
}
.fab svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.5)); }

/* ---------- Hoja inferior ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(8, 4, 2, .62); z-index: 20; touch-action: none; }
html.lock, html.lock body { overflow: hidden; overscroll-behavior: none; }
.sheet, .scan-result { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; z-index: 21;
  background: var(--surface); border-radius: 16px 16px 0 0; padding: 8px 16px calc(24px + var(--safe-b));
  max-width: 720px; margin: 0 auto; animation: up .22s ease-out;
  border-top: 2px solid var(--gold); box-shadow: 0 -10px 30px rgba(0,0,0,.45);
  background-image: radial-gradient(100% 40% at 50% 0%, color-mix(in srgb, var(--gold) 9%, transparent), transparent);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.follow-row { margin-top: 8px; } .follow-row .btn { flex: 1; justify-content: center; }
.help-btn { font: 700 17px var(--display); }
.help-item p { margin: 8px 0 2px; line-height: 1.5; }
.builder-intro { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0 14px; line-height: 1.5; }
.builder-intro svg.ico { flex: none; width: 34px; height: 34px; color: var(--gold); }
.pc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pc-set { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; aspect-ratio: 1; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-align: center; }
.pc-set .pc-name { font: 600 12.5px/1.25 var(--body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-set img { width: 34px; height: 34px; object-fit: contain; filter: var(--icon-filter); }
.pc-set .pc-code { font: 700 14px var(--display); color: var(--gold); }
.pc-set .sub { font-size: 11px; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 15px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--gold); }
.today { margin: 4px 0 10px; padding: 10px 12px; border-radius: 14px; background: rgba(214,168,78,.07); box-shadow: inset 0 0 0 1px rgba(214,168,78,.25); }
.today summary { font: 700 15px var(--display); letter-spacing: .04em; color: var(--gold); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.today-sec { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.today-row { font-size: 14px; line-height: 1.35; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.today-row svg.ico { flex: none; }
.link-row { background: none; border: 0; color: var(--text); padding: 2px 0; text-align: left; cursor: pointer; font: inherit; }
.today-row b.up { color: #7fdc8a; } .today-row b.down { color: #ff8f8f; }
.cmp-d { flex: none; min-width: 38px; text-align: center; font: 700 15px var(--display); border-radius: 8px; padding: 4px 6px; }
.cmp-d.up { color: #7fdc8a; background: rgba(127,220,138,.12); } .cmp-d.down { color: #ff8f8f; background: rgba(255,143,143,.12); }
.legal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.legal { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 8px; font-size: 11px; color: var(--muted); background: var(--surface-2); }
.legal b { font-size: 13px; color: var(--text); }
.legal.ok { box-shadow: inset 3px 0 0 #5fbf6f; } .legal.no { box-shadow: inset 3px 0 0 #e05a4f; } .legal.re { box-shadow: inset 3px 0 0 var(--gold); } .legal.off { opacity: .6; }
.rulings { margin: 8px 0 0; padding-left: 18px; line-height: 1.45; font-size: 14px; } .rulings li { margin-bottom: 6px; }
.sheet-back { position: absolute; left: 12px; top: 10px; display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px 0 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 999px; font: 600 14px var(--body); cursor: pointer; z-index: 2; }
.sheet-back svg.ico { margin: 0; }
.sheet-back[hidden] { display: none; }
.sheet { transition: transform .15s ease-out; }
.sheet:has(#sheet-back:not([hidden])) #sheet-body { padding-top: 34px; }
.sheet-grip { width: 44px; height: 4px; border-radius: 9px; background: var(--line); margin: 0 auto 8px; }
.sheet-close { position: absolute; right: 12px; top: 10px; border: 1px solid var(--line); background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.sheet h3 { margin: 6px 40px 4px 0; font: 700 21px/1.2 var(--display); letter-spacing: .03em; color: var(--gold-2); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .sheet h3 { color: var(--gold); } }
.card-big { display: block; width: min(260px, 70vw); aspect-ratio: 488/680; margin: 10px auto; border-radius: 12px; object-fit: cover; background: var(--surface-2); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field label { font: 600 12px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field select { padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-size: 20px; cursor: pointer; }
.stepper b { min-width: 24px; text-align: center; font-size: 19px; }
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; font: 17px var(--body) !important; color: var(--text) !important; }
.scan-preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; background: #000; }
.progress { height: 4px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin: 10px 0; }
.progress > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.candidates { display: flex; gap: 10px; overflow-x: auto; padding: 6px 0; }
.cand { flex: none; width: 110px; border: 2px solid transparent; border-radius: 10px; background: none; padding: 0; cursor: pointer; text-align: left; }
.cand.on { border-color: var(--gold); }
.cand img { width: 100%; border-radius: 8px; display: block; }
.cand span { display: block; font-size: 13px; padding: 4px 2px; color: var(--muted); }

/* ---------- Rejillas de cartas ---------- */
.thumbs { display: flex; gap: 6px; margin-top: 10px; }
.thumbs img { width: 52px; aspect-ratio: 488/680; border-radius: 4px; object-fit: cover; background: var(--surface-2); box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gcard { position: relative; min-width: 0; }
.gcard img { width: 100%; aspect-ratio: 488/680; border-radius: 6px; display: block; background: var(--surface-2); object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.gcard.missing img { filter: grayscale(1) brightness(.5) sepia(.3); }
.gcard .badge { position: absolute; top: 5px; left: 5px; padding: 0 7px; border-radius: 6px; font-weight: 700; font-size: 14px;
  background: rgba(10, 6, 3, .82); color: #f1e5c9; border: 1px solid rgba(214, 168, 78, .4); }
.gcard .badge.full { color: #8fdc93; } .gcard .badge.part { color: #f2d68f; } .gcard .badge.none { color: #c9bba0; }
.gcard .why { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Constructor ---------- */
.builder-cta { margin-top: 4px; background: linear-gradient(120deg, color-mix(in srgb, var(--gold) 20%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.cta-icon { font-size: 26px; width: 46px; text-align: center; flex: none; }
/* Iconos de maná oficiales (blanco, azul, negro, rojo, verde) */
.mana-row { gap: 10px; }
.seg button.mana { width: 44px; height: 44px; border-radius: 50%; padding: 0; border: 0; background: none; opacity: .35; filter: grayscale(.6); }
.seg button.mana.on { opacity: 1; filter: none; background: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.mana-icon { width: 100%; height: 100%; display: block; }
.curve { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding-top: 18px; }
.curve > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.curve i { width: 100%; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-radius: 4px 4px 1px 1px; min-height: 2px; }
.curve b { position: absolute; top: -2px; font-size: 13px; }
.curve span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.guide { margin: 14px 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 6%, var(--surface)); }
.guide summary { font: 700 14px var(--display); letter-spacing: .05em; color: var(--gold); cursor: pointer; }
.guide p { margin: 10px 0 4px; }
.guide-style { font-weight: 600; }
.guide ul { margin: 4px 0 6px; padding-left: 20px; }
.guide li { margin: 3px 0; }
.warn { background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 15px; margin: 10px 0; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
textarea.search { resize: vertical; font-family: inherit; }
label.btn { cursor: pointer; }

/* Rejillas: mantener pulsado no debe abrir el menú de imagen del móvil */
.gcard, .gcard img, .art img { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.sel-bar.floating { position: fixed; left: 0; right: 0; margin: 0; bottom: calc(var(--nav-h) + var(--safe-b)); padding: 10px 16px; z-index: 12; }
.sel-bar .sub { flex: 1; }
body:has(#col-bar:not([hidden])) .fab { display: none; }
.set-emoji { display: grid; place-items: center; font-size: 26px; filter: none; }

/* Selector visual de arte/edición */
.arts { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.art { flex: none; width: 96px; border: 2px solid transparent; border-radius: 8px; padding: 0; background: none; cursor: pointer; text-align: center; scroll-snap-align: center; }
.art img { width: 100%; aspect-ratio: 488/680; border-radius: 6px; display: block; object-fit: cover; background: var(--surface-2); }
.art span { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; padding: 3px 0; }
.art.on { border-color: var(--gold); }
.art.on span { color: var(--gold); }

/* Escáner en vivo */
.scanner { position: fixed; inset: 0; z-index: 40; background: #000; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(78vw, 46vh); aspect-ratio: 63/88;
  border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--gold); }
.scan-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scan-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scan-frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scan-frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.scan-top { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; }
.scan-top .sheet-close { position: static; }
#scan-lang { flex-wrap: nowrap; overflow-x: auto; max-width: calc(100% - 56px); scrollbar-width: none; }
#scan-lang button { flex: none; }
.scan-zoom span { font: 600 12px var(--body); }
.scan-bottom { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 18px); display: flex; flex-direction: column; gap: 10px; z-index: 1; }
.scan-status { text-align: center;
  color: #f2e6c9; font: 600 15px var(--display); letter-spacing: .03em; text-shadow: 0 1px 4px #000; }
.scan-tools { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.scan-zoom { display: flex; align-items: center; gap: 6px; color: #f2e6c9; background: rgba(0,0,0,.45); padding: 6px 10px; border-radius: 8px; }
.scan-zoom input { width: 120px; accent-color: var(--gold); }
.focus-ring { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid var(--gold); border-radius: 50%;
  pointer-events: none; animation: focus .7s ease-out forwards; z-index: 3; }
@keyframes focus { from { transform: scale(1.5); opacity: 1; } to { transform: scale(.8); opacity: 0; } }
.scan-result { position: absolute; left: 0; right: 0; bottom: 0; max-height: 72vh; overflow-y: auto; z-index: 2; background: var(--surface);
  border-top: 2px solid var(--gold); border-radius: 16px 16px 0 0; padding: 12px 16px calc(18px + var(--safe-b)); }

.splash { text-align: center; padding: 60px 20px; }
.splash .crest { width: 90px; height: 90px; }
.splash-msg { font: 600 15px var(--display); letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
.splash .progress { max-width: 260px; margin: 10px auto; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 90px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; z-index: 30; max-width: 90vw; box-shadow: var(--shadow); }
.skeleton { height: 70px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .skeleton { animation: none; } }

/* Perfil y medallas */
.profile-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.profile-head h3 { margin: 0; }
.avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font: 700 24px var(--display);
  background: radial-gradient(circle at 35% 30%, var(--gold), #7a5a1c); color: #1b1409; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); flex: none; }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0; }
.medal { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--gold); min-width: 0; }
.medal img, .medal > i { width: 30px; height: 30px; flex: none; font-style: normal; font-size: 22px; display: grid; place-items: center; }
.medal img { filter: invert(.8) sepia(1) saturate(3) hue-rotate(5deg); }
.medal div { min-width: 0; }
.medal b { display: block; font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; }
.medal span { display: block; font-size: 11.5px; color: var(--muted); }
.medal.locked { opacity: .5; border-color: transparent; }
.lock-screen { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px; }
.lock-screen .crest { width: 72px; height: 72px; }
.lock-screen .search, .lock-screen .btn { max-width: 320px; }
[data-mark] { cursor: pointer; }
.sel-bar #sel-del { padding: 11px 12px; }
#profile-btn + #lang-btn { margin-left: 6px; }
.deck-select { width: 100%; font: 600 15px var(--display); color: var(--text); }
.deck-select option { background: var(--surface); color: var(--text); }

/* Cartas alteradas */
.version .item-main .alter-btn { margin-top: 6px; padding: 6px 10px; font-size: 12px; }
.alter-box { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.alter-box .hint { margin: 0; }
a.gcard { text-decoration: none; color: inherit; display: block; }

/* − / + en las cartas de un mazo */
.mini-step { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; }
.mini-step button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 17px; line-height: 1; padding: 0; cursor: pointer; }
.mini-step button:disabled { opacity: .35; cursor: default; }
.mini-step b { min-width: 34px; text-align: center; font-size: 13px; }
.deck-line .mini-step { margin: 0 0 0 8px; }

/* Cartas que sigues */
.chip.up { color: #6fcf7f; border-color: #6fcf7f55; }
.chip.down { color: #e57373; border-color: #e5737355; }
.watch .item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.w-del { padding: 4px 9px; font-size: 12px; }
.mover[data-follow] { cursor: pointer; }
.mini-step b.over { color: var(--gold); }

/* Iconos propios: máscara pintada con el color del texto */
.ico { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: .4em; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; flex: none; }
.ico-import { --m: url(icons/import.png); } .ico-plus { --m: url(icons/plus.png); } .ico-star { --m: url(icons/star.png); }
.ico-share { --m: url(icons/share.png); } .ico-user { --m: url(icons/user.png); } .ico-precons { --m: url(icons/precons.png); } .ico-reserved { --m: url(icons/reserved.png); }
.ico-predict { --m: url(icons/predict.png); } .ico-follow { --m: url(icons/follow.png); } .ico-synergy { --m: url(icons/synergy.png); } .ico-pin { --m: url(icons/pin.png); } .ico-picture { --m: url(icons/picture.png); } .ico-alter { --m: url(icons/alter.png); } .ico-trophy { --m: url(icons/trophy.png); } .ico-down { --m: url(icons/down.png); } .ico-up { --m: url(icons/up.png); } .ico-meta { --m: url(icons/meta.png); } .ico-folder { --m: url(icons/folder.png); }
.set-emoji .ico, .cta-icon .ico { width: 26px; height: 26px; margin: 0; color: var(--gold); vertical-align: middle; }
.icon-btn { display: inline-grid; place-items: center; padding: 6px 10px; }
.icon-btn .ico { width: 20px; height: 20px; margin: 0; }
#share-btn { margin-left: auto; }
#share-btn + #profile-btn { margin-left: 6px; }
#share-btn[hidden] + #profile-btn { margin-left: auto; }

/* Quitar una carta del mazo del constructor */
.gcard { position: relative; }
.x-card { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff;
  font-size: 13px; line-height: 26px; padding: 0; cursor: pointer; }
/* Proxies */
.proxy-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.proxy-row .mini { width: 38px; height: 38px; font-size: 19px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 0; cursor: pointer; }
.proxy-row .mini:disabled { opacity: .35; }

/* Cartel de proxy encima de la carta */
.proxy-tag { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg); padding: 3px 10px; border-radius: 6px;
  background: rgba(150, 30, 30, .88); color: #fff; font: 700 13px var(--display); letter-spacing: .12em; border: 2px solid #fff3; pointer-events: none; white-space: nowrap; }
/* Las filas de opciones saltan de línea: así se ven todas, también con ratón (sin barra de desplazamiento escondida) */
.seg { flex-wrap: wrap; overflow-x: visible; }

.lock-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.lock-row { display: flex; gap: 6px; }
.lock-row .search { flex: 1; }
.lock-row .btn { padding: 0 12px; }

/* Desplegable de mazos con su icono al lado (las <option> no admiten imágenes) */
.deck-pick { display: flex; align-items: center; gap: 8px; }
.deck-pick > span .ico { width: 24px; height: 24px; margin: 0; color: var(--gold); }
.medal > i .ico { margin: 0; }

/* Gráfica de precio de una carta */
.pchart { margin: 10px 0; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid rgba(214,168,78,.3); }
.pchart-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pchart-head b { font-size: 20px; color: var(--gold); }
.pchart-head .sub { margin-left: auto; }
.pchart svg { width: 100%; height: 130px; display: block; margin: 6px 0; color: var(--text); }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th { text-align: left; font-weight: 600; opacity: .7; padding: 3px 4px; }
.ptable td { padding: 4px; border-top: 1px solid rgba(214,168,78,.15); }
.ptable td:nth-child(3), .ptable td:nth-child(4), .ptable th:nth-child(3), .ptable th:nth-child(4) { text-align: right; }
.ptable .up, .pchart-head .up { color: #6bbf59; } .ptable .down, .pchart-head .down { color: #e0675f; }

/* Resumen del día al abrir */
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.day-card { display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.day-card img { width: 100%; border-radius: 6px; aspect-ratio: 63 / 88; object-fit: cover; background: var(--surface-2); }
.day-pct { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.day-pct.up { color: #6bbf59; } .day-pct.down { color: #e0675f; }
.day-pct .ico { margin-right: 3px; }
.day-eur { font-size: 11px; opacity: .8; }

/* Ganadores de torneos */
.tour-card { margin: 8px 0 14px; padding: 10px; border-radius: 12px; border: 1px solid var(--gold); background: var(--surface-2); }
.tour-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.tour-head b { color: var(--gold); }
.tour-row { align-items: center; }
.tour-row[disabled] { opacity: .75; cursor: default; }
.tour-rank { width: 46px; flex: none; font-weight: 700; display: inline-flex; align-items: center; }
.tour-rank.win { color: var(--gold); }
.tour-rank .ico { margin-right: 3px; }

.lang-sel { background: var(--surface); color: var(--text); border: 1px solid rgba(214,168,78,.35); border-radius: 8px; padding: 8px 10px; min-height: 40px; font: inherit; font-size: 15px; margin-left: 6px; }
.num-tag .ico { margin: 0; width: 12px; height: 12px; vertical-align: -1px; }

/* Combos infinitos */
.combo-row { align-items: center; }
.combo-imgs { display: flex; flex: none; }
.combo-imgs img { width: 44px; border-radius: 4px; }
.combo-imgs img + img { margin-left: -14px; }
.combo-imgs img.missing, .combo-big img.missing { filter: grayscale(1) opacity(.55); }
.combo-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.combo-big figure { margin: 0; text-align: center; }
.combo-big img { width: 100%; border-radius: 8px; }
.combo-big figcaption { font-size: 12px; opacity: .8; margin-top: 4px; }
.combo-steps, .combo-pre { margin: 6px 0; padding-left: 22px; line-height: 1.45; }
.combo-steps li, .combo-pre li { margin: 4px 0; }

.combo-toggle { padding: 8px 10px; border: 1px solid var(--gold); border-radius: 10px; background: var(--surface-2); }
.combo-toggle .ico { color: var(--gold); }
.combo-pick { margin: 6px 0 10px; }

.pair-thumbs { display: flex; flex: none; }
.pair-thumbs .thumb + .thumb { margin-left: -12px; box-shadow: -2px 0 6px rgba(0,0,0,.5); }

.title-back { display: flex; align-items: center; gap: 10px; }
.title-back h3 { margin: 0; }
.back-btn { flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 20px; line-height: 1; }

.mini-chip { font: inherit; font-size: 12px; background: none; color: var(--gold); border: 1px solid rgba(214,168,78,.4); border-radius: 999px; padding: 2px 9px; margin-top: 4px; cursor: pointer; }
.mini-chip.up { color: var(--up, #6fcf7f); border-color: currentColor; }

#top-value, #top-sub { cursor: pointer; }
.link { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* Partida de prueba */
.pf-head { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.pf-life { font: 700 28px var(--display); color: var(--gold); }
.pf-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 70px; padding: 8px; margin: 6px 0; border: 1px solid rgba(214,168,78,.2); border-radius: 10px; background: rgba(0,0,0,.18); }
.pf-row.hand { border-style: dashed; }
.pf-card { position: relative; width: 62px; padding: 0; border: 0; background: none; border-radius: 6px; transition: transform .15s; }
.pf-card img { width: 100%; border-radius: 5px; display: block; }
.pf-card.tapped { transform: rotate(90deg) scale(.85); }
.pf-card.sick { opacity: .75; }
.pf-card.attacking { outline: 2px solid #e0675f; outline-offset: 1px; }
.pf-card .pt { position: absolute; right: 2px; bottom: 2px; background: rgba(0,0,0,.8); color: #fff; font-size: 11px; padding: 0 4px; border-radius: 4px; }
.pf-mid { text-align: center; font-weight: 600; color: var(--gold); margin: 4px 0; }
.pf-log { font-size: 13px; opacity: .85; max-height: 220px; overflow: auto; }
.pf-log div { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.05); }


body.immersive header.top { display: none; }

/* ---- Vidas (estilo LifeTap) ---- */
.lf-splash { display: grid; place-items: center; height: 60vh; font-size: 64px; opacity: .3; }
.lf-ask { text-align: center; padding: 8px 0; }
.lf-ask-ico { font-size: 54px; animation: lf-beat 1.2s ease-in-out infinite; }
@keyframes lf-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(.98); } 45% { transform: scale(1.1); } }
.lf-table { position: fixed; inset: 0; z-index: 15; background: #050302; display: grid; gap: 5px; padding: 5px; padding-top: calc(5px + env(safe-area-inset-top)); padding-bottom: calc(5px + env(safe-area-inset-bottom)); user-select: none; -webkit-user-select: none; touch-action: manipulation; animation: lf-in .35s ease-out; }
@keyframes lf-in { from { opacity: 0; transform: scale(.97); } }
.lf-table.n2 { grid-template-rows: 1fr 1fr; }
.lf-table.n2.side { grid-template-rows: 1fr; grid-template-columns: 1fr 1fr; }
.lf-table.n3, .lf-table.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.lf-table.n5, .lf-table.n6 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.lf-seat.span { grid-column: span 2; }
.lf-seat { position: relative; overflow: hidden; border-radius: 18px; box-shadow: inset 0 0 0 2px var(--c); transition: box-shadow .2s, filter .3s; }
.lf-seat.pick { box-shadow: inset 0 0 0 4px #ffe08a, 0 0 28px 4px #ffd35a; z-index: 1; }
.lf-in { position: absolute; left: 50%; top: 50%; background-size: cover; background-position: center; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-shadow: 0 2px 10px rgba(0,0,0,.75); border-radius: 18px; overflow: hidden; }
.lf-seat.dead .lf-in { filter: grayscale(1) brightness(.45); }
/* Como LifeTap: mitad izquierda resta, mitad derecha suma (en horizontal, desde donde mira cada jugador) */
.lf-tap { position: absolute; top: 0; bottom: 0; width: 50%; background: none; border: 0; color: rgba(255,255,255,.32); font-size: 44px; z-index: 1; display: flex; align-items: center; padding: 0 18px; -webkit-tap-highlight-color: transparent; }
.lf-tap.up { right: 0; justify-content: flex-end; } .lf-tap.down { left: 0; justify-content: flex-start; }
.lf-tap:active { background: rgba(255,255,255,.07); }
.lf-name { position: relative; z-index: 2; background: rgba(0,0,0,.35); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 3px 14px; font: 600 14px var(--display); letter-spacing: .03em; backdrop-filter: blur(4px); }
.lf-life { font: 800 clamp(64px, 19vmin, 150px)/1 var(--display); pointer-events: none; font-variant-numeric: tabular-nums; margin: 4px 0; }
.lf-life.bump { animation: lf-bump .22s ease-out; }
@keyframes lf-bump { 40% { transform: scale(1.12); } }
.lf-delta { position: absolute; top: 18%; font: 700 26px var(--display); pointer-events: none; padding: 2px 12px; border-radius: 999px; background: rgba(0,0,0,.4); animation: lf-pop .25s ease-out; }
.lf-delta.up { color: #8dffa0; } .lf-delta.down { color: #ff8f8f; }
@keyframes lf-pop { from { transform: translateY(8px) scale(.8); opacity: 0; } }
.lf-extra { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 4px; position: relative; z-index: 2; }
.lf-ctr { display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 4px 12px; border-radius: 999px; border: 0; background: rgba(0,0,0,.5); color: #fff; font: 700 18px var(--display); text-shadow: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.lf-ctr.cmd { box-shadow: inset 0 0 0 2px var(--c); }
.lf-ctr.hot { background: #6b1d14; }
.lf-ctr.add { opacity: .6; padding: 4px 10px; }
.lf-ctr.open { padding: 2px; gap: 6px; background: rgba(0,0,0,.75); box-shadow: 0 0 0 2px var(--gold); }
.lf-ctr.open button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font: 700 22px var(--display); }
.lf-skull { position: absolute; font-size: 60px; opacity: .85; pointer-events: none; animation: lf-pop .4s ease-out; }
.lf-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.lf-flash.up { background: radial-gradient(circle, rgba(120,255,150,.35), transparent 70%); }
.lf-flash.down { background: radial-gradient(circle, rgba(255,90,90,.4), transparent 70%); }
.lf-flash.go { animation: lf-flash .45s ease-out; }
@keyframes lf-flash { from { opacity: 1; } to { opacity: 0; } }
.lf-bar { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; display: flex; gap: 6px; background: rgba(12,8,5,.82); padding: 6px; border-radius: 999px; box-shadow: 0 4px 20px rgba(0,0,0,.6), inset 0 0 0 1px rgba(214,168,78,.35); backdrop-filter: blur(6px); }
.lf-table.side .lf-bar { flex-direction: column; }
.lf-bar button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 18px; transition: transform .1s; }
.lf-bar button:active { transform: scale(.88); }
.lf-panel { position: fixed; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); z-index: 4; width: min(94vw, 420px); background: rgba(16,11,7,.95); border-radius: 16px; padding: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.7), inset 0 0 0 1px rgba(214,168,78,.35); animation: lf-pop .2s ease-out; }
.lf-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 0; color: var(--text); }
.lf-row > span { min-width: 76px; font-size: 13px; opacity: .8; }
.lf-row button { border: 1px solid rgba(214,168,78,.35); background: rgba(255,255,255,.05); color: var(--text); border-radius: 10px; padding: 6px 10px; font: inherit; font-size: 14px; }
.lf-row button.on { background: var(--gold); color: #1a1209; border-color: var(--gold); font-weight: 700; }
.lf-row input { width: 64px; background: rgba(255,255,255,.06); border: 1px solid rgba(214,168,78,.35); color: var(--text); border-radius: 10px; padding: 6px; font: inherit; }
.lf-roll { text-align: center; font: 800 44px var(--display); color: var(--gold); padding: 6px 0; }
.lf-roll.spin { transform: rotate(-6deg) scale(.95); }
.lf-roll.land { animation: lf-bump .35s ease-out; }
.lf-profiles { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; }
.lf-prof { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: var(--text); font-size: 12px; min-width: 64px; }
.lf-prof.on .lf-avatar { box-shadow: 0 0 0 3px var(--gold); }
.lf-avatar { width: 54px; height: 54px; border-radius: 50%; background-size: cover; background-position: center; border: 2px solid rgba(255,255,255,.2); display: grid; place-items: center; font-size: 22px; }
.lf-avatar.add { background: rgba(255,255,255,.06); color: var(--gold); }
.lf-counters { display: grid; gap: 8px; }
.lf-step { display: flex; align-items: center; gap: 12px; }
.lf-step > span { flex: 1; display: flex; align-items: center; gap: 8px; }
.lf-step button { width: 46px; height: 38px; border-radius: 10px; border: 1px solid rgba(214,168,78,.4); background: none; color: var(--text); font-size: 18px; }
.lf-step b { min-width: 30px; text-align: center; font-size: 20px; }
.lf-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lf-preview { height: 150px; border-radius: 16px; background-size: cover; background-position: center; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-shadow: 0 2px 8px #000; margin-bottom: 10px; transition: background .2s; }
.lf-preview b { font: 700 28px var(--display); }
.lf-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.lf-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); padding: 0; }
.lf-swatch.on { box-shadow: 0 0 0 3px var(--gold); }
.lf-arts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.lf-art { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: none; aspect-ratio: 4 / 3; }
.lf-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lf-art span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 4px; }

.hot-rank { flex: none; width: 26px; text-align: center; font: 800 16px var(--display); color: var(--gold); }
.item.hot .up { color: #7fdc8a; font-weight: 700; font-size: 13px; }

/* Iconos de línea (SVG): mismo tamaño que las máscaras PNG */
svg.ico.svg { background: none !important; -webkit-mask: none !important; mask: none !important; display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: .4em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lf-splash svg.ico, .lf-ask-ico svg.ico { width: 64px; height: 64px; margin: 0; color: #e2614a; }
.lf-skull svg.ico { width: 60px; height: 60px; margin: 0; }
.lf-bar svg.ico, .lf-extra svg.ico, .sheet-close svg.ico, .x-card svg.ico, .w-del svg.ico, .check svg.ico { margin: 0; }
.lf-roll svg.ico { width: 44px; height: 44px; margin: 0; }
.medal svg.ico { width: 26px; height: 26px; margin: 0; }

.added-sum { margin: -4px 0 8px; font-size: 13px; color: var(--muted, #bfae90); }
.added-sum b { color: var(--gold); font-size: 15px; }

.month-card { margin: 10px 0; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.2); box-shadow: inset 0 0 0 1px rgba(214,168,78,.2); }
.month-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; text-transform: capitalize; }
.month-head .up { color: #7fdc8a; } .month-head .down { color: #ff8f8f; }

.big-togs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.big-togs .stepper { margin-left: auto; }
.big-tog { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: 600 16px var(--display); cursor: pointer; }
.big-tog.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: var(--gold); }
#add-alter .big-tog { flex: 1 1 40%; justify-content: center; }
.proxy-row { gap: 8px; align-items: center; }

/* Dados y moneda a pantalla completa */
.lf-dice-row button { min-width: 54px; padding: 12px 10px; font-size: 18px; font-weight: 700; }
.lf-dice { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(circle at 50% 42%, rgba(74,52,20,.93), rgba(0,0,0,.95) 65%); animation: lf-pop .2s ease-out; -webkit-tap-highlight-color: transparent; }
.lf-die-wrap { position: relative; filter: drop-shadow(0 16px 30px rgba(0,0,0,.7)) drop-shadow(0 0 22px rgba(214,168,78,.35)); }
.lf-die { --c: #c8923a; width: min(58vmin, 250px); aspect-ratio: 1; display: grid; place-items: center; color: #1a1209;
  background: radial-gradient(circle at 32% 26%, #fff3c9 0, color-mix(in srgb, var(--c) 70%, #fff) 22%, var(--c) 55%, color-mix(in srgb, var(--c) 55%, #000) 100%);
  clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%); }
.lf-die b { font: 800 clamp(70px, 24vmin, 120px)/1 var(--display); font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 rgba(255,255,255,.45); }
.lf-dice.d6 .lf-die { clip-path: none; border-radius: 22%; box-shadow: inset 0 -10px 0 rgba(0,0,0,.18), inset 0 6px 0 rgba(255,255,255,.35); }
.lf-dice.d4 .lf-die { clip-path: polygon(50% 3%, 97% 94%, 3% 94%); }
.lf-dice.d4 .lf-die b { padding-top: 30%; font-size: clamp(54px, 18vmin, 90px); }
.lf-dice.d8 .lf-die { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.lf-dice.d10 .lf-die { clip-path: polygon(50% 0, 100% 40%, 82% 100%, 18% 100%, 0 40%); }
.lf-dice.coin .lf-die, .lf-dice.first .lf-die { clip-path: none; border-radius: 50%; box-shadow: inset 0 0 0 10px rgba(0,0,0,.16), inset 0 0 0 16px rgba(255,255,255,.25); }
.lf-dice.coin .lf-die b { font-size: clamp(44px, 14vmin, 70px); }
.lf-die b svg.ico, .lf-dice.first .lf-die b svg.ico { width: 46%; height: 46%; margin: 0; }
.lf-dice.first .lf-die b { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; }
.lf-die-wrap.rolling .lf-die { animation: lf-tumble .42s linear infinite; }
.lf-dice.coin .lf-die-wrap.rolling .lf-die { animation: lf-flip .22s linear infinite; }
@keyframes lf-tumble { 0% { transform: rotate(0) scale(.88); } 50% { transform: rotate(180deg) scale(1.06); } 100% { transform: rotate(360deg) scale(.88); } }
@keyframes lf-flip { 0% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(180deg) translateY(-18px); } 100% { transform: rotateY(360deg) translateY(0); } }
.lf-die-wrap.land .lf-die { animation: lf-land .55s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes lf-land { 0% { transform: scale(1.45) rotate(-14deg); } 100% { transform: scale(1) rotate(0); } }
.lf-die-wrap.land::after { content: ""; position: absolute; inset: -18%; border-radius: 50%; border: 5px solid var(--gold); pointer-events: none; animation: lf-burst .7s ease-out forwards; }
@keyframes lf-burst { from { transform: scale(.55); opacity: 1; } to { transform: scale(1.55); opacity: 0; } }
.lf-die-wrap.crit .lf-die { --c: #3fbf6a; }
.lf-die-wrap.crit { filter: drop-shadow(0 0 40px rgba(90,230,130,.8)); }
.lf-die-wrap.crit::after { border-color: #6fe39a; }
.lf-die-wrap.fail .lf-die { --c: #c0392b; color: #fff; }
.lf-die-wrap.fail::after { border-color: #ff6b5a; }
.lf-dice-label { font: 700 26px var(--display); color: var(--gold); letter-spacing: .08em; text-shadow: 0 2px 10px rgba(0,0,0,.8); text-align: center; padding: 0 16px; }
.lf-dice-btns { display: flex; gap: 12px; }
.lf-dice-btns button { border: 1px solid rgba(214,168,78,.5); background: rgba(255,255,255,.07); color: var(--text); border-radius: 14px; padding: 14px 22px; font: 700 17px var(--display); display: inline-flex; align-items: center; gap: 8px; }
.lf-dice-btns button[data-again] { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: var(--gold); }

.scan-burst { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(16,11,7,.88); border: 1px solid rgba(214,168,78,.45); border-radius: 14px; padding: 10px 12px; color: var(--text); font-size: 15px; z-index: 1; }
.scan-burst[hidden], .scan-ask[hidden] { display: none; }
.scan-burst b { color: var(--gold); font-size: 20px; }
.scan-burst > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-burst .btn { flex: none; padding: 9px 12px; }

.trade-balance { margin: 10px 0 6px; padding: 14px; border-radius: 14px; text-align: center; font: 700 20px var(--display); background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(214,168,78,.3); }
.trade-balance span { display: block; margin-top: 4px; font: 400 14px var(--body); color: var(--muted); }
.trade-balance.even { color: var(--gold); } .trade-balance.up { color: #7fdc8a; } .trade-balance.down { color: #ff8f8f; }

/* Vidas: fichas de mesa, contadores a un toque y turno */
.lf-tokens { display: flex; gap: 6px; justify-content: center; min-height: 0; margin-bottom: 4px; pointer-events: none; position: relative; z-index: 2; }
.lf-tokens .tok { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font: 700 13px var(--display); color: #1a1209; background: linear-gradient(180deg, #ffe39a, #d6a84e); box-shadow: 0 2px 10px rgba(0,0,0,.5); animation: lf-pop .3s ease-out; }
.lf-tokens .tok.init { background: linear-gradient(180deg, #ffb3a3, #c0392b); color: #fff; }
.lf-tokens svg.ico { margin: 0; }

.lf-bar button.lf-turn { font: 800 14px var(--display); color: var(--gold); width: auto; min-width: 40px; padding: 0 8px; border-radius: 999px; }
.lf-bar button.day { background: rgba(255,214,102,.35); } .lf-bar button.night { background: rgba(90,120,255,.35); }
.lf-row .lf-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.lf-row > span svg.ico { margin-right: 4px; }
.lf-turn-n { min-width: 34px; text-align: center; font-size: 20px; color: var(--gold); }
.lf-panel { max-height: 46vh; overflow-y: auto; }

/* Escáner: la ventana de la carta ocupa menos para seguir viendo la cámara */
.scan-result { max-height: 52vh; }
.scan-result .stats { display: none; }
.scan-result .card-big { display: none; }
.scan-result .big-togs { margin: 6px 0; gap: 6px; }
.scan-result .big-tog { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.scan-result #add-alter .big-tog { flex: 1 1 20%; padding: 6px 4px; font-size: 12.5px; }
.scan-result .field { margin: 4px 0; }
.scan-result .art { width: 62px; } .scan-result .cand { width: 70px; } .scan-result .art span, .scan-result .art small { font-size: 10px; }
.scan-ask { background: rgba(16,11,7,.95); border: 1px solid var(--gold);
  border-radius: 16px; padding: 14px; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.scan-ask .sub { margin-top: 4px; }
.sell-list { width: 100%; font: 13px/1.5 ui-monospace, monospace; white-space: pre; overflow: auto; margin: 8px 0; }

.item.version { flex-wrap: wrap; }
.deck-tabs { display: flex; gap: 8px; margin: 10px 0 6px; }
.deck-tabs.scroll { flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.deck-tabs.scroll button { padding: 7px 11px; font-size: 13px; }
.deck-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line, rgba(214,168,78,.35)); background: var(--surface); color: var(--text); font: 600 14px var(--body); white-space: nowrap; }
.deck-tabs:not(.scroll) button { flex: 1; justify-content: center; }
.deck-tabs button.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: var(--gold); }
.deck-tabs .n { font-size: 12px; opacity: .7; }
.deck-fmt-label { font: 600 13px var(--display); letter-spacing: .04em; color: var(--muted); margin-top: 6px; }
.tier { display: inline-block; font: 700 11px var(--display); letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; margin-right: 6px; vertical-align: 2px; background: var(--surface-2); color: var(--muted); }
.tier.t1 { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); }
.tier.t2 { background: rgba(214,168,78,.25); color: var(--gold); }
.tier-head .sub { font: 400 13px var(--body); margin-left: 8px; text-transform: none; letter-spacing: 0; }
.format-info { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: rgba(214,168,78,.08); box-shadow: inset 0 0 0 1px rgba(214,168,78,.25); line-height: 1.45; }
.format-info svg.ico { flex: none; margin-top: 2px; color: var(--gold); }
.deck-guide p { margin: 8px 0 0; line-height: 1.5; }
.pr-grid .gcard img { cursor: pointer; }
.pr-noimg { aspect-ratio: 63/88; width: 100%; border-radius: 8px; border: 1px dashed var(--muted); background: var(--surface-2); color: var(--text); font: 600 13px var(--body); padding: 8px; }
.seg.wrap { flex-wrap: wrap; }
.arts.wrap { flex-wrap: wrap; overflow: visible; justify-content: flex-start; }
.pv-page { margin: 12px 0; text-align: center; }
.pv-page.back img { outline: 2px dashed rgba(214,168,78,.5); }
.pr-big { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 12px; }
.pr-big img { width: 62%; max-width: 360px; aspect-ratio: 488/680; border-radius: 12px; background: var(--surface-2); box-shadow: 0 6px 22px rgba(0,0,0,.5); cursor: zoom-in; object-fit: cover; }
.pr-big img.zoom { width: 100%; max-width: 680px; cursor: zoom-out; }
.pr-big:has(img.zoom) { flex-direction: column; }
.pr-big-side { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.pr-backs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.pr-backs button { flex: none; width: 76px; border: 2px solid transparent; border-radius: 8px; background: none; padding: 0; color: var(--muted); font-size: 11px; line-height: 1.2; }
.pr-backs button.on { border-color: var(--gold); color: var(--gold); }
.pr-backs img, .pr-noback { display: grid; place-items: center; width: 100%; aspect-ratio: 63/88; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.pr-backs button > span:last-child { display: block; padding: 3px 0; }
.pr-back-row { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.pr-back-row img { width: 64px; aspect-ratio: 63/88; border-radius: 6px; object-fit: cover; }
.pv-page img { width: 100%; max-width: 520px; box-shadow: 0 4px 18px rgba(0,0,0,.5); background: #fff; }
.pv-page span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.version-actions { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.version-actions .btn { flex: 1 1 auto; padding: 9px 12px; font-size: 14px; margin: 0; }
.version-actions .alter-box { flex-basis: 100%; }

/* Cabecera: los botones juntos a la derecha y que quepan en móviles estrechos (320 px) */
.brand .lang-btn + .lang-btn { margin-left: 0; }
.brand .lang-btn { flex: none; }
.brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) {
  .brand { gap: 6px; }
  .brand span { font-size: 15px; }
  .crest { width: 30px; height: 30px; }
  .brand .icon-btn { padding: 5px 7px; }
  .brand .lang-btn { padding: 4px 8px; }
}
@media (max-width: 340px) { .brand span { display: none; } }
.brand .icon-btn svg.ico { width: 20px; height: 20px; margin: 0; }
/* Resumen «Hoy»: el icono en la misma línea que el texto */
.today-row { display: block; }
.today-row svg.ico { display: inline-block; vertical-align: -3px; margin: 0 6px 0 0; width: 16px; height: 16px; }
.today-row.link-row { width: 100%; font-size: 14px; }
