/* TCGCARDPORT. Polished dark look (Travis, 19 November 2026): dark navy, gold accent, soft glow,
   lifted card tiles. Light mode keeps the same shapes. */
:root {
  --bg: #0a0d14;
  --bg-glow-1: rgba(245, 183, 10, .10);
  --bg-glow-2: rgba(59, 130, 246, .10);
  --panel: #121722;
  --panel-2: #1a2130;
  --panel-3: #222b3c;
  --line: #263044;
  --line-soft: rgba(255, 255, 255, .06);
  --text: #eef2f7;
  --muted: #8d98a8;
  --accent: #f5b70a;
  --accent-2: #ffd75e;
  --accent-ink: #14110a;
  --accent-soft: rgba(245, 183, 10, .14);
  --blue: #3b82f6;
  --up: #3fb950;
  --down: #f85149;
  --danger: #f85149;
  --radius: 16px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lift: 0 18px 40px -14px rgba(0, 0, 0, .75);
  --header: rgba(10, 13, 20, .78);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6fa;
    --bg-glow-1: rgba(224, 164, 0, .12);
    --bg-glow-2: rgba(59, 130, 246, .08);
    --panel: #ffffff;
    --panel-2: #f2f4f8;
    --panel-3: #e8ecf2;
    --line: #dde3ec;
    --line-soft: rgba(0, 0, 0, .05);
    --text: #111827;
    --muted: #5b6573;
    --accent: #e0a400;
    --accent-2: #f5c231;
    --accent-soft: rgba(224, 164, 0, .14);
    --up: #1a7f37;
    --down: #cf222e;
    --danger: #cf222e;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
    --shadow-lift: 0 16px 36px -14px rgba(16, 24, 40, .3);
    --header: rgba(255, 255, 255, .82);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 12% -8%, var(--bg-glow-1), transparent 70%),
    radial-gradient(800px 420px at 100% 0%, var(--bg-glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 700; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- header and tabs ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, calc((100% - 1040px) / 2));
  background: var(--header); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 900; letter-spacing: .06em; font-size: 1.05rem; }
.brand img { filter: drop-shadow(0 2px 8px rgba(245, 183, 10, .35)); }
.brand b { color: var(--accent); }
.rate {
  color: var(--muted); font-size: .78rem; text-align: right; font-variant-numeric: tabular-nums;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--panel);
}
.rate:empty { display: none; }

.tagline {
  margin: 18px auto 0; padding: 0 16px; max-width: 1040px; text-align: center;
  font-size: 1.05rem; font-weight: 600; color: var(--muted); letter-spacing: -.01em;
}
.tagline b { color: var(--accent); font-weight: 800; }
.tabs {
  display: flex; gap: 4px; margin: 12px auto 0; padding: 4px; width: max-content; max-width: calc(100% - 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
  position: sticky; top: 64px; z-index: 4; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: none; padding: 8px 18px; border-radius: 999px; cursor: pointer; color: var(--muted);
  font-weight: 700; white-space: nowrap; transition: color .15s, background .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-current] {
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink);
  box-shadow: 0 4px 14px -4px rgba(245, 183, 10, .55);
}

/* ---------- page and sections ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 18px 16px 72px; display: grid; gap: 16px; }
.hero, .sec {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  display: grid; gap: 14px; box-shadow: var(--shadow);
}
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(520px 200px at 100% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
}
.hero > * { position: relative; }
.hero > .btn.small { justify-self: start; }
.hero .head, .sec .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.hero > p { margin: 0; max-width: 62ch; }
.note { color: var(--muted); font-size: .84rem; margin: 0; }
.err { color: var(--danger); margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 32px 8px; border: 1px dashed var(--line); border-radius: 12px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1 1 220px; }
.stack { display: grid; gap: 12px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
label { display: grid; gap: 4px; }

/* ---------- inputs and buttons ---------- */
input, select {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:hover, select:hover { border-color: var(--panel-3); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 20px;
  border-radius: 12px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; font-weight: 800;
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink);
  box-shadow: 0 6px 16px -8px rgba(245, 183, 10, .7);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 8px 20px -8px rgba(245, 183, 10, .8); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--panel-2); border-color: var(--line); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); filter: none; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); box-shadow: none; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .85rem; border-radius: 10px; }
.btn.wide { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--accent); }
.chips.small .chip { padding: 4px 11px; font-size: .84rem; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip[aria-pressed="true"] .muted { color: inherit; opacity: .7; }

/* ---------- lists of cards ---------- */
.item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.item:first-of-type { border-top: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { text-align: right; display: grid; gap: 4px; justify-items: end; }
.nm { font-weight: 700; }
.sub { color: var(--muted); font-size: .85rem; }
.price { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.priceline { display: flex; align-items: baseline; gap: 8px; }
.total {
  font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.05;
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 70%, var(--accent)));
  -webkit-background-clip: text; background-clip: text;
}
.total .muted { font-size: .9rem; font-weight: 600; letter-spacing: 0; -webkit-text-fill-color: var(--muted); }
.trend { font-size: .78rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--panel-3); }
.trend.up { color: var(--up); background: color-mix(in srgb, var(--up) 14%, transparent); }
.trend.down { color: var(--down); background: color-mix(in srgb, var(--down) 14%, transparent); }
.ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 10px; }
.ctl label { width: 110px; }
.ctl input, .ctl select { min-height: 38px; padding: 6px 10px; border-radius: 10px; }

/* portfolio rows */
.vrow {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.vrow:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.badge {
  min-width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900;
  background: linear-gradient(160deg, #4f8ff7, #2b62d6); color: #fff; box-shadow: 0 6px 14px -6px rgba(59, 130, 246, .7);
}

/* ---------- browse grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.tile {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 6px; align-content: start;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow-lift); }
.tile .nm { margin-top: 4px; line-height: 1.25; }
.tile .btn { margin-top: 4px; }

/* ---------- card pictures ---------- */
.art {
  position: relative; aspect-ratio: 63 / 88; border-radius: 10px; overflow: hidden;
  background: linear-gradient(160deg, var(--cc, #555), #111); color: #fff; padding: 8px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .7);
}
.art.mini { width: 60px; flex: 0 0 60px; padding: 4px; font-size: .55rem; border-radius: 7px; }
.art .nm { font-size: .8em; }
.art .no { font-size: .7em; opacity: .8; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art.stock .nm, .art.stock .no { visibility: hidden; }
.art.photo { padding: 0; background: #000; }
.tile .art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .16) 50%, transparent 60%);
  transform: translateX(-100%); transition: transform .6s;
}
.tile:hover .art::after { transform: translateX(100%); }
.pricetag {
  position: absolute; z-index: 1; left: 6px; bottom: 6px; padding: 3px 9px; border-radius: 999px;
  background: rgba(8, 10, 14, .85); color: #fff; font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums;
  border: 1px solid rgba(245, 183, 10, .45); box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
.pricetag small { font-weight: 700; font-size: .7em; color: var(--accent-2); }

/* ---------- loading, sheets, toast ---------- */
.loading { display: grid; place-items: center; padding: 28px; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: end center; z-index: 20; padding: 16px; }
.sheet[hidden] { display: none; }
.sheet-card {
  width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  display: grid; gap: 14px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lift); animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
@media (min-width: 700px) { .sheet { place-items: center; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 999px; font-weight: 700; z-index: 30; max-width: calc(100% - 32px); text-align: center;
  box-shadow: var(--shadow-lift);
}
.toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::after { transition: none !important; animation: none !important; }
}

/* ---------- phones ---------- */
@media (max-width: 520px) {
  h1 { font-size: 1.45rem; }
  .top { padding: 10px 16px; }
  .tagline { font-size: .92rem; margin-top: 12px; }
  .rate { font-size: .72rem; padding: 3px 9px; white-space: nowrap; }
  .rate .rdate { display: none; }
  .tabs { top: 58px; width: auto; margin: 10px 16px 0; max-width: none; }
  .tabs button { flex: 1 1 auto; padding: 8px 8px; font-size: .88rem; }
  .hero, .sec { padding: 16px; }
  .item { flex-wrap: wrap; }
  .item .right { width: 100%; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .total { font-size: 2rem; }
}
