/* Mercado Volátil — mercado de CARTAS */
:root {
  --bg: #05040a;
  --bg-card: rgba(18, 14, 28, 0.92);
  --bg-elevated: #111018;
  --bg-hover: #1a1528;
  --border: rgba(167, 139, 250, 0.22);
  --border-light: rgba(167, 139, 250, 0.35);
  --text: #f8fafc;
  --muted: #a1a1aa;
  --dim: #71717a;
  --cyan: #00e5ff;
  --gold: #fbbf24;
  --purple: #c084fc;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --shadow: 0 8px 32px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(124, 58, 237, 0.18), transparent),
    radial-gradient(700px 400px at 92% 8%, rgba(251, 191, 36, 0.07), transparent),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.err { color: #fca5a5; font-size: .82rem; min-height: 1.2em; margin-top: 6px; }
code { background: var(--bg-elevated); padding: 1px 6px; border-radius: 4px; font-size: .85em; }

#bootScreen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
}
.boot-logo {
  font-weight: 900; letter-spacing: .12em; font-size: 1.5rem;
  background: linear-gradient(90deg, #c084fc, #fbbf24, #60a5fa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#bootStatus { color: var(--muted); font-size: .9rem; }

.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: rgba(5,4,10,.88); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em;
  cursor: pointer; user-select: none;
}
.logo span:first-child {
  background: linear-gradient(90deg, #c084fc, #fbbf24);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pill {
  font-size: .62rem; font-weight: 700; background: var(--gold); color: #1c1008;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .04em;
}
.header-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: .78rem; color: var(--muted); }
.header-meta strong { color: var(--text); font-weight: 600; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn, .btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px; font-family: inherit;
  font-weight: 600; cursor: pointer; transition: .15s;
}
.btn:disabled, .btn-sm:disabled { opacity: .5; cursor: not-allowed; }
.btn { padding: 9px 14px; font-size: .88rem; }
.btn-sm { padding: 6px 10px; font-size: .78rem; border-radius: 8px; }
.btn.primary, .btn-sm.primary {
  background: linear-gradient(135deg, #7c3aed, #b45309); color: #fff; border: none;
}
.btn.primary:hover, .btn-sm.primary:hover { filter: brightness(1.08); }
.btn.ghost, .btn-sm.ghost {
  background: transparent; border-color: var(--border); color: var(--text);
}
.btn.ghost:hover, .btn-sm.ghost:hover { background: var(--bg-hover); }
.btn.danger, .btn-sm.danger {
  background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.35); color: #fca5a5;
}
.icon-btn {
  background: transparent; border: none; color: var(--muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: var(--bg-hover); }

.main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
.market-kicker {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--purple); margin-bottom: 10px; font-weight: 600;
}

.stats-bar {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px;
}
@media (max-width: 900px) { .stats-bar { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .stats-bar { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-v { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; }
.stat-l { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat.up .stat-v { color: var(--green); }
.stat.down .stat-v { color: var(--red); }
.stat.legend .stat-v { color: var(--gold); }
.stat.epic .stat-v { color: #c084fc; }

.rarity-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rchip {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-family: inherit; font-weight: 700;
  font-size: .78rem; cursor: pointer; letter-spacing: .04em;
}
.rchip.active, .rchip:hover { color: #fff; }
.rchip.legend.active { border-color: rgba(251,191,36,.55); background: rgba(251,191,36,.15); color: var(--gold); }
.rchip.epic.active { border-color: rgba(168,85,247,.5); background: rgba(168,85,247,.15); color: #c084fc; }
.rchip.rare.active { border-color: rgba(59,130,246,.5); background: rgba(59,130,246,.15); color: #60a5fa; }
.rchip.common.active { border-color: rgba(148,163,184,.45); background: rgba(148,163,184,.12); color: #e2e8f0; }
.rchip.all.active { border-color: var(--border-light); background: rgba(255,255,255,.06); color: #fff; }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center;
}
.input, select.input, textarea.input {
  background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 10px 12px; font-family: inherit; font-size: .9rem;
  outline: none; width: 100%;
}
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(192,132,252,.12); }
.filters .input, .filters select { width: auto; min-width: 130px; }
.filters input[type="search"] { flex: 1; min-width: 160px; }
.textarea { resize: vertical; min-height: 120px; font-family: ui-monospace, monospace; font-size: .82rem; }

/* Trading cards: ver css/cards.css (visual oficial Jet Cards) */

.admin-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.admin-top h2 { font-size: 1.2rem; font-weight: 800; }
#adminAuthBadge { font-size: .78rem; margin-top: 4px; color: #fca5a5; }
#adminAuthBadge.ok { color: #86efac; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-family: inherit; font-weight: 600;
  font-size: .85rem; cursor: pointer;
}
.tab.active {
  background: rgba(192,132,252,.15); border-color: rgba(192,132,252,.45); color: var(--purple);
}
.card-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card-panel h4 { margin-bottom: 8px; font-size: 1rem; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .input { max-width: 280px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.file-btn { position: relative; overflow: hidden; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 .span2 { grid-column: 1 / -1; }
.field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px;
  font-size: .82rem; color: var(--muted);
}
.field span { font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.table-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; padding: 12px 14px; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.25);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-panel {
  background: #12101c; border: 1px solid var(--border-light); border-radius: 16px;
  width: min(480px, 100%); max-height: min(90vh, 780px); overflow: auto;
  box-shadow: var(--shadow); transform: translateY(8px) scale(.98); transition: transform .2s;
}
.modal-overlay.open .modal-panel { transform: none; }
.modal-panel.modal-md { width: min(520px, 100%); }
.modal-panel.modal-sm { width: min(400px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px;
}
.modal-head h3 { font-size: 1.05rem; font-weight: 800; }
.modal-body { padding: 8px 18px 12px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; flex-wrap: wrap;
}
.modal-msg { color: var(--text); line-height: 1.5; }
.detail-card-wrap {
  max-width: 180px; margin: 0 auto 16px;
}
.detail-hero { display: flex; align-items: center; gap: 14px; }
.detail-name { font-size: 1.05rem; font-weight: 800; }
.detail-sub { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px;
}
.detail-grid .span2 { grid-column: 1 / -1; }
.detail-grid .lbl {
  display: block; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 2px;
}

.seg {
  display: flex; background: rgba(0,0,0,.35); border-radius: 10px;
  padding: 3px; margin-bottom: 12px; border: 1px solid var(--border);
}
.seg-btn {
  flex: 1; border: none; background: transparent; color: var(--muted);
  padding: 8px; border-radius: 8px; font-family: inherit; font-weight: 600;
  font-size: .82rem; cursor: pointer;
}
.seg-btn.active { background: rgba(192,132,252,.2); color: var(--purple); }
.quick-pct { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.preview {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px; background: rgba(0,0,0,.35); border-radius: 10px;
  border: 1px solid var(--border); margin-top: 8px; font-variant-numeric: tabular-nums;
}
.preview .arrow { color: var(--dim); }

.toast-root {
  position: fixed; bottom: 20px; right: 16px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: #1a1528; border: 1px solid var(--border-light); color: var(--text);
  padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow);
  font-size: .88rem; font-weight: 500; opacity: 0; transform: translateY(8px);
  transition: .25s; max-width: 320px;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-color: rgba(34,197,94,.4); }
.toast-err { border-color: rgba(239,68,68,.45); }
.toast-warn { border-color: rgba(245,158,11,.45); }

.tc-holo-overlay {
  pointer-events: none;
  position: absolute; inset: 0; z-index: 4;
  background: linear-gradient(105deg,
    transparent 0%,
    rgba(255,0,128,0.1) 20%,
    rgba(0,255,255,0.12) 40%,
    rgba(255,255,0,0.1) 60%,
    transparent 80%);
  mix-blend-mode: color-dodge;
  animation: tc-holo 4s linear infinite;
  background-size: 200% 200%;
}
@keyframes tc-holo {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.tc-card.holo .tc-frame {
  box-shadow: 0 0 28px rgba(255, 120, 200, 0.25), 0 8px 24px rgba(0,0,0,0.45);
}
.stat.holo .stat-v { color: #f9a8d4; }
.rchip.holo.active {
  border-color: rgba(244,114,182,.55);
  background: rgba(244,114,182,.15);
  color: #f9a8d4;
}


.ai-out {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 280px;
  overflow: auto;
  font-size: .86rem;
  line-height: 1.5;
  color: var(--text);
}
.ai-text { white-space: normal; }
.ai-actions { margin-top: 8px; }
