:root {
  color-scheme: dark;
  --azure: #38a8ff;
  --azure-dark: #0869b6;
  --bloodstone: #db3b4b;
  --gold: #f1c96b;
  --ink: #07101c;
  --muted: #9db1c7;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top, #102943, var(--ink) 45%); color: #eef7ff; min-height: 100vh; }
a { color: var(--azure); }
header { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; padding: 1.1rem max(2rem, calc((100vw - 1520px) / 2)); border-bottom: 1px solid #25425f; background: #07101de8; position: sticky; top: 0; z-index: 2; backdrop-filter: blur(12px); }
.brand { color: white; font-weight: 900; text-decoration: none; letter-spacing: .05em; }
nav { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; font-size: 1rem; }
nav form { display: inline; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
main { width: min(1520px, calc(100vw - 4rem)); margin: 0 auto; padding: 3rem 0 5rem; }
.hero { padding: 2.75rem 0 3.5rem; max-width: 790px; }
.hero h1 { font-size: clamp(2.25rem, 4.5vw, 4rem); line-height: .98; margin: .4rem 0 .85rem; }
.detail h1 { font-size: clamp(2.4rem, 7vw, 4.8rem); line-height: .95; margin: .4rem 0 1rem; }
.hero > p:last-child { color: #c2d3e5; font-size: 1.08rem; line-height: 1.65; }
.eyebrow { margin: 0 0 .45rem; text-transform: uppercase; letter-spacing: .16em; color: var(--azure); font-size: .78rem; font-weight: 800; }
.market-section, .collection { margin-top: 2.5rem; }
.section-heading { max-width: 720px; margin-bottom: 1.5rem; }
.section-heading h2 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.6rem); }
.section-heading > p:last-child { color: var(--muted); line-height: 1.6; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 1.35rem; align-items: start; justify-content: start; }
.card, .panel, .detail, .collection { background: linear-gradient(145deg, #13253a, #0b1726); border: 1px solid #294b6d; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 45px #0006; }
.card { position: relative; height: 100%; transition: border-color .2s, transform .2s; }
.card:hover { border-color: #4f89bd; transform: translateY(-2px); }
.card.listed { border-color: #317caa; box-shadow: 0 18px 48px #001b2fb3, 0 0 0 1px #38a8ff24; }
.card.unlisted { filter: saturate(.82); }
.card-art { position: relative; }
.card-art img { display: block; width: 100%; aspect-ratio: 1.08; object-fit: cover; background: #091523; }
.listing-badge { position: absolute; top: .8rem; right: .8rem; padding: .28rem .65rem; border-radius: 999px; background: #07101ddd; border: 1px solid #52677c; font-size: .75rem; font-weight: 800; letter-spacing: .04em; }
.listing-badge.is-listed { color: #b9efff; border-color: var(--azure); box-shadow: 0 0 18px #38a8ff42; }
.listing-badge.is-unlisted { color: #bac6d2; }
.card-body, .panel { padding: 1.3rem; }
.card-body { display: flex; flex-direction: column; min-height: 365px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.badge { display: inline-block; background: #173f63; border: 1px solid var(--azure); border-radius: 999px; padding: .25rem .65rem; color: #cceaff; font-size: .8rem; }
.edition { color: #dce8f3; font-size: .85rem; font-weight: 700; }
.series { color: var(--azure); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; margin: .85rem 0 .3rem; }
.card h2 { margin: 0 0 .8rem; font-size: 1.35rem; }
.utility, .price { display: grid; gap: .18rem; padding: .7rem .75rem; margin-bottom: .65rem; border-radius: 11px; background: #071421aa; border: 1px solid #233e58; }
.utility small, .price small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.utility strong { color: #d5ebff; }
.price strong { color: var(--gold); font-size: 1.15rem; }
.owner { display: flex; justify-content: space-between; gap: 1rem; margin: .2rem 0 .8rem; color: #e5eff8; font-size: .9rem; }
.owner span { color: var(--muted); }
.card-footer { display: grid; gap: .65rem; margin-top: auto; }
.card-footer code { color: #8298ad; overflow-wrap: anywhere; font-size: .72rem; }
.card-footer .button { text-align: center; }
.holding-card { display: grid; }
.listing-controls { margin-top: -18px; padding: 2rem 1.3rem 1.3rem; background: #091522; border: 1px solid #294b6d; border-top: 0; border-radius: 0 0 18px 18px; }
.listing-controls p { color: var(--muted); }
.button, button { display: inline-block; border: 1px solid var(--azure); border-radius: 9px; background: #0e3859; color: white; padding: .65rem 1rem; text-decoration: none; cursor: pointer; font: inherit; }
button.primary { background: linear-gradient(90deg, var(--azure-dark), #8b2634); border-color: var(--bloodstone); }
input, select { width: 100%; max-width: 420px; background: #07111d; color: white; border: 1px solid #36536f; border-radius: 8px; padding: .7rem; margin: .4rem 0 .8rem; }
.collection { padding: clamp(1.4rem, 3vw, 2.25rem); margin-top: 4.5rem; background: radial-gradient(circle at 88% 5%, #183f65 0, transparent 30%), linear-gradient(145deg, #13253a, #0b1726); }
.collection-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
.collection-item { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; min-height: 150px; padding: 1rem; border-radius: 12px; background: #071421a8; border: 1px solid #294b6d; }
.collection-item h3 { margin: 0 0 .45rem; font-size: 1rem; }
.collection-item p { margin: 0; color: #b8cde0; font-size: .9rem; line-height: 1.45; }
.collection-item > strong { color: var(--gold); }
.set-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr); gap: 1.5rem; margin-top: 1.25rem; padding: clamp(1.15rem, 2vw, 1.6rem); border-radius: 14px; border: 1px solid #76643e; background: linear-gradient(120deg, #142d48, #241d2a); }
.set-feature > * { max-width: 640px; }
.set-feature h3 { margin: .15rem 0 .5rem; font-size: 1.55rem; color: #f5dc9e; }
.set-feature p { margin: .35rem 0 0; }
.set-feature p, .set-feature li, .progression-note p { color: #c1d1df; line-height: 1.55; }
.set-feature ul { margin: 0; padding-left: 1.2rem; }
.set-feature li + li { margin-top: .3rem; }
.progression-note { margin-top: 1.2rem; padding: 1rem 1.1rem; border-left: 3px solid var(--azure); background: #0a1826; }
.progression-note p { margin: .35rem 0 0; }
.empty-state { grid-column: 1 / -1; }
.detail { display: grid; grid-template-columns: minmax(260px, 44%) 1fr; padding: clamp(1rem, 4vw, 2.5rem); gap: 2rem; }
.detail > img { width: 100%; border-radius: 14px; background: #091523; }
dl { display: grid; grid-template-columns: minmax(120px, .5fr) 1fr; gap: .65rem 1rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.warning, .notice, .dev { border-left: 4px solid var(--bloodstone); padding: 1rem; background: #35141b80; margin: 1rem 0; }
footer { width: min(1520px, calc(100vw - 4rem)); margin: 0 auto; color: var(--muted); text-align: center; padding: 2rem; border-top: 1px solid #203b55; }

@media (min-width: 1440px) {
  .card-art img { aspect-ratio: 1.12; }
  .card-body { min-height: 380px; padding: 1.35rem; }
  .card h2 { font-size: 1.4rem; }
  .collection-item { min-height: 165px; padding: 1.15rem; }
}

@media (max-width: 1199px) {
  header { padding-inline: 3vw; }
  main, footer { width: 94vw; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.25rem; }
  .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  main { padding-top: 2rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-feature { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  header { align-items: flex-start; }
  header, main, footer { width: auto; }
  header { padding: 1rem; }
  main { margin-inline: 1rem; padding-top: 1rem; }
  footer { margin-inline: 1rem; }
  .hero { padding: 2.2rem 0 2.8rem; }
  .detail, .set-feature { grid-template-columns: 1fr; }
  dl { grid-template-columns: 1fr; }
  dt { margin-top: .5rem; }
  .grid, .collection-grid { grid-template-columns: 1fr; }
  .card-body { min-height: auto; }
  .collection { margin-top: 3.5rem; }
}
